From 4765e48db39d6680a08a2e1692075352a9f9ce34 Mon Sep 17 00:00:00 2001 From: Alicja Lukaszewicz Date: Fri, 18 Apr 2025 02:35:21 +0200 Subject: [PATCH 01/28] test: ensure no stdout output when calling zeInitDrivers (#320) Signed-off-by: Alicja Lukaszewicz --- test/loader_api.cpp | 75 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/test/loader_api.cpp b/test/loader_api.cpp index aa389e68..0d35fc2b 100644 --- a/test/loader_api.cpp +++ b/test/loader_api.cpp @@ -12,9 +12,20 @@ #include "ze_api.h" #include "zes_api.h" +#include + #if defined(_WIN32) + #include + #include + #include #define putenv_safe _putenv #else + #include + #include + #include + #define _dup dup + #define _dup2 dup2 + #define _close close #define putenv_safe putenv #endif @@ -365,4 +376,68 @@ TEST( EXPECT_FALSE(zelCheckIsLoaderInTearDown()); } +class CaptureOutput { +private: + int original_fd; + int fd; + int stream; + char filename[50] = "/tmp/capture_output_XXXXXX"; + +public: + enum { Stdout = 1, Stderr = 2 }; + + CaptureOutput(int stream_) : stream(stream_) { + original_fd = _dup(stream); +#if defined(__linux__) + fd = mkstemp(filename); +#elif defined(_WIN32) + tmpnam_s(filename, sizeof(filename)); + _sopen_s(&fd, filename, _O_CREAT | _O_RDWR, _SH_DENYNO, _S_IREAD | _S_IWRITE); +#endif + fflush(nullptr); + _dup2(fd, stream); + _close(fd); + } + + ~CaptureOutput() { + if (original_fd != -1) { + fflush(nullptr); + _dup2(original_fd, stream); + _close(original_fd); + original_fd = -1; + } + if (remove(filename) != 0) { + std::cerr << "Deleting file " << filename << " failed."; + } + } + + std::string GetOutput() { + if (original_fd != -1) { + fflush(nullptr); + _dup2(original_fd, stream); + _close(original_fd); + original_fd = -1; + } + std::ifstream stream(filename); + std::string output = std::string((std::istreambuf_iterator(stream)), + std::istreambuf_iterator()); + return output; + } +}; + +TEST( + LoaderInitDrivers, + GivenZeInitDriverWhenCalledThenNoOutputIsPrintedToStdout) { + uint32_t pInitDriversCount = 0; + ze_init_driver_type_desc_t desc = { ZE_STRUCTURE_TYPE_INIT_DRIVER_TYPE_DESC }; + desc.flags = UINT32_MAX; + desc.pNext = nullptr; + + CaptureOutput capture(CaptureOutput::Stdout); + EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, nullptr, &desc)); + + std::string output = capture.GetOutput(); + EXPECT_TRUE(output.empty()); +} + } // namespace From 04aaf366bf62c740e1cb2a806147189b22511f50 Mon Sep 17 00:00:00 2001 From: "Neil R. Spruit" Date: Tue, 22 Apr 2025 13:31:14 -0700 Subject: [PATCH 02/28] Only Enable Teardown thread on windows and remove debug on success (#323) Signed-off-by: Neil R. Spruit --- samples/zello_world/zello_world.cpp | 12 ++++++++---- source/lib/ze_lib.cpp | 6 +----- test/CMakeLists.txt | 21 +++++++++++++++++++++ test/loader_api.cpp | 3 +++ 4 files changed, 33 insertions(+), 9 deletions(-) diff --git a/samples/zello_world/zello_world.cpp b/samples/zello_world/zello_world.cpp index ba11bb09..2facbd66 100644 --- a/samples/zello_world/zello_world.cpp +++ b/samples/zello_world/zello_world.cpp @@ -196,10 +196,14 @@ int main( int argc, char *argv[] ) zeEventHostSynchronize(event, UINT64_MAX ); std::cout << "Congratulations, the device completed execution!\n"; - zeContextDestroy(context); - zeCommandListDestroy(command_list); - zeEventDestroy(event); - zeEventPoolDestroy(event_pool); + if (!zelCheckIsLoaderInTearDown()) + zeContextDestroy(context); + if (!zelCheckIsLoaderInTearDown()) + zeCommandListDestroy(command_list); + if (!zelCheckIsLoaderInTearDown()) + zeEventDestroy(event); + if (!zelCheckIsLoaderInTearDown()) + zeEventPoolDestroy(event_pool); if (tracing_enabled) { status = zelTracerDestroy(tracer); diff --git a/source/lib/ze_lib.cpp b/source/lib/ze_lib.cpp index 50be7828..43c20927 100644 --- a/source/lib/ze_lib.cpp +++ b/source/lib/ze_lib.cpp @@ -489,7 +489,7 @@ zelCheckIsLoaderInTearDown() { if (ze_lib::destruction || ze_lib::context == nullptr) { return true; } - #ifdef DYNAMIC_LOAD_LOADER + #if defined(DYNAMIC_LOAD_LOADER) && defined(_WIN32) std::promise stabilityPromise; std::future resultFuture = stabilityPromise.get_future(); int result = -1; @@ -497,10 +497,6 @@ zelCheckIsLoaderInTearDown() { // Launch the stability checker thread std::thread stabilityThread(stabilityCheck, std::move(stabilityPromise)); result = resultFuture.get(); // Blocks until the result is available - if (ze_lib::context->debugTraceEnabled) { - std::string message = "Stability checker thread completed with result: " + std::to_string(result); - ze_lib::context->debug_trace_message(message, ""); - } stabilityThread.join(); } catch (const std::exception& e) { if (ze_lib::context->debugTraceEnabled) { diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 9596906b..e124e11b 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -97,6 +97,27 @@ endif() add_test(NAME tests_loader_teardown_check COMMAND tests --gtest_filter=*GivenLoaderNotInDestructionStateWhenCallingzelCheckIsLoaderInTearDownThenFalseIsReturned) set_property(TEST tests_loader_teardown_check PROPERTY ENVIRONMENT "ZE_ENABLE_LOADER_DEBUG_TRACE=1;ZE_ENABLE_NULL_DRIVER=1") +add_test(NAME test_zello_world_legacy COMMAND zello_world --enable_legacy_init --enable_null_driver --force_loader_intercepts --enable_validation_layer --enable_tracing_layer --enable_tracing_layer_runtime) +set_property(TEST test_zello_world_legacy PROPERTY ENVIRONMENT "ZE_ENABLE_LOADER_DEBUG_TRACE=1") + +add_test(NAME test_zello_world_legacy_intercept COMMAND zello_world --enable_legacy_init --enable_null_driver --force_loader_intercepts) +set_property(TEST test_zello_world_legacy_intercept PROPERTY ENVIRONMENT "ZE_ENABLE_LOADER_DEBUG_TRACE=1") + +add_test(NAME test_zello_world_legacy_validation_layer COMMAND zello_world --enable_legacy_init --enable_null_driver --enable_validation_layer) +set_property(TEST test_zello_world_legacy_validation_layer PROPERTY ENVIRONMENT "ZE_ENABLE_LOADER_DEBUG_TRACE=1") + +add_test(NAME test_zello_world_legacy_tracing COMMAND zello_world --enable_legacy_init --enable_null_driver --enable_tracing_layer) +set_property(TEST test_zello_world_legacy_tracing PROPERTY ENVIRONMENT "ZE_ENABLE_LOADER_DEBUG_TRACE=1") + +add_test(NAME test_zello_world_legacy_dynamic_tracing COMMAND zello_world --enable_legacy_init --enable_null_driver --enable_tracing_layer_runtime) +set_property(TEST test_zello_world_legacy_dynamic_tracing PROPERTY ENVIRONMENT "ZE_ENABLE_LOADER_DEBUG_TRACE=1") + +add_test(NAME test_zello_world_legacy_all_tracing COMMAND zello_world --enable_legacy_init --enable_null_driver --force_loader_intercepts --enable_validation_layer --enable_tracing_layer) +set_property(TEST test_zello_world_legacy_all_tracing PROPERTY ENVIRONMENT "ZE_ENABLE_LOADER_DEBUG_TRACE=1") + +add_test(NAME test_zello_world_legacy_all_tracing_dynamic COMMAND zello_world --enable_legacy_init --enable_null_driver --force_loader_intercepts --enable_validation_layer --enable_tracing_layer_runtime) +set_property(TEST test_zello_world_legacy_all_tracing_dynamic PROPERTY ENVIRONMENT "ZE_ENABLE_LOADER_DEBUG_TRACE=1") + # These tests are currently not supported on Windows. The reason is that the std::cerr is not being redirected to a pipe in Windows to be then checked against the expected output. if(NOT MSVC) add_test(NAME tests_event_deadlock COMMAND tests --gtest_filter=*GivenLevelZeroLoaderPresentWhenCallingzeCommandListAppendMemoryCopyWithCircularDependencyOnEventsThenValidationLayerPrintsWarningOfDeadlock*) diff --git a/test/loader_api.cpp b/test/loader_api.cpp index 0d35fc2b..5ed18f0f 100644 --- a/test/loader_api.cpp +++ b/test/loader_api.cpp @@ -374,6 +374,9 @@ TEST( EXPECT_EQ(ZE_RESULT_SUCCESS, zeInit(0)); EXPECT_FALSE(zelCheckIsLoaderInTearDown()); + EXPECT_FALSE(zelCheckIsLoaderInTearDown()); + EXPECT_FALSE(zelCheckIsLoaderInTearDown()); + EXPECT_FALSE(zelCheckIsLoaderInTearDown()); } class CaptureOutput { From 145eddff2aafa7a2f6121762d0855e27958e8036 Mon Sep 17 00:00:00 2001 From: "Neil R. Spruit" Date: Thu, 24 Apr 2025 07:41:05 -0700 Subject: [PATCH 03/28] Add testing stdout from zeInitDrivers in CI (#324) Signed-off-by: Neil R. Spruit --- test/CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index e124e11b..3238a24d 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -118,6 +118,16 @@ set_property(TEST test_zello_world_legacy_all_tracing PROPERTY ENVIRONMENT "ZE_E add_test(NAME test_zello_world_legacy_all_tracing_dynamic COMMAND zello_world --enable_legacy_init --enable_null_driver --force_loader_intercepts --enable_validation_layer --enable_tracing_layer_runtime) set_property(TEST test_zello_world_legacy_all_tracing_dynamic PROPERTY ENVIRONMENT "ZE_ENABLE_LOADER_DEBUG_TRACE=1") +add_test(NAME tests_multi_driver_stdout COMMAND tests --gtest_filter=*GivenZeInitDriverWhenCalledThenNoOutputIsPrintedToStdout) +if (MSVC) + set_property(TEST tests_multi_driver_stdout APPEND PROPERTY ENVIRONMENT "ZE_ENABLE_ALT_DRIVERS=${CMAKE_BINARY_DIR}/bin/$/ze_null_test1.dll,${CMAKE_BINARY_DIR}/bin/$/ze_null_test2.dll") +else() + set_property(TEST tests_multi_driver_stdout APPEND PROPERTY ENVIRONMENT "ZE_ENABLE_ALT_DRIVERS=${CMAKE_BINARY_DIR}/lib/libze_null_test1.so,${CMAKE_BINARY_DIR}/lib/libze_null_test2.so") +endif() + +add_test(NAME tests_sigle_driver_stdout COMMAND tests --gtest_filter=*GivenZeInitDriverWhenCalledThenNoOutputIsPrintedToStdout) +set_property(TEST tests_sigle_driver_stdout PROPERTY ENVIRONMENT "ZE_ENABLE_NULL_DRIVER=1") + # These tests are currently not supported on Windows. The reason is that the std::cerr is not being redirected to a pipe in Windows to be then checked against the expected output. if(NOT MSVC) add_test(NAME tests_event_deadlock COMMAND tests --gtest_filter=*GivenLevelZeroLoaderPresentWhenCallingzeCommandListAppendMemoryCopyWithCircularDependencyOnEventsThenValidationLayerPrintsWarningOfDeadlock*) From c1872469737f807abc0ab8c4b35a263a568a6504 Mon Sep 17 00:00:00 2001 From: "Neil R. Spruit" Date: Thu, 24 Apr 2025 16:34:44 -0700 Subject: [PATCH 04/28] Update Level Zero Loader and Headers to support v1.13.1 of L0 Spec (#325) * Update Level Zero Loader and Headers to support v1.13.1 of L0 Spec * Update Product GUID * Add new ext ZE_STRUCTURE_TYPE_DEVICE_CACHELINE_SIZE_EXT to extension validation Signed-off-by: Neil R. Spruit --- CHANGELOG.md | 4 + CMakeLists.txt | 2 +- PRODUCT_GUID.txt | 4 +- include/layers/zel_tracing_register_cb.h | 388 ++++ include/ze.py | 815 +++++++- include/ze_api.h | 1808 ++++++++++++++--- include/ze_ddi.h | 164 +- include/ze_ddi_common.h | 2 +- include/zes.py | 29 +- include/zes_api.h | 160 +- include/zes_ddi.h | 2 +- include/zet.py | 90 +- include/zet_api.h | 208 +- include/zet_ddi.h | 55 +- source/drivers/null/ze_nullddi.cpp | 382 +++- source/drivers/null/zet_nullddi.cpp | 112 +- source/layers/tracing/ze_tracing_cb_structs.h | 11 + .../layers/tracing/ze_tracing_register_cb.cpp | 176 ++ source/layers/tracing/ze_trcddi.cpp | 542 ++++- .../extension_validation.inl | 2 +- .../ze_parameter_validation.cpp | 262 ++- .../ze_parameter_validation.h | 11 + .../zet_parameter_validation.cpp | 51 +- .../zet_parameter_validation.h | 3 + .../validation/common/ze_entry_points.h | 22 + .../validation/common/zet_entry_points.h | 6 + .../ze_handle_lifetime.cpp | 186 +- .../ze_handle_lifetime.h | 11 + .../zet_handle_lifetime.cpp | 51 +- .../zet_handle_lifetime.h | 3 + source/layers/validation/ze_valddi.cpp | 609 +++++- source/layers/validation/zet_valddi.cpp | 172 +- source/lib/ze_libapi.cpp | 1088 ++++++++-- source/lib/ze_libddi.cpp | 50 + source/lib/ze_tracing_register_cb_libapi.cpp | 275 +++ source/lib/zet_libapi.cpp | 188 +- source/lib/zet_libddi.cpp | 20 + source/loader/ze_ldrddi.cpp | 560 ++++- source/loader/ze_ldrddi.h | 6 + source/loader/ze_loader_internal.h | 2 + source/loader/zet_ldrddi.cpp | 156 +- 41 files changed, 8046 insertions(+), 642 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aab11a01..1292ad51 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Level zero loader changelog +## v1.22.0 +* Update to support v1.13.1 of the Level Zero Spec +* Add testing stdout from zeInitDrivers in CI +* Only Enable Teardown thread on windows and remove debug on success ## v1.21.9 * Fix init checks when sorting legacy drivers * Fix MSVC Link optimization flags diff --git a/CMakeLists.txt b/CMakeLists.txt index b2114c34..2b43d6a1 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.21.9) +project(level-zero VERSION 1.22.0) include(GNUInstallDirs) diff --git a/PRODUCT_GUID.txt b/PRODUCT_GUID.txt index 85c64204..3057573c 100644 --- a/PRODUCT_GUID.txt +++ b/PRODUCT_GUID.txt @@ -1,2 +1,2 @@ -1.21.9 -01037281-c9ef-43cf-bc65-f72fb3438788 \ No newline at end of file +1.22.0 +144d1a88-75bd-4f4a-8871-3660a84f7380 \ 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 a04d08ed..18b795d9 100644 --- a/include/layers/zel_tracing_register_cb.h +++ b/include/layers/zel_tracing_register_cb.h @@ -54,6 +54,150 @@ typedef void (ZE_APICALL *ze_pfnInitDriversCb_t)( void** ppTracerInstanceUserData ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeRTASBuilderCreateExt +/// @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_rtas_builder_create_ext_params_t +{ + ze_driver_handle_t* phDriver; + const ze_rtas_builder_ext_desc_t** ppDescriptor; + ze_rtas_builder_ext_handle_t** pphBuilder; +} ze_rtas_builder_create_ext_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeRTASBuilderCreateExt +/// @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_pfnRTASBuilderCreateExtCb_t)( + ze_rtas_builder_create_ext_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeRTASBuilderGetBuildPropertiesExt +/// @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_rtas_builder_get_build_properties_ext_params_t +{ + ze_rtas_builder_ext_handle_t* phBuilder; + const ze_rtas_builder_build_op_ext_desc_t** ppBuildOpDescriptor; + ze_rtas_builder_ext_properties_t** ppProperties; +} ze_rtas_builder_get_build_properties_ext_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeRTASBuilderGetBuildPropertiesExt +/// @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_pfnRTASBuilderGetBuildPropertiesExtCb_t)( + ze_rtas_builder_get_build_properties_ext_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeRTASBuilderBuildExt +/// @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_rtas_builder_build_ext_params_t +{ + ze_rtas_builder_ext_handle_t* phBuilder; + const ze_rtas_builder_build_op_ext_desc_t** ppBuildOpDescriptor; + void** ppScratchBuffer; + size_t* pscratchBufferSizeBytes; + void** ppRtasBuffer; + size_t* prtasBufferSizeBytes; + ze_rtas_parallel_operation_ext_handle_t* phParallelOperation; + void** ppBuildUserPtr; + ze_rtas_aabb_ext_t** ppBounds; + size_t** ppRtasBufferSizeBytes; +} ze_rtas_builder_build_ext_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeRTASBuilderBuildExt +/// @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_pfnRTASBuilderBuildExtCb_t)( + ze_rtas_builder_build_ext_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeRTASBuilderCommandListAppendCopyExt +/// @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_rtas_builder_command_list_append_copy_ext_params_t +{ + ze_command_list_handle_t* phCommandList; + void** pdstptr; + const void** psrcptr; + size_t* psize; + ze_event_handle_t* phSignalEvent; + uint32_t* pnumWaitEvents; + ze_event_handle_t** pphWaitEvents; +} ze_rtas_builder_command_list_append_copy_ext_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeRTASBuilderCommandListAppendCopyExt +/// @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_pfnRTASBuilderCommandListAppendCopyExtCb_t)( + ze_rtas_builder_command_list_append_copy_ext_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeRTASBuilderDestroyExt +/// @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_rtas_builder_destroy_ext_params_t +{ + ze_rtas_builder_ext_handle_t* phBuilder; +} ze_rtas_builder_destroy_ext_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeRTASBuilderDestroyExt +/// @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_pfnRTASBuilderDestroyExtCb_t)( + ze_rtas_builder_destroy_ext_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Callback function parameters for zeRTASBuilderCreateExp /// @details Each entry is a pointer to the parameter passed to the function; @@ -167,6 +311,108 @@ typedef void (ZE_APICALL *ze_pfnRTASBuilderDestroyExpCb_t)( void** ppTracerInstanceUserData ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeRTASParallelOperationCreateExt +/// @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_rtas_parallel_operation_create_ext_params_t +{ + ze_driver_handle_t* phDriver; + ze_rtas_parallel_operation_ext_handle_t** pphParallelOperation; +} ze_rtas_parallel_operation_create_ext_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeRTASParallelOperationCreateExt +/// @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_pfnRTASParallelOperationCreateExtCb_t)( + ze_rtas_parallel_operation_create_ext_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeRTASParallelOperationGetPropertiesExt +/// @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_rtas_parallel_operation_get_properties_ext_params_t +{ + ze_rtas_parallel_operation_ext_handle_t* phParallelOperation; + ze_rtas_parallel_operation_ext_properties_t** ppProperties; +} ze_rtas_parallel_operation_get_properties_ext_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeRTASParallelOperationGetPropertiesExt +/// @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_pfnRTASParallelOperationGetPropertiesExtCb_t)( + ze_rtas_parallel_operation_get_properties_ext_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeRTASParallelOperationJoinExt +/// @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_rtas_parallel_operation_join_ext_params_t +{ + ze_rtas_parallel_operation_ext_handle_t* phParallelOperation; +} ze_rtas_parallel_operation_join_ext_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeRTASParallelOperationJoinExt +/// @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_pfnRTASParallelOperationJoinExtCb_t)( + ze_rtas_parallel_operation_join_ext_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeRTASParallelOperationDestroyExt +/// @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_rtas_parallel_operation_destroy_ext_params_t +{ + ze_rtas_parallel_operation_ext_handle_t* phParallelOperation; +} ze_rtas_parallel_operation_destroy_ext_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeRTASParallelOperationDestroyExt +/// @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_pfnRTASParallelOperationDestroyExtCb_t)( + ze_rtas_parallel_operation_destroy_ext_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Callback function parameters for zeRTASParallelOperationCreateExp /// @details Each entry is a pointer to the parameter passed to the function; @@ -296,6 +542,33 @@ typedef void (ZE_APICALL *ze_pfnDriverGetExtensionFunctionAddressCb_t)( void** ppTracerInstanceUserData ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeDriverRTASFormatCompatibilityCheckExt +/// @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_driver_rtas_format_compatibility_check_ext_params_t +{ + ze_driver_handle_t* phDriver; + ze_rtas_format_ext_t* prtasFormatA; + ze_rtas_format_ext_t* prtasFormatB; +} ze_driver_rtas_format_compatibility_check_ext_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeDriverRTASFormatCompatibilityCheckExt +/// @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_pfnDriverRTASFormatCompatibilityCheckExtCb_t)( + ze_driver_rtas_format_compatibility_check_ext_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Callback function parameters for zeDriverGetLastErrorDescription /// @details Each entry is a pointer to the parameter passed to the function; @@ -428,6 +701,33 @@ typedef void (ZE_APICALL *ze_pfnDeviceReleaseExternalSemaphoreExtCb_t)( void** ppTracerInstanceUserData ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeDeviceGetVectorWidthPropertiesExt +/// @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_vector_width_properties_ext_params_t +{ + ze_device_handle_t* phDevice; + uint32_t** ppCount; + ze_device_vector_width_properties_ext_t** ppVectorWidthProperties; +} ze_device_get_vector_width_properties_ext_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeDeviceGetVectorWidthPropertiesExt +/// @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_pfnDeviceGetVectorWidthPropertiesExtCb_t)( + ze_device_get_vector_width_properties_ext_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; @@ -3204,6 +3504,94 @@ zelTracerCommandListAppendWaitExternalSemaphoreExtRegisterCallback( ); +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerRTASBuilderCreateExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnRTASBuilderCreateExtCb_t pfnCreateExtCb + ); + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerRTASBuilderGetBuildPropertiesExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnRTASBuilderGetBuildPropertiesExtCb_t pfnGetBuildPropertiesExtCb + ); + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerDriverRTASFormatCompatibilityCheckExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnDriverRTASFormatCompatibilityCheckExtCb_t pfnRTASFormatCompatibilityCheckExtCb + ); + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerRTASBuilderBuildExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnRTASBuilderBuildExtCb_t pfnBuildExtCb + ); + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerRTASBuilderCommandListAppendCopyExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnRTASBuilderCommandListAppendCopyExtCb_t pfnCommandListAppendCopyExtCb + ); + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerRTASBuilderDestroyExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnRTASBuilderDestroyExtCb_t pfnDestroyExtCb + ); + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerRTASParallelOperationCreateExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnRTASParallelOperationCreateExtCb_t pfnCreateExtCb + ); + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerRTASParallelOperationGetPropertiesExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnRTASParallelOperationGetPropertiesExtCb_t pfnGetPropertiesExtCb + ); + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerRTASParallelOperationJoinExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnRTASParallelOperationJoinExtCb_t pfnJoinExtCb + ); + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerRTASParallelOperationDestroyExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnRTASParallelOperationDestroyExtCb_t pfnDestroyExtCb + ); + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerDeviceGetVectorWidthPropertiesExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnDeviceGetVectorWidthPropertiesExtCb_t pfnGetVectorWidthPropertiesExtCb + ); + + ZE_APIEXPORT ze_result_t ZE_APICALL zelTracerDeviceReserveCacheExtRegisterCallback( zel_tracer_handle_t hTracer, diff --git a/include/ze.py b/include/ze.py index 1fa698fc..28ff35c5 100644 --- a/include/ze.py +++ b/include/ze.py @@ -4,7 +4,7 @@ SPDX-License-Identifier: MIT @file ze.py - @version v1.12-r1.12.15 + @version v1.13-r1.13.1 """ import platform @@ -219,6 +219,13 @@ class ze_result_v(IntEnum): ## memory WARNING_ACTION_REQUIRED = 0x7800001b ## [Sysman] an action is required to complete the desired operation ERROR_INVALID_KERNEL_HANDLE = 0x7800001c ## [Core, Validation] kernel handle is invalid for the operation + EXT_RTAS_BUILD_RETRY = 0x7800001d ## [Core, Extension] ray tracing acceleration structure build operation + ## failed due to insufficient resources, retry with a larger acceleration + ## structure buffer allocation + EXT_RTAS_BUILD_DEFERRED = 0x7800001e ## [Core, Extension] ray tracing acceleration structure build operation + ## deferred to parallel operation join + 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_UNKNOWN = 0x7ffffffe ## [Core] unknown or internal error class ze_result_t(c_int): @@ -322,6 +329,14 @@ class ze_structure_type_v(IntEnum): EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_EXT = 0x00020025 ## ::ze_external_semaphore_signal_params_ext_t EXTERNAL_SEMAPHORE_WAIT_PARAMS_EXT = 0x00020026 ## ::ze_external_semaphore_wait_params_ext_t DRIVER_DDI_HANDLES_EXT_PROPERTIES = 0x00020027 ## ::ze_driver_ddi_handles_ext_properties_t + DEVICE_CACHELINE_SIZE_EXT = 0x00020028 ## ::ze_device_cache_line_size_ext_t + DEVICE_VECTOR_WIDTH_PROPERTIES_EXT = 0x00020029 ## ::ze_device_vector_width_properties_ext_t + RTAS_BUILDER_EXT_DESC = 0x00020030 ## ::ze_rtas_builder_ext_desc_t + RTAS_BUILDER_BUILD_OP_EXT_DESC = 0x00020031 ## ::ze_rtas_builder_build_op_ext_desc_t + RTAS_BUILDER_EXT_PROPERTIES = 0x00020032 ## ::ze_rtas_builder_ext_properties_t + RTAS_PARALLEL_OPERATION_EXT_PROPERTIES = 0x00020033 ## ::ze_rtas_parallel_operation_ext_properties_t + RTAS_DEVICE_EXT_PROPERTIES = 0x00020034 ## ::ze_rtas_device_ext_properties_t + RTAS_GEOMETRY_AABBS_EXT_CB_PARAMS = 0x00020035 ## ::ze_rtas_geometry_aabbs_ext_cb_params_t class ze_structure_type_t(c_int): def __str__(self): @@ -492,7 +507,8 @@ class ze_api_version_v(IntEnum): _1_10 = ZE_MAKE_VERSION( 1, 10 ) ## version 1.10 _1_11 = ZE_MAKE_VERSION( 1, 11 ) ## version 1.11 _1_12 = ZE_MAKE_VERSION( 1, 12 ) ## version 1.12 - CURRENT = ZE_MAKE_VERSION( 1, 12 ) ## latest known version + _1_13 = ZE_MAKE_VERSION( 1, 13 ) ## version 1.13 + CURRENT = ZE_MAKE_VERSION( 1, 13 ) ## latest known version class ze_api_version_t(c_int): def __str__(self): @@ -501,7 +517,7 @@ def __str__(self): ############################################################################### ## @brief Current API version as a macro -ZE_API_VERSION_CURRENT_M = ZE_MAKE_VERSION( 1, 12 ) +ZE_API_VERSION_CURRENT_M = ZE_MAKE_VERSION( 1, 13 ) ############################################################################### ## @brief Maximum driver universal unique id (UUID) size in bytes @@ -961,6 +977,8 @@ class ze_command_queue_flags_v(IntEnum): ## work across multiple engines. ## this flag should be used when applications want full control over ## multi-engine submission and scheduling. + ## This flag is **DEPRECATED** as flag + ## ${X}_COMMAND_LIST_FLAG_EXPLICIT_ONLY is **DEPRECATED**. IN_ORDER = ZE_BIT(1) ## To be used only when creating immediate command lists. Commands ## appended to the immediate command ## list are executed in-order, with driver implementation enforcing @@ -1011,7 +1029,7 @@ class ze_command_queue_desc_t(Structure): ## structure (i.e. contains stype and pNext). ("ordinal", c_ulong), ## [in] command queue group ordinal ("index", c_ulong), ## [in] command queue index within the group; - ## must be zero if ::ZE_COMMAND_QUEUE_FLAG_EXPLICIT_ONLY is not set + ## must be zero. ("flags", ze_command_queue_flags_t), ## [in] usage flags. ## must be 0 (default) or a valid combination of ::ze_command_queue_flag_t; ## default behavior may use implicit driver-based heuristics to balance @@ -1037,6 +1055,8 @@ class ze_command_list_flags_v(IntEnum): ## work across multiple engines. ## this flag should be used when applications want full control over ## multi-engine submission and scheduling. + ## This flag is **DEPRECATED** and implementations are not expected to + ## support this feature. IN_ORDER = ZE_BIT(3) ## commands appended to this command list are executed in-order, with ## driver implementation ## enforcing dependencies between them. Application is not required to @@ -2270,6 +2290,641 @@ class ze_external_semaphore_wait_params_ext_t(Structure): ## such as ::ZE_EXTERNAL_SEMAPHORE_EXT_FLAG_D3D12_FENCE. ] +############################################################################### +## @brief CacheLine Size Extension Name +ZE_CACHELINE_SIZE_EXT_NAME = "ZE_extension_device_cache_line_size" + +############################################################################### +## @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_device_cache_line_size_ext_version_t(c_int): + def __str__(self): + return str(ze_device_cache_line_size_ext_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): + _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. + ] + +############################################################################### +## @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_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_ext_version_t(c_int): + def __str__(self): + return str(ze_rtas_builder_ext_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 + +class ze_rtas_device_ext_flags_t(c_int): + def __str__(self): + return hex(self.value) + + +############################################################################### +## @brief Ray tracing acceleration structure format +## +## @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)) + + +############################################################################### +## @brief Ray tracing acceleration structure builder flags +class ze_rtas_builder_ext_flags_v(IntEnum): + RESERVED = ZE_BIT(0) ## Reserved for future use + +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_ext_flags_v(IntEnum): + RESERVED = ZE_BIT(0) ## Reserved for future use + +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_ext_flags_v(IntEnum): + NON_OPAQUE = ZE_BIT(0) ## non-opaque geometries invoke an any-hit shader + +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_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_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 + +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_ext_flags_t) +class ze_rtas_builder_packed_instance_ext_flags_t(c_ubyte): + pass + +############################################################################### +## @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 + +class ze_rtas_builder_build_op_ext_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_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)) + + +############################################################################### +## @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 + +class ze_rtas_builder_geometry_type_ext_t(c_int): + def __str__(self): + 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_ext_t) +class ze_rtas_builder_packed_geometry_type_ext_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_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 + +############################################################################### +## @brief Ray tracing acceleration structure builder descriptor +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_ext_version_t) ## [in] ray tracing acceleration structure builder version + ] + +############################################################################### +## @brief Ray tracing acceleration structure builder properties +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_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. + ] + +############################################################################### +## @brief Ray tracing acceleration structure builder parallel operation +## properties +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_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 + ] + +############################################################################### +## @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): + _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 + ] + +############################################################################### +## @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 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 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 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_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 + ("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_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 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_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 + ## 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_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 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 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 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_ext_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 + ] + +############################################################################### +## @brief AABB callback function parameters +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 + ## 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 + ] + +############################################################################### +## @brief Callback function pointer type to return AABBs for a range of +## procedural primitives + +############################################################################### +## @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 Ray tracing acceleration structure builder instance geometry info +class ze_rtas_builder_instance_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_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 + ] + +############################################################################### +## @brief +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_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 + ] + +############################################################################### +## @brief Device Vector Sizes Query Extension Name +ZE_DEVICE_VECTOR_SIZES_EXT_NAME = "ZE_extension_device_vector_sizes" + +############################################################################### +## @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_device_vector_sizes_ext_version_t(c_int): + def __str__(self): + return str(ze_device_vector_sizes_ext_version_v(self.value)) + + +############################################################################### +## @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,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. + ] + ############################################################################### ## @brief Cache_Reservation Extension Name ZE_CACHE_RESERVATION_EXT_NAME = "ZE_extension_cache_reservation" @@ -2438,7 +3093,8 @@ class ze_image_view_planar_exp_desc_t(Structure): ("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). - ("planeIndex", c_ulong) ## [in] the 0-based plane index (e.g. NV12 is 0 = Y plane, 1 UV plane) + ("planeIndex", c_ulong) ## [DEPRECATED] no longer supported, use + ## ::ze_image_view_planar_ext_desc_t instead ] ############################################################################### @@ -2828,8 +3484,15 @@ def __str__(self): ############################################################################### ## @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 freeing - DEFER_FREE = ZE_BIT(1) ## schedules the memory to be freed but does not free immediately + 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): @@ -3341,6 +4004,7 @@ def __str__(self): ## identifier. class ze_rtas_format_exp_v(IntEnum): INVALID = 0 ## Invalid acceleration structure format + MAX = 0x7ffffffe ## Maximum acceleration structure format code class ze_rtas_format_exp_t(c_int): def __str__(self): @@ -4172,6 +4836,53 @@ class ze_mutable_graph_argument_exp_desc_t(Structure): ############################################################################### __use_win_types = "Windows" == platform.uname()[0] +############################################################################### +## @brief Function-pointer for zeRTASBuilderCreateExt +if __use_win_types: + _zeRTASBuilderCreateExt_t = WINFUNCTYPE( ze_result_t, ze_driver_handle_t, POINTER(ze_rtas_builder_ext_desc_t), POINTER(ze_rtas_builder_ext_handle_t) ) +else: + _zeRTASBuilderCreateExt_t = CFUNCTYPE( ze_result_t, ze_driver_handle_t, POINTER(ze_rtas_builder_ext_desc_t), POINTER(ze_rtas_builder_ext_handle_t) ) + +############################################################################### +## @brief Function-pointer for zeRTASBuilderGetBuildPropertiesExt +if __use_win_types: + _zeRTASBuilderGetBuildPropertiesExt_t = WINFUNCTYPE( ze_result_t, ze_rtas_builder_ext_handle_t, POINTER(ze_rtas_builder_build_op_ext_desc_t), POINTER(ze_rtas_builder_ext_properties_t) ) +else: + _zeRTASBuilderGetBuildPropertiesExt_t = CFUNCTYPE( ze_result_t, ze_rtas_builder_ext_handle_t, POINTER(ze_rtas_builder_build_op_ext_desc_t), POINTER(ze_rtas_builder_ext_properties_t) ) + +############################################################################### +## @brief Function-pointer for zeRTASBuilderBuildExt +if __use_win_types: + _zeRTASBuilderBuildExt_t = WINFUNCTYPE( ze_result_t, ze_rtas_builder_ext_handle_t, POINTER(ze_rtas_builder_build_op_ext_desc_t), c_void_p, c_size_t, c_void_p, c_size_t, ze_rtas_parallel_operation_ext_handle_t, c_void_p, POINTER(ze_rtas_aabb_ext_t), POINTER(c_size_t) ) +else: + _zeRTASBuilderBuildExt_t = CFUNCTYPE( ze_result_t, ze_rtas_builder_ext_handle_t, POINTER(ze_rtas_builder_build_op_ext_desc_t), c_void_p, c_size_t, c_void_p, c_size_t, ze_rtas_parallel_operation_ext_handle_t, c_void_p, POINTER(ze_rtas_aabb_ext_t), POINTER(c_size_t) ) + +############################################################################### +## @brief Function-pointer for zeRTASBuilderCommandListAppendCopyExt +if __use_win_types: + _zeRTASBuilderCommandListAppendCopyExt_t = WINFUNCTYPE( ze_result_t, ze_command_list_handle_t, c_void_p, c_void_p, c_size_t, ze_event_handle_t, c_ulong, POINTER(ze_event_handle_t) ) +else: + _zeRTASBuilderCommandListAppendCopyExt_t = CFUNCTYPE( ze_result_t, ze_command_list_handle_t, c_void_p, c_void_p, c_size_t, ze_event_handle_t, c_ulong, POINTER(ze_event_handle_t) ) + +############################################################################### +## @brief Function-pointer for zeRTASBuilderDestroyExt +if __use_win_types: + _zeRTASBuilderDestroyExt_t = WINFUNCTYPE( ze_result_t, ze_rtas_builder_ext_handle_t ) +else: + _zeRTASBuilderDestroyExt_t = CFUNCTYPE( ze_result_t, ze_rtas_builder_ext_handle_t ) + + +############################################################################### +## @brief Table of RTASBuilder functions pointers +class _ze_rtas_builder_dditable_t(Structure): + _fields_ = [ + ("pfnCreateExt", c_void_p), ## _zeRTASBuilderCreateExt_t + ("pfnGetBuildPropertiesExt", c_void_p), ## _zeRTASBuilderGetBuildPropertiesExt_t + ("pfnBuildExt", c_void_p), ## _zeRTASBuilderBuildExt_t + ("pfnCommandListAppendCopyExt", c_void_p), ## _zeRTASBuilderCommandListAppendCopyExt_t + ("pfnDestroyExt", c_void_p) ## _zeRTASBuilderDestroyExt_t + ] + ############################################################################### ## @brief Function-pointer for zeRTASBuilderCreateExp if __use_win_types: @@ -4211,6 +4922,45 @@ class _ze_rtas_builder_exp_dditable_t(Structure): ("pfnDestroyExp", c_void_p) ## _zeRTASBuilderDestroyExp_t ] +############################################################################### +## @brief Function-pointer for zeRTASParallelOperationCreateExt +if __use_win_types: + _zeRTASParallelOperationCreateExt_t = WINFUNCTYPE( ze_result_t, ze_driver_handle_t, POINTER(ze_rtas_parallel_operation_ext_handle_t) ) +else: + _zeRTASParallelOperationCreateExt_t = CFUNCTYPE( ze_result_t, ze_driver_handle_t, POINTER(ze_rtas_parallel_operation_ext_handle_t) ) + +############################################################################### +## @brief Function-pointer for zeRTASParallelOperationGetPropertiesExt +if __use_win_types: + _zeRTASParallelOperationGetPropertiesExt_t = WINFUNCTYPE( ze_result_t, ze_rtas_parallel_operation_ext_handle_t, POINTER(ze_rtas_parallel_operation_ext_properties_t) ) +else: + _zeRTASParallelOperationGetPropertiesExt_t = CFUNCTYPE( ze_result_t, ze_rtas_parallel_operation_ext_handle_t, POINTER(ze_rtas_parallel_operation_ext_properties_t) ) + +############################################################################### +## @brief Function-pointer for zeRTASParallelOperationJoinExt +if __use_win_types: + _zeRTASParallelOperationJoinExt_t = WINFUNCTYPE( ze_result_t, ze_rtas_parallel_operation_ext_handle_t ) +else: + _zeRTASParallelOperationJoinExt_t = CFUNCTYPE( ze_result_t, ze_rtas_parallel_operation_ext_handle_t ) + +############################################################################### +## @brief Function-pointer for zeRTASParallelOperationDestroyExt +if __use_win_types: + _zeRTASParallelOperationDestroyExt_t = WINFUNCTYPE( ze_result_t, ze_rtas_parallel_operation_ext_handle_t ) +else: + _zeRTASParallelOperationDestroyExt_t = CFUNCTYPE( ze_result_t, ze_rtas_parallel_operation_ext_handle_t ) + + +############################################################################### +## @brief Table of RTASParallelOperation functions pointers +class _ze_rtas_parallel_operation_dditable_t(Structure): + _fields_ = [ + ("pfnCreateExt", c_void_p), ## _zeRTASParallelOperationCreateExt_t + ("pfnGetPropertiesExt", c_void_p), ## _zeRTASParallelOperationGetPropertiesExt_t + ("pfnJoinExt", c_void_p), ## _zeRTASParallelOperationJoinExt_t + ("pfnDestroyExt", c_void_p) ## _zeRTASParallelOperationDestroyExt_t + ] + ############################################################################### ## @brief Function-pointer for zeRTASParallelOperationCreateExp if __use_win_types: @@ -4322,6 +5072,13 @@ class _ze_global_dditable_t(Structure): else: _zeDriverGetLastErrorDescription_t = CFUNCTYPE( ze_result_t, ze_driver_handle_t, POINTER(c_char_p) ) +############################################################################### +## @brief Function-pointer for zeDriverRTASFormatCompatibilityCheckExt +if __use_win_types: + _zeDriverRTASFormatCompatibilityCheckExt_t = WINFUNCTYPE( ze_result_t, ze_driver_handle_t, ze_rtas_format_ext_t, ze_rtas_format_ext_t ) +else: + _zeDriverRTASFormatCompatibilityCheckExt_t = CFUNCTYPE( ze_result_t, ze_driver_handle_t, ze_rtas_format_ext_t, ze_rtas_format_ext_t ) + ############################################################################### ## @brief Table of Driver functions pointers @@ -4333,7 +5090,8 @@ class _ze_driver_dditable_t(Structure): ("pfnGetIpcProperties", c_void_p), ## _zeDriverGetIpcProperties_t ("pfnGetExtensionProperties", c_void_p), ## _zeDriverGetExtensionProperties_t ("pfnGetExtensionFunctionAddress", c_void_p), ## _zeDriverGetExtensionFunctionAddress_t - ("pfnGetLastErrorDescription", c_void_p) ## _zeDriverGetLastErrorDescription_t + ("pfnGetLastErrorDescription", c_void_p), ## _zeDriverGetLastErrorDescription_t + ("pfnRTASFormatCompatibilityCheckExt", c_void_p) ## _zeDriverRTASFormatCompatibilityCheckExt_t ] ############################################################################### @@ -4498,6 +5256,13 @@ class _ze_driver_exp_dditable_t(Structure): else: _zeDeviceReleaseExternalSemaphoreExt_t = CFUNCTYPE( ze_result_t, ze_external_semaphore_ext_handle_t ) +############################################################################### +## @brief Function-pointer for zeDeviceGetVectorWidthPropertiesExt +if __use_win_types: + _zeDeviceGetVectorWidthPropertiesExt_t = WINFUNCTYPE( ze_result_t, ze_device_handle_t, POINTER(c_ulong), POINTER(ze_device_vector_width_properties_ext_t) ) +else: + _zeDeviceGetVectorWidthPropertiesExt_t = CFUNCTYPE( ze_result_t, ze_device_handle_t, POINTER(c_ulong), POINTER(ze_device_vector_width_properties_ext_t) ) + ############################################################################### ## @brief Table of Device functions pointers @@ -4523,7 +5288,8 @@ class _ze_device_dditable_t(Structure): ("pfnPciGetPropertiesExt", c_void_p), ## _zeDevicePciGetPropertiesExt_t ("pfnGetRootDevice", c_void_p), ## _zeDeviceGetRootDevice_t ("pfnImportExternalSemaphoreExt", c_void_p), ## _zeDeviceImportExternalSemaphoreExt_t - ("pfnReleaseExternalSemaphoreExt", c_void_p) ## _zeDeviceReleaseExternalSemaphoreExt_t + ("pfnReleaseExternalSemaphoreExt", c_void_p), ## _zeDeviceReleaseExternalSemaphoreExt_t + ("pfnGetVectorWidthPropertiesExt", c_void_p) ## _zeDeviceGetVectorWidthPropertiesExt_t ] ############################################################################### @@ -5907,7 +6673,9 @@ class _ze_fabric_edge_exp_dditable_t(Structure): ############################################################################### class _ze_dditable_t(Structure): _fields_ = [ + ("RTASBuilder", _ze_rtas_builder_dditable_t), ("RTASBuilderExp", _ze_rtas_builder_exp_dditable_t), + ("RTASParallelOperation", _ze_rtas_parallel_operation_dditable_t), ("RTASParallelOperationExp", _ze_rtas_parallel_operation_exp_dditable_t), ("Global", _ze_global_dditable_t), ("Driver", _ze_driver_dditable_t), @@ -5950,6 +6718,20 @@ def __init__(self, version : ze_api_version_t): # fill the ddi tables self.__dditable = _ze_dditable_t() + # call driver to get function pointers + _RTASBuilder = _ze_rtas_builder_dditable_t() + r = ze_result_v(self.__dll.zeGetRTASBuilderProcAddrTable(version, byref(_RTASBuilder))) + if r != ze_result_v.SUCCESS: + raise Exception(r) + self.__dditable.RTASBuilder = _RTASBuilder + + # attach function interface to function address + self.zeRTASBuilderCreateExt = _zeRTASBuilderCreateExt_t(self.__dditable.RTASBuilder.pfnCreateExt) + self.zeRTASBuilderGetBuildPropertiesExt = _zeRTASBuilderGetBuildPropertiesExt_t(self.__dditable.RTASBuilder.pfnGetBuildPropertiesExt) + self.zeRTASBuilderBuildExt = _zeRTASBuilderBuildExt_t(self.__dditable.RTASBuilder.pfnBuildExt) + self.zeRTASBuilderCommandListAppendCopyExt = _zeRTASBuilderCommandListAppendCopyExt_t(self.__dditable.RTASBuilder.pfnCommandListAppendCopyExt) + self.zeRTASBuilderDestroyExt = _zeRTASBuilderDestroyExt_t(self.__dditable.RTASBuilder.pfnDestroyExt) + # call driver to get function pointers _RTASBuilderExp = _ze_rtas_builder_exp_dditable_t() r = ze_result_v(self.__dll.zeGetRTASBuilderExpProcAddrTable(version, byref(_RTASBuilderExp))) @@ -5963,6 +6745,19 @@ def __init__(self, version : ze_api_version_t): self.zeRTASBuilderBuildExp = _zeRTASBuilderBuildExp_t(self.__dditable.RTASBuilderExp.pfnBuildExp) self.zeRTASBuilderDestroyExp = _zeRTASBuilderDestroyExp_t(self.__dditable.RTASBuilderExp.pfnDestroyExp) + # call driver to get function pointers + _RTASParallelOperation = _ze_rtas_parallel_operation_dditable_t() + r = ze_result_v(self.__dll.zeGetRTASParallelOperationProcAddrTable(version, byref(_RTASParallelOperation))) + if r != ze_result_v.SUCCESS: + raise Exception(r) + self.__dditable.RTASParallelOperation = _RTASParallelOperation + + # attach function interface to function address + self.zeRTASParallelOperationCreateExt = _zeRTASParallelOperationCreateExt_t(self.__dditable.RTASParallelOperation.pfnCreateExt) + self.zeRTASParallelOperationGetPropertiesExt = _zeRTASParallelOperationGetPropertiesExt_t(self.__dditable.RTASParallelOperation.pfnGetPropertiesExt) + self.zeRTASParallelOperationJoinExt = _zeRTASParallelOperationJoinExt_t(self.__dditable.RTASParallelOperation.pfnJoinExt) + self.zeRTASParallelOperationDestroyExt = _zeRTASParallelOperationDestroyExt_t(self.__dditable.RTASParallelOperation.pfnDestroyExt) + # call driver to get function pointers _RTASParallelOperationExp = _ze_rtas_parallel_operation_exp_dditable_t() r = ze_result_v(self.__dll.zeGetRTASParallelOperationExpProcAddrTable(version, byref(_RTASParallelOperationExp))) @@ -6002,6 +6797,7 @@ def __init__(self, version : ze_api_version_t): self.zeDriverGetExtensionProperties = _zeDriverGetExtensionProperties_t(self.__dditable.Driver.pfnGetExtensionProperties) self.zeDriverGetExtensionFunctionAddress = _zeDriverGetExtensionFunctionAddress_t(self.__dditable.Driver.pfnGetExtensionFunctionAddress) self.zeDriverGetLastErrorDescription = _zeDriverGetLastErrorDescription_t(self.__dditable.Driver.pfnGetLastErrorDescription) + self.zeDriverRTASFormatCompatibilityCheckExt = _zeDriverRTASFormatCompatibilityCheckExt_t(self.__dditable.Driver.pfnRTASFormatCompatibilityCheckExt) # call driver to get function pointers _DriverExp = _ze_driver_exp_dditable_t() @@ -6042,6 +6838,7 @@ def __init__(self, version : ze_api_version_t): self.zeDeviceGetRootDevice = _zeDeviceGetRootDevice_t(self.__dditable.Device.pfnGetRootDevice) self.zeDeviceImportExternalSemaphoreExt = _zeDeviceImportExternalSemaphoreExt_t(self.__dditable.Device.pfnImportExternalSemaphoreExt) self.zeDeviceReleaseExternalSemaphoreExt = _zeDeviceReleaseExternalSemaphoreExt_t(self.__dditable.Device.pfnReleaseExternalSemaphoreExt) + self.zeDeviceGetVectorWidthPropertiesExt = _zeDeviceGetVectorWidthPropertiesExt_t(self.__dditable.Device.pfnGetVectorWidthPropertiesExt) # call driver to get function pointers _DeviceExp = _ze_device_exp_dditable_t() diff --git a/include/ze_api.h b/include/ze_api.h index dfb30a25..03d12d03 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.12-r1.12.15 + * @version v1.13-r1.13.1 * */ #ifndef _ZE_API_H @@ -249,8 +249,15 @@ typedef enum _ze_result_t ///< memory ZE_RESULT_WARNING_ACTION_REQUIRED = 0x7800001b, ///< [Sysman] an action is required to complete the desired operation ZE_RESULT_ERROR_INVALID_KERNEL_HANDLE = 0x7800001c, ///< [Core, Validation] kernel handle is invalid for the operation + ZE_RESULT_EXT_RTAS_BUILD_RETRY = 0x7800001d, ///< [Core, Extension] ray tracing acceleration structure build operation + ///< failed due to insufficient resources, retry with a larger acceleration + ///< structure buffer allocation + ZE_RESULT_EXT_RTAS_BUILD_DEFERRED = 0x7800001e, ///< [Core, Extension] ray tracing acceleration structure build operation + ///< deferred to parallel operation join + 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_UNKNOWN = 0x7ffffffe, ///< [Core] unknown or internal error - ZE_RESULT_FORCE_UINT32 = 0x7fffffff + ZE_RESULT_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_RESULT_* ENUMs } ze_result_t; @@ -351,7 +358,15 @@ typedef enum _ze_structure_type_t ZE_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_EXT = 0x00020025, ///< ::ze_external_semaphore_signal_params_ext_t ZE_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_WAIT_PARAMS_EXT = 0x00020026, ///< ::ze_external_semaphore_wait_params_ext_t ZE_STRUCTURE_TYPE_DRIVER_DDI_HANDLES_EXT_PROPERTIES = 0x00020027, ///< ::ze_driver_ddi_handles_ext_properties_t - ZE_STRUCTURE_TYPE_FORCE_UINT32 = 0x7fffffff + ZE_STRUCTURE_TYPE_DEVICE_CACHELINE_SIZE_EXT = 0x00020028, ///< ::ze_device_cache_line_size_ext_t + ZE_STRUCTURE_TYPE_DEVICE_VECTOR_WIDTH_PROPERTIES_EXT = 0x00020029, ///< ::ze_device_vector_width_properties_ext_t + ZE_STRUCTURE_TYPE_RTAS_BUILDER_EXT_DESC = 0x00020030, ///< ::ze_rtas_builder_ext_desc_t + ZE_STRUCTURE_TYPE_RTAS_BUILDER_BUILD_OP_EXT_DESC = 0x00020031, ///< ::ze_rtas_builder_build_op_ext_desc_t + ZE_STRUCTURE_TYPE_RTAS_BUILDER_EXT_PROPERTIES = 0x00020032, ///< ::ze_rtas_builder_ext_properties_t + ZE_STRUCTURE_TYPE_RTAS_PARALLEL_OPERATION_EXT_PROPERTIES = 0x00020033, ///< ::ze_rtas_parallel_operation_ext_properties_t + ZE_STRUCTURE_TYPE_RTAS_DEVICE_EXT_PROPERTIES = 0x00020034, ///< ::ze_rtas_device_ext_properties_t + ZE_STRUCTURE_TYPE_RTAS_GEOMETRY_AABBS_EXT_CB_PARAMS = 0x00020035, ///< ::ze_rtas_geometry_aabbs_ext_cb_params_t + ZE_STRUCTURE_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_STRUCTURE_TYPE_* ENUMs } ze_structure_type_t; @@ -369,7 +384,7 @@ typedef enum _ze_external_memory_type_flag_t ///< resource ZE_EXTERNAL_MEMORY_TYPE_FLAG_D3D12_HEAP = ZE_BIT(6), ///< an NT handle referring to a Direct3D 12 heap resource ZE_EXTERNAL_MEMORY_TYPE_FLAG_D3D12_RESOURCE = ZE_BIT(7), ///< an NT handle referring to a Direct3D 12 committed resource - ZE_EXTERNAL_MEMORY_TYPE_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_EXTERNAL_MEMORY_TYPE_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_EXTERNAL_MEMORY_TYPE_FLAG_* ENUMs } ze_external_memory_type_flag_t; @@ -380,7 +395,7 @@ typedef enum _ze_bandwidth_unit_t ZE_BANDWIDTH_UNIT_UNKNOWN = 0, ///< The unit used for bandwidth is unknown ZE_BANDWIDTH_UNIT_BYTES_PER_NANOSEC = 1, ///< Bandwidth is provided in bytes/nanosec ZE_BANDWIDTH_UNIT_BYTES_PER_CLOCK = 2, ///< Bandwidth is provided in bytes/clock - ZE_BANDWIDTH_UNIT_FORCE_UINT32 = 0x7fffffff + ZE_BANDWIDTH_UNIT_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_BANDWIDTH_UNIT_* ENUMs } ze_bandwidth_unit_t; @@ -393,7 +408,7 @@ typedef enum _ze_latency_unit_t ZE_LATENCY_UNIT_CLOCK = 2, ///< Latency is provided in clocks ZE_LATENCY_UNIT_HOP = 3, ///< Latency is provided in hops (normalized so that the lowest latency ///< link has a latency of 1 hop) - ZE_LATENCY_UNIT_FORCE_UINT32 = 0x7fffffff + ZE_LATENCY_UNIT_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_LATENCY_UNIT_* ENUMs } ze_latency_unit_t; @@ -719,6 +734,86 @@ typedef struct _ze_external_semaphore_signal_params_ext_t ze_external_semaphore_ /// @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_cache_reservation_ext_desc_t typedef struct _ze_cache_reservation_ext_desc_t ze_cache_reservation_ext_desc_t; @@ -990,7 +1085,7 @@ 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 + ZE_INIT_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_INIT_FLAG_* ENUMs } ze_init_flag_t; @@ -1087,7 +1182,7 @@ typedef enum _ze_init_driver_type_flag_t { ZE_INIT_DRIVER_TYPE_FLAG_GPU = ZE_BIT(0), ///< initialize and retrieve GPU drivers ZE_INIT_DRIVER_TYPE_FLAG_NPU = ZE_BIT(1), ///< initialize and retrieve NPU drivers - ZE_INIT_DRIVER_TYPE_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_INIT_DRIVER_TYPE_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_INIT_DRIVER_TYPE_FLAG_* ENUMs } ze_init_driver_type_flag_t; @@ -1113,11 +1208,11 @@ typedef struct _ze_init_driver_type_desc_t /// other function. (zeInit is [Deprecated] and is replaced by /// zeInitDrivers) /// - Calls to zeInit[Deprecated] or InitDrivers will not alter the drivers -/// retrieved thru either api. -/// - Drivers init thru zeInit[Deprecated] or InitDrivers will not be +/// retrieved through either api. +/// - Drivers init through zeInit[Deprecated] or InitDrivers will not be /// reInitialized once init in an application. The Loader will determine -/// if the already init driver needs to be delivered to the user thru the -/// init type flags. +/// if the already init driver needs to be delivered to the user through +/// the init type flags. /// - Already init Drivers will not be uninitialized if the call to /// InitDrivers does not include that driver's type. Those init drivers /// which don't match the init flags will not have their driver handles @@ -1186,15 +1281,16 @@ typedef enum _ze_api_version_t ZE_API_VERSION_1_10 = ZE_MAKE_VERSION( 1, 10 ), ///< version 1.10 ZE_API_VERSION_1_11 = ZE_MAKE_VERSION( 1, 11 ), ///< version 1.11 ZE_API_VERSION_1_12 = ZE_MAKE_VERSION( 1, 12 ), ///< version 1.12 - ZE_API_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 12 ), ///< latest known version - ZE_API_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_API_VERSION_1_13 = ZE_MAKE_VERSION( 1, 13 ), ///< version 1.13 + ZE_API_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 13 ), ///< latest known version + ZE_API_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_API_VERSION_* ENUMs } 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, 12 ) +#define ZE_API_VERSION_CURRENT_M ZE_MAKE_VERSION( 1, 13 ) #endif // ZE_API_VERSION_CURRENT_M /////////////////////////////////////////////////////////////////////////////// @@ -1284,7 +1380,7 @@ typedef enum _ze_ipc_property_flag_t ///< ::zeMemGetIpcHandle. ZE_IPC_PROPERTY_FLAG_EVENT_POOL = ZE_BIT(1), ///< Supports passing event pools between processes. See ///< ::zeEventPoolGetIpcHandle. - ZE_IPC_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_IPC_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_IPC_PROPERTY_FLAG_* ENUMs } ze_ipc_property_flag_t; @@ -1551,7 +1647,7 @@ typedef enum _ze_device_type_t ZE_DEVICE_TYPE_FPGA = 3, ///< Field Programmable Gate Array ZE_DEVICE_TYPE_MCA = 4, ///< Memory Copy Accelerator ZE_DEVICE_TYPE_VPU = 5, ///< Vision Processing Unit - ZE_DEVICE_TYPE_FORCE_UINT32 = 0x7fffffff + ZE_DEVICE_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_DEVICE_TYPE_* ENUMs } ze_device_type_t; @@ -1584,7 +1680,7 @@ typedef enum _ze_device_property_flag_t ZE_DEVICE_PROPERTY_FLAG_SUBDEVICE = ZE_BIT(1), ///< Device handle used for query represents a sub-device. ZE_DEVICE_PROPERTY_FLAG_ECC = ZE_BIT(2), ///< Device supports error correction memory access. ZE_DEVICE_PROPERTY_FLAG_ONDEMANDPAGING = ZE_BIT(3), ///< Device supports on-demand page-faulting. - ZE_DEVICE_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_DEVICE_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_DEVICE_PROPERTY_FLAG_* ENUMs } ze_device_property_flag_t; @@ -1748,7 +1844,7 @@ typedef enum _ze_device_module_flag_t ZE_DEVICE_MODULE_FLAG_FP64 = ZE_BIT(1), ///< Device supports 64-bit floating-point operations ZE_DEVICE_MODULE_FLAG_INT64_ATOMICS = ZE_BIT(2), ///< Device supports 64-bit atomic operations ZE_DEVICE_MODULE_FLAG_DP4A = ZE_BIT(3), ///< Device supports four component dot product and accumulate operations - ZE_DEVICE_MODULE_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_DEVICE_MODULE_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_DEVICE_MODULE_FLAG_* ENUMs } ze_device_module_flag_t; @@ -1766,7 +1862,7 @@ typedef enum _ze_device_fp_flag_t ZE_DEVICE_FP_FLAG_ROUNDED_DIVIDE_SQRT = ZE_BIT(6), ///< Supports rounding as defined by IEEE754 for divide and sqrt ///< operations. ZE_DEVICE_FP_FLAG_SOFT_FLOAT = ZE_BIT(7), ///< Uses software implementation for basic floating-point operations. - ZE_DEVICE_FP_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_DEVICE_FP_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_DEVICE_FP_FLAG_* ENUMs } ze_device_fp_flag_t; @@ -1834,7 +1930,7 @@ typedef enum _ze_command_queue_group_property_flag_t ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COOPERATIVE_KERNELS = ZE_BIT(2), ///< Command queue group supports cooperative kernels. ///< See ::zeCommandListAppendLaunchCooperativeKernel for more details. ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_METRICS = ZE_BIT(3), ///< Command queue groups supports metric queries. - ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_* ENUMs } ze_command_queue_group_property_flag_t; @@ -1903,7 +1999,7 @@ typedef uint32_t ze_device_memory_property_flags_t; typedef enum _ze_device_memory_property_flag_t { ZE_DEVICE_MEMORY_PROPERTY_FLAG_TBD = ZE_BIT(0), ///< reserved for future use - ZE_DEVICE_MEMORY_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_DEVICE_MEMORY_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_DEVICE_MEMORY_PROPERTY_FLAG_* ENUMs } ze_device_memory_property_flag_t; @@ -1979,7 +2075,7 @@ typedef enum _ze_memory_access_cap_flag_t ZE_MEMORY_ACCESS_CAP_FLAG_ATOMIC = ZE_BIT(1), ///< Supports atomic access ZE_MEMORY_ACCESS_CAP_FLAG_CONCURRENT = ZE_BIT(2), ///< Supports concurrent access ZE_MEMORY_ACCESS_CAP_FLAG_CONCURRENT_ATOMIC = ZE_BIT(3), ///< Supports concurrent atomic access - ZE_MEMORY_ACCESS_CAP_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_MEMORY_ACCESS_CAP_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_MEMORY_ACCESS_CAP_FLAG_* ENUMs } ze_memory_access_cap_flag_t; @@ -2037,7 +2133,7 @@ typedef uint32_t ze_device_cache_property_flags_t; typedef enum _ze_device_cache_property_flag_t { ZE_DEVICE_CACHE_PROPERTY_FLAG_USER_CONTROL = ZE_BIT(0), ///< Device support User Cache Control (i.e. SLM section vs Generic Cache) - ZE_DEVICE_CACHE_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_DEVICE_CACHE_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_DEVICE_CACHE_PROPERTY_FLAG_* ENUMs } ze_device_cache_property_flag_t; @@ -2185,7 +2281,7 @@ typedef enum _ze_device_p2p_property_flag_t { ZE_DEVICE_P2P_PROPERTY_FLAG_ACCESS = ZE_BIT(0), ///< Device supports access between peer devices. ZE_DEVICE_P2P_PROPERTY_FLAG_ATOMICS = ZE_BIT(1), ///< Device supports atomics between peer devices. - ZE_DEVICE_P2P_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_DEVICE_P2P_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_DEVICE_P2P_PROPERTY_FLAG_* ENUMs } ze_device_p2p_property_flag_t; @@ -2337,7 +2433,7 @@ typedef uint32_t ze_context_flags_t; typedef enum _ze_context_flag_t { ZE_CONTEXT_FLAG_TBD = ZE_BIT(0), ///< reserved for future use - ZE_CONTEXT_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_CONTEXT_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_CONTEXT_FLAG_* ENUMs } ze_context_flag_t; @@ -2492,6 +2588,8 @@ typedef enum _ze_command_queue_flag_t ///< work across multiple engines. ///< this flag should be used when applications want full control over ///< multi-engine submission and scheduling. + ///< This flag is **DEPRECATED** as flag + ///< ${X}_COMMAND_LIST_FLAG_EXPLICIT_ONLY is **DEPRECATED**. ZE_COMMAND_QUEUE_FLAG_IN_ORDER = ZE_BIT(1), ///< To be used only when creating immediate command lists. Commands ///< appended to the immediate command ///< list are executed in-order, with driver implementation enforcing @@ -2501,7 +2599,7 @@ typedef enum _ze_command_queue_flag_t ///< the next to define an in-order list, and application is allowed to ///< pass signal and wait events ///< to each appended command to implement more complex dependency graphs. - ZE_COMMAND_QUEUE_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_COMMAND_QUEUE_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_COMMAND_QUEUE_FLAG_* ENUMs } ze_command_queue_flag_t; @@ -2514,7 +2612,7 @@ typedef enum _ze_command_queue_mode_t ///< Host thread is blocked using wait on implicit synchronization object ZE_COMMAND_QUEUE_MODE_ASYNCHRONOUS = 2, ///< Device execution is scheduled and will complete in future; ///< explicit synchronization object must be used to determine completeness - ZE_COMMAND_QUEUE_MODE_FORCE_UINT32 = 0x7fffffff + ZE_COMMAND_QUEUE_MODE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_COMMAND_QUEUE_MODE_* ENUMs } ze_command_queue_mode_t; @@ -2525,7 +2623,7 @@ typedef enum _ze_command_queue_priority_t ZE_COMMAND_QUEUE_PRIORITY_NORMAL = 0, ///< [default] normal priority ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_LOW = 1, ///< lower priority than normal ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_HIGH = 2, ///< higher priority than normal - ZE_COMMAND_QUEUE_PRIORITY_FORCE_UINT32 = 0x7fffffff + ZE_COMMAND_QUEUE_PRIORITY_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_COMMAND_QUEUE_PRIORITY_* ENUMs } ze_command_queue_priority_t; @@ -2538,7 +2636,7 @@ typedef struct _ze_command_queue_desc_t ///< structure (i.e. contains stype and pNext). uint32_t ordinal; ///< [in] command queue group ordinal uint32_t index; ///< [in] command queue index within the group; - ///< must be zero if ::ZE_COMMAND_QUEUE_FLAG_EXPLICIT_ONLY is not set + ///< must be zero. ze_command_queue_flags_t flags; ///< [in] usage flags. ///< must be 0 (default) or a valid combination of ::ze_command_queue_flag_t; ///< default behavior may use implicit driver-based heuristics to balance @@ -2769,6 +2867,8 @@ typedef enum _ze_command_list_flag_t ///< work across multiple engines. ///< this flag should be used when applications want full control over ///< multi-engine submission and scheduling. + ///< This flag is **DEPRECATED** and implementations are not expected to + ///< support this feature. ZE_COMMAND_LIST_FLAG_IN_ORDER = ZE_BIT(3), ///< commands appended to this command list are executed in-order, with ///< driver implementation ///< enforcing dependencies between them. Application is not required to @@ -2780,7 +2880,7 @@ typedef enum _ze_command_list_flag_t ///< more complex dependency graphs. Cannot be combined with ::ZE_COMMAND_LIST_FLAG_RELAXED_ORDERING. ZE_COMMAND_LIST_FLAG_EXP_CLONEABLE = ZE_BIT(4), ///< this command list may be cloned using ::zeCommandListCreateCloneExp ///< after ::zeCommandListClose. - ZE_COMMAND_LIST_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_COMMAND_LIST_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_COMMAND_LIST_FLAG_* ENUMs } ze_command_list_flag_t; @@ -3770,7 +3870,7 @@ typedef enum _ze_memory_advice_t ZE_MEMORY_ADVICE_SET_SYSTEM_MEMORY_PREFERRED_LOCATION = 8, ///< hint that the preferred memory location is host memory ZE_MEMORY_ADVICE_CLEAR_SYSTEM_MEMORY_PREFERRED_LOCATION = 9, ///< removes the effect of ///< ::ZE_MEMORY_ADVICE_SET_SYSTEM_MEMORY_PREFERRED_LOCATION - ZE_MEMORY_ADVICE_FORCE_UINT32 = 0x7fffffff + ZE_MEMORY_ADVICE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_MEMORY_ADVICE_* ENUMs } ze_memory_advice_t; @@ -3838,7 +3938,7 @@ typedef enum _ze_event_pool_flag_t ZE_EVENT_POOL_FLAG_KERNEL_MAPPED_TIMESTAMP = ZE_BIT(3), ///< Indicates all events in pool will contain kernel timestamps ///< synchronized to host time domain; cannot be combined with ///< ::ZE_EVENT_POOL_FLAG_KERNEL_TIMESTAMP - ZE_EVENT_POOL_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_EVENT_POOL_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_EVENT_POOL_FLAG_* ENUMs } ze_event_pool_flag_t; @@ -3934,7 +4034,7 @@ typedef enum _ze_event_scope_flag_t ///< device access and peer device access ZE_EVENT_SCOPE_FLAG_HOST = ZE_BIT(2), ///< cache hierarchies are flushed or invalidated sufficient for device and ///< host access - ZE_EVENT_SCOPE_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_EVENT_SCOPE_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_EVENT_SCOPE_FLAG_* ENUMs } ze_event_scope_flag_t; @@ -4608,7 +4708,7 @@ 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 + ZE_FENCE_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_FENCE_FLAG_* ENUMs } ze_fence_flag_t; @@ -4788,7 +4888,7 @@ typedef enum _ze_image_flag_t { ZE_IMAGE_FLAG_KERNEL_WRITE = ZE_BIT(0), ///< kernels will write contents ZE_IMAGE_FLAG_BIAS_UNCACHED = ZE_BIT(1), ///< device should not cache contents - ZE_IMAGE_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_IMAGE_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_IMAGE_FLAG_* ENUMs } ze_image_flag_t; @@ -4802,7 +4902,7 @@ typedef enum _ze_image_type_t ZE_IMAGE_TYPE_2DARRAY = 3, ///< 2D array ZE_IMAGE_TYPE_3D = 4, ///< 3D ZE_IMAGE_TYPE_BUFFER = 5, ///< Buffer - ZE_IMAGE_TYPE_FORCE_UINT32 = 0x7fffffff + ZE_IMAGE_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_IMAGE_TYPE_* ENUMs } ze_image_type_t; @@ -4856,7 +4956,7 @@ typedef enum _ze_image_format_layout_t ZE_IMAGE_FORMAT_LAYOUT_8_8_8 = 43, ///< 3-component 8-bit layout ZE_IMAGE_FORMAT_LAYOUT_16_16_16 = 44, ///< 3-component 16-bit layout ZE_IMAGE_FORMAT_LAYOUT_32_32_32 = 45, ///< 3-component 32-bit layout - ZE_IMAGE_FORMAT_LAYOUT_FORCE_UINT32 = 0x7fffffff + ZE_IMAGE_FORMAT_LAYOUT_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_IMAGE_FORMAT_LAYOUT_* ENUMs } ze_image_format_layout_t; @@ -4869,7 +4969,7 @@ typedef enum _ze_image_format_type_t ZE_IMAGE_FORMAT_TYPE_UNORM = 2, ///< Unsigned normalized integer ZE_IMAGE_FORMAT_TYPE_SNORM = 3, ///< Signed normalized integer ZE_IMAGE_FORMAT_TYPE_FLOAT = 4, ///< Float - ZE_IMAGE_FORMAT_TYPE_FORCE_UINT32 = 0x7fffffff + ZE_IMAGE_FORMAT_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_IMAGE_FORMAT_TYPE_* ENUMs } ze_image_format_type_t; @@ -4884,7 +4984,7 @@ typedef enum _ze_image_format_swizzle_t ZE_IMAGE_FORMAT_SWIZZLE_0 = 4, ///< Zero ZE_IMAGE_FORMAT_SWIZZLE_1 = 5, ///< One ZE_IMAGE_FORMAT_SWIZZLE_X = 6, ///< Don't care - ZE_IMAGE_FORMAT_SWIZZLE_FORCE_UINT32 = 0x7fffffff + ZE_IMAGE_FORMAT_SWIZZLE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_IMAGE_FORMAT_SWIZZLE_* ENUMs } ze_image_format_swizzle_t; @@ -4949,7 +5049,7 @@ typedef enum _ze_image_sampler_filter_flag_t { ZE_IMAGE_SAMPLER_FILTER_FLAG_POINT = ZE_BIT(0), ///< device supports point filtering ZE_IMAGE_SAMPLER_FILTER_FLAG_LINEAR = ZE_BIT(1), ///< device supports linear filtering - ZE_IMAGE_SAMPLER_FILTER_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_IMAGE_SAMPLER_FILTER_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_IMAGE_SAMPLER_FILTER_FLAG_* ENUMs } ze_image_sampler_filter_flag_t; @@ -5071,7 +5171,7 @@ typedef enum _ze_device_mem_alloc_flag_t ZE_DEVICE_MEM_ALLOC_FLAG_BIAS_CACHED = ZE_BIT(0), ///< device should cache allocation ZE_DEVICE_MEM_ALLOC_FLAG_BIAS_UNCACHED = ZE_BIT(1), ///< device should not cache allocation (UC) ZE_DEVICE_MEM_ALLOC_FLAG_BIAS_INITIAL_PLACEMENT = ZE_BIT(2), ///< optimize shared allocation for first access on the device - ZE_DEVICE_MEM_ALLOC_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_DEVICE_MEM_ALLOC_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_DEVICE_MEM_ALLOC_FLAG_* ENUMs } ze_device_mem_alloc_flag_t; @@ -5099,7 +5199,7 @@ typedef enum _ze_host_mem_alloc_flag_t ZE_HOST_MEM_ALLOC_FLAG_BIAS_UNCACHED = ZE_BIT(1), ///< host should not cache allocation (UC) ZE_HOST_MEM_ALLOC_FLAG_BIAS_WRITE_COMBINED = ZE_BIT(2), ///< host memory should be allocated write-combined (WC) ZE_HOST_MEM_ALLOC_FLAG_BIAS_INITIAL_PLACEMENT = ZE_BIT(3), ///< optimize shared allocation for first access on the host - ZE_HOST_MEM_ALLOC_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_HOST_MEM_ALLOC_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_HOST_MEM_ALLOC_FLAG_* ENUMs } ze_host_mem_alloc_flag_t; @@ -5264,8 +5364,11 @@ zeMemAllocHost( /// @details /// - The application must ensure the device is not currently referencing /// the memory before it is freed -/// - The implementation of this function may immediately free all Host and -/// Device allocations associated with this memory +/// - 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. @@ -5294,7 +5397,7 @@ typedef enum _ze_memory_type_t ZE_MEMORY_TYPE_HOST = 1, ///< the memory pointed to is a host allocation ZE_MEMORY_TYPE_DEVICE = 2, ///< the memory pointed to is a device allocation ZE_MEMORY_TYPE_SHARED = 3, ///< the memory pointed to is a shared ownership allocation - ZE_MEMORY_TYPE_FORCE_UINT32 = 0x7fffffff + ZE_MEMORY_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_MEMORY_TYPE_* ENUMs } ze_memory_type_t; @@ -5486,7 +5589,7 @@ typedef enum _ze_ipc_memory_flag_t { ZE_IPC_MEMORY_FLAG_BIAS_CACHED = ZE_BIT(0), ///< device should cache allocation ZE_IPC_MEMORY_FLAG_BIAS_UNCACHED = ZE_BIT(1), ///< device should not cache allocation (UC) - ZE_IPC_MEMORY_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_IPC_MEMORY_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_IPC_MEMORY_FLAG_* ENUMs } ze_ipc_memory_flag_t; @@ -5687,7 +5790,7 @@ typedef enum _ze_memory_atomic_attr_exp_flag_t ZE_MEMORY_ATOMIC_ATTR_EXP_FLAG_SYSTEM_ATOMICS = ZE_BIT(6), ///< Concurrent atomics on the pointer from both host and device are ///< allowed. Requires ::ZE_MEMORY_ACCESS_CAP_FLAG_CONCURRENT_ATOMIC ///< returned by ::zeDeviceGetMemoryAccessProperties. - ZE_MEMORY_ATOMIC_ATTR_EXP_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_MEMORY_ATOMIC_ATTR_EXP_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_MEMORY_ATOMIC_ATTR_EXP_FLAG_* ENUMs } ze_memory_atomic_attr_exp_flag_t; @@ -5701,7 +5804,7 @@ typedef enum _ze_memory_atomic_attr_exp_flag_t /// 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_INVALID_ARGUMENT is returned. +/// ::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 @@ -5780,7 +5883,7 @@ typedef enum _ze_module_format_t { ZE_MODULE_FORMAT_IL_SPIRV = 0, ///< Format is SPIRV IL format ZE_MODULE_FORMAT_NATIVE = 1, ///< Format is device native format - ZE_MODULE_FORMAT_FORCE_UINT32 = 0x7fffffff + ZE_MODULE_FORMAT_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_MODULE_FORMAT_* ENUMs } ze_module_format_t; @@ -6105,7 +6208,7 @@ typedef enum _ze_module_property_flag_t { ZE_MODULE_PROPERTY_FLAG_IMPORTS = ZE_BIT(0), ///< Module has imports (i.e. imported global variables and/or kernels). ///< See ::zeModuleDynamicLink. - ZE_MODULE_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_MODULE_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_MODULE_PROPERTY_FLAG_* ENUMs } ze_module_property_flag_t; @@ -6151,7 +6254,7 @@ typedef enum _ze_kernel_flag_t ZE_KERNEL_FLAG_FORCE_RESIDENCY = ZE_BIT(0), ///< force all device allocations to be resident during execution ZE_KERNEL_FLAG_EXPLICIT_RESIDENCY = ZE_BIT(1), ///< application is responsible for all residency of device allocations. ///< driver may disable implicit residency management. - ZE_KERNEL_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_KERNEL_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_KERNEL_FLAG_* ENUMs } ze_kernel_flag_t; @@ -6379,7 +6482,7 @@ typedef enum _ze_kernel_indirect_access_flag_t ZE_KERNEL_INDIRECT_ACCESS_FLAG_HOST = ZE_BIT(0), ///< Indicates that the kernel accesses host allocations indirectly. ZE_KERNEL_INDIRECT_ACCESS_FLAG_DEVICE = ZE_BIT(1), ///< Indicates that the kernel accesses device allocations indirectly. ZE_KERNEL_INDIRECT_ACCESS_FLAG_SHARED = ZE_BIT(2), ///< Indicates that the kernel accesses shared allocations indirectly. - ZE_KERNEL_INDIRECT_ACCESS_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_KERNEL_INDIRECT_ACCESS_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_KERNEL_INDIRECT_ACCESS_FLAG_* ENUMs } ze_kernel_indirect_access_flag_t; @@ -6461,10 +6564,14 @@ zeKernelGetSourceAttributes( 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. + ///< 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. ); /////////////////////////////////////////////////////////////////////////////// @@ -6474,7 +6581,7 @@ typedef enum _ze_cache_config_flag_t { ZE_CACHE_CONFIG_FLAG_LARGE_SLM = ZE_BIT(0), ///< Large SLM size ZE_CACHE_CONFIG_FLAG_LARGE_DATA = ZE_BIT(1), ///< Large General Data size - ZE_CACHE_CONFIG_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_CACHE_CONFIG_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_CACHE_CONFIG_FLAG_* ENUMs } ze_cache_config_flag_t; @@ -6833,7 +6940,7 @@ typedef enum _ze_module_program_exp_version_t { ZE_MODULE_PROGRAM_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZE_MODULE_PROGRAM_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_MODULE_PROGRAM_EXP_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_MODULE_PROGRAM_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_MODULE_PROGRAM_EXP_VERSION_* ENUMs } ze_module_program_exp_version_t; @@ -6886,7 +6993,7 @@ typedef enum _ze_raytracing_ext_version_t { ZE_RAYTRACING_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZE_RAYTRACING_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_RAYTRACING_EXT_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_RAYTRACING_EXT_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_RAYTRACING_EXT_VERSION_* ENUMs } ze_raytracing_ext_version_t; @@ -6896,7 +7003,7 @@ typedef uint32_t ze_device_raytracing_ext_flags_t; typedef enum _ze_device_raytracing_ext_flag_t { ZE_DEVICE_RAYTRACING_EXT_FLAG_RAYQUERY = ZE_BIT(0), ///< Supports rayquery - ZE_DEVICE_RAYTRACING_EXT_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_DEVICE_RAYTRACING_EXT_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_DEVICE_RAYTRACING_EXT_FLAG_* ENUMs } ze_device_raytracing_ext_flag_t; @@ -6922,7 +7029,7 @@ typedef uint32_t ze_raytracing_mem_alloc_ext_flags_t; typedef enum _ze_raytracing_mem_alloc_ext_flag_t { ZE_RAYTRACING_MEM_ALLOC_EXT_FLAG_TBD = ZE_BIT(0), ///< reserved for future use - ZE_RAYTRACING_MEM_ALLOC_EXT_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_RAYTRACING_MEM_ALLOC_EXT_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_RAYTRACING_MEM_ALLOC_EXT_FLAG_* ENUMs } ze_raytracing_mem_alloc_ext_flag_t; @@ -7084,7 +7191,7 @@ typedef enum _ze_sampler_address_mode_t ///< 0.0f, 0.0f, 0.0f) if image format swizzle contains alpha, otherwise ///< (0.0f, 0.0f, 0.0f, 1.0f). ZE_SAMPLER_ADDRESS_MODE_MIRROR = 4, ///< Out-of-bounds coordinates are mirrored starting from edge. - ZE_SAMPLER_ADDRESS_MODE_FORCE_UINT32 = 0x7fffffff + ZE_SAMPLER_ADDRESS_MODE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_SAMPLER_ADDRESS_MODE_* ENUMs } ze_sampler_address_mode_t; @@ -7094,7 +7201,7 @@ typedef enum _ze_sampler_filter_mode_t { ZE_SAMPLER_FILTER_MODE_NEAREST = 0, ///< No coordinate modifications for out of bounds image access. ZE_SAMPLER_FILTER_MODE_LINEAR = 1, ///< Out-of-bounds coordinates are wrapped back around. - ZE_SAMPLER_FILTER_MODE_FORCE_UINT32 = 0x7fffffff + ZE_SAMPLER_FILTER_MODE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_SAMPLER_FILTER_MODE_* ENUMs } ze_sampler_filter_mode_t; @@ -7184,7 +7291,7 @@ typedef enum _ze_memory_access_attribute_t ZE_MEMORY_ACCESS_ATTRIBUTE_NONE = 0, ///< Indicates the memory page is inaccessible. ZE_MEMORY_ACCESS_ATTRIBUTE_READWRITE = 1, ///< Indicates the memory page supports read write access. ZE_MEMORY_ACCESS_ATTRIBUTE_READONLY = 2, ///< Indicates the memory page supports read-only access. - ZE_MEMORY_ACCESS_ATTRIBUTE_FORCE_UINT32 = 0x7fffffff + ZE_MEMORY_ACCESS_ATTRIBUTE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_MEMORY_ACCESS_ATTRIBUTE_* ENUMs } ze_memory_access_attribute_t; @@ -7292,7 +7399,7 @@ typedef enum _ze_physical_mem_flag_t { ZE_PHYSICAL_MEM_FLAG_ALLOCATE_ON_DEVICE = ZE_BIT(0), ///< [default] allocate physical device memory. ZE_PHYSICAL_MEM_FLAG_ALLOCATE_ON_HOST = ZE_BIT(1), ///< Allocate physical host memory instead. - ZE_PHYSICAL_MEM_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_PHYSICAL_MEM_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_PHYSICAL_MEM_FLAG_* ENUMs } ze_physical_mem_flag_t; @@ -7541,7 +7648,7 @@ typedef enum _ze_float_atomics_ext_version_t { ZE_FLOAT_ATOMICS_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZE_FLOAT_ATOMICS_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_FLOAT_ATOMICS_EXT_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_FLOAT_ATOMICS_EXT_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_FLOAT_ATOMICS_EXT_VERSION_* ENUMs } ze_float_atomics_ext_version_t; @@ -7556,7 +7663,7 @@ typedef enum _ze_device_fp_atomic_ext_flag_t ZE_DEVICE_FP_ATOMIC_EXT_FLAG_LOCAL_LOAD_STORE = ZE_BIT(16), ///< Supports atomic load, store, and exchange ZE_DEVICE_FP_ATOMIC_EXT_FLAG_LOCAL_ADD = ZE_BIT(17), ///< Supports atomic add and subtract ZE_DEVICE_FP_ATOMIC_EXT_FLAG_LOCAL_MIN_MAX = ZE_BIT(18), ///< Supports atomic min and max - ZE_DEVICE_FP_ATOMIC_EXT_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_DEVICE_FP_ATOMIC_EXT_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_DEVICE_FP_ATOMIC_EXT_FLAG_* ENUMs } ze_device_fp_atomic_ext_flag_t; @@ -7599,7 +7706,7 @@ typedef enum _ze_global_offset_exp_version_t { ZE_GLOBAL_OFFSET_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZE_GLOBAL_OFFSET_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_GLOBAL_OFFSET_EXP_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_GLOBAL_OFFSET_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_GLOBAL_OFFSET_EXP_VERSION_* ENUMs } ze_global_offset_exp_version_t; @@ -7648,7 +7755,7 @@ 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_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_RELAXED_ALLOCATION_LIMITS_EXP_VERSION_FORCE_UINT32 = 0x7fffffff + 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; @@ -7659,7 +7766,7 @@ 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_FORCE_UINT32 = 0x7fffffff + 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; @@ -7701,7 +7808,7 @@ typedef enum _ze_kernel_get_binary_exp_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 + ZE_KERNEL_GET_BINARY_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_KERNEL_GET_BINARY_EXP_VERSION_* ENUMs } ze_kernel_get_binary_exp_version_t; @@ -7752,7 +7859,7 @@ 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_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_DRIVER_DDI_HANDLES_EXT_VERSION_FORCE_UINT32 = 0x7fffffff + 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; @@ -7762,7 +7869,7 @@ typedef uint32_t ze_driver_ddi_handle_ext_flags_t; typedef enum _ze_driver_ddi_handle_ext_flag_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 + ZE_DRIVER_DDI_HANDLE_EXT_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_DRIVER_DDI_HANDLE_EXT_FLAG_* ENUMs } ze_driver_ddi_handle_ext_flag_t; @@ -7800,7 +7907,7 @@ 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 + ZE_EXTERNAL_SEMAPHORE_EXT_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_EXTERNAL_SEMAPHORE_EXT_VERSION_* ENUMs } ze_external_semaphore_ext_version_t; @@ -7822,7 +7929,7 @@ typedef enum _ze_external_semaphore_ext_flag_t 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 + ZE_EXTERNAL_SEMAPHORE_EXT_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_EXTERNAL_SEMAPHORE_EXT_FLAG_* ENUMs } ze_external_semaphore_ext_flag_t; @@ -8032,229 +8139,1289 @@ zeCommandListAppendWaitExternalSemaphoreExt( #if !defined(__GNUC__) #pragma endregion #endif -// Intel 'oneAPI' Level-Zero Extension APIs for Cache Reservation +// Intel 'oneAPI' Level-Zero Extension APIs for CacheLine Size #if !defined(__GNUC__) -#pragma region cacheReservation +#pragma region CacheLineSize #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 - -} ze_cache_reservation_ext_version_t; +#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 Cache Reservation Region -typedef enum _ze_cache_ext_region_t +/// @brief CacheLine Size Extension Version(s) +typedef enum _ze_device_cache_line_size_ext_version_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 + 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_cache_ext_region_t; +} ze_device_cache_line_size_ext_version_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief CacheReservation structure +/// @brief CacheLine Size queried using ::zeDeviceGetCacheProperties /// /// @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 ::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 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_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 - ); + size_t cacheLineSize; ///< [out] The cache line size in bytes. -/////////////////////////////////////////////////////////////////////////////// -/// @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_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_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 - ); +} ze_device_cache_line_size_ext_t; #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. #if !defined(__GNUC__) -#pragma region eventquerytimestamps +#pragma region RTAS #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_EXT_NAME +/// @brief Ray Tracing Acceleration Structure Extension Name +#define ZE_RTAS_EXT_NAME "ZE_extension_rtas" +#endif // ZE_RTAS_EXT_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_ext_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 + 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_event_query_timestamps_exp_version_t; +} ze_rtas_builder_ext_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_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 -/// - The application may call this function from simultaneous threads. -/// - The implementation of this function must be thread-safe. -/// - The implementation must support -/// ::ZE_experimental_event_query_timestamps. -/// - 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_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_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; -#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 +/// @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 Image Memory Properties Extension Version(s) -typedef enum _ze_image_memory_properties_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_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 + 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_image_memory_properties_exp_version_t; +} ze_rtas_parallel_operation_ext_flag_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Image memory properties -typedef struct _ze_image_memory_properties_exp_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_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_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_image_memory_properties_exp_t; +} ze_rtas_builder_geometry_ext_flag_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Query image memory properties. +/// @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 -/// - The application may call this function from simultaneous threads. -/// - The implementation of this function must be thread-safe. -/// - The implementation must support -/// ::ZE_experimental_image_memory_properties extension. +/// - 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 /// -/// @remarks +/// @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_extension_rtas 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_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_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_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_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_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_NULL_HANDLE +/// + `nullptr == hDriver` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `::ZE_RTAS_FORMAT_EXT_MAX < rtasFormatA` +/// + `::ZE_RTAS_FORMAT_EXT_MAX < rtasFormatB` +/// - ::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_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_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_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 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_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 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_extension_rtas 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_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 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. +/// +/// @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_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 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_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 Destroys a ray tracing acceleration structure builder parallel +/// operation object +/// +/// @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. +/// +/// @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_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 + ); + +#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 Device Vector Sizes Query Extension Version(s) +typedef enum _ze_device_vector_sizes_ext_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_device_vector_sizes_ext_version_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 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_device_vector_width_properties_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @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_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 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_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_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_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_experimental_event_query_timestamps. +/// - 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_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 +/////////////////////////////////////////////////////////////////////////////// +#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 +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. +/// - The implementation must support +/// ::ZE_experimental_image_memory_properties extension. +/// +/// @remarks /// _Analogues_ /// - None /// @@ -8293,7 +9460,7 @@ typedef enum _ze_image_view_ext_version_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 + ZE_IMAGE_VIEW_EXT_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_IMAGE_VIEW_EXT_VERSION_* ENUMs } ze_image_view_ext_version_t; @@ -8355,7 +9522,7 @@ typedef enum _ze_image_view_exp_version_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 + ZE_IMAGE_VIEW_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_IMAGE_VIEW_EXP_VERSION_* ENUMs } ze_image_view_exp_version_t; @@ -8427,7 +9594,7 @@ 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 + ZE_IMAGE_VIEW_PLANAR_EXT_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_IMAGE_VIEW_PLANAR_EXT_VERSION_* ENUMs } ze_image_view_planar_ext_version_t; @@ -8454,7 +9621,7 @@ typedef enum _ze_image_view_planar_exp_version_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 + ZE_IMAGE_VIEW_PLANAR_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_IMAGE_VIEW_PLANAR_EXP_VERSION_* ENUMs } ze_image_view_planar_exp_version_t; @@ -8465,7 +9632,8 @@ typedef struct _ze_image_view_planar_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) + uint32_t planeIndex; ///< [DEPRECATED] no longer supported, use + ///< ::ze_image_view_planar_ext_desc_t instead } ze_image_view_planar_exp_desc_t; @@ -8488,7 +9656,7 @@ typedef enum _ze_scheduling_hints_exp_version_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 + ZE_SCHEDULING_HINTS_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_SCHEDULING_HINTS_EXP_VERSION_* ENUMs } ze_scheduling_hints_exp_version_t; @@ -8500,7 +9668,7 @@ typedef enum _ze_scheduling_hint_exp_flag_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 + ZE_SCHEDULING_HINT_EXP_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_SCHEDULING_HINT_EXP_FLAG_* ENUMs } ze_scheduling_hint_exp_flag_t; @@ -8587,7 +9755,7 @@ typedef enum _ze_linkonce_odr_ext_version_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 + ZE_LINKONCE_ODR_EXT_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_LINKONCE_ODR_EXT_VERSION_* ENUMs } ze_linkonce_odr_ext_version_t; @@ -8610,7 +9778,7 @@ typedef enum _ze_power_saving_hint_exp_version_t { ZE_POWER_SAVING_HINT_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZE_POWER_SAVING_HINT_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_POWER_SAVING_HINT_EXP_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_POWER_SAVING_HINT_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_POWER_SAVING_HINT_EXP_VERSION_* ENUMs } ze_power_saving_hint_exp_version_t; @@ -8622,7 +9790,7 @@ typedef enum _ze_power_saving_hint_type_t ///< 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 + ZE_POWER_SAVING_HINT_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_POWER_SAVING_HINT_TYPE_* ENUMs } ze_power_saving_hint_type_t; @@ -8657,7 +9825,7 @@ typedef enum _ze_subgroup_ext_version_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 + ZE_SUBGROUP_EXT_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_SUBGROUP_EXT_VERSION_* ENUMs } ze_subgroup_ext_version_t; @@ -8680,7 +9848,7 @@ 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 + ZE_EU_COUNT_EXT_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_EU_COUNT_EXT_VERSION_* ENUMs } ze_eu_count_ext_version_t; @@ -8719,7 +9887,7 @@ typedef enum _ze_pci_properties_ext_version_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 + ZE_PCI_PROPERTIES_EXT_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_PCI_PROPERTIES_EXT_VERSION_* ENUMs } ze_pci_properties_ext_version_t; @@ -8812,7 +9980,7 @@ 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 + ZE_SRGB_EXT_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_SRGB_EXT_VERSION_* ENUMs } ze_srgb_ext_version_t; @@ -8851,7 +10019,7 @@ 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 + ZE_IMAGE_COPY_EXT_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_IMAGE_COPY_EXT_VERSION_* ENUMs } ze_image_copy_ext_version_t; @@ -9002,7 +10170,7 @@ 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 + 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; @@ -9061,7 +10229,7 @@ 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 + ZE_LINKAGE_INSPECTION_EXT_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_LINKAGE_INSPECTION_EXT_VERSION_* ENUMs } ze_linkage_inspection_ext_version_t; @@ -9073,7 +10241,7 @@ 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 + ZE_LINKAGE_INSPECTION_EXT_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_LINKAGE_INSPECTION_EXT_FLAG_* ENUMs } ze_linkage_inspection_ext_flag_t; @@ -9144,7 +10312,7 @@ 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 + 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; @@ -9155,7 +10323,7 @@ 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 + 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; @@ -9199,7 +10367,7 @@ 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 + 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; @@ -9208,9 +10376,16 @@ typedef enum _ze_memory_free_policies_ext_version_t 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 freeing - ZE_DRIVER_MEMORY_FREE_POLICY_EXT_FLAG_DEFER_FREE = ZE_BIT(1), ///< schedules the memory to be freed but does not free immediately - ZE_DRIVER_MEMORY_FREE_POLICY_EXT_FLAG_FORCE_UINT32 = 0x7fffffff + 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; @@ -9246,11 +10421,13 @@ typedef struct _ze_memory_free_ext_desc_t } ze_memory_free_ext_desc_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Frees allocated host memory, device memory, or shared memory using the -/// specified free policy. +/// @brief Frees allocated host memory, device memory, or shared memory on the +/// context using the specified free policy. /// /// @details -/// - The memory free policy is specified by the memory free descriptor. +/// - 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. @@ -9349,7 +10526,7 @@ typedef enum _ze_device_luid_ext_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 + ZE_DEVICE_LUID_EXT_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_DEVICE_LUID_EXT_VERSION_* ENUMs } ze_device_luid_ext_version_t; @@ -9421,7 +10598,7 @@ typedef enum _ze_fabric_vertex_exp_type_t 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 + ZE_FABRIC_VERTEX_EXP_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_FABRIC_VERTEX_EXP_TYPE_* ENUMs } ze_fabric_vertex_exp_type_t; @@ -9434,7 +10611,7 @@ typedef enum _ze_fabric_edge_exp_duplexity_t ///< 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 + ZE_FABRIC_EDGE_EXP_DUPLEXITY_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_FABRIC_EDGE_EXP_DUPLEXITY_* ENUMs } ze_fabric_edge_exp_duplexity_t; @@ -9736,7 +10913,7 @@ 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 + 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; @@ -9766,7 +10943,7 @@ typedef enum _ze_device_memory_ext_type_t 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_FORCE_UINT32 = 0x7fffffff + ZE_DEVICE_MEMORY_EXT_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_DEVICE_MEMORY_EXT_TYPE_* ENUMs } ze_device_memory_ext_type_t; @@ -9810,7 +10987,7 @@ 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 + ZE_BFLOAT16_CONVERSIONS_EXT_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_BFLOAT16_CONVERSIONS_EXT_VERSION_* ENUMs } ze_bfloat16_conversions_ext_version_t; @@ -9833,7 +11010,7 @@ 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 + ZE_DEVICE_IP_VERSION_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_DEVICE_IP_VERSION_VERSION_* ENUMs } ze_device_ip_version_version_t; @@ -9873,7 +11050,7 @@ 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 + 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; @@ -9918,7 +11095,7 @@ typedef enum _ze_sub_allocations_exp_version_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 + ZE_SUB_ALLOCATIONS_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_SUB_ALLOCATIONS_EXP_VERSION_* ENUMs } ze_sub_allocations_exp_version_t; @@ -9972,7 +11149,7 @@ 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 + 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; @@ -9983,7 +11160,7 @@ 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 + 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; @@ -10112,7 +11289,7 @@ 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 + ZE_RTAS_BUILDER_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_RTAS_BUILDER_EXP_VERSION_* ENUMs } ze_rtas_builder_exp_version_t; @@ -10122,7 +11299,7 @@ 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 + ZE_RTAS_DEVICE_EXP_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_RTAS_DEVICE_EXP_FLAG_* ENUMs } ze_rtas_device_exp_flag_t; @@ -10135,7 +11312,8 @@ typedef enum _ze_rtas_device_exp_flag_t typedef enum _ze_rtas_format_exp_t { ZE_RTAS_FORMAT_EXP_INVALID = 0, ///< Invalid acceleration structure format - ZE_RTAS_FORMAT_EXP_FORCE_UINT32 = 0x7fffffff + 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 } ze_rtas_format_exp_t; @@ -10145,7 +11323,7 @@ typedef uint32_t ze_rtas_builder_exp_flags_t; typedef enum _ze_rtas_builder_exp_flag_t { ZE_RTAS_BUILDER_EXP_FLAG_RESERVED = ZE_BIT(0), ///< Reserved for future use - ZE_RTAS_BUILDER_EXP_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_RTAS_BUILDER_EXP_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_RTAS_BUILDER_EXP_FLAG_* ENUMs } ze_rtas_builder_exp_flag_t; @@ -10155,7 +11333,7 @@ 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 + ZE_RTAS_PARALLEL_OPERATION_EXP_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_RTAS_PARALLEL_OPERATION_EXP_FLAG_* ENUMs } ze_rtas_parallel_operation_exp_flag_t; @@ -10165,7 +11343,7 @@ 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 + 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; @@ -10185,7 +11363,7 @@ typedef enum _ze_rtas_builder_instance_exp_flag_t ///< 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 + ZE_RTAS_BUILDER_INSTANCE_EXP_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_RTAS_BUILDER_INSTANCE_EXP_FLAG_* ENUMs } ze_rtas_builder_instance_exp_flag_t; @@ -10211,7 +11389,7 @@ 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 + 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; @@ -10234,7 +11412,7 @@ 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 + 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; @@ -10246,7 +11424,7 @@ typedef enum _ze_rtas_builder_geometry_type_exp_t 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 + ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_* ENUMs } ze_rtas_builder_geometry_type_exp_t; @@ -10275,7 +11453,7 @@ typedef enum _ze_rtas_builder_input_data_format_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 + 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; @@ -10724,7 +11902,7 @@ zeRTASBuilderCreateExp( /// + `nullptr == pBuildOpDescriptor` /// + `nullptr == pProperties` /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `::ZE_RTAS_FORMAT_EXP_INVALID < pBuildOpDescriptor->rtasFormat` +/// + `::ZE_RTAS_FORMAT_EXP_MAX < pBuildOpDescriptor->rtasFormat` /// + `::ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_HIGH < pBuildOpDescriptor->buildQuality` /// + `0x3 < pBuildOpDescriptor->buildFlags` ZE_APIEXPORT ze_result_t ZE_APICALL @@ -10750,8 +11928,8 @@ zeRTASBuilderGetBuildPropertiesExp( /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hDriver` /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `::ZE_RTAS_FORMAT_EXP_INVALID < rtasFormatA` -/// + `::ZE_RTAS_FORMAT_EXP_INVALID < rtasFormatB` +/// + `::ZE_RTAS_FORMAT_EXP_MAX < rtasFormatA` +/// + `::ZE_RTAS_FORMAT_EXP_MAX < rtasFormatB` /// - ::ZE_RESULT_SUCCESS /// + An acceleration structure built with `rtasFormatA` is compatible with devices that report `rtasFormatB`. /// - ::ZE_RESULT_EXP_ERROR_OPERANDS_INCOMPATIBLE @@ -10826,7 +12004,7 @@ zeDriverRTASFormatCompatibilityCheckExp( /// + `nullptr == pScratchBuffer` /// + `nullptr == pRtasBuffer` /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `::ZE_RTAS_FORMAT_EXP_INVALID < pBuildOpDescriptor->rtasFormat` +/// + `::ZE_RTAS_FORMAT_EXP_MAX < pBuildOpDescriptor->rtasFormat` /// + `::ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_HIGH < pBuildOpDescriptor->buildQuality` /// + `0x3 < pBuildOpDescriptor->buildFlags` /// - ::ZE_RESULT_EXP_RTAS_BUILD_DEFERRED @@ -10995,7 +12173,7 @@ 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 + 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; @@ -11006,7 +12184,7 @@ 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 + 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; @@ -11045,7 +12223,7 @@ 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 + ZE_BINDLESS_IMAGE_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_BINDLESS_IMAGE_EXP_VERSION_* ENUMs } ze_bindless_image_exp_version_t; @@ -11059,7 +12237,7 @@ typedef enum _ze_image_bindless_exp_flag_t 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 + ZE_IMAGE_BINDLESS_EXP_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_IMAGE_BINDLESS_EXP_FLAG_* ENUMs } ze_image_bindless_exp_flag_t; @@ -11188,7 +12366,7 @@ 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 + 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; @@ -11245,7 +12423,7 @@ 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 + 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; @@ -11307,7 +12485,7 @@ 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 + 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; @@ -11324,7 +12502,7 @@ typedef enum _ze_mutable_command_exp_flag_t 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 + ZE_MUTABLE_COMMAND_EXP_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_MUTABLE_COMMAND_EXP_FLAG_* ENUMs } ze_mutable_command_exp_flag_t; @@ -11349,7 +12527,7 @@ 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 + 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; diff --git a/include/ze_ddi.h b/include/ze_ddi.h index 9f99592b..86f43368 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.12-r1.12.15 + * @version v1.13-r1.13.1 * */ #ifndef _ZE_DDI_H @@ -19,6 +19,88 @@ extern "C" { #endif +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeRTASBuilderCreateExt +typedef ze_result_t (ZE_APICALL *ze_pfnRTASBuilderCreateExt_t)( + ze_driver_handle_t, + const ze_rtas_builder_ext_desc_t*, + ze_rtas_builder_ext_handle_t* + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeRTASBuilderGetBuildPropertiesExt +typedef ze_result_t (ZE_APICALL *ze_pfnRTASBuilderGetBuildPropertiesExt_t)( + ze_rtas_builder_ext_handle_t, + const ze_rtas_builder_build_op_ext_desc_t*, + ze_rtas_builder_ext_properties_t* + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeRTASBuilderBuildExt +typedef ze_result_t (ZE_APICALL *ze_pfnRTASBuilderBuildExt_t)( + ze_rtas_builder_ext_handle_t, + const ze_rtas_builder_build_op_ext_desc_t*, + void*, + size_t, + void*, + size_t, + ze_rtas_parallel_operation_ext_handle_t, + void*, + ze_rtas_aabb_ext_t*, + size_t* + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeRTASBuilderCommandListAppendCopyExt +typedef ze_result_t (ZE_APICALL *ze_pfnRTASBuilderCommandListAppendCopyExt_t)( + ze_command_list_handle_t, + void*, + const void*, + size_t, + ze_event_handle_t, + uint32_t, + ze_event_handle_t* + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeRTASBuilderDestroyExt +typedef ze_result_t (ZE_APICALL *ze_pfnRTASBuilderDestroyExt_t)( + ze_rtas_builder_ext_handle_t + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Table of RTASBuilder functions pointers +typedef struct _ze_rtas_builder_dditable_t +{ + ze_pfnRTASBuilderCreateExt_t pfnCreateExt; + ze_pfnRTASBuilderGetBuildPropertiesExt_t pfnGetBuildPropertiesExt; + ze_pfnRTASBuilderBuildExt_t pfnBuildExt; + ze_pfnRTASBuilderCommandListAppendCopyExt_t pfnCommandListAppendCopyExt; + ze_pfnRTASBuilderDestroyExt_t pfnDestroyExt; +} ze_rtas_builder_dditable_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Exported function for filling application's RTASBuilder 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 +zeGetRTASBuilderProcAddrTable( + ze_api_version_t version, ///< [in] API version requested + ze_rtas_builder_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeGetRTASBuilderProcAddrTable +typedef ze_result_t (ZE_APICALL *ze_pfnGetRTASBuilderProcAddrTable_t)( + ze_api_version_t, + ze_rtas_builder_dditable_t* + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Function-pointer for zeRTASBuilderCreateExp typedef ze_result_t (ZE_APICALL *ze_pfnRTASBuilderCreateExp_t)( @@ -88,6 +170,64 @@ typedef ze_result_t (ZE_APICALL *ze_pfnGetRTASBuilderExpProcAddrTable_t)( ze_rtas_builder_exp_dditable_t* ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeRTASParallelOperationCreateExt +typedef ze_result_t (ZE_APICALL *ze_pfnRTASParallelOperationCreateExt_t)( + ze_driver_handle_t, + ze_rtas_parallel_operation_ext_handle_t* + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeRTASParallelOperationGetPropertiesExt +typedef ze_result_t (ZE_APICALL *ze_pfnRTASParallelOperationGetPropertiesExt_t)( + ze_rtas_parallel_operation_ext_handle_t, + ze_rtas_parallel_operation_ext_properties_t* + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeRTASParallelOperationJoinExt +typedef ze_result_t (ZE_APICALL *ze_pfnRTASParallelOperationJoinExt_t)( + ze_rtas_parallel_operation_ext_handle_t + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeRTASParallelOperationDestroyExt +typedef ze_result_t (ZE_APICALL *ze_pfnRTASParallelOperationDestroyExt_t)( + ze_rtas_parallel_operation_ext_handle_t + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Table of RTASParallelOperation functions pointers +typedef struct _ze_rtas_parallel_operation_dditable_t +{ + ze_pfnRTASParallelOperationCreateExt_t pfnCreateExt; + ze_pfnRTASParallelOperationGetPropertiesExt_t pfnGetPropertiesExt; + ze_pfnRTASParallelOperationJoinExt_t pfnJoinExt; + ze_pfnRTASParallelOperationDestroyExt_t pfnDestroyExt; +} ze_rtas_parallel_operation_dditable_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Exported function for filling application's RTASParallelOperation 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 +zeGetRTASParallelOperationProcAddrTable( + ze_api_version_t version, ///< [in] API version requested + ze_rtas_parallel_operation_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeGetRTASParallelOperationProcAddrTable +typedef ze_result_t (ZE_APICALL *ze_pfnGetRTASParallelOperationProcAddrTable_t)( + ze_api_version_t, + ze_rtas_parallel_operation_dditable_t* + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Function-pointer for zeRTASParallelOperationCreateExp typedef ze_result_t (ZE_APICALL *ze_pfnRTASParallelOperationCreateExp_t)( @@ -241,6 +381,14 @@ typedef ze_result_t (ZE_APICALL *ze_pfnDriverGetLastErrorDescription_t)( const char** ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeDriverRTASFormatCompatibilityCheckExt +typedef ze_result_t (ZE_APICALL *ze_pfnDriverRTASFormatCompatibilityCheckExt_t)( + ze_driver_handle_t, + ze_rtas_format_ext_t, + ze_rtas_format_ext_t + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Table of Driver functions pointers typedef struct _ze_driver_dditable_t @@ -252,6 +400,7 @@ typedef struct _ze_driver_dditable_t ze_pfnDriverGetExtensionProperties_t pfnGetExtensionProperties; ze_pfnDriverGetExtensionFunctionAddress_t pfnGetExtensionFunctionAddress; ze_pfnDriverGetLastErrorDescription_t pfnGetLastErrorDescription; + ze_pfnDriverRTASFormatCompatibilityCheckExt_t pfnRTASFormatCompatibilityCheckExt; } ze_driver_dditable_t; /////////////////////////////////////////////////////////////////////////////// @@ -470,6 +619,14 @@ typedef ze_result_t (ZE_APICALL *ze_pfnDeviceReleaseExternalSemaphoreExt_t)( ze_external_semaphore_ext_handle_t ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeDeviceGetVectorWidthPropertiesExt +typedef ze_result_t (ZE_APICALL *ze_pfnDeviceGetVectorWidthPropertiesExt_t)( + ze_device_handle_t, + uint32_t*, + ze_device_vector_width_properties_ext_t* + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Table of Device functions pointers typedef struct _ze_device_dditable_t @@ -495,6 +652,7 @@ typedef struct _ze_device_dditable_t ze_pfnDeviceGetRootDevice_t pfnGetRootDevice; ze_pfnDeviceImportExternalSemaphoreExt_t pfnImportExternalSemaphoreExt; ze_pfnDeviceReleaseExternalSemaphoreExt_t pfnReleaseExternalSemaphoreExt; + ze_pfnDeviceGetVectorWidthPropertiesExt_t pfnGetVectorWidthPropertiesExt; } ze_device_dditable_t; /////////////////////////////////////////////////////////////////////////////// @@ -2588,7 +2746,9 @@ typedef ze_result_t (ZE_APICALL *ze_pfnGetFabricEdgeExpProcAddrTable_t)( /// @brief Container for all DDI tables typedef struct _ze_dditable_t { + ze_rtas_builder_dditable_t RTASBuilder; ze_rtas_builder_exp_dditable_t RTASBuilderExp; + ze_rtas_parallel_operation_dditable_t RTASParallelOperation; ze_rtas_parallel_operation_exp_dditable_t RTASParallelOperationExp; ze_global_dditable_t Global; ze_driver_dditable_t Driver; @@ -2622,7 +2782,9 @@ typedef struct _ze_dditable_driver_t { ze_api_version_t version; uint8_t isValidFlag; + ze_rtas_builder_dditable_t * RTASBuilder; ze_rtas_builder_exp_dditable_t * RTASBuilderExp; + ze_rtas_parallel_operation_dditable_t * RTASParallelOperation; ze_rtas_parallel_operation_exp_dditable_t * RTASParallelOperationExp; ze_global_dditable_t * Global; ze_driver_dditable_t * Driver; diff --git a/include/ze_ddi_common.h b/include/ze_ddi_common.h index 7831c57f..ca6eb50a 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.12-r1.12.15 + * @version v1.13-r1.13.1 * */ #ifndef _ZE_DDI_COMMON_H diff --git a/include/zes.py b/include/zes.py index 2b005b07..b9a9ca21 100644 --- a/include/zes.py +++ b/include/zes.py @@ -4,7 +4,7 @@ SPDX-License-Identifier: MIT @file zes.py - @version v1.12-r1.12.15 + @version v1.13-r1.13.1 """ import platform @@ -169,6 +169,7 @@ class zes_structure_type_v(IntEnum): VF_UTIL_MEM_EXP2 = 0x00020009 ## ::zes_vf_util_mem_exp2_t VF_UTIL_ENGINE_EXP2 = 0x00020010 ## ::zes_vf_util_engine_exp2_t VF_EXP2_CAPABILITIES = 0x00020011 ## ::zes_vf_exp2_capabilities_t + DEVICE_ECC_DEFAULT_PROPERTIES_EXT = 0x00020012 ## ::zes_device_ecc_default_properties_ext_t class zes_structure_type_t(c_int): def __str__(self): @@ -2147,6 +2148,32 @@ 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 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 62705642..82f706e0 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.12-r1.12.15 + * @version v1.13-r1.13.1 * */ #ifndef _ZES_API_H @@ -162,7 +162,8 @@ typedef enum _zes_structure_type_t ZES_STRUCTURE_TYPE_VF_UTIL_MEM_EXP2 = 0x00020009, ///< ::zes_vf_util_mem_exp2_t ZES_STRUCTURE_TYPE_VF_UTIL_ENGINE_EXP2 = 0x00020010, ///< ::zes_vf_util_engine_exp2_t ZES_STRUCTURE_TYPE_VF_EXP2_CAPABILITIES = 0x00020011, ///< ::zes_vf_exp2_capabilities_t - ZES_STRUCTURE_TYPE_FORCE_UINT32 = 0x7fffffff + ZES_STRUCTURE_TYPE_DEVICE_ECC_DEFAULT_PROPERTIES_EXT = 0x00020012, ///< ::zes_device_ecc_default_properties_ext_t + ZES_STRUCTURE_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_STRUCTURE_TYPE_* ENUMs } zes_structure_type_t; @@ -508,6 +509,10 @@ 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_power_limit_ext_desc_t typedef struct _zes_power_limit_ext_desc_t zes_power_limit_ext_desc_t; @@ -582,7 +587,7 @@ typedef uint32_t zes_init_flags_t; typedef enum _zes_init_flag_t { ZES_INIT_FLAG_PLACEHOLDER = ZE_BIT(0), ///< placeholder for future use - ZES_INIT_FLAG_FORCE_UINT32 = 0x7fffffff + ZES_INIT_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_INIT_FLAG_* ENUMs } zes_init_flag_t; @@ -793,7 +798,7 @@ typedef enum _zes_engine_type_flag_t ZES_ENGINE_TYPE_FLAG_MEDIA = ZE_BIT(3), ///< Engines that process media workloads. ZES_ENGINE_TYPE_FLAG_DMA = ZE_BIT(4), ///< Engines that copy blocks of data. ZES_ENGINE_TYPE_FLAG_RENDER = ZE_BIT(5), ///< Engines that can process both 3D content and compute kernels. - ZES_ENGINE_TYPE_FLAG_FORCE_UINT32 = 0x7fffffff + ZES_ENGINE_TYPE_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_ENGINE_TYPE_FLAG_* ENUMs } zes_engine_type_flag_t; @@ -804,7 +809,7 @@ typedef enum _zes_repair_status_t ZES_REPAIR_STATUS_UNSUPPORTED = 0, ///< The device does not support in-field repairs. ZES_REPAIR_STATUS_NOT_PERFORMED = 1, ///< The device has never been repaired. ZES_REPAIR_STATUS_PERFORMED = 2, ///< The device has been repaired. - ZES_REPAIR_STATUS_FORCE_UINT32 = 0x7fffffff + ZES_REPAIR_STATUS_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_REPAIR_STATUS_* ENUMs } zes_repair_status_t; @@ -816,7 +821,7 @@ typedef enum _zes_reset_reason_flag_t ZES_RESET_REASON_FLAG_WEDGED = ZE_BIT(0), ///< The device needs to be reset because one or more parts of the hardware ///< is wedged ZES_RESET_REASON_FLAG_REPAIR = ZE_BIT(1), ///< The device needs to be reset in order to complete in-field repairs - ZES_RESET_REASON_FLAG_FORCE_UINT32 = 0x7fffffff + ZES_RESET_REASON_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_RESET_REASON_FLAG_* ENUMs } zes_reset_reason_flag_t; @@ -827,7 +832,7 @@ typedef enum _zes_reset_type_t ZES_RESET_TYPE_WARM = 0, ///< Apply warm reset ZES_RESET_TYPE_COLD = 1, ///< Apply cold reset ZES_RESET_TYPE_FLR = 2, ///< Apply FLR reset - ZES_RESET_TYPE_FORCE_UINT32 = 0x7fffffff + ZES_RESET_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_RESET_TYPE_* ENUMs } zes_reset_type_t; @@ -874,7 +879,7 @@ typedef enum _zes_device_type_t ZES_DEVICE_TYPE_FPGA = 3, ///< Field Programmable Gate Array ZES_DEVICE_TYPE_MCA = 4, ///< Memory Copy Accelerator ZES_DEVICE_TYPE_VPU = 5, ///< Vision Processing Unit - ZES_DEVICE_TYPE_FORCE_UINT32 = 0x7fffffff + ZES_DEVICE_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_DEVICE_TYPE_* ENUMs } zes_device_type_t; @@ -887,7 +892,7 @@ typedef enum _zes_device_property_flag_t ZES_DEVICE_PROPERTY_FLAG_SUBDEVICE = ZE_BIT(1), ///< Device handle used for query represents a sub-device. ZES_DEVICE_PROPERTY_FLAG_ECC = ZE_BIT(2), ///< Device supports error correction memory access. ZES_DEVICE_PROPERTY_FLAG_ONDEMANDPAGING = ZE_BIT(3), ///< Device supports on-demand page-faulting. - ZES_DEVICE_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff + ZES_DEVICE_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_DEVICE_PROPERTY_FLAG_* ENUMs } zes_device_property_flag_t; @@ -1171,7 +1176,7 @@ typedef enum _zes_pci_link_status_t ZES_PCI_LINK_STATUS_QUALITY_ISSUES = 2, ///< The link is up but has quality and/or bandwidth degradation ZES_PCI_LINK_STATUS_STABILITY_ISSUES = 3, ///< The link has stability issues and preventing workloads making forward ///< progress - ZES_PCI_LINK_STATUS_FORCE_UINT32 = 0x7fffffff + ZES_PCI_LINK_STATUS_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_PCI_LINK_STATUS_* ENUMs } zes_pci_link_status_t; @@ -1182,7 +1187,7 @@ typedef enum _zes_pci_link_qual_issue_flag_t { ZES_PCI_LINK_QUAL_ISSUE_FLAG_REPLAYS = ZE_BIT(0), ///< A significant number of replays are occurring ZES_PCI_LINK_QUAL_ISSUE_FLAG_SPEED = ZE_BIT(1), ///< There is a degradation in the maximum bandwidth of the link - ZES_PCI_LINK_QUAL_ISSUE_FLAG_FORCE_UINT32 = 0x7fffffff + ZES_PCI_LINK_QUAL_ISSUE_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_PCI_LINK_QUAL_ISSUE_FLAG_* ENUMs } zes_pci_link_qual_issue_flag_t; @@ -1192,7 +1197,7 @@ typedef uint32_t zes_pci_link_stab_issue_flags_t; typedef enum _zes_pci_link_stab_issue_flag_t { ZES_PCI_LINK_STAB_ISSUE_FLAG_RETRAINING = ZE_BIT(0), ///< Link retraining has occurred to deal with quality issues - ZES_PCI_LINK_STAB_ISSUE_FLAG_FORCE_UINT32 = 0x7fffffff + ZES_PCI_LINK_STAB_ISSUE_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_PCI_LINK_STAB_ISSUE_FLAG_* ENUMs } zes_pci_link_stab_issue_flag_t; @@ -1225,7 +1230,7 @@ typedef enum _zes_pci_bar_type_t ZES_PCI_BAR_TYPE_MMIO = 0, ///< MMIO registers ZES_PCI_BAR_TYPE_ROM = 1, ///< ROM aperture ZES_PCI_BAR_TYPE_MEM = 2, ///< Device memory - ZES_PCI_BAR_TYPE_FORCE_UINT32 = 0x7fffffff + ZES_PCI_BAR_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_PCI_BAR_TYPE_* ENUMs } zes_pci_bar_type_t; @@ -1418,7 +1423,7 @@ typedef enum _zes_overclock_domain_t ZES_OVERCLOCK_DOMAIN_GPU_MEDIA = 64, ///< Overclocking a GPU with media assets on its own PLL/VR. ZES_OVERCLOCK_DOMAIN_VRAM = 128, ///< Overclocking device local memory. ZES_OVERCLOCK_DOMAIN_ADM = 256, ///< Overclocking LLC/L4 cache. - ZES_OVERCLOCK_DOMAIN_FORCE_UINT32 = 0x7fffffff + ZES_OVERCLOCK_DOMAIN_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_OVERCLOCK_DOMAIN_* ENUMs } zes_overclock_domain_t; @@ -1441,7 +1446,7 @@ typedef enum _zes_overclock_control_t ZES_OVERCLOCK_CONTROL_TEMP_LIMIT = 512, ///< This control changes the value of TjMax. ZES_OVERCLOCK_CONTROL_ITD_DISABLE = 1024, ///< This control permits disabling the adaptive voltage feature ITD ZES_OVERCLOCK_CONTROL_ACM_DISABLE = 2048, ///< This control permits disabling the adaptive voltage feature ACM. - ZES_OVERCLOCK_CONTROL_FORCE_UINT32 = 0x7fffffff + ZES_OVERCLOCK_CONTROL_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_OVERCLOCK_CONTROL_* ENUMs } zes_overclock_control_t; @@ -1455,7 +1460,7 @@ typedef enum _zes_overclock_mode_t ZES_OVERCLOCK_MODE_MODE_UNAVAILABLE = 4, ///< Overclocking is unavailable at this time since the system is running ///< on battery. ZES_OVERCLOCK_MODE_MODE_DISABLED = 5, ///< Overclock mode is disabled. - ZES_OVERCLOCK_MODE_FORCE_UINT32 = 0x7fffffff + ZES_OVERCLOCK_MODE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_OVERCLOCK_MODE_* ENUMs } zes_overclock_mode_t; @@ -1468,7 +1473,7 @@ typedef enum _zes_control_state_t ZES_CONTROL_STATE_STATE_ACTIVE = 2, ///< The overclock control has been set and it is active. ZES_CONTROL_STATE_STATE_DISABLED = 3, ///< The overclock control value has been disabled due to the current power ///< configuration (typically when running on DC). - ZES_CONTROL_STATE_FORCE_UINT32 = 0x7fffffff + ZES_CONTROL_STATE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_CONTROL_STATE_* ENUMs } zes_control_state_t; @@ -1481,7 +1486,7 @@ typedef enum _zes_pending_action_t ZES_PENDING_ACTION_PENDING_COLD_RESET = 2, ///< The requested change requires a device cold reset (hotplug, system ///< boot). ZES_PENDING_ACTION_PENDING_WARM_RESET = 3, ///< The requested change requires a device warm reset (PCIe FLR). - ZES_PENDING_ACTION_FORCE_UINT32 = 0x7fffffff + ZES_PENDING_ACTION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_PENDING_ACTION_* ENUMs } zes_pending_action_t; @@ -1496,7 +1501,7 @@ typedef enum _zes_vf_program_type_t ///< the frequency of those points cannot be changed ZES_VF_PROGRAM_TYPE_VF_VOLT_FIXED = 2, ///< Can only program the frequency for the V-F points that is reads back - ///< the voltage of each point cannot be changed. - ZES_VF_PROGRAM_TYPE_FORCE_UINT32 = 0x7fffffff + ZES_VF_PROGRAM_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_VF_PROGRAM_TYPE_* ENUMs } zes_vf_program_type_t; @@ -1506,7 +1511,7 @@ typedef enum _zes_vf_type_t { ZES_VF_TYPE_VOLT = 0, ///< VF Voltage point ZES_VF_TYPE_FREQ = 1, ///< VF Frequency point - ZES_VF_TYPE_FORCE_UINT32 = 0x7fffffff + ZES_VF_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_VF_TYPE_* ENUMs } zes_vf_type_t; @@ -1517,7 +1522,7 @@ typedef enum _zes_vf_array_type_t ZES_VF_ARRAY_TYPE_USER_VF_ARRAY = 0, ///< User V-F array ZES_VF_ARRAY_TYPE_DEFAULT_VF_ARRAY = 1, ///< Default V-F array ZES_VF_ARRAY_TYPE_LIVE_VF_ARRAY = 2, ///< Live V-F array - ZES_VF_ARRAY_TYPE_FORCE_UINT32 = 0x7fffffff + ZES_VF_ARRAY_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_VF_ARRAY_TYPE_* ENUMs } zes_vf_array_type_t; @@ -2031,7 +2036,7 @@ typedef enum _zes_diag_result_t ZES_DIAG_RESULT_FAIL_CANT_REPAIR = 2, ///< Diagnostic had problems setting up repairs ZES_DIAG_RESULT_REBOOT_FOR_REPAIR = 3, ///< Diagnostics found errors, setup for repair and reboot is required to ///< complete the process - ZES_DIAG_RESULT_FORCE_UINT32 = 0x7fffffff + ZES_DIAG_RESULT_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_DIAG_RESULT_* ENUMs } zes_diag_result_t; @@ -2217,7 +2222,7 @@ typedef enum _zes_device_ecc_state_t ZES_DEVICE_ECC_STATE_UNAVAILABLE = 0, ///< None ZES_DEVICE_ECC_STATE_ENABLED = 1, ///< ECC enabled. ZES_DEVICE_ECC_STATE_DISABLED = 2, ///< ECC disabled. - ZES_DEVICE_ECC_STATE_FORCE_UINT32 = 0x7fffffff + ZES_DEVICE_ECC_STATE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_DEVICE_ECC_STATE_* ENUMs } zes_device_ecc_state_t; @@ -2229,7 +2234,7 @@ typedef enum _zes_device_action_t ZES_DEVICE_ACTION_WARM_CARD_RESET = 1, ///< Warm reset of the card. ZES_DEVICE_ACTION_COLD_CARD_RESET = 2, ///< Cold reset of the card. ZES_DEVICE_ACTION_COLD_SYSTEM_REBOOT = 3, ///< Cold reboot of the system. - ZES_DEVICE_ACTION_FORCE_UINT32 = 0x7fffffff + ZES_DEVICE_ACTION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_DEVICE_ACTION_* ENUMs } zes_device_action_t; @@ -2406,7 +2411,7 @@ typedef enum _zes_engine_group_t ///< engines so activity of such an engine may not be indicative of the ///< underlying resource utilization - use ::ZES_ENGINE_GROUP_MEDIA_ALL for ///< that. - ZES_ENGINE_GROUP_FORCE_UINT32 = 0x7fffffff + ZES_ENGINE_GROUP_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_ENGINE_GROUP_* ENUMs } zes_engine_group_t; @@ -2574,7 +2579,7 @@ typedef enum _zes_event_type_flag_t ZES_EVENT_TYPE_FLAG_DEVICE_RESET_REQUIRED = ZE_BIT(14), ///< Event is triggered when the device needs to be reset (use ///< ::zesDeviceGetState() to determine the reasons for the reset). ZES_EVENT_TYPE_FLAG_SURVIVABILITY_MODE_DETECTED = ZE_BIT(15), ///< Event is triggered when graphics driver encounter an error condition. - ZES_EVENT_TYPE_FLAG_FORCE_UINT32 = 0x7fffffff + ZES_EVENT_TYPE_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_EVENT_TYPE_FLAG_* ENUMs } zes_event_type_flag_t; @@ -2721,7 +2726,7 @@ typedef enum _zes_fabric_port_status_t ZES_FABRIC_PORT_STATUS_FAILED = 3, ///< Port connection instabilities are preventing workloads making forward ///< progress ZES_FABRIC_PORT_STATUS_DISABLED = 4, ///< The port is configured down - ZES_FABRIC_PORT_STATUS_FORCE_UINT32 = 0x7fffffff + ZES_FABRIC_PORT_STATUS_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_FABRIC_PORT_STATUS_* ENUMs } zes_fabric_port_status_t; @@ -2732,7 +2737,7 @@ typedef enum _zes_fabric_port_qual_issue_flag_t { ZES_FABRIC_PORT_QUAL_ISSUE_FLAG_LINK_ERRORS = ZE_BIT(0), ///< Excessive link errors are occurring ZES_FABRIC_PORT_QUAL_ISSUE_FLAG_SPEED = ZE_BIT(1), ///< There is a degradation in the bitrate and/or width of the link - ZES_FABRIC_PORT_QUAL_ISSUE_FLAG_FORCE_UINT32 = 0x7fffffff + ZES_FABRIC_PORT_QUAL_ISSUE_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_FABRIC_PORT_QUAL_ISSUE_FLAG_* ENUMs } zes_fabric_port_qual_issue_flag_t; @@ -2752,7 +2757,7 @@ typedef enum _zes_fabric_port_failure_flag_t ///< period of time. Driver will allow port to continue to train, but will ///< not enable the port for use until the port has been disabled and ///< subsequently re-enabled using ::zesFabricPortSetConfig(). - ZES_FABRIC_PORT_FAILURE_FLAG_FORCE_UINT32 = 0x7fffffff + ZES_FABRIC_PORT_FAILURE_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_FABRIC_PORT_FAILURE_FLAG_* ENUMs } zes_fabric_port_failure_flag_t; @@ -3137,7 +3142,7 @@ typedef enum _zes_fan_speed_mode_t ZES_FAN_SPEED_MODE_FIXED = 1, ///< The fan speed is currently set to a fixed value ZES_FAN_SPEED_MODE_TABLE = 2, ///< The fan speed is currently controlled dynamically by hardware based on ///< a temp/speed table - ZES_FAN_SPEED_MODE_FORCE_UINT32 = 0x7fffffff + ZES_FAN_SPEED_MODE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_FAN_SPEED_MODE_* ENUMs } zes_fan_speed_mode_t; @@ -3147,7 +3152,7 @@ typedef enum _zes_fan_speed_units_t { ZES_FAN_SPEED_UNITS_RPM = 0, ///< The fan speed is in units of revolutions per minute (rpm) ZES_FAN_SPEED_UNITS_PERCENT = 1, ///< The fan speed is a percentage of the maximum speed of the fan - ZES_FAN_SPEED_UNITS_FORCE_UINT32 = 0x7fffffff + ZES_FAN_SPEED_UNITS_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_FAN_SPEED_UNITS_* ENUMs } zes_fan_speed_units_t; @@ -3594,7 +3599,7 @@ typedef enum _zes_freq_domain_t ZES_FREQ_DOMAIN_GPU = 0, ///< GPU Core Domain. ZES_FREQ_DOMAIN_MEMORY = 1, ///< Local Memory Domain. ZES_FREQ_DOMAIN_MEDIA = 2, ///< GPU Media Domain. - ZES_FREQ_DOMAIN_FORCE_UINT32 = 0x7fffffff + ZES_FREQ_DOMAIN_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_FREQ_DOMAIN_* ENUMs } zes_freq_domain_t; @@ -3668,7 +3673,7 @@ typedef enum _zes_freq_throttle_reason_flag_t ZES_FREQ_THROTTLE_REASON_FLAG_SW_RANGE = ZE_BIT(5), ///< frequency throttled due to software supplied frequency range ZES_FREQ_THROTTLE_REASON_FLAG_HW_RANGE = ZE_BIT(6), ///< frequency throttled due to a sub block that has a lower frequency ///< range when it receives clocks - ZES_FREQ_THROTTLE_REASON_FLAG_FORCE_UINT32 = 0x7fffffff + ZES_FREQ_THROTTLE_REASON_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_FREQ_THROTTLE_REASON_FLAG_* ENUMs } zes_freq_throttle_reason_flag_t; @@ -3740,7 +3745,7 @@ typedef enum _zes_oc_mode_t ///< specified overclock values. This mode disables OVERRIDE and ///< INTERPOLATIVE modes. This mode can damage the part, most of the ///< protections are disabled on this mode. - ZES_OC_MODE_FORCE_UINT32 = 0x7fffffff + ZES_OC_MODE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_OC_MODE_* ENUMs } zes_oc_mode_t; @@ -4532,7 +4537,7 @@ typedef enum _zes_mem_type_t ZES_MEM_TYPE_GDDR6 = 17, ///< GDDR6 memory ZES_MEM_TYPE_GDDR6X = 18, ///< GDDR6X memory ZES_MEM_TYPE_GDDR7 = 19, ///< GDDR7 memory - ZES_MEM_TYPE_FORCE_UINT32 = 0x7fffffff + ZES_MEM_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_MEM_TYPE_* ENUMs } zes_mem_type_t; @@ -4542,7 +4547,7 @@ typedef enum _zes_mem_loc_t { ZES_MEM_LOC_SYSTEM = 0, ///< System memory ZES_MEM_LOC_DEVICE = 1, ///< On board local device memory - ZES_MEM_LOC_FORCE_UINT32 = 0x7fffffff + ZES_MEM_LOC_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_MEM_LOC_* ENUMs } zes_mem_loc_t; @@ -4557,7 +4562,7 @@ typedef enum _zes_mem_health_t ZES_MEM_HEALTH_CRITICAL = 3, ///< Operating with reduced memory to cover banks with too many ///< uncorrectable errors. ZES_MEM_HEALTH_REPLACE = 4, ///< Device should be replaced due to excessive uncorrectable errors. - ZES_MEM_HEALTH_FORCE_UINT32 = 0x7fffffff + ZES_MEM_HEALTH_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_MEM_HEALTH_* ENUMs } zes_mem_health_t; @@ -4895,7 +4900,7 @@ typedef enum _zes_power_domain_t ZES_POWER_DOMAIN_STACK = 3, ///< The PUnit power domain is a stack-level power domain. ZES_POWER_DOMAIN_MEMORY = 4, ///< The PUnit power domain is a memory-level power domain. ZES_POWER_DOMAIN_GPU = 5, ///< The PUnit power domain is a GPU-level power domain. - ZES_POWER_DOMAIN_FORCE_UINT32 = 0x7fffffff + ZES_POWER_DOMAIN_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_POWER_DOMAIN_* ENUMs } zes_power_domain_t; @@ -4915,7 +4920,7 @@ typedef enum _zes_power_level_t ZES_POWER_LEVEL_INSTANTANEOUS = 4, ///< The PUnit predicts effective power draw using the current device ///< configuration (frequency, voltage, etc...) & throttles proactively to ///< stay within the specified limit. - ZES_POWER_LEVEL_FORCE_UINT32 = 0x7fffffff + ZES_POWER_LEVEL_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_POWER_LEVEL_* ENUMs } zes_power_level_t; @@ -4927,7 +4932,7 @@ typedef enum _zes_power_source_t ///< battery powered. ZES_POWER_SOURCE_MAINS = 1, ///< Limit active only when the device is mains powered. ZES_POWER_SOURCE_BATTERY = 2, ///< Limit active only when the device is battery powered. - ZES_POWER_SOURCE_FORCE_UINT32 = 0x7fffffff + ZES_POWER_SOURCE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_POWER_SOURCE_* ENUMs } zes_power_source_t; @@ -4938,7 +4943,7 @@ typedef enum _zes_limit_unit_t ZES_LIMIT_UNIT_UNKNOWN = 0, ///< The PUnit power monitoring unit cannot be determined. ZES_LIMIT_UNIT_CURRENT = 1, ///< The limit is specified in milliamperes of current drawn. ZES_LIMIT_UNIT_POWER = 2, ///< The limit is specified in milliwatts of power generated. - ZES_LIMIT_UNIT_FORCE_UINT32 = 0x7fffffff + ZES_LIMIT_UNIT_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_LIMIT_UNIT_* ENUMs } zes_limit_unit_t; @@ -5305,7 +5310,7 @@ typedef enum _zes_psu_voltage_status_t ZES_PSU_VOLTAGE_STATUS_NORMAL = 1, ///< No unusual voltages have been detected ZES_PSU_VOLTAGE_STATUS_OVER = 2, ///< Over-voltage has occurred ZES_PSU_VOLTAGE_STATUS_UNDER = 3, ///< Under-voltage has occurred - ZES_PSU_VOLTAGE_STATUS_FORCE_UINT32 = 0x7fffffff + ZES_PSU_VOLTAGE_STATUS_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_PSU_VOLTAGE_STATUS_* ENUMs } zes_psu_voltage_status_t; @@ -5434,7 +5439,7 @@ typedef enum _zes_ras_error_type_t { ZES_RAS_ERROR_TYPE_CORRECTABLE = 0, ///< Errors were corrected by hardware ZES_RAS_ERROR_TYPE_UNCORRECTABLE = 1, ///< Error were not corrected - ZES_RAS_ERROR_TYPE_FORCE_UINT32 = 0x7fffffff + ZES_RAS_ERROR_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_RAS_ERROR_TYPE_* ENUMs } zes_ras_error_type_t; @@ -5453,7 +5458,7 @@ typedef enum _zes_ras_error_cat_t ZES_RAS_ERROR_CAT_CACHE_ERRORS = 5, ///< The number of errors that have occurred in caches (L1/L3/register ///< file/shared local memory/sampler) ZES_RAS_ERROR_CAT_DISPLAY_ERRORS = 6, ///< The number of errors that have occurred in the display - ZES_RAS_ERROR_CAT_FORCE_UINT32 = 0x7fffffff + ZES_RAS_ERROR_CAT_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_RAS_ERROR_CAT_* ENUMs } zes_ras_error_cat_t; @@ -5708,7 +5713,7 @@ typedef enum _zes_sched_mode_t ///< contexts must wait until the running context completes with no further ///< submitted work. ZES_SCHED_MODE_COMPUTE_UNIT_DEBUG = 3, ///< [DEPRECATED] No longer supported. - ZES_SCHED_MODE_FORCE_UINT32 = 0x7fffffff + ZES_SCHED_MODE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_SCHED_MODE_* ENUMs } zes_sched_mode_t; @@ -6060,7 +6065,7 @@ zesSchedulerSetComputeUnitDebugMode( typedef enum _zes_standby_type_t { ZES_STANDBY_TYPE_GLOBAL = 0, ///< Control the overall standby policy of the device/sub-device - ZES_STANDBY_TYPE_FORCE_UINT32 = 0x7fffffff + ZES_STANDBY_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_STANDBY_TYPE_* ENUMs } zes_standby_type_t; @@ -6085,7 +6090,7 @@ typedef enum _zes_standby_promo_mode_t ZES_STANDBY_PROMO_MODE_DEFAULT = 0, ///< Best compromise between performance and energy savings. ZES_STANDBY_PROMO_MODE_NEVER = 1, ///< The device/component will never shutdown. This can improve performance ///< but uses more energy. - ZES_STANDBY_PROMO_MODE_FORCE_UINT32 = 0x7fffffff + ZES_STANDBY_PROMO_MODE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_STANDBY_PROMO_MODE_* ENUMs } zes_standby_promo_mode_t; @@ -6213,7 +6218,7 @@ typedef enum _zes_temp_sensors_t ZES_TEMP_SENSORS_GPU_BOARD = 6, ///< The maximum temperature across all sensors in the GPU Board ZES_TEMP_SENSORS_GPU_BOARD_MIN = 7, ///< The minimum temperature across all sensors in the GPU Board ZES_TEMP_SENSORS_VOLTAGE_REGULATOR = 8, ///< The maximum temperature across all sensors in the Voltage Regulator - ZES_TEMP_SENSORS_FORCE_UINT32 = 0x7fffffff + ZES_TEMP_SENSORS_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_TEMP_SENSORS_* ENUMs } zes_temp_sensors_t; @@ -6425,6 +6430,41 @@ 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 @@ -6444,7 +6484,7 @@ typedef enum _zes_power_limits_ext_version_t { ZES_POWER_LIMITS_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZES_POWER_LIMITS_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZES_POWER_LIMITS_EXT_VERSION_FORCE_UINT32 = 0x7fffffff + ZES_POWER_LIMITS_EXT_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_POWER_LIMITS_EXT_VERSION_* ENUMs } zes_power_limits_ext_version_t; @@ -6584,7 +6624,7 @@ typedef enum _zes_engine_activity_ext_version_t { ZES_ENGINE_ACTIVITY_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZES_ENGINE_ACTIVITY_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZES_ENGINE_ACTIVITY_EXT_VERSION_FORCE_UINT32 = 0x7fffffff + ZES_ENGINE_ACTIVITY_EXT_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_ENGINE_ACTIVITY_EXT_VERSION_* ENUMs } zes_engine_activity_ext_version_t; @@ -6668,7 +6708,7 @@ typedef enum _zes_ras_state_exp_version_t { ZES_RAS_STATE_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZES_RAS_STATE_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZES_RAS_STATE_EXP_VERSION_FORCE_UINT32 = 0x7fffffff + ZES_RAS_STATE_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_RAS_STATE_EXP_VERSION_* ENUMs } zes_ras_state_exp_version_t; @@ -6690,7 +6730,7 @@ typedef enum _zes_ras_error_category_exp_t ZES_RAS_ERROR_CATEGORY_EXP_MEMORY_ERRORS = 7, ///< The number of errors that have occurred in Memory ZES_RAS_ERROR_CATEGORY_EXP_SCALE_ERRORS = 8, ///< The number of errors that have occurred in Scale Fabric ZES_RAS_ERROR_CATEGORY_EXP_L3FABRIC_ERRORS = 9, ///< The number of errors that have occurred in L3 Fabric - ZES_RAS_ERROR_CATEGORY_EXP_FORCE_UINT32 = 0x7fffffff + ZES_RAS_ERROR_CATEGORY_EXP_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_RAS_ERROR_CATEGORY_EXP_* ENUMs } zes_ras_error_category_exp_t; @@ -6786,7 +6826,7 @@ typedef enum _zes_mem_page_offline_state_exp_version_t { ZES_MEM_PAGE_OFFLINE_STATE_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZES_MEM_PAGE_OFFLINE_STATE_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZES_MEM_PAGE_OFFLINE_STATE_EXP_VERSION_FORCE_UINT32 = 0x7fffffff + ZES_MEM_PAGE_OFFLINE_STATE_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_MEM_PAGE_OFFLINE_STATE_EXP_VERSION_* ENUMs } zes_mem_page_offline_state_exp_version_t; @@ -6826,7 +6866,7 @@ typedef enum _zes_mem_bandwidth_counter_bits_exp_version_t { ZES_MEM_BANDWIDTH_COUNTER_BITS_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZES_MEM_BANDWIDTH_COUNTER_BITS_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZES_MEM_BANDWIDTH_COUNTER_BITS_EXP_VERSION_FORCE_UINT32 = 0x7fffffff + ZES_MEM_BANDWIDTH_COUNTER_BITS_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_MEM_BANDWIDTH_COUNTER_BITS_EXP_VERSION_* ENUMs } zes_mem_bandwidth_counter_bits_exp_version_t; @@ -6868,7 +6908,7 @@ typedef enum _zes_power_domain_properties_exp_version_t { ZES_POWER_DOMAIN_PROPERTIES_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZES_POWER_DOMAIN_PROPERTIES_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZES_POWER_DOMAIN_PROPERTIES_EXP_VERSION_FORCE_UINT32 = 0x7fffffff + ZES_POWER_DOMAIN_PROPERTIES_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_POWER_DOMAIN_PROPERTIES_EXP_VERSION_* ENUMs } zes_power_domain_properties_exp_version_t; @@ -6908,7 +6948,7 @@ typedef enum _zes_firmware_security_exp_version_t { ZES_FIRMWARE_SECURITY_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZES_FIRMWARE_SECURITY_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZES_FIRMWARE_SECURITY_EXP_VERSION_FORCE_UINT32 = 0x7fffffff + ZES_FIRMWARE_SECURITY_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_FIRMWARE_SECURITY_EXP_VERSION_* ENUMs } zes_firmware_security_exp_version_t; @@ -6979,7 +7019,7 @@ typedef enum _zes_sysman_device_mapping_exp_version_t { ZES_SYSMAN_DEVICE_MAPPING_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZES_SYSMAN_DEVICE_MAPPING_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ),///< latest known version - ZES_SYSMAN_DEVICE_MAPPING_EXP_VERSION_FORCE_UINT32 = 0x7fffffff + ZES_SYSMAN_DEVICE_MAPPING_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_SYSMAN_DEVICE_MAPPING_EXP_VERSION_* ENUMs } zes_sysman_device_mapping_exp_version_t; @@ -7077,7 +7117,7 @@ typedef enum _zes_vf_management_exp_version_t ZES_VF_MANAGEMENT_EXP_VERSION_1_1 = ZE_MAKE_VERSION( 1, 1 ), ///< version 1.1 (deprecated) ZES_VF_MANAGEMENT_EXP_VERSION_1_2 = ZE_MAKE_VERSION( 1, 2 ), ///< version 1.2 ZES_VF_MANAGEMENT_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 2 ), ///< latest known version - ZES_VF_MANAGEMENT_EXP_VERSION_FORCE_UINT32 = 0x7fffffff + ZES_VF_MANAGEMENT_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_VF_MANAGEMENT_EXP_VERSION_* ENUMs } zes_vf_management_exp_version_t; @@ -7088,7 +7128,7 @@ typedef enum _zes_vf_info_mem_type_exp_flag_t { ZES_VF_INFO_MEM_TYPE_EXP_FLAG_MEM_TYPE_SYSTEM = ZE_BIT(0), ///< System memory ZES_VF_INFO_MEM_TYPE_EXP_FLAG_MEM_TYPE_DEVICE = ZE_BIT(1), ///< Device local memory - ZES_VF_INFO_MEM_TYPE_EXP_FLAG_FORCE_UINT32 = 0x7fffffff + ZES_VF_INFO_MEM_TYPE_EXP_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_VF_INFO_MEM_TYPE_EXP_FLAG_* ENUMs } zes_vf_info_mem_type_exp_flag_t; @@ -7101,7 +7141,7 @@ typedef enum _zes_vf_info_util_exp_flag_t ZES_VF_INFO_UTIL_EXP_FLAG_INFO_MEM_CPU = ZE_BIT(1), ///< System memory utilization associated with virtual function ZES_VF_INFO_UTIL_EXP_FLAG_INFO_MEM_GPU = ZE_BIT(2), ///< Device memory utilization associated with virtual function ZES_VF_INFO_UTIL_EXP_FLAG_INFO_ENGINE = ZE_BIT(3), ///< Engine utilization associated with virtual function - ZES_VF_INFO_UTIL_EXP_FLAG_FORCE_UINT32 = 0x7fffffff + ZES_VF_INFO_UTIL_EXP_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_VF_INFO_UTIL_EXP_FLAG_* ENUMs } zes_vf_info_util_exp_flag_t; diff --git a/include/zes_ddi.h b/include/zes_ddi.h index 3e2965ad..24b53356 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.12-r1.12.15 + * @version v1.13-r1.13.1 * */ #ifndef _ZES_DDI_H diff --git a/include/zet.py b/include/zet.py index 90d891b0..a6201bc1 100644 --- a/include/zet.py +++ b/include/zet.py @@ -4,7 +4,7 @@ SPDX-License-Identifier: MIT @file zet.py - @version v1.12-r1.12.15 + @version v1.13-r1.13.1 """ import platform @@ -676,6 +676,7 @@ class zet_metric_group_type_exp_flags_v(IntEnum): ## 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): @@ -707,6 +708,47 @@ class zet_export_dma_buf_exp_properties_t(Structure): ("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" @@ -1118,13 +1160,29 @@ class _zet_device_dditable_t(Structure): else: _zetDeviceCreateMetricGroupsFromMetricsExp_t = CFUNCTYPE( ze_result_t, zet_device_handle_t, c_ulong, *, *, *, *, POINTER(zet_metric_group_handle_t) ) +############################################################################### +## @brief Function-pointer for zetDeviceEnableMetricsExp +if __use_win_types: + _zetDeviceEnableMetricsExp_t = WINFUNCTYPE( ze_result_t, zet_device_handle_t ) +else: + _zetDeviceEnableMetricsExp_t = CFUNCTYPE( ze_result_t, zet_device_handle_t ) + +############################################################################### +## @brief Function-pointer for zetDeviceDisableMetricsExp +if __use_win_types: + _zetDeviceDisableMetricsExp_t = WINFUNCTYPE( ze_result_t, zet_device_handle_t ) +else: + _zetDeviceDisableMetricsExp_t = CFUNCTYPE( ze_result_t, zet_device_handle_t ) + ############################################################################### ## @brief Table of DeviceExp functions pointers class _zet_device_exp_dditable_t(Structure): _fields_ = [ ("pfnGetConcurrentMetricGroupsExp", c_void_p), ## _zetDeviceGetConcurrentMetricGroupsExp_t - ("pfnCreateMetricGroupsFromMetricsExp", c_void_p) ## _zetDeviceCreateMetricGroupsFromMetricsExp_t + ("pfnCreateMetricGroupsFromMetricsExp", c_void_p), ## _zetDeviceCreateMetricGroupsFromMetricsExp_t + ("pfnEnableMetricsExp", c_void_p), ## _zetDeviceEnableMetricsExp_t + ("pfnDisableMetricsExp", c_void_p) ## _zetDeviceDisableMetricsExp_t ] ############################################################################### @@ -1181,6 +1239,21 @@ class _zet_command_list_dditable_t(Structure): ("pfnAppendMetricMemoryBarrier", c_void_p) ## _zetCommandListAppendMetricMemoryBarrier_t ] +############################################################################### +## @brief Function-pointer for zetCommandListAppendMarkerExp +if __use_win_types: + _zetCommandListAppendMarkerExp_t = WINFUNCTYPE( ze_result_t, zet_command_list_handle_t, zet_metric_group_handle_t, c_ulong ) +else: + _zetCommandListAppendMarkerExp_t = CFUNCTYPE( ze_result_t, zet_command_list_handle_t, zet_metric_group_handle_t, c_ulong ) + + +############################################################################### +## @brief Table of CommandListExp functions pointers +class _zet_command_list_exp_dditable_t(Structure): + _fields_ = [ + ("pfnAppendMarkerExp", c_void_p) ## _zetCommandListAppendMarkerExp_t + ] + ############################################################################### ## @brief Function-pointer for zetModuleGetDebugInfo if __use_win_types: @@ -1628,6 +1701,7 @@ class _zet_dditable_t(Structure): ("DeviceExp", _zet_device_exp_dditable_t), ("Context", _zet_context_dditable_t), ("CommandList", _zet_command_list_dditable_t), + ("CommandListExp", _zet_command_list_exp_dditable_t), ("Module", _zet_module_dditable_t), ("Kernel", _zet_kernel_dditable_t), ("Metric", _zet_metric_dditable_t), @@ -1714,6 +1788,8 @@ def __init__(self, version : ze_api_version_t): # attach function interface to function address self.zetDeviceGetConcurrentMetricGroupsExp = _zetDeviceGetConcurrentMetricGroupsExp_t(self.__dditable.DeviceExp.pfnGetConcurrentMetricGroupsExp) self.zetDeviceCreateMetricGroupsFromMetricsExp = _zetDeviceCreateMetricGroupsFromMetricsExp_t(self.__dditable.DeviceExp.pfnCreateMetricGroupsFromMetricsExp) + self.zetDeviceEnableMetricsExp = _zetDeviceEnableMetricsExp_t(self.__dditable.DeviceExp.pfnEnableMetricsExp) + self.zetDeviceDisableMetricsExp = _zetDeviceDisableMetricsExp_t(self.__dditable.DeviceExp.pfnDisableMetricsExp) # call driver to get function pointers _Context = _zet_context_dditable_t() @@ -1738,6 +1814,16 @@ def __init__(self, version : ze_api_version_t): self.zetCommandListAppendMetricQueryEnd = _zetCommandListAppendMetricQueryEnd_t(self.__dditable.CommandList.pfnAppendMetricQueryEnd) self.zetCommandListAppendMetricMemoryBarrier = _zetCommandListAppendMetricMemoryBarrier_t(self.__dditable.CommandList.pfnAppendMetricMemoryBarrier) + # call driver to get function pointers + _CommandListExp = _zet_command_list_exp_dditable_t() + r = ze_result_v(self.__dll.zetGetCommandListExpProcAddrTable(version, byref(_CommandListExp))) + if r != ze_result_v.SUCCESS: + raise Exception(r) + self.__dditable.CommandListExp = _CommandListExp + + # attach function interface to function address + self.zetCommandListAppendMarkerExp = _zetCommandListAppendMarkerExp_t(self.__dditable.CommandListExp.pfnAppendMarkerExp) + # call driver to get function pointers _Module = _zet_module_dditable_t() r = ze_result_v(self.__dll.zetGetModuleProcAddrTable(version, byref(_Module))) diff --git a/include/zet_api.h b/include/zet_api.h index c8906ad7..13b8ea01 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.12-r1.12.15 + * @version v1.13-r1.13.1 * */ #ifndef _ZET_API_H @@ -102,7 +102,7 @@ typedef enum _zet_structure_type_t ZET_STRUCTURE_TYPE_METRIC_GROUP_TYPE_EXP = 0x00010006, ///< ::zet_metric_group_type_exp_t ZET_STRUCTURE_TYPE_EXPORT_DMA_EXP_PROPERTIES = 0x00010007, ///< ::zet_export_dma_buf_exp_properties_t ZET_STRUCTURE_TYPE_METRIC_TRACER_EXP_DESC = 0x00010008, ///< ::zet_metric_tracer_exp_desc_t - ZET_STRUCTURE_TYPE_FORCE_UINT32 = 0x7fffffff + ZET_STRUCTURE_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_STRUCTURE_TYPE_* ENUMs } zet_structure_type_t; @@ -138,7 +138,7 @@ typedef enum _zet_value_type_t ZET_VALUE_TYPE_STRING = 5, ///< C string ZET_VALUE_TYPE_UINT8 = 6, ///< 8-bit unsigned-integer ZET_VALUE_TYPE_UINT16 = 7, ///< 16-bit unsigned-integer - ZET_VALUE_TYPE_FORCE_UINT32 = 0x7fffffff + ZET_VALUE_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_VALUE_TYPE_* ENUMs } zet_value_type_t; @@ -269,6 +269,10 @@ 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; @@ -335,7 +339,7 @@ typedef struct _zet_metric_programmable_param_value_exp_t zet_metric_programmabl typedef enum _zet_module_debug_info_format_t { ZET_MODULE_DEBUG_INFO_FORMAT_ELF_DWARF = 0, ///< Format is ELF/DWARF - ZET_MODULE_DEBUG_INFO_FORMAT_FORCE_UINT32 = 0x7fffffff + ZET_MODULE_DEBUG_INFO_FORMAT_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_MODULE_DEBUG_INFO_FORMAT_* ENUMs } zet_module_debug_info_format_t; @@ -383,7 +387,7 @@ typedef uint32_t zet_device_debug_property_flags_t; typedef enum _zet_device_debug_property_flag_t { ZET_DEVICE_DEBUG_PROPERTY_FLAG_ATTACH = ZE_BIT(0), ///< the device supports attaching for debug - ZET_DEVICE_DEBUG_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff + ZET_DEVICE_DEBUG_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_DEVICE_DEBUG_PROPERTY_FLAG_* ENUMs } zet_device_debug_property_flag_t; @@ -480,7 +484,7 @@ typedef enum _zet_debug_event_flag_t { ZET_DEBUG_EVENT_FLAG_NEED_ACK = ZE_BIT(0), ///< The event needs to be acknowledged by calling ///< ::zetDebugAcknowledgeEvent. - ZET_DEBUG_EVENT_FLAG_FORCE_UINT32 = 0x7fffffff + ZET_DEBUG_EVENT_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_DEBUG_EVENT_FLAG_* ENUMs } zet_debug_event_flag_t; @@ -497,7 +501,7 @@ typedef enum _zet_debug_event_type_t ZET_DEBUG_EVENT_TYPE_THREAD_STOPPED = 6, ///< The thread stopped due to a device exception ZET_DEBUG_EVENT_TYPE_THREAD_UNAVAILABLE = 7, ///< The thread is not available to be stopped ZET_DEBUG_EVENT_TYPE_PAGE_FAULT = 8, ///< A page request could not be completed on the device - ZET_DEBUG_EVENT_TYPE_FORCE_UINT32 = 0x7fffffff + ZET_DEBUG_EVENT_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_DEBUG_EVENT_TYPE_* ENUMs } zet_debug_event_type_t; @@ -507,7 +511,7 @@ typedef enum _zet_debug_detach_reason_t { ZET_DEBUG_DETACH_REASON_INVALID = 0, ///< The detach reason is not valid ZET_DEBUG_DETACH_REASON_HOST_EXIT = 1, ///< The host process exited - ZET_DEBUG_DETACH_REASON_FORCE_UINT32 = 0x7fffffff + ZET_DEBUG_DETACH_REASON_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_DEBUG_DETACH_REASON_* ENUMs } zet_debug_detach_reason_t; @@ -547,7 +551,7 @@ typedef enum _zet_debug_page_fault_reason_t ZET_DEBUG_PAGE_FAULT_REASON_INVALID = 0, ///< The page fault reason is not valid ZET_DEBUG_PAGE_FAULT_REASON_MAPPING_ERROR = 1, ///< The address is not mapped ZET_DEBUG_PAGE_FAULT_REASON_PERMISSION_ERROR = 2, ///< Invalid access permissions - ZET_DEBUG_PAGE_FAULT_REASON_FORCE_UINT32 = 0x7fffffff + ZET_DEBUG_PAGE_FAULT_REASON_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_DEBUG_PAGE_FAULT_REASON_* ENUMs } zet_debug_page_fault_reason_t; @@ -676,7 +680,7 @@ typedef enum _zet_debug_memory_space_type_t ZET_DEBUG_MEMORY_SPACE_TYPE_DEFAULT = 0, ///< default memory space (attribute may be omitted) ZET_DEBUG_MEMORY_SPACE_TYPE_SLM = 1, ///< shared local memory space (GPU-only) ZET_DEBUG_MEMORY_SPACE_TYPE_ELF = 2, ///< ELF file memory space - ZET_DEBUG_MEMORY_SPACE_TYPE_FORCE_UINT32 = 0x7fffffff + ZET_DEBUG_MEMORY_SPACE_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_DEBUG_MEMORY_SPACE_TYPE_* ENUMs } zet_debug_memory_space_type_t; @@ -763,7 +767,7 @@ typedef enum _zet_debug_regset_flag_t { ZET_DEBUG_REGSET_FLAG_READABLE = ZE_BIT(0), ///< register set is readable ZET_DEBUG_REGSET_FLAG_WRITEABLE = ZE_BIT(1), ///< register set is writeable - ZET_DEBUG_REGSET_FLAG_FORCE_UINT32 = 0x7fffffff + ZET_DEBUG_REGSET_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_DEBUG_REGSET_FLAG_* ENUMs } zet_debug_regset_flag_t; @@ -868,8 +872,8 @@ zetDebugReadRegisters( ///< than the `count` member of ::zet_debug_regset_properties_t for the ///< type uint32_t count, ///< [in] the number of registers to read; start+count must be less than or - ///< equal to the `count` member of ::zet_debug_register_group_properties_t - ///< for the type + ///< equal to the `count` member of ::zet_debug_regset_properties_t for the + ///< type void* pRegisterValues ///< [in,out][optional][range(0, count)] buffer of register values ); @@ -895,8 +899,8 @@ zetDebugWriteRegisters( ///< than the `count` member of ::zet_debug_regset_properties_t for the ///< type uint32_t count, ///< [in] the number of registers to write; start+count must be less than - ///< or equal to the `count` member of - ///< ::zet_debug_register_group_properties_t for the type + ///< or equal to the `count` member of ::zet_debug_regset_properties_t for + ///< the type void* pRegisterValues ///< [in,out][optional][range(0, count)] buffer of register values ); @@ -957,7 +961,7 @@ typedef enum _zet_metric_group_sampling_type_flag_t ZET_METRIC_GROUP_SAMPLING_TYPE_FLAG_EVENT_BASED = ZE_BIT(0), ///< Event based sampling ZET_METRIC_GROUP_SAMPLING_TYPE_FLAG_TIME_BASED = ZE_BIT(1), ///< Time based sampling ZET_METRIC_GROUP_SAMPLING_TYPE_FLAG_EXP_TRACER_BASED = ZE_BIT(2), ///< Experimental Tracer based sampling - ZET_METRIC_GROUP_SAMPLING_TYPE_FLAG_FORCE_UINT32 = 0x7fffffff + ZET_METRIC_GROUP_SAMPLING_TYPE_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_METRIC_GROUP_SAMPLING_TYPE_FLAG_* ENUMs } zet_metric_group_sampling_type_flag_t; @@ -1022,7 +1026,7 @@ typedef enum _zet_metric_type_t ZET_METRIC_TYPE_IP_EXP = 0x7ffffffe, ///< Metric type: instruction pointer. Deprecated, use ///< ::ZET_METRIC_TYPE_IP. ZET_METRIC_TYPE_IP = 0x7ffffffe, ///< Metric type: instruction pointer - ZET_METRIC_TYPE_FORCE_UINT32 = 0x7fffffff + ZET_METRIC_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_METRIC_TYPE_* ENUMs } zet_metric_type_t; @@ -1032,7 +1036,7 @@ typedef enum _zet_metric_group_calculation_type_t { ZET_METRIC_GROUP_CALCULATION_TYPE_METRIC_VALUES = 0, ///< Calculated metric values from raw data. ZET_METRIC_GROUP_CALCULATION_TYPE_MAX_METRIC_VALUES = 1, ///< Maximum metric values. - ZET_METRIC_GROUP_CALCULATION_TYPE_FORCE_UINT32 = 0x7fffffff + ZET_METRIC_GROUP_CALCULATION_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_METRIC_GROUP_CALCULATION_TYPE_* ENUMs } zet_metric_group_calculation_type_t; @@ -1348,7 +1352,7 @@ typedef enum _zet_metric_query_pool_type_t { ZET_METRIC_QUERY_POOL_TYPE_PERFORMANCE = 0, ///< Performance metric query pool. ZET_METRIC_QUERY_POOL_TYPE_EXECUTION = 1, ///< Skips workload execution between begin/end calls. - ZET_METRIC_QUERY_POOL_TYPE_FORCE_UINT32 = 0x7fffffff + ZET_METRIC_QUERY_POOL_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_METRIC_QUERY_POOL_TYPE_* ENUMs } zet_metric_query_pool_type_t; @@ -1626,7 +1630,7 @@ typedef enum _zet_profile_flag_t ZET_PROFILE_FLAG_REGISTER_REALLOCATION = ZE_BIT(0), ///< request the compiler attempt to minimize register usage as much as ///< possible to allow for instrumentation ZET_PROFILE_FLAG_FREE_REGISTER_INFO = ZE_BIT(1), ///< request the compiler generate free register info - ZET_PROFILE_FLAG_FORCE_UINT32 = 0x7fffffff + ZET_PROFILE_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_PROFILE_FLAG_* ENUMs } zet_profile_flag_t; @@ -1648,7 +1652,7 @@ typedef struct _zet_profile_properties_t typedef enum _zet_profile_token_type_t { ZET_PROFILE_TOKEN_TYPE_FREE_REGISTER = 0, ///< GRF info - ZET_PROFILE_TOKEN_TYPE_FORCE_UINT32 = 0x7fffffff + ZET_PROFILE_TOKEN_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_PROFILE_TOKEN_TYPE_* ENUMs } zet_profile_token_type_t; @@ -1721,7 +1725,7 @@ typedef enum _zet_api_tracing_exp_version_t { ZET_API_TRACING_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZET_API_TRACING_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZET_API_TRACING_EXP_VERSION_FORCE_UINT32 = 0x7fffffff + ZET_API_TRACING_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_API_TRACING_EXP_VERSION_* ENUMs } zet_api_tracing_exp_version_t; @@ -1890,7 +1894,7 @@ typedef enum _zet_concurrent_metric_groups_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 + ZET_CONCURRENT_METRIC_GROUPS_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_CONCURRENT_METRIC_GROUPS_EXP_VERSION_* ENUMs } zet_concurrent_metric_groups_exp_version_t; @@ -1942,7 +1946,7 @@ typedef enum _zet_metric_tracer_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 + ZET_METRIC_TRACER_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_METRIC_TRACER_EXP_VERSION_* ENUMs } zet_metric_tracer_exp_version_t; @@ -2293,7 +2297,8 @@ typedef enum _zet_metric_group_type_exp_flag_t ///< 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_FORCE_UINT32 = 0x7fffffff + 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; @@ -2324,6 +2329,145 @@ typedef struct _zet_export_dma_buf_exp_properties_t } 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 Append a Marker based on the Metric source of the Metric Group, to a +/// Command List. +/// +/// @details +/// - This function appends a Marker based on the Metric source of the +/// Metric Group, to Command List. +/// +/// @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_NULL_HANDLE +/// + `nullptr == hCommandList` +/// + `nullptr == hMetricGroup` +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 + ); + +#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 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 +/// - 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 +/// - ::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_NULL_HANDLE +/// + `nullptr == hDevice` +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. + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Disable Metrics collection during runtime, if it was already enabled. +/// +/// @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. +/// +/// @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_NULL_HANDLE +/// + `nullptr == hDevice` +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 + ); + #if !defined(__GNUC__) #pragma endregion #endif @@ -2343,7 +2487,7 @@ 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 + 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; @@ -2421,7 +2565,7 @@ 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 + 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; @@ -2490,7 +2634,7 @@ 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 + 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; @@ -2628,7 +2772,7 @@ 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 + ZET_METRIC_PROGRAMMABLE_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_METRIC_PROGRAMMABLE_EXP_VERSION_* ENUMs } zet_metric_programmable_exp_version_t; @@ -2723,7 +2867,7 @@ typedef enum _zet_metric_programmable_param_type_exp_t 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 + 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; @@ -2740,7 +2884,7 @@ typedef enum _zet_value_info_type_exp_t 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 + ZET_VALUE_INFO_TYPE_EXP_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_VALUE_INFO_TYPE_EXP_* ENUMs } zet_value_info_type_exp_t; @@ -3216,6 +3360,8 @@ zetMetricGroupCloseExp( /// - 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 diff --git a/include/zet_ddi.h b/include/zet_ddi.h index 504106d4..bf7f56c0 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.12-r1.12.15 + * @version v1.13-r1.13.1 * */ #ifndef _ZET_DDI_H @@ -281,12 +281,26 @@ typedef ze_result_t (ZE_APICALL *zet_pfnDeviceCreateMetricGroupsFromMetricsExp_t zet_metric_group_handle_t* ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zetDeviceEnableMetricsExp +typedef ze_result_t (ZE_APICALL *zet_pfnDeviceEnableMetricsExp_t)( + zet_device_handle_t + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zetDeviceDisableMetricsExp +typedef ze_result_t (ZE_APICALL *zet_pfnDeviceDisableMetricsExp_t)( + zet_device_handle_t + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Table of DeviceExp functions pointers typedef struct _zet_device_exp_dditable_t { zet_pfnDeviceGetConcurrentMetricGroupsExp_t pfnGetConcurrentMetricGroupsExp; zet_pfnDeviceCreateMetricGroupsFromMetricsExp_t pfnCreateMetricGroupsFromMetricsExp; + zet_pfnDeviceEnableMetricsExp_t pfnEnableMetricsExp; + zet_pfnDeviceDisableMetricsExp_t pfnDisableMetricsExp; } zet_device_exp_dditable_t; /////////////////////////////////////////////////////////////////////////////// @@ -412,6 +426,43 @@ typedef ze_result_t (ZE_APICALL *zet_pfnGetCommandListProcAddrTable_t)( zet_command_list_dditable_t* ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zetCommandListAppendMarkerExp +typedef ze_result_t (ZE_APICALL *zet_pfnCommandListAppendMarkerExp_t)( + zet_command_list_handle_t, + zet_metric_group_handle_t, + uint32_t + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Table of CommandListExp functions pointers +typedef struct _zet_command_list_exp_dditable_t +{ + zet_pfnCommandListAppendMarkerExp_t pfnAppendMarkerExp; +} zet_command_list_exp_dditable_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Exported function for filling application's CommandListExp 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 +zetGetCommandListExpProcAddrTable( + ze_api_version_t version, ///< [in] API version requested + zet_command_list_exp_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zetGetCommandListExpProcAddrTable +typedef ze_result_t (ZE_APICALL *zet_pfnGetCommandListExpProcAddrTable_t)( + ze_api_version_t, + zet_command_list_exp_dditable_t* + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Function-pointer for zetModuleGetDebugInfo typedef ze_result_t (ZE_APICALL *zet_pfnModuleGetDebugInfo_t)( @@ -1154,6 +1205,7 @@ typedef struct _zet_dditable_t zet_device_exp_dditable_t DeviceExp; zet_context_dditable_t Context; zet_command_list_dditable_t CommandList; + zet_command_list_exp_dditable_t CommandListExp; zet_module_dditable_t Module; zet_kernel_dditable_t Kernel; zet_metric_dditable_t Metric; @@ -1178,6 +1230,7 @@ typedef struct _zet_dditable_driver_t zet_device_exp_dditable_t * DeviceExp; zet_context_dditable_t * Context; zet_command_list_dditable_t * CommandList; + zet_command_list_exp_dditable_t * CommandListExp; zet_module_dditable_t * Module; zet_kernel_dditable_t * Kernel; zet_metric_dditable_t * Metric; diff --git a/source/drivers/null/ze_nullddi.cpp b/source/drivers/null/ze_nullddi.cpp index b3740a94..e23aa7d1 100644 --- a/source/drivers/null/ze_nullddi.cpp +++ b/source/drivers/null/ze_nullddi.cpp @@ -3322,10 +3322,14 @@ namespace driver 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. + ///< 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. ) { ze_result_t result = ZE_RESULT_SUCCESS; @@ -4108,6 +4112,304 @@ namespace driver return result; } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASBuilderCreateExt + __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 + ) + { + 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 ) + { + result = pfnCreateExt( hDriver, pDescriptor, phBuilder ); + } + else + { + // generic implementation + *phBuilder = reinterpret_cast( context.get() ); + + } + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASBuilderGetBuildPropertiesExt + __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 + ) + { + 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 ) + { + result = pfnGetBuildPropertiesExt( hBuilder, pBuildOpDescriptor, pProperties ); + } + else + { + // generic implementation + } + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @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 + ) + { + 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 ) + { + result = pfnRTASFormatCompatibilityCheckExt( hDriver, rtasFormatA, rtasFormatB ); + } + else + { + // generic implementation + } + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASBuilderBuildExt + __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 + ) + { + 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 ) + { + result = pfnBuildExt( hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes ); + } + else + { + // generic implementation + } + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASBuilderCommandListAppendCopyExt + __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 + ) + { + 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 ) + { + result = pfnCommandListAppendCopyExt( hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents ); + } + else + { + // generic implementation + } + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASBuilderDestroyExt + __zedlllocal ze_result_t ZE_APICALL + 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 pfnDestroyExt = context.zeDdiTable.RTASBuilder.pfnDestroyExt; + if( nullptr != pfnDestroyExt ) + { + result = pfnDestroyExt( hBuilder ); + } + else + { + // generic implementation + + } + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @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 + ) + { + 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 ) + { + result = pfnCreateExt( hDriver, phParallelOperation ); + } + else + { + // generic implementation + *phParallelOperation = reinterpret_cast( context.get() ); + + } + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @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 + ) + { + 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 ) + { + result = pfnGetPropertiesExt( hParallelOperation, pProperties ); + } + else + { + // generic implementation + } + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASParallelOperationJoinExt + __zedlllocal ze_result_t ZE_APICALL + 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 pfnJoinExt = context.zeDdiTable.RTASParallelOperation.pfnJoinExt; + if( nullptr != pfnJoinExt ) + { + result = pfnJoinExt( hParallelOperation ); + } + else + { + // generic implementation + } + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASParallelOperationDestroyExt + __zedlllocal ze_result_t ZE_APICALL + 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 pfnDestroyExt = context.zeDdiTable.RTASParallelOperation.pfnDestroyExt; + if( nullptr != pfnDestroyExt ) + { + result = pfnDestroyExt( hParallelOperation ); + } + else + { + // generic implementation + + } + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeDeviceGetVectorWidthPropertiesExt + __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. + ) + { + 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 ) + { + result = pfnGetVectorWidthPropertiesExt( hDevice, pCount, pVectorWidthProperties ); + } + else + { + // generic implementation + } + + return result; + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zeDeviceReserveCacheExt __zedlllocal ze_result_t ZE_APICALL @@ -5294,6 +5596,41 @@ zeGetGlobalProcAddrTable( return result; } +/////////////////////////////////////////////////////////////////////////////// +/// @brief Exported function for filling application's RTASBuilder 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 +zeGetRTASBuilderProcAddrTable( + ze_api_version_t version, ///< [in] API version requested + ze_rtas_builder_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers + ) +{ + if( nullptr == pDdiTable ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + if( driver::context.version < version ) + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + + ze_result_t result = ZE_RESULT_SUCCESS; + + pDdiTable->pfnCreateExt = driver::zeRTASBuilderCreateExt; + + pDdiTable->pfnGetBuildPropertiesExt = driver::zeRTASBuilderGetBuildPropertiesExt; + + pDdiTable->pfnBuildExt = driver::zeRTASBuilderBuildExt; + + pDdiTable->pfnCommandListAppendCopyExt = driver::zeRTASBuilderCommandListAppendCopyExt; + + pDdiTable->pfnDestroyExt = driver::zeRTASBuilderDestroyExt; + + return result; +} + /////////////////////////////////////////////////////////////////////////////// /// @brief Exported function for filling application's RTASBuilderExp table /// with current process' addresses @@ -5327,6 +5664,39 @@ zeGetRTASBuilderExpProcAddrTable( return result; } +/////////////////////////////////////////////////////////////////////////////// +/// @brief Exported function for filling application's RTASParallelOperation 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 +zeGetRTASParallelOperationProcAddrTable( + ze_api_version_t version, ///< [in] API version requested + ze_rtas_parallel_operation_dditable_t* pDdiTable///< [in,out] pointer to table of DDI function pointers + ) +{ + if( nullptr == pDdiTable ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + if( driver::context.version < version ) + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + + ze_result_t result = ZE_RESULT_SUCCESS; + + pDdiTable->pfnCreateExt = driver::zeRTASParallelOperationCreateExt; + + pDdiTable->pfnGetPropertiesExt = driver::zeRTASParallelOperationGetPropertiesExt; + + pDdiTable->pfnJoinExt = driver::zeRTASParallelOperationJoinExt; + + pDdiTable->pfnDestroyExt = driver::zeRTASParallelOperationDestroyExt; + + return result; +} + /////////////////////////////////////////////////////////////////////////////// /// @brief Exported function for filling application's RTASParallelOperationExp table /// with current process' addresses @@ -5394,6 +5764,8 @@ zeGetDriverProcAddrTable( pDdiTable->pfnGetExtensionFunctionAddress = driver::zeDriverGetExtensionFunctionAddress; + pDdiTable->pfnRTASFormatCompatibilityCheckExt = driver::zeDriverRTASFormatCompatibilityCheckExt; + pDdiTable->pfnGetLastErrorDescription = driver::zeDriverGetLastErrorDescription; return result; @@ -5482,6 +5854,8 @@ zeGetDeviceProcAddrTable( pDdiTable->pfnReleaseExternalSemaphoreExt = driver::zeDeviceReleaseExternalSemaphoreExt; + pDdiTable->pfnGetVectorWidthPropertiesExt = driver::zeDeviceGetVectorWidthPropertiesExt; + pDdiTable->pfnReserveCacheExt = driver::zeDeviceReserveCacheExt; pDdiTable->pfnSetCacheAdviceExt = driver::zeDeviceSetCacheAdviceExt; diff --git a/source/drivers/null/zet_nullddi.cpp b/source/drivers/null/zet_nullddi.cpp index fd01dbf9..2b79a154 100644 --- a/source/drivers/null/zet_nullddi.cpp +++ b/source/drivers/null/zet_nullddi.cpp @@ -348,8 +348,8 @@ namespace driver ///< than the `count` member of ::zet_debug_regset_properties_t for the ///< type uint32_t count, ///< [in] the number of registers to read; start+count must be less than or - ///< equal to the `count` member of ::zet_debug_register_group_properties_t - ///< for the type + ///< equal to the `count` member of ::zet_debug_regset_properties_t for the + ///< type void* pRegisterValues ///< [in,out][optional][range(0, count)] buffer of register values ) { @@ -380,8 +380,8 @@ namespace driver ///< than the `count` member of ::zet_debug_regset_properties_t for the ///< type uint32_t count, ///< [in] the number of registers to write; start+count must be less than - ///< or equal to the `count` member of - ///< ::zet_debug_register_group_properties_t for the type + ///< or equal to the `count` member of ::zet_debug_regset_properties_t for + ///< the type void* pRegisterValues ///< [in,out][optional][range(0, count)] buffer of register values ) { @@ -1401,6 +1401,79 @@ namespace driver return result; } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetCommandListAppendMarkerExp + __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 + ) + { + 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 ) + { + result = pfnAppendMarkerExp( hCommandList, hMetricGroup, value ); + } + else + { + // generic implementation + } + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetDeviceEnableMetricsExp + __zedlllocal ze_result_t ZE_APICALL + 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 pfnEnableMetricsExp = context.zetDdiTable.DeviceExp.pfnEnableMetricsExp; + if( nullptr != pfnEnableMetricsExp ) + { + result = pfnEnableMetricsExp( hDevice ); + } + else + { + // generic implementation + } + + 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; + + // 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 ) + { + result = pfnDisableMetricsExp( hDevice ); + } + else + { + // generic implementation + } + + return result; + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zetMetricGroupCalculateMultipleMetricValuesExp __zedlllocal ze_result_t ZE_APICALL @@ -2116,6 +2189,10 @@ zetGetDeviceExpProcAddrTable( pDdiTable->pfnCreateMetricGroupsFromMetricsExp = driver::zetDeviceCreateMetricGroupsFromMetricsExp; + pDdiTable->pfnEnableMetricsExp = driver::zetDeviceEnableMetricsExp; + + pDdiTable->pfnDisableMetricsExp = driver::zetDeviceDisableMetricsExp; + return result; } @@ -2179,6 +2256,33 @@ zetGetCommandListProcAddrTable( return result; } +/////////////////////////////////////////////////////////////////////////////// +/// @brief Exported function for filling application's CommandListExp 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 +zetGetCommandListExpProcAddrTable( + ze_api_version_t version, ///< [in] API version requested + zet_command_list_exp_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers + ) +{ + if( nullptr == pDdiTable ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + if( driver::context.version < version ) + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + + ze_result_t result = ZE_RESULT_SUCCESS; + + pDdiTable->pfnAppendMarkerExp = driver::zetCommandListAppendMarkerExp; + + return result; +} + /////////////////////////////////////////////////////////////////////////////// /// @brief Exported function for filling application's Kernel table /// with current process' addresses diff --git a/source/layers/tracing/ze_tracing_cb_structs.h b/source/layers/tracing/ze_tracing_cb_structs.h index 5e6f6e74..c1c53b2d 100644 --- a/source/layers/tracing/ze_tracing_cb_structs.h +++ b/source/layers/tracing/ze_tracing_cb_structs.h @@ -30,6 +30,11 @@ typedef struct _zel_global_callbacks_t /// @brief Table of RTASBuilder callback functions pointers typedef struct _zel_rtas_builder_callbacks_t { + ze_pfnRTASBuilderCreateExtCb_t pfnCreateExtCb; + ze_pfnRTASBuilderGetBuildPropertiesExtCb_t pfnGetBuildPropertiesExtCb; + ze_pfnRTASBuilderBuildExtCb_t pfnBuildExtCb; + ze_pfnRTASBuilderCommandListAppendCopyExtCb_t pfnCommandListAppendCopyExtCb; + ze_pfnRTASBuilderDestroyExtCb_t pfnDestroyExtCb; ze_pfnRTASBuilderCreateExpCb_t pfnCreateExpCb; ze_pfnRTASBuilderGetBuildPropertiesExpCb_t pfnGetBuildPropertiesExpCb; ze_pfnRTASBuilderBuildExpCb_t pfnBuildExpCb; @@ -40,6 +45,10 @@ typedef struct _zel_rtas_builder_callbacks_t /// @brief Table of RTASParallelOperation callback functions pointers typedef struct _zel_rtas_parallel_operation_callbacks_t { + ze_pfnRTASParallelOperationCreateExtCb_t pfnCreateExtCb; + ze_pfnRTASParallelOperationGetPropertiesExtCb_t pfnGetPropertiesExtCb; + ze_pfnRTASParallelOperationJoinExtCb_t pfnJoinExtCb; + ze_pfnRTASParallelOperationDestroyExtCb_t pfnDestroyExtCb; ze_pfnRTASParallelOperationCreateExpCb_t pfnCreateExpCb; ze_pfnRTASParallelOperationGetPropertiesExpCb_t pfnGetPropertiesExpCb; ze_pfnRTASParallelOperationJoinExpCb_t pfnJoinExpCb; @@ -56,6 +65,7 @@ typedef struct _zel_driver_callbacks_t ze_pfnDriverGetIpcPropertiesCb_t pfnGetIpcPropertiesCb; ze_pfnDriverGetExtensionPropertiesCb_t pfnGetExtensionPropertiesCb; ze_pfnDriverGetExtensionFunctionAddressCb_t pfnGetExtensionFunctionAddressCb; + ze_pfnDriverRTASFormatCompatibilityCheckExtCb_t pfnRTASFormatCompatibilityCheckExtCb; ze_pfnDriverGetLastErrorDescriptionCb_t pfnGetLastErrorDescriptionCb; ze_pfnDriverRTASFormatCompatibilityCheckExpCb_t pfnRTASFormatCompatibilityCheckExpCb; } zel_driver_callbacks_t; @@ -81,6 +91,7 @@ typedef struct _zel_device_callbacks_t ze_pfnDeviceGetGlobalTimestampsCb_t pfnGetGlobalTimestampsCb; ze_pfnDeviceImportExternalSemaphoreExtCb_t pfnImportExternalSemaphoreExtCb; ze_pfnDeviceReleaseExternalSemaphoreExtCb_t pfnReleaseExternalSemaphoreExtCb; + ze_pfnDeviceGetVectorWidthPropertiesExtCb_t pfnGetVectorWidthPropertiesExtCb; ze_pfnDeviceReserveCacheExtCb_t pfnReserveCacheExtCb; ze_pfnDeviceSetCacheAdviceExtCb_t pfnSetCacheAdviceExtCb; ze_pfnDevicePciGetPropertiesExtCb_t pfnPciGetPropertiesExtCb; diff --git a/source/layers/tracing/ze_tracing_register_cb.cpp b/source/layers/tracing/ze_tracing_register_cb.cpp index bf2379a0..79d8a7e6 100644 --- a/source/layers/tracing/ze_tracing_register_cb.cpp +++ b/source/layers/tracing/ze_tracing_register_cb.cpp @@ -2435,6 +2435,182 @@ zelTracerCommandListAppendWaitExternalSemaphoreExtRegisterCallback( } +ZE_DLLEXPORT ze_result_t ZE_APICALL +zelTracerRTASBuilderCreateExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnRTASBuilderCreateExtCb_t pfnCreateExtCb + ) { + + ze_result_t result; + auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getProEpilogues(callback_type, result); + if (result == ZE_RESULT_SUCCESS) + cbs.RTASBuilder.pfnCreateExtCb = pfnCreateExtCb; + + return result; +} + + +ZE_DLLEXPORT ze_result_t ZE_APICALL +zelTracerRTASBuilderGetBuildPropertiesExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnRTASBuilderGetBuildPropertiesExtCb_t pfnGetBuildPropertiesExtCb + ) { + + ze_result_t result; + auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getProEpilogues(callback_type, result); + if (result == ZE_RESULT_SUCCESS) + cbs.RTASBuilder.pfnGetBuildPropertiesExtCb = pfnGetBuildPropertiesExtCb; + + return result; +} + + +ZE_DLLEXPORT ze_result_t ZE_APICALL +zelTracerDriverRTASFormatCompatibilityCheckExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnDriverRTASFormatCompatibilityCheckExtCb_t pfnRTASFormatCompatibilityCheckExtCb + ) { + + ze_result_t result; + auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getProEpilogues(callback_type, result); + if (result == ZE_RESULT_SUCCESS) + cbs.Driver.pfnRTASFormatCompatibilityCheckExtCb = pfnRTASFormatCompatibilityCheckExtCb; + + return result; +} + + +ZE_DLLEXPORT ze_result_t ZE_APICALL +zelTracerRTASBuilderBuildExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnRTASBuilderBuildExtCb_t pfnBuildExtCb + ) { + + ze_result_t result; + auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getProEpilogues(callback_type, result); + if (result == ZE_RESULT_SUCCESS) + cbs.RTASBuilder.pfnBuildExtCb = pfnBuildExtCb; + + return result; +} + + +ZE_DLLEXPORT ze_result_t ZE_APICALL +zelTracerRTASBuilderCommandListAppendCopyExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnRTASBuilderCommandListAppendCopyExtCb_t pfnCommandListAppendCopyExtCb + ) { + + ze_result_t result; + auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getProEpilogues(callback_type, result); + if (result == ZE_RESULT_SUCCESS) + cbs.RTASBuilder.pfnCommandListAppendCopyExtCb = pfnCommandListAppendCopyExtCb; + + return result; +} + + +ZE_DLLEXPORT ze_result_t ZE_APICALL +zelTracerRTASBuilderDestroyExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnRTASBuilderDestroyExtCb_t pfnDestroyExtCb + ) { + + ze_result_t result; + auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getProEpilogues(callback_type, result); + if (result == ZE_RESULT_SUCCESS) + cbs.RTASBuilder.pfnDestroyExtCb = pfnDestroyExtCb; + + return result; +} + + +ZE_DLLEXPORT ze_result_t ZE_APICALL +zelTracerRTASParallelOperationCreateExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnRTASParallelOperationCreateExtCb_t pfnCreateExtCb + ) { + + ze_result_t result; + auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getProEpilogues(callback_type, result); + if (result == ZE_RESULT_SUCCESS) + cbs.RTASParallelOperation.pfnCreateExtCb = pfnCreateExtCb; + + return result; +} + + +ZE_DLLEXPORT ze_result_t ZE_APICALL +zelTracerRTASParallelOperationGetPropertiesExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnRTASParallelOperationGetPropertiesExtCb_t pfnGetPropertiesExtCb + ) { + + ze_result_t result; + auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getProEpilogues(callback_type, result); + if (result == ZE_RESULT_SUCCESS) + cbs.RTASParallelOperation.pfnGetPropertiesExtCb = pfnGetPropertiesExtCb; + + return result; +} + + +ZE_DLLEXPORT ze_result_t ZE_APICALL +zelTracerRTASParallelOperationJoinExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnRTASParallelOperationJoinExtCb_t pfnJoinExtCb + ) { + + ze_result_t result; + auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getProEpilogues(callback_type, result); + if (result == ZE_RESULT_SUCCESS) + cbs.RTASParallelOperation.pfnJoinExtCb = pfnJoinExtCb; + + return result; +} + + +ZE_DLLEXPORT ze_result_t ZE_APICALL +zelTracerRTASParallelOperationDestroyExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnRTASParallelOperationDestroyExtCb_t pfnDestroyExtCb + ) { + + ze_result_t result; + auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getProEpilogues(callback_type, result); + if (result == ZE_RESULT_SUCCESS) + cbs.RTASParallelOperation.pfnDestroyExtCb = pfnDestroyExtCb; + + return result; +} + + +ZE_DLLEXPORT ze_result_t ZE_APICALL +zelTracerDeviceGetVectorWidthPropertiesExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnDeviceGetVectorWidthPropertiesExtCb_t pfnGetVectorWidthPropertiesExtCb + ) { + + ze_result_t result; + auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getProEpilogues(callback_type, result); + if (result == ZE_RESULT_SUCCESS) + cbs.Device.pfnGetVectorWidthPropertiesExtCb = pfnGetVectorWidthPropertiesExtCb; + + return result; +} + + ZE_DLLEXPORT ze_result_t ZE_APICALL zelTracerDeviceReserveCacheExtRegisterCallback( zel_tracer_handle_t hTracer, diff --git a/source/layers/tracing/ze_trcddi.cpp b/source/layers/tracing/ze_trcddi.cpp index 9df2671d..f52237e3 100644 --- a/source/layers/tracing/ze_trcddi.cpp +++ b/source/layers/tracing/ze_trcddi.cpp @@ -4830,10 +4830,14 @@ namespace tracing_layer 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. + ///< 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. ) { auto pfnGetSourceAttributes = context.zeDdiTable.Kernel.pfnGetSourceAttributes; @@ -6041,6 +6045,447 @@ namespace tracing_layer *tracerParams.pphWaitEvents); } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASBuilderCreateExt + __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 + ) + { + auto pfnCreateExt = context.zeDdiTable.RTASBuilder.pfnCreateExt; + + if( nullptr == pfnCreateExt) + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.RTASBuilder.pfnCreateExt, hDriver, pDescriptor, phBuilder); + + // capture parameters + ze_rtas_builder_create_ext_params_t tracerParams = { + &hDriver, + &pDescriptor, + &phBuilder + }; + + tracing_layer::APITracerCallbackDataImp apiCallbackData; + + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnRTASBuilderCreateExtCb_t, RTASBuilder, pfnCreateExtCb); + + + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.RTASBuilder.pfnCreateExt, + &tracerParams, + apiCallbackData.apiOrdinal, + apiCallbackData.prologCallbacks, + apiCallbackData.epilogCallbacks, + *tracerParams.phDriver, + *tracerParams.ppDescriptor, + *tracerParams.pphBuilder); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASBuilderGetBuildPropertiesExt + __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 + ) + { + auto pfnGetBuildPropertiesExt = context.zeDdiTable.RTASBuilder.pfnGetBuildPropertiesExt; + + if( nullptr == pfnGetBuildPropertiesExt) + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.RTASBuilder.pfnGetBuildPropertiesExt, hBuilder, pBuildOpDescriptor, pProperties); + + // capture parameters + ze_rtas_builder_get_build_properties_ext_params_t tracerParams = { + &hBuilder, + &pBuildOpDescriptor, + &pProperties + }; + + tracing_layer::APITracerCallbackDataImp apiCallbackData; + + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnRTASBuilderGetBuildPropertiesExtCb_t, RTASBuilder, pfnGetBuildPropertiesExtCb); + + + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.RTASBuilder.pfnGetBuildPropertiesExt, + &tracerParams, + apiCallbackData.apiOrdinal, + apiCallbackData.prologCallbacks, + apiCallbackData.epilogCallbacks, + *tracerParams.phBuilder, + *tracerParams.ppBuildOpDescriptor, + *tracerParams.ppProperties); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @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 + ) + { + auto pfnRTASFormatCompatibilityCheckExt = context.zeDdiTable.Driver.pfnRTASFormatCompatibilityCheckExt; + + if( nullptr == pfnRTASFormatCompatibilityCheckExt) + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.Driver.pfnRTASFormatCompatibilityCheckExt, hDriver, rtasFormatA, rtasFormatB); + + // capture parameters + ze_driver_rtas_format_compatibility_check_ext_params_t tracerParams = { + &hDriver, + &rtasFormatA, + &rtasFormatB + }; + + tracing_layer::APITracerCallbackDataImp apiCallbackData; + + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnDriverRTASFormatCompatibilityCheckExtCb_t, Driver, pfnRTASFormatCompatibilityCheckExtCb); + + + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.Driver.pfnRTASFormatCompatibilityCheckExt, + &tracerParams, + apiCallbackData.apiOrdinal, + apiCallbackData.prologCallbacks, + apiCallbackData.epilogCallbacks, + *tracerParams.phDriver, + *tracerParams.prtasFormatA, + *tracerParams.prtasFormatB); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASBuilderBuildExt + __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 + ) + { + auto pfnBuildExt = context.zeDdiTable.RTASBuilder.pfnBuildExt; + + if( nullptr == pfnBuildExt) + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.RTASBuilder.pfnBuildExt, hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes); + + // capture parameters + ze_rtas_builder_build_ext_params_t tracerParams = { + &hBuilder, + &pBuildOpDescriptor, + &pScratchBuffer, + &scratchBufferSizeBytes, + &pRtasBuffer, + &rtasBufferSizeBytes, + &hParallelOperation, + &pBuildUserPtr, + &pBounds, + &pRtasBufferSizeBytes + }; + + tracing_layer::APITracerCallbackDataImp apiCallbackData; + + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnRTASBuilderBuildExtCb_t, RTASBuilder, pfnBuildExtCb); + + + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.RTASBuilder.pfnBuildExt, + &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); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASBuilderCommandListAppendCopyExt + __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 + ) + { + auto pfnCommandListAppendCopyExt = context.zeDdiTable.RTASBuilder.pfnCommandListAppendCopyExt; + + if( nullptr == pfnCommandListAppendCopyExt) + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.RTASBuilder.pfnCommandListAppendCopyExt, hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents); + + // capture parameters + ze_rtas_builder_command_list_append_copy_ext_params_t tracerParams = { + &hCommandList, + &dstptr, + &srcptr, + &size, + &hSignalEvent, + &numWaitEvents, + &phWaitEvents + }; + + tracing_layer::APITracerCallbackDataImp apiCallbackData; + + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnRTASBuilderCommandListAppendCopyExtCb_t, RTASBuilder, pfnCommandListAppendCopyExtCb); + + + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.RTASBuilder.pfnCommandListAppendCopyExt, + &tracerParams, + apiCallbackData.apiOrdinal, + apiCallbackData.prologCallbacks, + apiCallbackData.epilogCallbacks, + *tracerParams.phCommandList, + *tracerParams.pdstptr, + *tracerParams.psrcptr, + *tracerParams.psize, + *tracerParams.phSignalEvent, + *tracerParams.pnumWaitEvents, + *tracerParams.pphWaitEvents); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASBuilderDestroyExt + __zedlllocal ze_result_t ZE_APICALL + zeRTASBuilderDestroyExt( + ze_rtas_builder_ext_handle_t hBuilder ///< [in][release] handle of builder object to destroy + ) + { + auto pfnDestroyExt = context.zeDdiTable.RTASBuilder.pfnDestroyExt; + + if( nullptr == pfnDestroyExt) + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.RTASBuilder.pfnDestroyExt, hBuilder); + + // capture parameters + ze_rtas_builder_destroy_ext_params_t tracerParams = { + &hBuilder + }; + + tracing_layer::APITracerCallbackDataImp apiCallbackData; + + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnRTASBuilderDestroyExtCb_t, RTASBuilder, pfnDestroyExtCb); + + + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.RTASBuilder.pfnDestroyExt, + &tracerParams, + apiCallbackData.apiOrdinal, + apiCallbackData.prologCallbacks, + apiCallbackData.epilogCallbacks, + *tracerParams.phBuilder); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @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 + ) + { + auto pfnCreateExt = context.zeDdiTable.RTASParallelOperation.pfnCreateExt; + + if( nullptr == pfnCreateExt) + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.RTASParallelOperation.pfnCreateExt, hDriver, phParallelOperation); + + // capture parameters + ze_rtas_parallel_operation_create_ext_params_t tracerParams = { + &hDriver, + &phParallelOperation + }; + + 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 pfnGetPropertiesExt = context.zeDdiTable.RTASParallelOperation.pfnGetPropertiesExt; + + if( nullptr == pfnGetPropertiesExt) + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.RTASParallelOperation.pfnGetPropertiesExt, hParallelOperation, pProperties); + + // capture parameters + ze_rtas_parallel_operation_get_properties_ext_params_t tracerParams = { + &hParallelOperation, + &pProperties + }; + + tracing_layer::APITracerCallbackDataImp apiCallbackData; + + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnRTASParallelOperationGetPropertiesExtCb_t, RTASParallelOperation, pfnGetPropertiesExtCb); + + + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.RTASParallelOperation.pfnGetPropertiesExt, + &tracerParams, + apiCallbackData.apiOrdinal, + apiCallbackData.prologCallbacks, + apiCallbackData.epilogCallbacks, + *tracerParams.phParallelOperation, + *tracerParams.ppProperties); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASParallelOperationJoinExt + __zedlllocal ze_result_t ZE_APICALL + zeRTASParallelOperationJoinExt( + ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in] handle of parallel operation object + ) + { + auto pfnJoinExt = context.zeDdiTable.RTASParallelOperation.pfnJoinExt; + + if( nullptr == pfnJoinExt) + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.RTASParallelOperation.pfnJoinExt, hParallelOperation); + + // capture parameters + ze_rtas_parallel_operation_join_ext_params_t tracerParams = { + &hParallelOperation + }; + + tracing_layer::APITracerCallbackDataImp apiCallbackData; + + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnRTASParallelOperationJoinExtCb_t, RTASParallelOperation, pfnJoinExtCb); + + + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.RTASParallelOperation.pfnJoinExt, + &tracerParams, + apiCallbackData.apiOrdinal, + apiCallbackData.prologCallbacks, + apiCallbackData.epilogCallbacks, + *tracerParams.phParallelOperation); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASParallelOperationDestroyExt + __zedlllocal ze_result_t ZE_APICALL + zeRTASParallelOperationDestroyExt( + ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in][release] handle of parallel operation object to destroy + ) + { + auto pfnDestroyExt = context.zeDdiTable.RTASParallelOperation.pfnDestroyExt; + + if( nullptr == pfnDestroyExt) + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.RTASParallelOperation.pfnDestroyExt, hParallelOperation); + + // capture parameters + ze_rtas_parallel_operation_destroy_ext_params_t tracerParams = { + &hParallelOperation + }; + + tracing_layer::APITracerCallbackDataImp apiCallbackData; + + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnRTASParallelOperationDestroyExtCb_t, RTASParallelOperation, pfnDestroyExtCb); + + + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.RTASParallelOperation.pfnDestroyExt, + &tracerParams, + apiCallbackData.apiOrdinal, + apiCallbackData.prologCallbacks, + apiCallbackData.epilogCallbacks, + *tracerParams.phParallelOperation); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeDeviceGetVectorWidthPropertiesExt + __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. + ) + { + auto pfnGetVectorWidthPropertiesExt = context.zeDdiTable.Device.pfnGetVectorWidthPropertiesExt; + + if( nullptr == pfnGetVectorWidthPropertiesExt) + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.Device.pfnGetVectorWidthPropertiesExt, hDevice, pCount, pVectorWidthProperties); + + // capture parameters + ze_device_get_vector_width_properties_ext_params_t tracerParams = { + &hDevice, + &pCount, + &pVectorWidthProperties + }; + + tracing_layer::APITracerCallbackDataImp apiCallbackData; + + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnDeviceGetVectorWidthPropertiesExtCb_t, Device, pfnGetVectorWidthPropertiesExtCb); + + + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.Device.pfnGetVectorWidthPropertiesExt, + &tracerParams, + apiCallbackData.apiOrdinal, + apiCallbackData.prologCallbacks, + apiCallbackData.epilogCallbacks, + *tracerParams.phDevice, + *tracerParams.ppCount, + *tracerParams.ppVectorWidthProperties); + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zeDeviceReserveCacheExt __zedlllocal ze_result_t ZE_APICALL @@ -7766,6 +8211,49 @@ zeGetGlobalProcAddrTable( return result; } +/////////////////////////////////////////////////////////////////////////////// +/// @brief Exported function for filling application's RTASBuilder 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 +zeGetRTASBuilderProcAddrTable( + ze_api_version_t version, ///< [in] API version requested + ze_rtas_builder_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers + ) +{ + auto& dditable = tracing_layer::context.zeDdiTable.RTASBuilder; + + if( nullptr == pDdiTable ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + if (ZE_MAJOR_VERSION(tracing_layer::context.version) != ZE_MAJOR_VERSION(version) || + ZE_MINOR_VERSION(tracing_layer::context.version) > ZE_MINOR_VERSION(version)) + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + + ze_result_t result = ZE_RESULT_SUCCESS; + + dditable.pfnCreateExt = pDdiTable->pfnCreateExt; + pDdiTable->pfnCreateExt = tracing_layer::zeRTASBuilderCreateExt; + + dditable.pfnGetBuildPropertiesExt = pDdiTable->pfnGetBuildPropertiesExt; + pDdiTable->pfnGetBuildPropertiesExt = tracing_layer::zeRTASBuilderGetBuildPropertiesExt; + + dditable.pfnBuildExt = pDdiTable->pfnBuildExt; + pDdiTable->pfnBuildExt = tracing_layer::zeRTASBuilderBuildExt; + + dditable.pfnCommandListAppendCopyExt = pDdiTable->pfnCommandListAppendCopyExt; + pDdiTable->pfnCommandListAppendCopyExt = tracing_layer::zeRTASBuilderCommandListAppendCopyExt; + + dditable.pfnDestroyExt = pDdiTable->pfnDestroyExt; + pDdiTable->pfnDestroyExt = tracing_layer::zeRTASBuilderDestroyExt; + + return result; +} + /////////////////////////////////////////////////////////////////////////////// /// @brief Exported function for filling application's RTASBuilderExp table /// with current process' addresses @@ -7806,6 +8294,46 @@ zeGetRTASBuilderExpProcAddrTable( return result; } +/////////////////////////////////////////////////////////////////////////////// +/// @brief Exported function for filling application's RTASParallelOperation 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 +zeGetRTASParallelOperationProcAddrTable( + ze_api_version_t version, ///< [in] API version requested + ze_rtas_parallel_operation_dditable_t* pDdiTable///< [in,out] pointer to table of DDI function pointers + ) +{ + auto& dditable = tracing_layer::context.zeDdiTable.RTASParallelOperation; + + if( nullptr == pDdiTable ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + if (ZE_MAJOR_VERSION(tracing_layer::context.version) != ZE_MAJOR_VERSION(version) || + ZE_MINOR_VERSION(tracing_layer::context.version) > ZE_MINOR_VERSION(version)) + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + + ze_result_t result = ZE_RESULT_SUCCESS; + + dditable.pfnCreateExt = pDdiTable->pfnCreateExt; + pDdiTable->pfnCreateExt = tracing_layer::zeRTASParallelOperationCreateExt; + + dditable.pfnGetPropertiesExt = pDdiTable->pfnGetPropertiesExt; + pDdiTable->pfnGetPropertiesExt = tracing_layer::zeRTASParallelOperationGetPropertiesExt; + + dditable.pfnJoinExt = pDdiTable->pfnJoinExt; + pDdiTable->pfnJoinExt = tracing_layer::zeRTASParallelOperationJoinExt; + + dditable.pfnDestroyExt = pDdiTable->pfnDestroyExt; + pDdiTable->pfnDestroyExt = tracing_layer::zeRTASParallelOperationDestroyExt; + + return result; +} + /////////////////////////////////////////////////////////////////////////////// /// @brief Exported function for filling application's RTASParallelOperationExp table /// with current process' addresses @@ -7889,6 +8417,9 @@ zeGetDriverProcAddrTable( dditable.pfnGetExtensionFunctionAddress = pDdiTable->pfnGetExtensionFunctionAddress; pDdiTable->pfnGetExtensionFunctionAddress = tracing_layer::zeDriverGetExtensionFunctionAddress; + dditable.pfnRTASFormatCompatibilityCheckExt = pDdiTable->pfnRTASFormatCompatibilityCheckExt; + pDdiTable->pfnRTASFormatCompatibilityCheckExt = tracing_layer::zeDriverRTASFormatCompatibilityCheckExt; + dditable.pfnGetLastErrorDescription = pDdiTable->pfnGetLastErrorDescription; pDdiTable->pfnGetLastErrorDescription = tracing_layer::zeDriverGetLastErrorDescription; @@ -8002,6 +8533,9 @@ zeGetDeviceProcAddrTable( dditable.pfnReleaseExternalSemaphoreExt = pDdiTable->pfnReleaseExternalSemaphoreExt; pDdiTable->pfnReleaseExternalSemaphoreExt = tracing_layer::zeDeviceReleaseExternalSemaphoreExt; + dditable.pfnGetVectorWidthPropertiesExt = pDdiTable->pfnGetVectorWidthPropertiesExt; + pDdiTable->pfnGetVectorWidthPropertiesExt = tracing_layer::zeDeviceGetVectorWidthPropertiesExt; + dditable.pfnReserveCacheExt = pDdiTable->pfnReserveCacheExt; pDdiTable->pfnReserveCacheExt = tracing_layer::zeDeviceReserveCacheExt; diff --git a/source/layers/validation/checkers/parameter_validation/extension_validation.inl b/source/layers/validation/checkers/parameter_validation/extension_validation.inl index c7de1238..951617a8 100644 --- a/source/layers/validation/checkers/parameter_validation/extension_validation.inl +++ b/source/layers/validation/checkers/parameter_validation/extension_validation.inl @@ -146,7 +146,7 @@ inline ze_result_t ParameterValidation::validateExtensions(const ze_device_cache } std::vector baseTypes = {ZE_STRUCTURE_TYPE_DEVICE_CACHE_PROPERTIES}; - std::vector types = {ZE_STRUCTURE_TYPE_CACHE_RESERVATION_EXT_DESC}; + std::vector types = {ZE_STRUCTURE_TYPE_CACHE_RESERVATION_EXT_DESC,ZE_STRUCTURE_TYPE_DEVICE_CACHELINE_SIZE_EXT}; return validateStructureTypes(descriptor, baseTypes, types); } 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 d51c6b3f..44687fd9 100644 --- a/source/layers/validation/checkers/parameter_validation/ze_parameter_validation.cpp +++ b/source/layers/validation/checkers/parameter_validation/ze_parameter_validation.cpp @@ -2497,10 +2497,14 @@ namespace validation_layer 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. + ///< 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. ) { if( nullptr == hKernel ) @@ -3171,6 +3175,248 @@ namespace validation_layer } + 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 + ) + { + if( nullptr == hDriver ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + if( nullptr == pDescriptor ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + if( nullptr == phBuilder ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + if( ZE_RTAS_BUILDER_EXT_VERSION_CURRENT < pDescriptor->builderVersion ) + return ZE_RESULT_ERROR_INVALID_ENUMERATION; + + return ParameterValidation::validateExtensions(pDescriptor); + } + + + 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 + ) + { + if( nullptr == hBuilder ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + if( nullptr == pBuildOpDescriptor ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + if( nullptr == pProperties ) + 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; + + auto retVal = ZE_RESULT_SUCCESS; + retVal = ParameterValidation::validateExtensions(pBuildOpDescriptor); + if(retVal) + return retVal; + retVal = ParameterValidation::validateExtensions(pProperties); + return retVal; + } + + + 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 + ) + { + if( nullptr == hDriver ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + if( ZE_RTAS_FORMAT_EXT_MAX < rtasFormatA ) + return ZE_RESULT_ERROR_INVALID_ENUMERATION; + + if( ZE_RTAS_FORMAT_EXT_MAX < rtasFormatB ) + return ZE_RESULT_ERROR_INVALID_ENUMERATION; + + return ZE_RESULT_SUCCESS; + } + + + 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 + ) + { + if( nullptr == hBuilder ) + 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 ) + 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); + } + + + ze_result_t + 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::zeDeviceReserveCacheExtPrologue( ze_device_handle_t hDevice, ///< [in] handle of the device object @@ -3723,7 +3969,7 @@ namespace validation_layer if( nullptr == pProperties ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if( ZE_RTAS_FORMAT_EXP_INVALID < pBuildOpDescriptor->rtasFormat ) + if( ZE_RTAS_FORMAT_EXP_MAX < pBuildOpDescriptor->rtasFormat ) return ZE_RESULT_ERROR_INVALID_ENUMERATION; if( ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_HIGH < pBuildOpDescriptor->buildQuality ) @@ -3751,10 +3997,10 @@ namespace validation_layer if( nullptr == hDriver ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - if( ZE_RTAS_FORMAT_EXP_INVALID < rtasFormatA ) + if( ZE_RTAS_FORMAT_EXP_MAX < rtasFormatA ) return ZE_RESULT_ERROR_INVALID_ENUMERATION; - if( ZE_RTAS_FORMAT_EXP_INVALID < rtasFormatB ) + if( ZE_RTAS_FORMAT_EXP_MAX < rtasFormatB ) return ZE_RESULT_ERROR_INVALID_ENUMERATION; return ZE_RESULT_SUCCESS; @@ -3790,7 +4036,7 @@ namespace validation_layer if( nullptr == pRtasBuffer ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if( ZE_RTAS_FORMAT_EXP_INVALID < pBuildOpDescriptor->rtasFormat ) + if( ZE_RTAS_FORMAT_EXP_MAX < pBuildOpDescriptor->rtasFormat ) return ZE_RESULT_ERROR_INVALID_ENUMERATION; if( ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_HIGH < pBuildOpDescriptor->buildQuality ) 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 a22a25ff..eb6a4069 100644 --- a/source/layers/validation/checkers/parameter_validation/ze_parameter_validation.h +++ b/source/layers/validation/checkers/parameter_validation/ze_parameter_validation.h @@ -171,6 +171,17 @@ namespace validation_layer 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 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; 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 2f5468d1..c8a3bda3 100644 --- a/source/layers/validation/checkers/parameter_validation/zet_parameter_validation.cpp +++ b/source/layers/validation/checkers/parameter_validation/zet_parameter_validation.cpp @@ -259,8 +259,8 @@ namespace validation_layer ///< than the `count` member of ::zet_debug_regset_properties_t for the ///< type uint32_t count, ///< [in] the number of registers to read; start+count must be less than or - ///< equal to the `count` member of ::zet_debug_register_group_properties_t - ///< for the type + ///< equal to the `count` member of ::zet_debug_regset_properties_t for the + ///< type void* pRegisterValues ///< [in,out][optional][range(0, count)] buffer of register values ) { @@ -280,8 +280,8 @@ namespace validation_layer ///< than the `count` member of ::zet_debug_regset_properties_t for the ///< type uint32_t count, ///< [in] the number of registers to write; start+count must be less than - ///< or equal to the `count` member of - ///< ::zet_debug_register_group_properties_t for the type + ///< or equal to the `count` member of ::zet_debug_regset_properties_t for + ///< the type void* pRegisterValues ///< [in,out][optional][range(0, count)] buffer of register values ) { @@ -1014,6 +1014,49 @@ namespace validation_layer } + 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 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 4a2d24bc..eb141301 100644 --- a/source/layers/validation/checkers/parameter_validation/zet_parameter_validation.h +++ b/source/layers/validation/checkers/parameter_validation/zet_parameter_validation.h @@ -69,6 +69,9 @@ namespace validation_layer 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; diff --git a/source/layers/validation/common/ze_entry_points.h b/source/layers/validation/common/ze_entry_points.h index c96c1ec5..971500c9 100644 --- a/source/layers/validation/common/ze_entry_points.h +++ b/source/layers/validation/common/ze_entry_points.h @@ -319,6 +319,28 @@ class ZEValidationEntryPoints { 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 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;} diff --git a/source/layers/validation/common/zet_entry_points.h b/source/layers/validation/common/zet_entry_points.h index e5c541af..d52be228 100644 --- a/source/layers/validation/common/zet_entry_points.h +++ b/source/layers/validation/common/zet_entry_points.h @@ -115,6 +115,12 @@ class ZETValidationEntryPoints { 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;} 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 b892b6c0..fe36fcb3 100644 --- a/source/layers/validation/handle_lifetime_tracking/ze_handle_lifetime.cpp +++ b/source/layers/validation/handle_lifetime_tracking/ze_handle_lifetime.cpp @@ -2032,10 +2032,14 @@ namespace validation_layer 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. + ///< 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. ) { @@ -2606,6 +2610,180 @@ namespace validation_layer 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 + ) + { + + if ( !context.handleLifetime->isHandleValid( hDriver )){ + 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 + ) + { + + if ( !context.handleLifetime->isHandleValid( hBuilder )){ + 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 + ) + { + + if ( !context.handleLifetime->isHandleValid( hDriver )){ + 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 + ) + { + + if ( !context.handleLifetime->isHandleValid( hBuilder )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + if (hParallelOperation && !context.handleLifetime->isHandleValid( hParallelOperation )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + return ZE_RESULT_SUCCESS; + } + ze_result_t + 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( 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::zeRTASBuilderDestroyExtPrologue( + ze_rtas_builder_ext_handle_t hBuilder ///< [in][release] handle of builder object to destroy + ) + { + + if ( !context.handleLifetime->isHandleValid( hBuilder )){ + 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 + ) + { + + if ( !context.handleLifetime->isHandleValid( hDriver )){ + 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 + ) + { + + if ( !context.handleLifetime->isHandleValid( hParallelOperation )){ + 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 + ) + { + + if ( !context.handleLifetime->isHandleValid( hParallelOperation )){ + 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::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 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 5b598b0d..66bf76cc 100644 --- a/source/layers/validation/handle_lifetime_tracking/ze_handle_lifetime.h +++ b/source/layers/validation/handle_lifetime_tracking/ze_handle_lifetime.h @@ -167,6 +167,17 @@ namespace validation_layer 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 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; 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 bf4b9837..d9c92c00 100644 --- a/source/layers/validation/handle_lifetime_tracking/zet_handle_lifetime.cpp +++ b/source/layers/validation/handle_lifetime_tracking/zet_handle_lifetime.cpp @@ -201,8 +201,8 @@ namespace validation_layer ///< than the `count` member of ::zet_debug_regset_properties_t for the ///< type uint32_t count, ///< [in] the number of registers to read; start+count must be less than or - ///< equal to the `count` member of ::zet_debug_register_group_properties_t - ///< for the type + ///< equal to the `count` member of ::zet_debug_regset_properties_t for the + ///< type void* pRegisterValues ///< [in,out][optional][range(0, count)] buffer of register values ) { @@ -221,8 +221,8 @@ namespace validation_layer ///< than the `count` member of ::zet_debug_regset_properties_t for the ///< type uint32_t count, ///< [in] the number of registers to write; start+count must be less than - ///< or equal to the `count` member of - ///< ::zet_debug_register_group_properties_t for the type + ///< or equal to the `count` member of ::zet_debug_regset_properties_t for + ///< the type void* pRegisterValues ///< [in,out][optional][range(0, count)] buffer of register values ) { @@ -869,6 +869,49 @@ namespace validation_layer 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 + ) + { + + 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 )){ + 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. + ) + { + + if ( !context.handleLifetime->isHandleValid( hDevice )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + 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 + ) + { + + if ( !context.handleLifetime->isHandleValid( hDevice )){ + 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 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 bb3b6ea3..8729e8dc 100644 --- a/source/layers/validation/handle_lifetime_tracking/zet_handle_lifetime.h +++ b/source/layers/validation/handle_lifetime_tracking/zet_handle_lifetime.h @@ -68,6 +68,9 @@ namespace validation_layer 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; diff --git a/source/layers/validation/ze_valddi.cpp b/source/layers/validation/ze_valddi.cpp index 2a618cb8..e779acf6 100644 --- a/source/layers/validation/ze_valddi.cpp +++ b/source/layers/validation/ze_valddi.cpp @@ -5589,10 +5589,14 @@ namespace validation_layer 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. + ///< 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("zeKernelGetSourceAttributes(hKernel, pSize, pString)"); @@ -6911,6 +6915,514 @@ namespace validation_layer return logAndPropagateResult("zeCommandListAppendWaitExternalSemaphoreExt", driver_result); } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASBuilderCreateExt + __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 + ) + { + context.logger->log_trace("zeRTASBuilderCreateExt(hDriver, pDescriptor, phBuilder)"); + + auto pfnCreateExt = context.zeDdiTable.RTASBuilder.pfnCreateExt; + + if( nullptr == pfnCreateExt ) + return logAndPropagateResult("zeRTASBuilderCreateExt", ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); + + 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); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zeHandleLifetime.zeRTASBuilderCreateExtPrologue( hDriver, pDescriptor, phBuilder ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult("zeRTASBuilderCreateExt", result); + } + + auto driver_result = pfnCreateExt( hDriver, pDescriptor, phBuilder ); + + 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); + } + + + if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ + + if (phBuilder){ + context.handleLifetime->addHandle( *phBuilder ); + context.handleLifetime->addDependent( hDriver, *phBuilder ); + + } + } + return logAndPropagateResult("zeRTASBuilderCreateExt", driver_result); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASBuilderGetBuildPropertiesExt + __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 + ) + { + context.logger->log_trace("zeRTASBuilderGetBuildPropertiesExt(hBuilder, pBuildOpDescriptor, pProperties)"); + + auto pfnGetBuildPropertiesExt = context.zeDdiTable.RTASBuilder.pfnGetBuildPropertiesExt; + + if( nullptr == pfnGetBuildPropertiesExt ) + return logAndPropagateResult("zeRTASBuilderGetBuildPropertiesExt", ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); + + 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); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zeHandleLifetime.zeRTASBuilderGetBuildPropertiesExtPrologue( hBuilder, pBuildOpDescriptor, pProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult("zeRTASBuilderGetBuildPropertiesExt", result); + } + + auto driver_result = pfnGetBuildPropertiesExt( hBuilder, pBuildOpDescriptor, pProperties ); + + 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); + } + + return logAndPropagateResult("zeRTASBuilderGetBuildPropertiesExt", driver_result); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @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("zeDriverRTASFormatCompatibilityCheckExt(hDriver, rtasFormatA, rtasFormatB)"); + + auto pfnRTASFormatCompatibilityCheckExt = context.zeDdiTable.Driver.pfnRTASFormatCompatibilityCheckExt; + + if( nullptr == pfnRTASFormatCompatibilityCheckExt ) + return logAndPropagateResult("zeDriverRTASFormatCompatibilityCheckExt", ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); + + 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); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zeHandleLifetime.zeDriverRTASFormatCompatibilityCheckExtPrologue( hDriver, rtasFormatA, rtasFormatB ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult("zeDriverRTASFormatCompatibilityCheckExt", result); + } + + auto driver_result = pfnRTASFormatCompatibilityCheckExt( hDriver, rtasFormatA, rtasFormatB ); + + 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); + } + + return logAndPropagateResult("zeDriverRTASFormatCompatibilityCheckExt", driver_result); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASBuilderBuildExt + __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 + ) + { + context.logger->log_trace("zeRTASBuilderBuildExt(hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes)"); + + auto pfnBuildExt = context.zeDdiTable.RTASBuilder.pfnBuildExt; + + if( nullptr == pfnBuildExt ) + return logAndPropagateResult("zeRTASBuilderBuildExt", ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); + + 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); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + 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); + } + + 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->zeRTASBuilderBuildExtEpilogue( hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult("zeRTASBuilderBuildExt", result); + } + + return logAndPropagateResult("zeRTASBuilderBuildExt", driver_result); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASBuilderCommandListAppendCopyExt + __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 + ) + { + context.logger->log_trace("zeRTASBuilderCommandListAppendCopyExt(hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); + + auto pfnCommandListAppendCopyExt = context.zeDdiTable.RTASBuilder.pfnCommandListAppendCopyExt; + + if( nullptr == pfnCommandListAppendCopyExt ) + return logAndPropagateResult("zeRTASBuilderCommandListAppendCopyExt", ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); + + 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); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + 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); + } + + 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); + } + + return logAndPropagateResult("zeRTASBuilderCommandListAppendCopyExt", driver_result); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASBuilderDestroyExt + __zedlllocal ze_result_t ZE_APICALL + zeRTASBuilderDestroyExt( + ze_rtas_builder_ext_handle_t hBuilder ///< [in][release] handle of builder object to destroy + ) + { + context.logger->log_trace("zeRTASBuilderDestroyExt(hBuilder)"); + + auto pfnDestroyExt = context.zeDdiTable.RTASBuilder.pfnDestroyExt; + + if( nullptr == pfnDestroyExt ) + return logAndPropagateResult("zeRTASBuilderDestroyExt", ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); + + 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); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zeHandleLifetime.zeRTASBuilderDestroyExtPrologue( hBuilder ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult("zeRTASBuilderDestroyExt", result); + } + + auto driver_result = pfnDestroyExt( hBuilder ); + + 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); + } + + return logAndPropagateResult("zeRTASBuilderDestroyExt", driver_result); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @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 + ) + { + context.logger->log_trace("zeRTASParallelOperationCreateExt(hDriver, phParallelOperation)"); + + auto pfnCreateExt = context.zeDdiTable.RTASParallelOperation.pfnCreateExt; + + if( nullptr == pfnCreateExt ) + return logAndPropagateResult("zeRTASParallelOperationCreateExt", ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); + + 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); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zeHandleLifetime.zeRTASParallelOperationCreateExtPrologue( hDriver, phParallelOperation ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult("zeRTASParallelOperationCreateExt", result); + } + + auto driver_result = pfnCreateExt( hDriver, phParallelOperation ); + + 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); + } + + + if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ + + if (phParallelOperation){ + context.handleLifetime->addHandle( *phParallelOperation ); + context.handleLifetime->addDependent( hDriver, *phParallelOperation ); + + } + } + return logAndPropagateResult("zeRTASParallelOperationCreateExt", driver_result); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @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("zeRTASParallelOperationGetPropertiesExt(hParallelOperation, pProperties)"); + + auto pfnGetPropertiesExt = context.zeDdiTable.RTASParallelOperation.pfnGetPropertiesExt; + + if( nullptr == pfnGetPropertiesExt ) + return logAndPropagateResult("zeRTASParallelOperationGetPropertiesExt", ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); + + 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); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zeHandleLifetime.zeRTASParallelOperationGetPropertiesExtPrologue( hParallelOperation, pProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult("zeRTASParallelOperationGetPropertiesExt", result); + } + + auto driver_result = pfnGetPropertiesExt( hParallelOperation, pProperties ); + + 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); + } + + return logAndPropagateResult("zeRTASParallelOperationGetPropertiesExt", driver_result); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASParallelOperationJoinExt + __zedlllocal ze_result_t ZE_APICALL + zeRTASParallelOperationJoinExt( + ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in] handle of parallel operation object + ) + { + context.logger->log_trace("zeRTASParallelOperationJoinExt(hParallelOperation)"); + + auto pfnJoinExt = context.zeDdiTable.RTASParallelOperation.pfnJoinExt; + + if( nullptr == pfnJoinExt ) + return logAndPropagateResult("zeRTASParallelOperationJoinExt", ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); + + 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); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zeHandleLifetime.zeRTASParallelOperationJoinExtPrologue( hParallelOperation ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult("zeRTASParallelOperationJoinExt", result); + } + + auto driver_result = pfnJoinExt( hParallelOperation ); + + 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); + } + + return logAndPropagateResult("zeRTASParallelOperationJoinExt", driver_result); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASParallelOperationDestroyExt + __zedlllocal ze_result_t ZE_APICALL + zeRTASParallelOperationDestroyExt( + ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in][release] handle of parallel operation object to destroy + ) + { + context.logger->log_trace("zeRTASParallelOperationDestroyExt(hParallelOperation)"); + + auto pfnDestroyExt = context.zeDdiTable.RTASParallelOperation.pfnDestroyExt; + + if( nullptr == pfnDestroyExt ) + return logAndPropagateResult("zeRTASParallelOperationDestroyExt", ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); + + 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); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zeHandleLifetime.zeRTASParallelOperationDestroyExtPrologue( hParallelOperation ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult("zeRTASParallelOperationDestroyExt", result); + } + + auto driver_result = pfnDestroyExt( hParallelOperation ); + + 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); + } + + return logAndPropagateResult("zeRTASParallelOperationDestroyExt", driver_result); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeDeviceGetVectorWidthPropertiesExt + __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. + ) + { + context.logger->log_trace("zeDeviceGetVectorWidthPropertiesExt(hDevice, pCount, pVectorWidthProperties)"); + + auto pfnGetVectorWidthPropertiesExt = context.zeDdiTable.Device.pfnGetVectorWidthPropertiesExt; + + if( nullptr == pfnGetVectorWidthPropertiesExt ) + return logAndPropagateResult("zeDeviceGetVectorWidthPropertiesExt", ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); + + 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); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zeHandleLifetime.zeDeviceGetVectorWidthPropertiesExtPrologue( hDevice, pCount, pVectorWidthProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult("zeDeviceGetVectorWidthPropertiesExt", result); + } + + auto driver_result = pfnGetVectorWidthPropertiesExt( hDevice, pCount, pVectorWidthProperties ); + + 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); + } + + return logAndPropagateResult("zeDeviceGetVectorWidthPropertiesExt", driver_result); + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zeDeviceReserveCacheExt __zedlllocal ze_result_t ZE_APICALL @@ -8940,6 +9452,49 @@ zeGetGlobalProcAddrTable( return result; } +/////////////////////////////////////////////////////////////////////////////// +/// @brief Exported function for filling application's RTASBuilder 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 +zeGetRTASBuilderProcAddrTable( + ze_api_version_t version, ///< [in] API version requested + ze_rtas_builder_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers + ) +{ + auto& dditable = validation_layer::context.zeDdiTable.RTASBuilder; + + if( nullptr == pDdiTable ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || + ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + + ze_result_t result = ZE_RESULT_SUCCESS; + + dditable.pfnCreateExt = pDdiTable->pfnCreateExt; + pDdiTable->pfnCreateExt = validation_layer::zeRTASBuilderCreateExt; + + dditable.pfnGetBuildPropertiesExt = pDdiTable->pfnGetBuildPropertiesExt; + pDdiTable->pfnGetBuildPropertiesExt = validation_layer::zeRTASBuilderGetBuildPropertiesExt; + + dditable.pfnBuildExt = pDdiTable->pfnBuildExt; + pDdiTable->pfnBuildExt = validation_layer::zeRTASBuilderBuildExt; + + dditable.pfnCommandListAppendCopyExt = pDdiTable->pfnCommandListAppendCopyExt; + pDdiTable->pfnCommandListAppendCopyExt = validation_layer::zeRTASBuilderCommandListAppendCopyExt; + + dditable.pfnDestroyExt = pDdiTable->pfnDestroyExt; + pDdiTable->pfnDestroyExt = validation_layer::zeRTASBuilderDestroyExt; + + return result; +} + /////////////////////////////////////////////////////////////////////////////// /// @brief Exported function for filling application's RTASBuilderExp table /// with current process' addresses @@ -8980,6 +9535,46 @@ zeGetRTASBuilderExpProcAddrTable( return result; } +/////////////////////////////////////////////////////////////////////////////// +/// @brief Exported function for filling application's RTASParallelOperation 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 +zeGetRTASParallelOperationProcAddrTable( + ze_api_version_t version, ///< [in] API version requested + ze_rtas_parallel_operation_dditable_t* pDdiTable///< [in,out] pointer to table of DDI function pointers + ) +{ + auto& dditable = validation_layer::context.zeDdiTable.RTASParallelOperation; + + if( nullptr == pDdiTable ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || + ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + + ze_result_t result = ZE_RESULT_SUCCESS; + + dditable.pfnCreateExt = pDdiTable->pfnCreateExt; + pDdiTable->pfnCreateExt = validation_layer::zeRTASParallelOperationCreateExt; + + dditable.pfnGetPropertiesExt = pDdiTable->pfnGetPropertiesExt; + pDdiTable->pfnGetPropertiesExt = validation_layer::zeRTASParallelOperationGetPropertiesExt; + + dditable.pfnJoinExt = pDdiTable->pfnJoinExt; + pDdiTable->pfnJoinExt = validation_layer::zeRTASParallelOperationJoinExt; + + dditable.pfnDestroyExt = pDdiTable->pfnDestroyExt; + pDdiTable->pfnDestroyExt = validation_layer::zeRTASParallelOperationDestroyExt; + + return result; +} + /////////////////////////////////////////////////////////////////////////////// /// @brief Exported function for filling application's RTASParallelOperationExp table /// with current process' addresses @@ -9063,6 +9658,9 @@ zeGetDriverProcAddrTable( dditable.pfnGetExtensionFunctionAddress = pDdiTable->pfnGetExtensionFunctionAddress; pDdiTable->pfnGetExtensionFunctionAddress = validation_layer::zeDriverGetExtensionFunctionAddress; + dditable.pfnRTASFormatCompatibilityCheckExt = pDdiTable->pfnRTASFormatCompatibilityCheckExt; + pDdiTable->pfnRTASFormatCompatibilityCheckExt = validation_layer::zeDriverRTASFormatCompatibilityCheckExt; + dditable.pfnGetLastErrorDescription = pDdiTable->pfnGetLastErrorDescription; pDdiTable->pfnGetLastErrorDescription = validation_layer::zeDriverGetLastErrorDescription; @@ -9176,6 +9774,9 @@ zeGetDeviceProcAddrTable( dditable.pfnReleaseExternalSemaphoreExt = pDdiTable->pfnReleaseExternalSemaphoreExt; pDdiTable->pfnReleaseExternalSemaphoreExt = validation_layer::zeDeviceReleaseExternalSemaphoreExt; + dditable.pfnGetVectorWidthPropertiesExt = pDdiTable->pfnGetVectorWidthPropertiesExt; + pDdiTable->pfnGetVectorWidthPropertiesExt = validation_layer::zeDeviceGetVectorWidthPropertiesExt; + dditable.pfnReserveCacheExt = pDdiTable->pfnReserveCacheExt; pDdiTable->pfnReserveCacheExt = validation_layer::zeDeviceReserveCacheExt; diff --git a/source/layers/validation/zet_valddi.cpp b/source/layers/validation/zet_valddi.cpp index 0791d400..661037ae 100644 --- a/source/layers/validation/zet_valddi.cpp +++ b/source/layers/validation/zet_valddi.cpp @@ -569,8 +569,8 @@ namespace validation_layer ///< than the `count` member of ::zet_debug_regset_properties_t for the ///< type uint32_t count, ///< [in] the number of registers to read; start+count must be less than or - ///< equal to the `count` member of ::zet_debug_register_group_properties_t - ///< for the type + ///< equal to the `count` member of ::zet_debug_regset_properties_t for the + ///< type void* pRegisterValues ///< [in,out][optional][range(0, count)] buffer of register values ) { @@ -619,8 +619,8 @@ namespace validation_layer ///< than the `count` member of ::zet_debug_regset_properties_t for the ///< type uint32_t count, ///< [in] the number of registers to write; start+count must be less than - ///< or equal to the `count` member of - ///< ::zet_debug_register_group_properties_t for the type + ///< or equal to the `count` member of ::zet_debug_regset_properties_t for + ///< the type void* pRegisterValues ///< [in,out][optional][range(0, count)] buffer of register values ) { @@ -2342,6 +2342,133 @@ namespace validation_layer return logAndPropagateResult("zetMetricTracerDecodeExp", driver_result); } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetCommandListAppendMarkerExp + __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 + ) + { + context.logger->log_trace("zetCommandListAppendMarkerExp(hCommandList, hMetricGroup, value)"); + + auto pfnAppendMarkerExp = context.zetDdiTable.CommandListExp.pfnAppendMarkerExp; + + if( nullptr == pfnAppendMarkerExp ) + return logAndPropagateResult("zetCommandListAppendMarkerExp", ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); + + 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); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zetHandleLifetime.zetCommandListAppendMarkerExpPrologue( hCommandList, hMetricGroup, value ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult("zetCommandListAppendMarkerExp", result); + } + + auto driver_result = pfnAppendMarkerExp( hCommandList, hMetricGroup, value ); + + 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); + } + + return logAndPropagateResult("zetCommandListAppendMarkerExp", driver_result); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetDeviceEnableMetricsExp + __zedlllocal ze_result_t ZE_APICALL + zetDeviceEnableMetricsExp( + zet_device_handle_t hDevice ///< [in] handle of the device where metrics collection has to be enabled. + ) + { + context.logger->log_trace("zetDeviceEnableMetricsExp(hDevice)"); + + auto pfnEnableMetricsExp = context.zetDdiTable.DeviceExp.pfnEnableMetricsExp; + + if( nullptr == pfnEnableMetricsExp ) + return logAndPropagateResult("zetDeviceEnableMetricsExp", ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); + + 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); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zetHandleLifetime.zetDeviceEnableMetricsExpPrologue( hDevice ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult("zetDeviceEnableMetricsExp", result); + } + + auto driver_result = pfnEnableMetricsExp( hDevice ); + + 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); + } + + return logAndPropagateResult("zetDeviceEnableMetricsExp", driver_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 + ) + { + context.logger->log_trace("zetDeviceDisableMetricsExp(hDevice)"); + + auto pfnDisableMetricsExp = context.zetDdiTable.DeviceExp.pfnDisableMetricsExp; + + if( nullptr == pfnDisableMetricsExp ) + return logAndPropagateResult("zetDeviceDisableMetricsExp", ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); + + 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); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zetHandleLifetime.zetDeviceDisableMetricsExpPrologue( hDevice ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult("zetDeviceDisableMetricsExp", result); + } + + auto driver_result = pfnDisableMetricsExp( hDevice ); + + 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); + } + + return logAndPropagateResult("zetDeviceDisableMetricsExp", driver_result); + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zetMetricGroupCalculateMultipleMetricValuesExp __zedlllocal ze_result_t ZE_APICALL @@ -3449,6 +3576,12 @@ zetGetDeviceExpProcAddrTable( dditable.pfnCreateMetricGroupsFromMetricsExp = pDdiTable->pfnCreateMetricGroupsFromMetricsExp; pDdiTable->pfnCreateMetricGroupsFromMetricsExp = validation_layer::zetDeviceCreateMetricGroupsFromMetricsExp; + dditable.pfnEnableMetricsExp = pDdiTable->pfnEnableMetricsExp; + pDdiTable->pfnEnableMetricsExp = validation_layer::zetDeviceEnableMetricsExp; + + dditable.pfnDisableMetricsExp = pDdiTable->pfnDisableMetricsExp; + pDdiTable->pfnDisableMetricsExp = validation_layer::zetDeviceDisableMetricsExp; + return result; } @@ -3523,6 +3656,37 @@ zetGetCommandListProcAddrTable( return result; } +/////////////////////////////////////////////////////////////////////////////// +/// @brief Exported function for filling application's CommandListExp 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 +zetGetCommandListExpProcAddrTable( + ze_api_version_t version, ///< [in] API version requested + zet_command_list_exp_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers + ) +{ + auto& dditable = validation_layer::context.zetDdiTable.CommandListExp; + + if( nullptr == pDdiTable ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || + ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + + ze_result_t result = ZE_RESULT_SUCCESS; + + dditable.pfnAppendMarkerExp = pDdiTable->pfnAppendMarkerExp; + pDdiTable->pfnAppendMarkerExp = validation_layer::zetCommandListAppendMarkerExp; + + return result; +} + /////////////////////////////////////////////////////////////////////////////// /// @brief Exported function for filling application's Kernel table /// with current process' addresses diff --git a/source/lib/ze_libapi.cpp b/source/lib/ze_libapi.cpp index c2aaf622..d6a2f55f 100644 --- a/source/lib/ze_libapi.cpp +++ b/source/lib/ze_libapi.cpp @@ -6234,8 +6234,11 @@ zeMemAllocHost( /// @details /// - The application must ensure the device is not currently referencing /// the memory before it is freed -/// - The implementation of this function may immediately free all Host and -/// Device allocations associated with this memory +/// - 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. @@ -6794,7 +6797,7 @@ zeMemCloseIpcHandle( /// 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_INVALID_ARGUMENT is returned. +/// ::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 @@ -8089,10 +8092,14 @@ zeKernelGetSourceAttributes( 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. + ///< 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 DYNAMIC_LOAD_LOADER @@ -9987,15 +9994,12 @@ zeCommandListAppendWaitExternalSemaphoreExt( } /////////////////////////////////////////////////////////////////////////////// -/// @brief Reserve Cache on Device +/// @brief Creates a ray tracing acceleration structure builder object /// /// @details -/// - The application may call this function but may not be successful as -/// some other application may have reserve prior -/// -/// @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_extension_rtas extension. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -10004,15 +10008,17 @@ zeCommandListAppendWaitExternalSemaphoreExt( /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hDevice` +/// + `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_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 +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 DYNAMIC_LOAD_LOADER @@ -10020,40 +10026,40 @@ 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_pfnRTASBuilderCreateExt_t pfnCreateExt = [&result] { + auto pfnCreateExt = ze_lib::context->zeDdiTable.load()->RTASBuilder.pfnCreateExt; + if( nullptr == pfnCreateExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnReserveCacheExt; + return pfnCreateExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnReserveCacheExt( hDevice, cacheLevel, cacheReservationSize ); + return pfnCreateExt( hDriver, pDescriptor, phBuilder ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnReserveCacheExt = ze_lib::context->zeDdiTable.load()->Device.pfnReserveCacheExt; - if( nullptr == pfnReserveCacheExt ) { + 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 pfnReserveCacheExt( hDevice, cacheLevel, cacheReservationSize ); + return pfnCreateExt( hDriver, pDescriptor, phBuilder ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Assign VA section to use reserved section +/// @brief Retrieves ray tracing acceleration structure builder properties /// /// @details -/// - The application may call this function to assign VA to particular -/// reservartion region +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -10062,17 +10068,19 @@ zeDeviceReserveCacheExt( /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hDevice` +/// + `nullptr == hBuilder` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == ptr` +/// + `nullptr == pBuildOpDescriptor` +/// + `nullptr == pProperties` /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `::ZE_CACHE_EXT_REGION_NON_RESERVED < cacheRegion` +/// + `::ZE_RTAS_FORMAT_EXT_MAX < pBuildOpDescriptor->rtasFormat` +/// + `::ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXT_HIGH < pBuildOpDescriptor->buildQuality` +/// + `0x3 < pBuildOpDescriptor->buildFlags` 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 +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 DYNAMIC_LOAD_LOADER @@ -10080,52 +10088,40 @@ 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_pfnRTASBuilderGetBuildPropertiesExt_t pfnGetBuildPropertiesExt = [&result] { + auto pfnGetBuildPropertiesExt = ze_lib::context->zeDdiTable.load()->RTASBuilder.pfnGetBuildPropertiesExt; + if( nullptr == pfnGetBuildPropertiesExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnSetCacheAdviceExt; + return pfnGetBuildPropertiesExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnSetCacheAdviceExt( hDevice, ptr, regionSize, cacheRegion ); + return pfnGetBuildPropertiesExt( hBuilder, pBuildOpDescriptor, pProperties ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnSetCacheAdviceExt = ze_lib::context->zeDdiTable.load()->Device.pfnSetCacheAdviceExt; - if( nullptr == pfnSetCacheAdviceExt ) { + 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 pfnSetCacheAdviceExt( hDevice, ptr, regionSize, cacheRegion ); + return pfnGetBuildPropertiesExt( hBuilder, pBuildOpDescriptor, pProperties ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Query event timestamps for a device or sub-device. +/// @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. -/// - The implementation must support -/// ::ZE_experimental_event_query_timestamps. -/// - 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 @@ -10134,22 +10130,19 @@ zeDeviceSetCacheAdviceExt( /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hEvent` -/// + `nullptr == hDevice` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pCount` +/// + `nullptr == hDriver` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `::ZE_RTAS_FORMAT_EXT_MAX < rtasFormatA` +/// + `::ZE_RTAS_FORMAT_EXT_MAX < rtasFormatB` +/// - ::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 -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. +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 DYNAMIC_LOAD_LOADER @@ -10157,46 +10150,83 @@ 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_pfnDriverRTASFormatCompatibilityCheckExt_t pfnRTASFormatCompatibilityCheckExt = [&result] { + auto pfnRTASFormatCompatibilityCheckExt = ze_lib::context->zeDdiTable.load()->Driver.pfnRTASFormatCompatibilityCheckExt; + if( nullptr == pfnRTASFormatCompatibilityCheckExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnQueryTimestampsExp; + return pfnRTASFormatCompatibilityCheckExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnQueryTimestampsExp( hEvent, hDevice, pCount, pTimestamps ); + return pfnRTASFormatCompatibilityCheckExt( hDriver, rtasFormatA, rtasFormatB ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnQueryTimestampsExp = ze_lib::context->zeDdiTable.load()->EventExp.pfnQueryTimestampsExp; - if( nullptr == pfnQueryTimestampsExp ) { + 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 pfnQueryTimestampsExp( hEvent, hDevice, pCount, pTimestamps ); + return pfnRTASFormatCompatibilityCheckExt( hDriver, rtasFormatA, rtasFormatB ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Query image memory properties. +/// @brief Build ray tracing acceleration structure /// /// @details -/// - The application may call this function from simultaneous threads. -/// - The implementation of this function must be thread-safe. -/// - The implementation must support -/// ::ZE_experimental_image_memory_properties extension. -/// -/// @remarks -/// _Analogues_ -/// - None +/// - 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 @@ -10205,13 +10235,36 @@ zeEventQueryTimestampsExp( /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hImage` +/// + `nullptr == hBuilder` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pMemoryProperties` +/// + `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_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 -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. +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 DYNAMIC_LOAD_LOADER @@ -10219,53 +10272,55 @@ 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_pfnRTASBuilderBuildExt_t pfnBuildExt = [&result] { + auto pfnBuildExt = ze_lib::context->zeDdiTable.load()->RTASBuilder.pfnBuildExt; + if( nullptr == pfnBuildExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetMemoryPropertiesExp; + return pfnBuildExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnGetMemoryPropertiesExp( hImage, pMemoryProperties ); + return pfnBuildExt( hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetMemoryPropertiesExp = ze_lib::context->zeDdiTable.load()->ImageExp.pfnGetMemoryPropertiesExp; - if( nullptr == pfnGetMemoryPropertiesExp ) { + 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 pfnGetMemoryPropertiesExp( hImage, pMemoryProperties ); + return pfnBuildExt( hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Create image view on the context. +/// @brief Copies a ray tracing acceleration structure (RTAS) from host to device +/// memory. /// /// @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_extension_image_view 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 +/// - 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 @@ -10274,23 +10329,26 @@ zeImageGetMemoryPropertiesExp( /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY /// - ::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_IMAGE_FORMAT +/// + `nullptr == dstptr` +/// + `nullptr == srcptr` +/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT +/// - ::ZE_RESULT_ERROR_INVALID_SIZE +/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` 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 +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 DYNAMIC_LOAD_LOADER @@ -10298,49 +10356,749 @@ 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_pfnRTASBuilderCommandListAppendCopyExt_t pfnCommandListAppendCopyExt = [&result] { + auto pfnCommandListAppendCopyExt = ze_lib::context->zeDdiTable.load()->RTASBuilder.pfnCommandListAppendCopyExt; + if( nullptr == pfnCommandListAppendCopyExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnViewCreateExt; + return pfnCommandListAppendCopyExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnViewCreateExt( hContext, hDevice, desc, hImage, phImageView ); + return pfnCommandListAppendCopyExt( hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnViewCreateExt = ze_lib::context->zeDdiTable.load()->Image.pfnViewCreateExt; - if( nullptr == pfnViewCreateExt ) { + 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 pfnViewCreateExt( hContext, hDevice, desc, hImage, phImageView ); + return pfnCommandListAppendCopyExt( hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Create image view on the context. +/// @brief Destroys a ray tracing acceleration structure builder object /// /// @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 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 implementation must support ::ZE_experimental_image_view -/// 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. +/// +/// @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_NULL_HANDLE +/// + `nullptr == hBuilder` +/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE +ze_result_t ZE_APICALL +zeRTASBuilderDestroyExt( + ze_rtas_builder_ext_handle_t hBuilder ///< [in][release] handle of builder object to destroy + ) +{ + #ifdef DYNAMIC_LOAD_LOADER + ze_result_t result = ZE_RESULT_SUCCESS; + 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 ) { + result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnDestroyExt; + }(); + if (result != ZE_RESULT_SUCCESS) { + return result; + } + return pfnDestroyExt( hBuilder ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + 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 pfnDestroyExt( hBuilder ); + #endif +} + +/////////////////////////////////////////////////////////////////////////////// +/// @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_extension_rtas 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_NULL_HANDLE +/// + `nullptr == hDriver` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == phParallelOperation` +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 + ) +{ + #ifdef DYNAMIC_LOAD_LOADER + ze_result_t result = ZE_RESULT_SUCCESS; + 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 ) { + result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnCreateExt; + }(); + if (result != ZE_RESULT_SUCCESS) { + return result; + } + return pfnCreateExt( hDriver, phParallelOperation ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + 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 pfnCreateExt( hDriver, phParallelOperation ); + #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. +/// +/// @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_NULL_HANDLE +/// + `nullptr == hParallelOperation` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pProperties` +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 + ) +{ + #ifdef DYNAMIC_LOAD_LOADER + ze_result_t result = ZE_RESULT_SUCCESS; + 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 ) { + result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnGetPropertiesExt; + }(); + if (result != ZE_RESULT_SUCCESS) { + return result; + } + return pfnGetPropertiesExt( hParallelOperation, pProperties ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + 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 pfnGetPropertiesExt( hParallelOperation, pProperties ); + #endif +} + +/////////////////////////////////////////////////////////////////////////////// +/// @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_NULL_HANDLE +/// + `nullptr == hParallelOperation` +ze_result_t ZE_APICALL +zeRTASParallelOperationJoinExt( + ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in] handle of parallel operation object + ) +{ + #ifdef DYNAMIC_LOAD_LOADER + ze_result_t result = ZE_RESULT_SUCCESS; + 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 ) { + result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnJoinExt; + }(); + if (result != ZE_RESULT_SUCCESS) { + return result; + } + return pfnJoinExt( hParallelOperation ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + 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 pfnJoinExt( hParallelOperation ); + #endif +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Destroys a ray tracing acceleration structure builder parallel +/// operation object +/// +/// @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. +/// +/// @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_NULL_HANDLE +/// + `nullptr == hParallelOperation` +ze_result_t ZE_APICALL +zeRTASParallelOperationDestroyExt( + ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in][release] handle of parallel operation object to destroy + ) +{ + #ifdef DYNAMIC_LOAD_LOADER + ze_result_t result = ZE_RESULT_SUCCESS; + 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 ) { + result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnDestroyExt; + }(); + if (result != ZE_RESULT_SUCCESS) { + return result; + } + return pfnDestroyExt( hParallelOperation ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + 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 pfnDestroyExt( hParallelOperation ); + #endif +} + +/////////////////////////////////////////////////////////////////////////////// +/// @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_NULL_HANDLE +/// + `nullptr == hDevice` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pCount` +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. + ) +{ + #ifdef DYNAMIC_LOAD_LOADER + ze_result_t result = ZE_RESULT_SUCCESS; + 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 ) { + result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnGetVectorWidthPropertiesExt; + }(); + if (result != ZE_RESULT_SUCCESS) { + return result; + } + return pfnGetVectorWidthPropertiesExt( hDevice, pCount, pVectorWidthProperties ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + 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 pfnGetVectorWidthPropertiesExt( hDevice, pCount, pVectorWidthProperties ); + #endif +} + +/////////////////////////////////////////////////////////////////////////////// +/// @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_NULL_HANDLE +/// + `nullptr == hDevice` +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 + ) +{ + #ifdef DYNAMIC_LOAD_LOADER + ze_result_t result = ZE_RESULT_SUCCESS; + 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 ) { + result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnReserveCacheExt; + }(); + if (result != ZE_RESULT_SUCCESS) { + return result; + } + return pfnReserveCacheExt( hDevice, cacheLevel, cacheReservationSize ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + 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 pfnReserveCacheExt( hDevice, cacheLevel, cacheReservationSize ); + #endif +} + +/////////////////////////////////////////////////////////////////////////////// +/// @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_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_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 + ) +{ + #ifdef DYNAMIC_LOAD_LOADER + ze_result_t result = ZE_RESULT_SUCCESS; + 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 ) { + result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnSetCacheAdviceExt; + }(); + if (result != ZE_RESULT_SUCCESS) { + return result; + } + return pfnSetCacheAdviceExt( hDevice, ptr, regionSize, cacheRegion ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + 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 pfnSetCacheAdviceExt( hDevice, ptr, regionSize, cacheRegion ); + #endif +} + +/////////////////////////////////////////////////////////////////////////////// +/// @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_experimental_event_query_timestamps. +/// - 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_NULL_HANDLE +/// + `nullptr == hEvent` +/// + `nullptr == hDevice` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pCount` +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. + ) +{ + #ifdef DYNAMIC_LOAD_LOADER + ze_result_t result = ZE_RESULT_SUCCESS; + 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 ) { + result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnQueryTimestampsExp; + }(); + if (result != ZE_RESULT_SUCCESS) { + return result; + } + return pfnQueryTimestampsExp( hEvent, hDevice, pCount, pTimestamps ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + 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 pfnQueryTimestampsExp( hEvent, hDevice, pCount, pTimestamps ); + #endif +} + +/////////////////////////////////////////////////////////////////////////////// +/// @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_experimental_image_memory_properties 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_NULL_HANDLE +/// + `nullptr == hImage` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pMemoryProperties` +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. + ) +{ + #ifdef DYNAMIC_LOAD_LOADER + ze_result_t result = ZE_RESULT_SUCCESS; + 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 ) { + result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnGetMemoryPropertiesExp; + }(); + if (result != ZE_RESULT_SUCCESS) { + return result; + } + return pfnGetMemoryPropertiesExp( hImage, pMemoryProperties ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + 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 pfnGetMemoryPropertiesExp( hImage, pMemoryProperties ); + #endif +} + +/////////////////////////////////////////////////////////////////////////////// +/// @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_extension_image_view 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_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_IMAGE_FORMAT +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 + ) +{ + #ifdef DYNAMIC_LOAD_LOADER + ze_result_t result = ZE_RESULT_SUCCESS; + 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 ) { + result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnViewCreateExt; + }(); + if (result != ZE_RESULT_SUCCESS) { + return result; + } + return pfnViewCreateExt( hContext, hDevice, desc, hImage, phImageView ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + 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 pfnViewCreateExt( hContext, hDevice, desc, hImage, phImageView ); + #endif +} + +/////////////////////////////////////////////////////////////////////////////// +/// @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_experimental_image_view +/// 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. @@ -10851,11 +11609,13 @@ zeModuleInspectLinkageExt( } /////////////////////////////////////////////////////////////////////////////// -/// @brief Frees allocated host memory, device memory, or shared memory using the -/// specified free policy. +/// @brief Frees allocated host memory, device memory, or shared memory on the +/// context using the specified free policy. /// /// @details -/// - The memory free policy is specified by the memory free descriptor. +/// - 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. @@ -11576,7 +12336,7 @@ zeRTASBuilderCreateExp( /// + `nullptr == pBuildOpDescriptor` /// + `nullptr == pProperties` /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `::ZE_RTAS_FORMAT_EXP_INVALID < pBuildOpDescriptor->rtasFormat` +/// + `::ZE_RTAS_FORMAT_EXP_MAX < pBuildOpDescriptor->rtasFormat` /// + `::ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_HIGH < pBuildOpDescriptor->buildQuality` /// + `0x3 < pBuildOpDescriptor->buildFlags` ze_result_t ZE_APICALL @@ -11635,8 +12395,8 @@ zeRTASBuilderGetBuildPropertiesExp( /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hDriver` /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `::ZE_RTAS_FORMAT_EXP_INVALID < rtasFormatA` -/// + `::ZE_RTAS_FORMAT_EXP_INVALID < rtasFormatB` +/// + `::ZE_RTAS_FORMAT_EXP_MAX < rtasFormatA` +/// + `::ZE_RTAS_FORMAT_EXP_MAX < rtasFormatB` /// - ::ZE_RESULT_SUCCESS /// + An acceleration structure built with `rtasFormatA` is compatible with devices that report `rtasFormatB`. /// - ::ZE_RESULT_EXP_ERROR_OPERANDS_INCOMPATIBLE @@ -11744,7 +12504,7 @@ zeDriverRTASFormatCompatibilityCheckExp( /// + `nullptr == pScratchBuffer` /// + `nullptr == pRtasBuffer` /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `::ZE_RTAS_FORMAT_EXP_INVALID < pBuildOpDescriptor->rtasFormat` +/// + `::ZE_RTAS_FORMAT_EXP_MAX < pBuildOpDescriptor->rtasFormat` /// + `::ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_HIGH < pBuildOpDescriptor->buildQuality` /// + `0x3 < pBuildOpDescriptor->buildFlags` /// - ::ZE_RESULT_EXP_RTAS_BUILD_DEFERRED diff --git a/source/lib/ze_libddi.cpp b/source/lib/ze_libddi.cpp index ee61632e..2549ad93 100644 --- a/source/lib/ze_libddi.cpp +++ b/source/lib/ze_libddi.cpp @@ -32,6 +32,24 @@ namespace ze_lib GET_FUNCTION_PTR(loader, "zeInitDrivers") ); } + if( ZE_RESULT_SUCCESS == result ) + { + // Optional + auto getTable = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeGetRTASBuilderProcAddrTable") ); + getTableWithCheck(getTable, version, &initialzeDdiTable.RTASBuilder ); + initialzeDdiTable.RTASBuilder.pfnCreateExt = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeRTASBuilderCreateExt") ); + initialzeDdiTable.RTASBuilder.pfnGetBuildPropertiesExt = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeRTASBuilderGetBuildPropertiesExt") ); + initialzeDdiTable.RTASBuilder.pfnBuildExt = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeRTASBuilderBuildExt") ); + initialzeDdiTable.RTASBuilder.pfnCommandListAppendCopyExt = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeRTASBuilderCommandListAppendCopyExt") ); + initialzeDdiTable.RTASBuilder.pfnDestroyExt = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeRTASBuilderDestroyExt") ); + } + if( ZE_RESULT_SUCCESS == result ) { // Optional @@ -48,6 +66,22 @@ namespace ze_lib GET_FUNCTION_PTR(loader, "zeRTASBuilderDestroyExp") ); } + if( ZE_RESULT_SUCCESS == result ) + { + // Optional + auto getTable = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeGetRTASParallelOperationProcAddrTable") ); + getTableWithCheck(getTable, version, &initialzeDdiTable.RTASParallelOperation ); + initialzeDdiTable.RTASParallelOperation.pfnCreateExt = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeRTASParallelOperationCreateExt") ); + initialzeDdiTable.RTASParallelOperation.pfnGetPropertiesExt = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeRTASParallelOperationGetPropertiesExt") ); + initialzeDdiTable.RTASParallelOperation.pfnJoinExt = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeRTASParallelOperationJoinExt") ); + initialzeDdiTable.RTASParallelOperation.pfnDestroyExt = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeRTASParallelOperationDestroyExt") ); + } + if( ZE_RESULT_SUCCESS == result ) { // Optional @@ -81,6 +115,8 @@ namespace ze_lib GET_FUNCTION_PTR(loader, "zeDriverGetExtensionProperties") ); initialzeDdiTable.Driver.pfnGetExtensionFunctionAddress = reinterpret_cast( GET_FUNCTION_PTR(loader, "zeDriverGetExtensionFunctionAddress") ); + initialzeDdiTable.Driver.pfnRTASFormatCompatibilityCheckExt = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeDriverRTASFormatCompatibilityCheckExt") ); initialzeDdiTable.Driver.pfnGetLastErrorDescription = reinterpret_cast( GET_FUNCTION_PTR(loader, "zeDriverGetLastErrorDescription") ); } @@ -134,6 +170,8 @@ namespace ze_lib GET_FUNCTION_PTR(loader, "zeDeviceImportExternalSemaphoreExt") ); initialzeDdiTable.Device.pfnReleaseExternalSemaphoreExt = reinterpret_cast( GET_FUNCTION_PTR(loader, "zeDeviceReleaseExternalSemaphoreExt") ); + initialzeDdiTable.Device.pfnGetVectorWidthPropertiesExt = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeDeviceGetVectorWidthPropertiesExt") ); initialzeDdiTable.Device.pfnReserveCacheExt = reinterpret_cast( GET_FUNCTION_PTR(loader, "zeDeviceReserveCacheExt") ); initialzeDdiTable.Device.pfnSetCacheAdviceExt = reinterpret_cast( @@ -624,12 +662,24 @@ namespace ze_lib result = zeGetGlobalProcAddrTable( version, &initialzeDdiTable.Global ); } + if( ZE_RESULT_SUCCESS == result ) + { + // Optional + zeGetRTASBuilderProcAddrTable( version, &initialzeDdiTable.RTASBuilder ); + } + if( ZE_RESULT_SUCCESS == result ) { // Optional zeGetRTASBuilderExpProcAddrTable( version, &initialzeDdiTable.RTASBuilderExp ); } + if( ZE_RESULT_SUCCESS == result ) + { + // Optional + zeGetRTASParallelOperationProcAddrTable( version, &initialzeDdiTable.RTASParallelOperation ); + } + 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 df0192d8..a42b7412 100644 --- a/source/lib/ze_tracing_register_cb_libapi.cpp +++ b/source/lib/ze_tracing_register_cb_libapi.cpp @@ -3793,6 +3793,281 @@ zelTracerCommandListAppendWaitExternalSemaphoreExtRegisterCallback( } +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerRTASBuilderCreateExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnRTASBuilderCreateExtCb_t pfnCreateExtCb + ) { + + 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_pfnRTASBuilderCreateExtCb_t pfnCreateExtCb + ); + + auto func = reinterpret_cast( + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerRTASBuilderCreateExtRegisterCallback") ); + + if(func) + return func(hTracer, callback_type, pfnCreateExtCb); + + return ZE_RESULT_ERROR_UNINITIALIZED; +} + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerRTASBuilderGetBuildPropertiesExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnRTASBuilderGetBuildPropertiesExtCb_t pfnGetBuildPropertiesExtCb + ) { + + 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_pfnRTASBuilderGetBuildPropertiesExtCb_t pfnGetBuildPropertiesExtCb + ); + + auto func = reinterpret_cast( + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerRTASBuilderGetBuildPropertiesExtRegisterCallback") ); + + if(func) + return func(hTracer, callback_type, pfnGetBuildPropertiesExtCb); + + return ZE_RESULT_ERROR_UNINITIALIZED; +} + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerDriverRTASFormatCompatibilityCheckExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnDriverRTASFormatCompatibilityCheckExtCb_t pfnRTASFormatCompatibilityCheckExtCb + ) { + + 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_pfnDriverRTASFormatCompatibilityCheckExtCb_t pfnRTASFormatCompatibilityCheckExtCb + ); + + auto func = reinterpret_cast( + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerDriverRTASFormatCompatibilityCheckExtRegisterCallback") ); + + if(func) + return func(hTracer, callback_type, pfnRTASFormatCompatibilityCheckExtCb); + + return ZE_RESULT_ERROR_UNINITIALIZED; +} + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerRTASBuilderBuildExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnRTASBuilderBuildExtCb_t pfnBuildExtCb + ) { + + 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_pfnRTASBuilderBuildExtCb_t pfnBuildExtCb + ); + + auto func = reinterpret_cast( + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerRTASBuilderBuildExtRegisterCallback") ); + + if(func) + return func(hTracer, callback_type, pfnBuildExtCb); + + return ZE_RESULT_ERROR_UNINITIALIZED; +} + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerRTASBuilderCommandListAppendCopyExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnRTASBuilderCommandListAppendCopyExtCb_t pfnCommandListAppendCopyExtCb + ) { + + 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_pfnRTASBuilderCommandListAppendCopyExtCb_t pfnCommandListAppendCopyExtCb + ); + + auto func = reinterpret_cast( + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerRTASBuilderCommandListAppendCopyExtRegisterCallback") ); + + if(func) + return func(hTracer, callback_type, pfnCommandListAppendCopyExtCb); + + return ZE_RESULT_ERROR_UNINITIALIZED; +} + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerRTASBuilderDestroyExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnRTASBuilderDestroyExtCb_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_pfnRTASBuilderDestroyExtCb_t pfnDestroyExtCb + ); + + auto func = reinterpret_cast( + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerRTASBuilderDestroyExtRegisterCallback") ); + + if(func) + return func(hTracer, callback_type, pfnDestroyExtCb); + + return ZE_RESULT_ERROR_UNINITIALIZED; +} + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerRTASParallelOperationCreateExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnRTASParallelOperationCreateExtCb_t pfnCreateExtCb + ) { + + 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_pfnRTASParallelOperationCreateExtCb_t pfnCreateExtCb + ); + + auto func = reinterpret_cast( + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerRTASParallelOperationCreateExtRegisterCallback") ); + + if(func) + return func(hTracer, callback_type, pfnCreateExtCb); + + return ZE_RESULT_ERROR_UNINITIALIZED; +} + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerRTASParallelOperationGetPropertiesExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnRTASParallelOperationGetPropertiesExtCb_t pfnGetPropertiesExtCb + ) { + + 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_pfnRTASParallelOperationGetPropertiesExtCb_t pfnGetPropertiesExtCb + ); + + auto func = reinterpret_cast( + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerRTASParallelOperationGetPropertiesExtRegisterCallback") ); + + if(func) + return func(hTracer, callback_type, pfnGetPropertiesExtCb); + + return ZE_RESULT_ERROR_UNINITIALIZED; +} + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerRTASParallelOperationJoinExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnRTASParallelOperationJoinExtCb_t pfnJoinExtCb + ) { + + 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_pfnRTASParallelOperationJoinExtCb_t pfnJoinExtCb + ); + + auto func = reinterpret_cast( + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerRTASParallelOperationJoinExtRegisterCallback") ); + + if(func) + return func(hTracer, callback_type, pfnJoinExtCb); + + return ZE_RESULT_ERROR_UNINITIALIZED; +} + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerRTASParallelOperationDestroyExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnRTASParallelOperationDestroyExtCb_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_pfnRTASParallelOperationDestroyExtCb_t pfnDestroyExtCb + ); + + auto func = reinterpret_cast( + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerRTASParallelOperationDestroyExtRegisterCallback") ); + + if(func) + return func(hTracer, callback_type, pfnDestroyExtCb); + + return ZE_RESULT_ERROR_UNINITIALIZED; +} + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerDeviceGetVectorWidthPropertiesExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnDeviceGetVectorWidthPropertiesExtCb_t pfnGetVectorWidthPropertiesExtCb + ) { + + 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_pfnDeviceGetVectorWidthPropertiesExtCb_t pfnGetVectorWidthPropertiesExtCb + ); + + auto func = reinterpret_cast( + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerDeviceGetVectorWidthPropertiesExtRegisterCallback") ); + + if(func) + return func(hTracer, callback_type, pfnGetVectorWidthPropertiesExtCb); + + return ZE_RESULT_ERROR_UNINITIALIZED; +} + + ZE_APIEXPORT ze_result_t ZE_APICALL zelTracerDeviceReserveCacheExtRegisterCallback( zel_tracer_handle_t hTracer, diff --git a/source/lib/zet_libapi.cpp b/source/lib/zet_libapi.cpp index 719f8c25..fb8377b2 100644 --- a/source/lib/zet_libapi.cpp +++ b/source/lib/zet_libapi.cpp @@ -738,8 +738,8 @@ zetDebugReadRegisters( ///< than the `count` member of ::zet_debug_regset_properties_t for the ///< type uint32_t count, ///< [in] the number of registers to read; start+count must be less than or - ///< equal to the `count` member of ::zet_debug_register_group_properties_t - ///< for the type + ///< equal to the `count` member of ::zet_debug_regset_properties_t for the + ///< type void* pRegisterValues ///< [in,out][optional][range(0, count)] buffer of register values ) { @@ -798,8 +798,8 @@ zetDebugWriteRegisters( ///< than the `count` member of ::zet_debug_regset_properties_t for the ///< type uint32_t count, ///< [in] the number of registers to write; start+count must be less than - ///< or equal to the `count` member of - ///< ::zet_debug_register_group_properties_t for the type + ///< or equal to the `count` member of ::zet_debug_regset_properties_t for + ///< the type void* pRegisterValues ///< [in,out][optional][range(0, count)] buffer of register values ) { @@ -3016,6 +3016,186 @@ zetMetricTracerDecodeExp( #endif } +/////////////////////////////////////////////////////////////////////////////// +/// @brief Append a Marker based on the Metric source of the Metric Group, to a +/// Command List. +/// +/// @details +/// - This function appends a Marker based on the Metric source of the +/// Metric Group, to Command List. +/// +/// @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_NULL_HANDLE +/// + `nullptr == hCommandList` +/// + `nullptr == hMetricGroup` +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 + ) +{ + #ifdef DYNAMIC_LOAD_LOADER + ze_result_t result = ZE_RESULT_SUCCESS; + 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 ) { + result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnAppendMarkerExp; + }(); + if (result != ZE_RESULT_SUCCESS) { + return result; + } + return pfnAppendMarkerExp( hCommandList, hMetricGroup, value ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + 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 pfnAppendMarkerExp( hCommandList, hMetricGroup, value ); + #endif +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Enable Metrics collection during runtime. +/// +/// @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. +/// +/// @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_NULL_HANDLE +/// + `nullptr == hDevice` +ze_result_t ZE_APICALL +zetDeviceEnableMetricsExp( + zet_device_handle_t hDevice ///< [in] handle of the device where metrics collection has to be enabled. + ) +{ + #ifdef DYNAMIC_LOAD_LOADER + ze_result_t result = ZE_RESULT_SUCCESS; + 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 ) { + result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnEnableMetricsExp; + }(); + if (result != ZE_RESULT_SUCCESS) { + return result; + } + return pfnEnableMetricsExp( hDevice ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + 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 pfnEnableMetricsExp( hDevice ); + #endif +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Disable Metrics collection during runtime, if it was already enabled. +/// +/// @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. +/// +/// @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_NULL_HANDLE +/// + `nullptr == hDevice` +ze_result_t ZE_APICALL +zetDeviceDisableMetricsExp( + zet_device_handle_t hDevice ///< [in] handle of the device where metrics collection has to be disabled + ) +{ + #ifdef DYNAMIC_LOAD_LOADER + ze_result_t result = ZE_RESULT_SUCCESS; + 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 ) { + result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnDisableMetricsExp; + }(); + if (result != ZE_RESULT_SUCCESS) { + return result; + } + return pfnDisableMetricsExp( hDevice ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + 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 pfnDisableMetricsExp( hDevice ); + #endif +} + /////////////////////////////////////////////////////////////////////////////// /// @brief Calculate one or more sets of metric values from raw data. /// diff --git a/source/lib/zet_libddi.cpp b/source/lib/zet_libddi.cpp index 91ec9e6c..af6143c5 100644 --- a/source/lib/zet_libddi.cpp +++ b/source/lib/zet_libddi.cpp @@ -90,6 +90,10 @@ namespace ze_lib GET_FUNCTION_PTR(loader, "zetDeviceGetConcurrentMetricGroupsExp") ); initialzetDdiTable.DeviceExp.pfnCreateMetricGroupsFromMetricsExp = reinterpret_cast( GET_FUNCTION_PTR(loader, "zetDeviceCreateMetricGroupsFromMetricsExp") ); + initialzetDdiTable.DeviceExp.pfnEnableMetricsExp = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zetDeviceEnableMetricsExp") ); + initialzetDdiTable.DeviceExp.pfnDisableMetricsExp = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zetDeviceDisableMetricsExp") ); } if( ZE_RESULT_SUCCESS == result ) @@ -116,6 +120,16 @@ namespace ze_lib GET_FUNCTION_PTR(loader, "zetCommandListAppendMetricMemoryBarrier") ); } + if( ZE_RESULT_SUCCESS == result ) + { + // Optional + auto getTable = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zetGetCommandListExpProcAddrTable") ); + getTableWithCheck(getTable, version, &initialzetDdiTable.CommandListExp ); + initialzetDdiTable.CommandListExp.pfnAppendMarkerExp = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zetCommandListAppendMarkerExp") ); + } + if( ZE_RESULT_SUCCESS == result ) { auto getTable = reinterpret_cast( @@ -331,6 +345,12 @@ namespace ze_lib result = zetGetCommandListProcAddrTable( version, &initialzetDdiTable.CommandList ); } + if( ZE_RESULT_SUCCESS == result ) + { + // Optional + zetGetCommandListExpProcAddrTable( version, &initialzetDdiTable.CommandListExp ); + } + if( ZE_RESULT_SUCCESS == result ) { result = zetGetKernelProcAddrTable( version, &initialzetDdiTable.Kernel ); diff --git a/source/loader/ze_ldrddi.cpp b/source/loader/ze_ldrddi.cpp index 8d080a5c..b4bc7c79 100644 --- a/source/loader/ze_ldrddi.cpp +++ b/source/loader/ze_ldrddi.cpp @@ -4074,10 +4074,14 @@ namespace loader 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. + ///< 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. ) { ze_result_t result = ZE_RESULT_SUCCESS; @@ -5060,6 +5064,361 @@ namespace loader return result; } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASBuilderCreateExt + __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 + ) + { + 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 ) + return ZE_RESULT_ERROR_UNINITIALIZED; + + // convert loader handle to driver handle + hDriver = reinterpret_cast( hDriver )->handle; + + // forward to device-driver + result = pfnCreateExt( hDriver, pDescriptor, phBuilder ); + + if( ZE_RESULT_SUCCESS != result ) + return result; + + try + { + // convert driver handle to loader handle + *phBuilder = reinterpret_cast( + context->ze_rtas_builder_ext_factory.getInstance( *phBuilder, dditable ) ); + } + catch( std::bad_alloc& ) + { + result = ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY; + } + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASBuilderGetBuildPropertiesExt + __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 + ) + { + 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 ) + return ZE_RESULT_ERROR_UNINITIALIZED; + + // convert loader handle to driver handle + hBuilder = reinterpret_cast( hBuilder )->handle; + + // forward to device-driver + result = pfnGetBuildPropertiesExt( hBuilder, pBuildOpDescriptor, pProperties ); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @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 + ) + { + 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 ) + return ZE_RESULT_ERROR_UNINITIALIZED; + + // convert loader handle to driver handle + hDriver = reinterpret_cast( hDriver )->handle; + + // forward to device-driver + result = pfnRTASFormatCompatibilityCheckExt( hDriver, rtasFormatA, rtasFormatB ); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASBuilderBuildExt + __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 + ) + { + 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 ) + 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; + + // forward to device-driver + result = pfnBuildExt( hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes ); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASBuilderCommandListAppendCopyExt + __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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract driver's function pointer table + 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 + 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 = pfnCommandListAppendCopyExt( hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEventsLocal ); + delete []phWaitEventsLocal; + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASBuilderDestroyExt + __zedlllocal ze_result_t ZE_APICALL + 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( hBuilder )->dditable; + auto pfnDestroyExt = dditable->ze.RTASBuilder.pfnDestroyExt; + if( nullptr == pfnDestroyExt ) + return ZE_RESULT_ERROR_UNINITIALIZED; + + // convert loader handle to driver handle + hBuilder = reinterpret_cast( hBuilder )->handle; + + // forward to device-driver + result = pfnDestroyExt( hBuilder ); + + if( ZE_RESULT_SUCCESS != result ) + return result; + + // release loader handle + context->ze_rtas_builder_ext_factory.release( hBuilder ); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @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 + ) + { + 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 ) + return ZE_RESULT_ERROR_UNINITIALIZED; + + // convert loader handle to driver handle + hDriver = reinterpret_cast( hDriver )->handle; + + // forward to device-driver + result = pfnCreateExt( hDriver, phParallelOperation ); + + if( ZE_RESULT_SUCCESS != result ) + return result; + + try + { + // convert driver handle to loader handle + *phParallelOperation = reinterpret_cast( + context->ze_rtas_parallel_operation_ext_factory.getInstance( *phParallelOperation, dditable ) ); + } + catch( std::bad_alloc& ) + { + result = ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY; + } + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @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 + ) + { + 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 ) + return ZE_RESULT_ERROR_UNINITIALIZED; + + // convert loader handle to driver handle + hParallelOperation = reinterpret_cast( hParallelOperation )->handle; + + // forward to device-driver + result = pfnGetPropertiesExt( hParallelOperation, pProperties ); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASParallelOperationJoinExt + __zedlllocal ze_result_t ZE_APICALL + 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( hParallelOperation )->dditable; + auto pfnJoinExt = dditable->ze.RTASParallelOperation.pfnJoinExt; + if( nullptr == pfnJoinExt ) + return ZE_RESULT_ERROR_UNINITIALIZED; + + // convert loader handle to driver handle + hParallelOperation = reinterpret_cast( hParallelOperation )->handle; + + // forward to device-driver + result = pfnJoinExt( hParallelOperation ); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASParallelOperationDestroyExt + __zedlllocal ze_result_t ZE_APICALL + 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( hParallelOperation )->dditable; + auto pfnDestroyExt = dditable->ze.RTASParallelOperation.pfnDestroyExt; + if( nullptr == pfnDestroyExt ) + return ZE_RESULT_ERROR_UNINITIALIZED; + + // convert loader handle to driver handle + hParallelOperation = reinterpret_cast( hParallelOperation )->handle; + + // forward to device-driver + 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 zeDeviceGetVectorWidthPropertiesExt + __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. + ) + { + 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 ) + return ZE_RESULT_ERROR_UNINITIALIZED; + + // convert loader handle to driver handle + hDevice = reinterpret_cast( hDevice )->handle; + + // forward to device-driver + result = pfnGetVectorWidthPropertiesExt( hDevice, pCount, pVectorWidthProperties ); + + return result; + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zeDeviceReserveCacheExt __zedlllocal ze_result_t ZE_APICALL @@ -6608,6 +6967,102 @@ zeGetGlobalProcAddrTable( return result; } +/////////////////////////////////////////////////////////////////////////////// +/// @brief Exported function for filling application's RTASBuilder 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 +zeGetRTASBuilderProcAddrTable( + ze_api_version_t version, ///< [in] API version requested + ze_rtas_builder_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; + + ze_result_t result = ZE_RESULT_SUCCESS; + + bool atLeastOneDriverValid = false; + // Load the device-driver DDI tables + for( auto& drv : loader::context->zeDrivers ) + { + if(drv.initStatus != ZE_RESULT_SUCCESS) + continue; + auto getTable = reinterpret_cast( + GET_FUNCTION_PTR( drv.handle, "zeGetRTASBuilderProcAddrTable") ); + if(!getTable) + continue; + auto getTableResult = getTable( version, &drv.dditable.ze.RTASBuilder); + if(getTableResult == ZE_RESULT_SUCCESS) + atLeastOneDriverValid = true; + else + drv.initStatus = getTableResult; + } + + if(!atLeastOneDriverValid) + result = ZE_RESULT_ERROR_UNINITIALIZED; + else + result = ZE_RESULT_SUCCESS; + + if( ZE_RESULT_SUCCESS == result ) + { + if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) + { + // return pointers to loader's DDIs + pDdiTable->pfnCreateExt = loader::zeRTASBuilderCreateExt; + pDdiTable->pfnGetBuildPropertiesExt = loader::zeRTASBuilderGetBuildPropertiesExt; + pDdiTable->pfnBuildExt = loader::zeRTASBuilderBuildExt; + pDdiTable->pfnCommandListAppendCopyExt = loader::zeRTASBuilderCommandListAppendCopyExt; + pDdiTable->pfnDestroyExt = loader::zeRTASBuilderDestroyExt; + } + else + { + // return pointers directly to driver's DDIs + *pDdiTable = loader::context->zeDrivers.front().dditable.ze.RTASBuilder; + } + } + + // 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, "zeGetRTASBuilderProcAddrTable") ); + 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, "zeGetRTASBuilderProcAddrTable") ); + if(!getTable) + return ZE_RESULT_ERROR_UNINITIALIZED; + ze_rtas_builder_dditable_t dditable; + memcpy(&dditable, pDdiTable, sizeof(ze_rtas_builder_dditable_t)); + result = getTable( version, &dditable ); + loader::context->tracing_dditable.ze.RTASBuilder = dditable; + if ( loader::context->tracingLayerEnabled ) { + result = getTable( version, pDdiTable ); + } + } + + return result; +} + /////////////////////////////////////////////////////////////////////////////// /// @brief Exported function for filling application's RTASBuilderExp table /// with current process' addresses @@ -6694,6 +7149,101 @@ zeGetRTASBuilderExpProcAddrTable( return result; } +/////////////////////////////////////////////////////////////////////////////// +/// @brief Exported function for filling application's RTASParallelOperation 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 +zeGetRTASParallelOperationProcAddrTable( + ze_api_version_t version, ///< [in] API version requested + ze_rtas_parallel_operation_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; + + ze_result_t result = ZE_RESULT_SUCCESS; + + bool atLeastOneDriverValid = false; + // Load the device-driver DDI tables + for( auto& drv : loader::context->zeDrivers ) + { + if(drv.initStatus != ZE_RESULT_SUCCESS) + continue; + auto getTable = reinterpret_cast( + GET_FUNCTION_PTR( drv.handle, "zeGetRTASParallelOperationProcAddrTable") ); + if(!getTable) + continue; + auto getTableResult = getTable( version, &drv.dditable.ze.RTASParallelOperation); + if(getTableResult == ZE_RESULT_SUCCESS) + atLeastOneDriverValid = true; + else + drv.initStatus = getTableResult; + } + + if(!atLeastOneDriverValid) + result = ZE_RESULT_ERROR_UNINITIALIZED; + else + result = ZE_RESULT_SUCCESS; + + if( ZE_RESULT_SUCCESS == result ) + { + if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) + { + // return pointers to loader's DDIs + pDdiTable->pfnCreateExt = loader::zeRTASParallelOperationCreateExt; + pDdiTable->pfnGetPropertiesExt = loader::zeRTASParallelOperationGetPropertiesExt; + pDdiTable->pfnJoinExt = loader::zeRTASParallelOperationJoinExt; + pDdiTable->pfnDestroyExt = loader::zeRTASParallelOperationDestroyExt; + } + else + { + // return pointers directly to driver's DDIs + *pDdiTable = loader::context->zeDrivers.front().dditable.ze.RTASParallelOperation; + } + } + + // 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, "zeGetRTASParallelOperationProcAddrTable") ); + 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, "zeGetRTASParallelOperationProcAddrTable") ); + if(!getTable) + return ZE_RESULT_ERROR_UNINITIALIZED; + ze_rtas_parallel_operation_dditable_t dditable; + memcpy(&dditable, pDdiTable, sizeof(ze_rtas_parallel_operation_dditable_t)); + result = getTable( version, &dditable ); + loader::context->tracing_dditable.ze.RTASParallelOperation = dditable; + if ( loader::context->tracingLayerEnabled ) { + result = getTable( version, pDdiTable ); + } + } + + return result; +} + /////////////////////////////////////////////////////////////////////////////// /// @brief Exported function for filling application's RTASParallelOperationExp table /// with current process' addresses @@ -6840,6 +7390,7 @@ zeGetDriverProcAddrTable( pDdiTable->pfnGetIpcProperties = loader::zeDriverGetIpcProperties; pDdiTable->pfnGetExtensionProperties = loader::zeDriverGetExtensionProperties; pDdiTable->pfnGetExtensionFunctionAddress = loader::zeDriverGetExtensionFunctionAddress; + pDdiTable->pfnRTASFormatCompatibilityCheckExt = loader::zeDriverRTASFormatCompatibilityCheckExt; pDdiTable->pfnGetLastErrorDescription = loader::zeDriverGetLastErrorDescription; } else @@ -7032,6 +7583,7 @@ zeGetDeviceProcAddrTable( pDdiTable->pfnGetGlobalTimestamps = loader::zeDeviceGetGlobalTimestamps; pDdiTable->pfnImportExternalSemaphoreExt = loader::zeDeviceImportExternalSemaphoreExt; pDdiTable->pfnReleaseExternalSemaphoreExt = loader::zeDeviceReleaseExternalSemaphoreExt; + pDdiTable->pfnGetVectorWidthPropertiesExt = loader::zeDeviceGetVectorWidthPropertiesExt; pDdiTable->pfnReserveCacheExt = loader::zeDeviceReserveCacheExt; pDdiTable->pfnSetCacheAdviceExt = loader::zeDeviceSetCacheAdviceExt; pDdiTable->pfnPciGetPropertiesExt = loader::zeDevicePciGetPropertiesExt; diff --git a/source/loader/ze_ldrddi.h b/source/loader/ze_ldrddi.h index 2643d540..609bb853 100644 --- a/source/loader/ze_ldrddi.h +++ b/source/loader/ze_ldrddi.h @@ -63,6 +63,12 @@ namespace loader 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 >; + using ze_rtas_builder_ext_object_t = object_t < ze_rtas_builder_ext_handle_t >; + using ze_rtas_builder_ext_factory_t = singleton_factory_t < ze_rtas_builder_ext_object_t, ze_rtas_builder_ext_handle_t >; + + 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_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 >; diff --git a/source/loader/ze_loader_internal.h b/source/loader/ze_loader_internal.h index 295a33a2..e391523b 100644 --- a/source/loader/ze_loader_internal.h +++ b/source/loader/ze_loader_internal.h @@ -84,7 +84,9 @@ namespace loader ze_module_factory_t ze_module_factory; ze_physical_mem_factory_t ze_physical_mem_factory; ze_rtas_builder_exp_factory_t ze_rtas_builder_exp_factory; + ze_rtas_builder_ext_factory_t ze_rtas_builder_ext_factory; ze_rtas_parallel_operation_exp_factory_t ze_rtas_parallel_operation_exp_factory; + ze_rtas_parallel_operation_ext_factory_t ze_rtas_parallel_operation_ext_factory; ze_sampler_factory_t ze_sampler_factory; zes_device_factory_t zes_device_factory; zes_diag_factory_t zes_diag_factory; diff --git a/source/loader/zet_ldrddi.cpp b/source/loader/zet_ldrddi.cpp index 68c211ee..8629d2bf 100644 --- a/source/loader/zet_ldrddi.cpp +++ b/source/loader/zet_ldrddi.cpp @@ -376,8 +376,8 @@ namespace loader ///< than the `count` member of ::zet_debug_regset_properties_t for the ///< type uint32_t count, ///< [in] the number of registers to read; start+count must be less than or - ///< equal to the `count` member of ::zet_debug_register_group_properties_t - ///< for the type + ///< equal to the `count` member of ::zet_debug_regset_properties_t for the + ///< type void* pRegisterValues ///< [in,out][optional][range(0, count)] buffer of register values ) { @@ -409,8 +409,8 @@ namespace loader ///< than the `count` member of ::zet_debug_regset_properties_t for the ///< type uint32_t count, ///< [in] the number of registers to write; start+count must be less than - ///< or equal to the `count` member of - ///< ::zet_debug_register_group_properties_t for the type + ///< or equal to the `count` member of ::zet_debug_regset_properties_t for + ///< the type void* pRegisterValues ///< [in,out][optional][range(0, count)] buffer of register values ) { @@ -1654,6 +1654,85 @@ namespace loader return result; } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetCommandListAppendMarkerExp + __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 + ) + { + 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 ) + return ZE_RESULT_ERROR_UNINITIALIZED; + + // convert loader handle to driver handle + hCommandList = reinterpret_cast( hCommandList )->handle; + + // convert loader handle to driver handle + hMetricGroup = reinterpret_cast( hMetricGroup )->handle; + + // forward to device-driver + result = pfnAppendMarkerExp( hCommandList, hMetricGroup, value ); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetDeviceEnableMetricsExp + __zedlllocal ze_result_t ZE_APICALL + 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( hDevice )->dditable; + auto pfnEnableMetricsExp = dditable->zet.DeviceExp.pfnEnableMetricsExp; + if( nullptr == pfnEnableMetricsExp ) + 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; + + // convert loader handle to driver handle + hDevice = reinterpret_cast( hDevice )->handle; + + // forward to device-driver + result = pfnDisableMetricsExp( hDevice ); + + return result; + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zetMetricGroupCalculateMultipleMetricValuesExp __zedlllocal ze_result_t ZE_APICALL @@ -2632,6 +2711,8 @@ zetGetDeviceExpProcAddrTable( // return pointers to loader's DDIs pDdiTable->pfnGetConcurrentMetricGroupsExp = loader::zetDeviceGetConcurrentMetricGroupsExp; pDdiTable->pfnCreateMetricGroupsFromMetricsExp = loader::zetDeviceCreateMetricGroupsFromMetricsExp; + pDdiTable->pfnEnableMetricsExp = loader::zetDeviceEnableMetricsExp; + pDdiTable->pfnDisableMetricsExp = loader::zetDeviceDisableMetricsExp; } else { @@ -2808,6 +2889,73 @@ zetGetCommandListProcAddrTable( return result; } +/////////////////////////////////////////////////////////////////////////////// +/// @brief Exported function for filling application's CommandListExp 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 +zetGetCommandListExpProcAddrTable( + ze_api_version_t version, ///< [in] API version requested + zet_command_list_exp_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; + + ze_result_t result = ZE_RESULT_SUCCESS; + + // Load the device-driver DDI tables + for( auto& drv : loader::context->zeDrivers ) + { + if(drv.initStatus != ZE_RESULT_SUCCESS) + continue; + auto getTable = reinterpret_cast( + GET_FUNCTION_PTR( drv.handle, "zetGetCommandListExpProcAddrTable") ); + if(!getTable) + continue; + result = getTable( version, &drv.dditable.zet.CommandListExp); + } + + + if( ZE_RESULT_SUCCESS == result ) + { + if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) + { + // return pointers to loader's DDIs + pDdiTable->pfnAppendMarkerExp = loader::zetCommandListAppendMarkerExp; + } + else + { + // return pointers directly to driver's DDIs + *pDdiTable = loader::context->zeDrivers.front().dditable.zet.CommandListExp; + } + } + + // 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, "zetGetCommandListExpProcAddrTable") ); + if(!getTable) + return ZE_RESULT_ERROR_UNINITIALIZED; + result = getTable( version, pDdiTable ); + } + + return result; +} + /////////////////////////////////////////////////////////////////////////////// /// @brief Exported function for filling application's Kernel table /// with current process' addresses From a03488abdc85277f2f56c092125e912072054ec7 Mon Sep 17 00:00:00 2001 From: "Neil R. Spruit" Date: Fri, 25 Apr 2025 11:28:31 -0700 Subject: [PATCH 05/28] Revert "Update Level Zero Loader and Headers to support v1.13.1 of L0 Spec (#325)" (#326) This reverts commit c1872469737f807abc0ab8c4b35a263a568a6504. --- CHANGELOG.md | 4 - CMakeLists.txt | 2 +- PRODUCT_GUID.txt | 4 +- include/layers/zel_tracing_register_cb.h | 388 ---- include/ze.py | 815 +------- include/ze_api.h | 1806 +++-------------- include/ze_ddi.h | 164 +- include/ze_ddi_common.h | 2 +- include/zes.py | 29 +- include/zes_api.h | 160 +- include/zes_ddi.h | 2 +- include/zet.py | 90 +- include/zet_api.h | 208 +- include/zet_ddi.h | 55 +- source/drivers/null/ze_nullddi.cpp | 382 +--- source/drivers/null/zet_nullddi.cpp | 112 +- source/layers/tracing/ze_tracing_cb_structs.h | 11 - .../layers/tracing/ze_tracing_register_cb.cpp | 176 -- source/layers/tracing/ze_trcddi.cpp | 542 +---- .../extension_validation.inl | 2 +- .../ze_parameter_validation.cpp | 262 +-- .../ze_parameter_validation.h | 11 - .../zet_parameter_validation.cpp | 51 +- .../zet_parameter_validation.h | 3 - .../validation/common/ze_entry_points.h | 22 - .../validation/common/zet_entry_points.h | 6 - .../ze_handle_lifetime.cpp | 186 +- .../ze_handle_lifetime.h | 11 - .../zet_handle_lifetime.cpp | 51 +- .../zet_handle_lifetime.h | 3 - source/layers/validation/ze_valddi.cpp | 609 +----- source/layers/validation/zet_valddi.cpp | 172 +- source/lib/ze_libapi.cpp | 1074 ++-------- source/lib/ze_libddi.cpp | 50 - source/lib/ze_tracing_register_cb_libapi.cpp | 275 --- source/lib/zet_libapi.cpp | 188 +- source/lib/zet_libddi.cpp | 20 - source/loader/ze_ldrddi.cpp | 560 +---- source/loader/ze_ldrddi.h | 6 - source/loader/ze_loader_internal.h | 2 - source/loader/zet_ldrddi.cpp | 156 +- 41 files changed, 634 insertions(+), 8038 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1292ad51..aab11a01 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,5 @@ # Level zero loader changelog -## v1.22.0 -* Update to support v1.13.1 of the Level Zero Spec -* Add testing stdout from zeInitDrivers in CI -* Only Enable Teardown thread on windows and remove debug on success ## v1.21.9 * Fix init checks when sorting legacy drivers * Fix MSVC Link optimization flags diff --git a/CMakeLists.txt b/CMakeLists.txt index 2b43d6a1..b2114c34 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.22.0) +project(level-zero VERSION 1.21.9) include(GNUInstallDirs) diff --git a/PRODUCT_GUID.txt b/PRODUCT_GUID.txt index 3057573c..85c64204 100644 --- a/PRODUCT_GUID.txt +++ b/PRODUCT_GUID.txt @@ -1,2 +1,2 @@ -1.22.0 -144d1a88-75bd-4f4a-8871-3660a84f7380 \ No newline at end of file +1.21.9 +01037281-c9ef-43cf-bc65-f72fb3438788 \ 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 18b795d9..a04d08ed 100644 --- a/include/layers/zel_tracing_register_cb.h +++ b/include/layers/zel_tracing_register_cb.h @@ -54,150 +54,6 @@ typedef void (ZE_APICALL *ze_pfnInitDriversCb_t)( void** ppTracerInstanceUserData ); -/////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function parameters for zeRTASBuilderCreateExt -/// @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_rtas_builder_create_ext_params_t -{ - ze_driver_handle_t* phDriver; - const ze_rtas_builder_ext_desc_t** ppDescriptor; - ze_rtas_builder_ext_handle_t** pphBuilder; -} ze_rtas_builder_create_ext_params_t; - - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function-pointer for zeRTASBuilderCreateExt -/// @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_pfnRTASBuilderCreateExtCb_t)( - ze_rtas_builder_create_ext_params_t* params, - ze_result_t result, - void* pTracerUserData, - void** ppTracerInstanceUserData - ); - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function parameters for zeRTASBuilderGetBuildPropertiesExt -/// @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_rtas_builder_get_build_properties_ext_params_t -{ - ze_rtas_builder_ext_handle_t* phBuilder; - const ze_rtas_builder_build_op_ext_desc_t** ppBuildOpDescriptor; - ze_rtas_builder_ext_properties_t** ppProperties; -} ze_rtas_builder_get_build_properties_ext_params_t; - - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function-pointer for zeRTASBuilderGetBuildPropertiesExt -/// @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_pfnRTASBuilderGetBuildPropertiesExtCb_t)( - ze_rtas_builder_get_build_properties_ext_params_t* params, - ze_result_t result, - void* pTracerUserData, - void** ppTracerInstanceUserData - ); - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function parameters for zeRTASBuilderBuildExt -/// @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_rtas_builder_build_ext_params_t -{ - ze_rtas_builder_ext_handle_t* phBuilder; - const ze_rtas_builder_build_op_ext_desc_t** ppBuildOpDescriptor; - void** ppScratchBuffer; - size_t* pscratchBufferSizeBytes; - void** ppRtasBuffer; - size_t* prtasBufferSizeBytes; - ze_rtas_parallel_operation_ext_handle_t* phParallelOperation; - void** ppBuildUserPtr; - ze_rtas_aabb_ext_t** ppBounds; - size_t** ppRtasBufferSizeBytes; -} ze_rtas_builder_build_ext_params_t; - - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function-pointer for zeRTASBuilderBuildExt -/// @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_pfnRTASBuilderBuildExtCb_t)( - ze_rtas_builder_build_ext_params_t* params, - ze_result_t result, - void* pTracerUserData, - void** ppTracerInstanceUserData - ); - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function parameters for zeRTASBuilderCommandListAppendCopyExt -/// @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_rtas_builder_command_list_append_copy_ext_params_t -{ - ze_command_list_handle_t* phCommandList; - void** pdstptr; - const void** psrcptr; - size_t* psize; - ze_event_handle_t* phSignalEvent; - uint32_t* pnumWaitEvents; - ze_event_handle_t** pphWaitEvents; -} ze_rtas_builder_command_list_append_copy_ext_params_t; - - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function-pointer for zeRTASBuilderCommandListAppendCopyExt -/// @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_pfnRTASBuilderCommandListAppendCopyExtCb_t)( - ze_rtas_builder_command_list_append_copy_ext_params_t* params, - ze_result_t result, - void* pTracerUserData, - void** ppTracerInstanceUserData - ); - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function parameters for zeRTASBuilderDestroyExt -/// @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_rtas_builder_destroy_ext_params_t -{ - ze_rtas_builder_ext_handle_t* phBuilder; -} ze_rtas_builder_destroy_ext_params_t; - - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function-pointer for zeRTASBuilderDestroyExt -/// @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_pfnRTASBuilderDestroyExtCb_t)( - ze_rtas_builder_destroy_ext_params_t* params, - ze_result_t result, - void* pTracerUserData, - void** ppTracerInstanceUserData - ); - /////////////////////////////////////////////////////////////////////////////// /// @brief Callback function parameters for zeRTASBuilderCreateExp /// @details Each entry is a pointer to the parameter passed to the function; @@ -311,108 +167,6 @@ typedef void (ZE_APICALL *ze_pfnRTASBuilderDestroyExpCb_t)( void** ppTracerInstanceUserData ); -/////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function parameters for zeRTASParallelOperationCreateExt -/// @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_rtas_parallel_operation_create_ext_params_t -{ - ze_driver_handle_t* phDriver; - ze_rtas_parallel_operation_ext_handle_t** pphParallelOperation; -} ze_rtas_parallel_operation_create_ext_params_t; - - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function-pointer for zeRTASParallelOperationCreateExt -/// @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_pfnRTASParallelOperationCreateExtCb_t)( - ze_rtas_parallel_operation_create_ext_params_t* params, - ze_result_t result, - void* pTracerUserData, - void** ppTracerInstanceUserData - ); - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function parameters for zeRTASParallelOperationGetPropertiesExt -/// @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_rtas_parallel_operation_get_properties_ext_params_t -{ - ze_rtas_parallel_operation_ext_handle_t* phParallelOperation; - ze_rtas_parallel_operation_ext_properties_t** ppProperties; -} ze_rtas_parallel_operation_get_properties_ext_params_t; - - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function-pointer for zeRTASParallelOperationGetPropertiesExt -/// @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_pfnRTASParallelOperationGetPropertiesExtCb_t)( - ze_rtas_parallel_operation_get_properties_ext_params_t* params, - ze_result_t result, - void* pTracerUserData, - void** ppTracerInstanceUserData - ); - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function parameters for zeRTASParallelOperationJoinExt -/// @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_rtas_parallel_operation_join_ext_params_t -{ - ze_rtas_parallel_operation_ext_handle_t* phParallelOperation; -} ze_rtas_parallel_operation_join_ext_params_t; - - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function-pointer for zeRTASParallelOperationJoinExt -/// @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_pfnRTASParallelOperationJoinExtCb_t)( - ze_rtas_parallel_operation_join_ext_params_t* params, - ze_result_t result, - void* pTracerUserData, - void** ppTracerInstanceUserData - ); - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function parameters for zeRTASParallelOperationDestroyExt -/// @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_rtas_parallel_operation_destroy_ext_params_t -{ - ze_rtas_parallel_operation_ext_handle_t* phParallelOperation; -} ze_rtas_parallel_operation_destroy_ext_params_t; - - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function-pointer for zeRTASParallelOperationDestroyExt -/// @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_pfnRTASParallelOperationDestroyExtCb_t)( - ze_rtas_parallel_operation_destroy_ext_params_t* params, - ze_result_t result, - void* pTracerUserData, - void** ppTracerInstanceUserData - ); - /////////////////////////////////////////////////////////////////////////////// /// @brief Callback function parameters for zeRTASParallelOperationCreateExp /// @details Each entry is a pointer to the parameter passed to the function; @@ -542,33 +296,6 @@ typedef void (ZE_APICALL *ze_pfnDriverGetExtensionFunctionAddressCb_t)( void** ppTracerInstanceUserData ); -/////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function parameters for zeDriverRTASFormatCompatibilityCheckExt -/// @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_driver_rtas_format_compatibility_check_ext_params_t -{ - ze_driver_handle_t* phDriver; - ze_rtas_format_ext_t* prtasFormatA; - ze_rtas_format_ext_t* prtasFormatB; -} ze_driver_rtas_format_compatibility_check_ext_params_t; - - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function-pointer for zeDriverRTASFormatCompatibilityCheckExt -/// @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_pfnDriverRTASFormatCompatibilityCheckExtCb_t)( - ze_driver_rtas_format_compatibility_check_ext_params_t* params, - ze_result_t result, - void* pTracerUserData, - void** ppTracerInstanceUserData - ); - /////////////////////////////////////////////////////////////////////////////// /// @brief Callback function parameters for zeDriverGetLastErrorDescription /// @details Each entry is a pointer to the parameter passed to the function; @@ -701,33 +428,6 @@ typedef void (ZE_APICALL *ze_pfnDeviceReleaseExternalSemaphoreExtCb_t)( void** ppTracerInstanceUserData ); -/////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function parameters for zeDeviceGetVectorWidthPropertiesExt -/// @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_vector_width_properties_ext_params_t -{ - ze_device_handle_t* phDevice; - uint32_t** ppCount; - ze_device_vector_width_properties_ext_t** ppVectorWidthProperties; -} ze_device_get_vector_width_properties_ext_params_t; - - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function-pointer for zeDeviceGetVectorWidthPropertiesExt -/// @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_pfnDeviceGetVectorWidthPropertiesExtCb_t)( - ze_device_get_vector_width_properties_ext_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; @@ -3504,94 +3204,6 @@ zelTracerCommandListAppendWaitExternalSemaphoreExtRegisterCallback( ); -ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerRTASBuilderCreateExtRegisterCallback( - zel_tracer_handle_t hTracer, - zel_tracer_reg_t callback_type, - ze_pfnRTASBuilderCreateExtCb_t pfnCreateExtCb - ); - - -ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerRTASBuilderGetBuildPropertiesExtRegisterCallback( - zel_tracer_handle_t hTracer, - zel_tracer_reg_t callback_type, - ze_pfnRTASBuilderGetBuildPropertiesExtCb_t pfnGetBuildPropertiesExtCb - ); - - -ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerDriverRTASFormatCompatibilityCheckExtRegisterCallback( - zel_tracer_handle_t hTracer, - zel_tracer_reg_t callback_type, - ze_pfnDriverRTASFormatCompatibilityCheckExtCb_t pfnRTASFormatCompatibilityCheckExtCb - ); - - -ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerRTASBuilderBuildExtRegisterCallback( - zel_tracer_handle_t hTracer, - zel_tracer_reg_t callback_type, - ze_pfnRTASBuilderBuildExtCb_t pfnBuildExtCb - ); - - -ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerRTASBuilderCommandListAppendCopyExtRegisterCallback( - zel_tracer_handle_t hTracer, - zel_tracer_reg_t callback_type, - ze_pfnRTASBuilderCommandListAppendCopyExtCb_t pfnCommandListAppendCopyExtCb - ); - - -ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerRTASBuilderDestroyExtRegisterCallback( - zel_tracer_handle_t hTracer, - zel_tracer_reg_t callback_type, - ze_pfnRTASBuilderDestroyExtCb_t pfnDestroyExtCb - ); - - -ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerRTASParallelOperationCreateExtRegisterCallback( - zel_tracer_handle_t hTracer, - zel_tracer_reg_t callback_type, - ze_pfnRTASParallelOperationCreateExtCb_t pfnCreateExtCb - ); - - -ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerRTASParallelOperationGetPropertiesExtRegisterCallback( - zel_tracer_handle_t hTracer, - zel_tracer_reg_t callback_type, - ze_pfnRTASParallelOperationGetPropertiesExtCb_t pfnGetPropertiesExtCb - ); - - -ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerRTASParallelOperationJoinExtRegisterCallback( - zel_tracer_handle_t hTracer, - zel_tracer_reg_t callback_type, - ze_pfnRTASParallelOperationJoinExtCb_t pfnJoinExtCb - ); - - -ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerRTASParallelOperationDestroyExtRegisterCallback( - zel_tracer_handle_t hTracer, - zel_tracer_reg_t callback_type, - ze_pfnRTASParallelOperationDestroyExtCb_t pfnDestroyExtCb - ); - - -ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerDeviceGetVectorWidthPropertiesExtRegisterCallback( - zel_tracer_handle_t hTracer, - zel_tracer_reg_t callback_type, - ze_pfnDeviceGetVectorWidthPropertiesExtCb_t pfnGetVectorWidthPropertiesExtCb - ); - - ZE_APIEXPORT ze_result_t ZE_APICALL zelTracerDeviceReserveCacheExtRegisterCallback( zel_tracer_handle_t hTracer, diff --git a/include/ze.py b/include/ze.py index 28ff35c5..1fa698fc 100644 --- a/include/ze.py +++ b/include/ze.py @@ -4,7 +4,7 @@ SPDX-License-Identifier: MIT @file ze.py - @version v1.13-r1.13.1 + @version v1.12-r1.12.15 """ import platform @@ -219,13 +219,6 @@ class ze_result_v(IntEnum): ## memory WARNING_ACTION_REQUIRED = 0x7800001b ## [Sysman] an action is required to complete the desired operation ERROR_INVALID_KERNEL_HANDLE = 0x7800001c ## [Core, Validation] kernel handle is invalid for the operation - EXT_RTAS_BUILD_RETRY = 0x7800001d ## [Core, Extension] ray tracing acceleration structure build operation - ## failed due to insufficient resources, retry with a larger acceleration - ## structure buffer allocation - EXT_RTAS_BUILD_DEFERRED = 0x7800001e ## [Core, Extension] ray tracing acceleration structure build operation - ## deferred to parallel operation join - 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_UNKNOWN = 0x7ffffffe ## [Core] unknown or internal error class ze_result_t(c_int): @@ -329,14 +322,6 @@ class ze_structure_type_v(IntEnum): EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_EXT = 0x00020025 ## ::ze_external_semaphore_signal_params_ext_t EXTERNAL_SEMAPHORE_WAIT_PARAMS_EXT = 0x00020026 ## ::ze_external_semaphore_wait_params_ext_t DRIVER_DDI_HANDLES_EXT_PROPERTIES = 0x00020027 ## ::ze_driver_ddi_handles_ext_properties_t - DEVICE_CACHELINE_SIZE_EXT = 0x00020028 ## ::ze_device_cache_line_size_ext_t - DEVICE_VECTOR_WIDTH_PROPERTIES_EXT = 0x00020029 ## ::ze_device_vector_width_properties_ext_t - RTAS_BUILDER_EXT_DESC = 0x00020030 ## ::ze_rtas_builder_ext_desc_t - RTAS_BUILDER_BUILD_OP_EXT_DESC = 0x00020031 ## ::ze_rtas_builder_build_op_ext_desc_t - RTAS_BUILDER_EXT_PROPERTIES = 0x00020032 ## ::ze_rtas_builder_ext_properties_t - RTAS_PARALLEL_OPERATION_EXT_PROPERTIES = 0x00020033 ## ::ze_rtas_parallel_operation_ext_properties_t - RTAS_DEVICE_EXT_PROPERTIES = 0x00020034 ## ::ze_rtas_device_ext_properties_t - RTAS_GEOMETRY_AABBS_EXT_CB_PARAMS = 0x00020035 ## ::ze_rtas_geometry_aabbs_ext_cb_params_t class ze_structure_type_t(c_int): def __str__(self): @@ -507,8 +492,7 @@ class ze_api_version_v(IntEnum): _1_10 = ZE_MAKE_VERSION( 1, 10 ) ## version 1.10 _1_11 = ZE_MAKE_VERSION( 1, 11 ) ## version 1.11 _1_12 = ZE_MAKE_VERSION( 1, 12 ) ## version 1.12 - _1_13 = ZE_MAKE_VERSION( 1, 13 ) ## version 1.13 - CURRENT = ZE_MAKE_VERSION( 1, 13 ) ## latest known version + CURRENT = ZE_MAKE_VERSION( 1, 12 ) ## latest known version class ze_api_version_t(c_int): def __str__(self): @@ -517,7 +501,7 @@ def __str__(self): ############################################################################### ## @brief Current API version as a macro -ZE_API_VERSION_CURRENT_M = ZE_MAKE_VERSION( 1, 13 ) +ZE_API_VERSION_CURRENT_M = ZE_MAKE_VERSION( 1, 12 ) ############################################################################### ## @brief Maximum driver universal unique id (UUID) size in bytes @@ -977,8 +961,6 @@ class ze_command_queue_flags_v(IntEnum): ## work across multiple engines. ## this flag should be used when applications want full control over ## multi-engine submission and scheduling. - ## This flag is **DEPRECATED** as flag - ## ${X}_COMMAND_LIST_FLAG_EXPLICIT_ONLY is **DEPRECATED**. IN_ORDER = ZE_BIT(1) ## To be used only when creating immediate command lists. Commands ## appended to the immediate command ## list are executed in-order, with driver implementation enforcing @@ -1029,7 +1011,7 @@ class ze_command_queue_desc_t(Structure): ## structure (i.e. contains stype and pNext). ("ordinal", c_ulong), ## [in] command queue group ordinal ("index", c_ulong), ## [in] command queue index within the group; - ## must be zero. + ## must be zero if ::ZE_COMMAND_QUEUE_FLAG_EXPLICIT_ONLY is not set ("flags", ze_command_queue_flags_t), ## [in] usage flags. ## must be 0 (default) or a valid combination of ::ze_command_queue_flag_t; ## default behavior may use implicit driver-based heuristics to balance @@ -1055,8 +1037,6 @@ class ze_command_list_flags_v(IntEnum): ## work across multiple engines. ## this flag should be used when applications want full control over ## multi-engine submission and scheduling. - ## This flag is **DEPRECATED** and implementations are not expected to - ## support this feature. IN_ORDER = ZE_BIT(3) ## commands appended to this command list are executed in-order, with ## driver implementation ## enforcing dependencies between them. Application is not required to @@ -2290,641 +2270,6 @@ class ze_external_semaphore_wait_params_ext_t(Structure): ## such as ::ZE_EXTERNAL_SEMAPHORE_EXT_FLAG_D3D12_FENCE. ] -############################################################################### -## @brief CacheLine Size Extension Name -ZE_CACHELINE_SIZE_EXT_NAME = "ZE_extension_device_cache_line_size" - -############################################################################### -## @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_device_cache_line_size_ext_version_t(c_int): - def __str__(self): - return str(ze_device_cache_line_size_ext_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): - _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. - ] - -############################################################################### -## @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_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_ext_version_t(c_int): - def __str__(self): - return str(ze_rtas_builder_ext_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 - -class ze_rtas_device_ext_flags_t(c_int): - def __str__(self): - return hex(self.value) - - -############################################################################### -## @brief Ray tracing acceleration structure format -## -## @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)) - - -############################################################################### -## @brief Ray tracing acceleration structure builder flags -class ze_rtas_builder_ext_flags_v(IntEnum): - RESERVED = ZE_BIT(0) ## Reserved for future use - -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_ext_flags_v(IntEnum): - RESERVED = ZE_BIT(0) ## Reserved for future use - -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_ext_flags_v(IntEnum): - NON_OPAQUE = ZE_BIT(0) ## non-opaque geometries invoke an any-hit shader - -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_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_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 - -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_ext_flags_t) -class ze_rtas_builder_packed_instance_ext_flags_t(c_ubyte): - pass - -############################################################################### -## @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 - -class ze_rtas_builder_build_op_ext_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_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)) - - -############################################################################### -## @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 - -class ze_rtas_builder_geometry_type_ext_t(c_int): - def __str__(self): - 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_ext_t) -class ze_rtas_builder_packed_geometry_type_ext_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_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 - -############################################################################### -## @brief Ray tracing acceleration structure builder descriptor -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_ext_version_t) ## [in] ray tracing acceleration structure builder version - ] - -############################################################################### -## @brief Ray tracing acceleration structure builder properties -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_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. - ] - -############################################################################### -## @brief Ray tracing acceleration structure builder parallel operation -## properties -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_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 - ] - -############################################################################### -## @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): - _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 - ] - -############################################################################### -## @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 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 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 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_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 - ("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_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 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_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 - ## 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_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 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 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 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_ext_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 - ] - -############################################################################### -## @brief AABB callback function parameters -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 - ## 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 - ] - -############################################################################### -## @brief Callback function pointer type to return AABBs for a range of -## procedural primitives - -############################################################################### -## @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 Ray tracing acceleration structure builder instance geometry info -class ze_rtas_builder_instance_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_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 - ] - -############################################################################### -## @brief -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_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 - ] - -############################################################################### -## @brief Device Vector Sizes Query Extension Name -ZE_DEVICE_VECTOR_SIZES_EXT_NAME = "ZE_extension_device_vector_sizes" - -############################################################################### -## @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_device_vector_sizes_ext_version_t(c_int): - def __str__(self): - return str(ze_device_vector_sizes_ext_version_v(self.value)) - - -############################################################################### -## @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,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. - ] - ############################################################################### ## @brief Cache_Reservation Extension Name ZE_CACHE_RESERVATION_EXT_NAME = "ZE_extension_cache_reservation" @@ -3093,8 +2438,7 @@ class ze_image_view_planar_exp_desc_t(Structure): ("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). - ("planeIndex", c_ulong) ## [DEPRECATED] no longer supported, use - ## ::ze_image_view_planar_ext_desc_t instead + ("planeIndex", c_ulong) ## [in] the 0-based plane index (e.g. NV12 is 0 = Y plane, 1 UV plane) ] ############################################################################### @@ -3484,15 +2828,8 @@ def __str__(self): ############################################################################### ## @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. + BLOCKING_FREE = ZE_BIT(0) ## blocks until all commands using the memory are complete before freeing + DEFER_FREE = ZE_BIT(1) ## schedules the memory to be freed but does not free immediately class ze_driver_memory_free_policy_ext_flags_t(c_int): def __str__(self): @@ -4004,7 +3341,6 @@ def __str__(self): ## identifier. class ze_rtas_format_exp_v(IntEnum): INVALID = 0 ## Invalid acceleration structure format - MAX = 0x7ffffffe ## Maximum acceleration structure format code class ze_rtas_format_exp_t(c_int): def __str__(self): @@ -4836,53 +4172,6 @@ class ze_mutable_graph_argument_exp_desc_t(Structure): ############################################################################### __use_win_types = "Windows" == platform.uname()[0] -############################################################################### -## @brief Function-pointer for zeRTASBuilderCreateExt -if __use_win_types: - _zeRTASBuilderCreateExt_t = WINFUNCTYPE( ze_result_t, ze_driver_handle_t, POINTER(ze_rtas_builder_ext_desc_t), POINTER(ze_rtas_builder_ext_handle_t) ) -else: - _zeRTASBuilderCreateExt_t = CFUNCTYPE( ze_result_t, ze_driver_handle_t, POINTER(ze_rtas_builder_ext_desc_t), POINTER(ze_rtas_builder_ext_handle_t) ) - -############################################################################### -## @brief Function-pointer for zeRTASBuilderGetBuildPropertiesExt -if __use_win_types: - _zeRTASBuilderGetBuildPropertiesExt_t = WINFUNCTYPE( ze_result_t, ze_rtas_builder_ext_handle_t, POINTER(ze_rtas_builder_build_op_ext_desc_t), POINTER(ze_rtas_builder_ext_properties_t) ) -else: - _zeRTASBuilderGetBuildPropertiesExt_t = CFUNCTYPE( ze_result_t, ze_rtas_builder_ext_handle_t, POINTER(ze_rtas_builder_build_op_ext_desc_t), POINTER(ze_rtas_builder_ext_properties_t) ) - -############################################################################### -## @brief Function-pointer for zeRTASBuilderBuildExt -if __use_win_types: - _zeRTASBuilderBuildExt_t = WINFUNCTYPE( ze_result_t, ze_rtas_builder_ext_handle_t, POINTER(ze_rtas_builder_build_op_ext_desc_t), c_void_p, c_size_t, c_void_p, c_size_t, ze_rtas_parallel_operation_ext_handle_t, c_void_p, POINTER(ze_rtas_aabb_ext_t), POINTER(c_size_t) ) -else: - _zeRTASBuilderBuildExt_t = CFUNCTYPE( ze_result_t, ze_rtas_builder_ext_handle_t, POINTER(ze_rtas_builder_build_op_ext_desc_t), c_void_p, c_size_t, c_void_p, c_size_t, ze_rtas_parallel_operation_ext_handle_t, c_void_p, POINTER(ze_rtas_aabb_ext_t), POINTER(c_size_t) ) - -############################################################################### -## @brief Function-pointer for zeRTASBuilderCommandListAppendCopyExt -if __use_win_types: - _zeRTASBuilderCommandListAppendCopyExt_t = WINFUNCTYPE( ze_result_t, ze_command_list_handle_t, c_void_p, c_void_p, c_size_t, ze_event_handle_t, c_ulong, POINTER(ze_event_handle_t) ) -else: - _zeRTASBuilderCommandListAppendCopyExt_t = CFUNCTYPE( ze_result_t, ze_command_list_handle_t, c_void_p, c_void_p, c_size_t, ze_event_handle_t, c_ulong, POINTER(ze_event_handle_t) ) - -############################################################################### -## @brief Function-pointer for zeRTASBuilderDestroyExt -if __use_win_types: - _zeRTASBuilderDestroyExt_t = WINFUNCTYPE( ze_result_t, ze_rtas_builder_ext_handle_t ) -else: - _zeRTASBuilderDestroyExt_t = CFUNCTYPE( ze_result_t, ze_rtas_builder_ext_handle_t ) - - -############################################################################### -## @brief Table of RTASBuilder functions pointers -class _ze_rtas_builder_dditable_t(Structure): - _fields_ = [ - ("pfnCreateExt", c_void_p), ## _zeRTASBuilderCreateExt_t - ("pfnGetBuildPropertiesExt", c_void_p), ## _zeRTASBuilderGetBuildPropertiesExt_t - ("pfnBuildExt", c_void_p), ## _zeRTASBuilderBuildExt_t - ("pfnCommandListAppendCopyExt", c_void_p), ## _zeRTASBuilderCommandListAppendCopyExt_t - ("pfnDestroyExt", c_void_p) ## _zeRTASBuilderDestroyExt_t - ] - ############################################################################### ## @brief Function-pointer for zeRTASBuilderCreateExp if __use_win_types: @@ -4922,45 +4211,6 @@ class _ze_rtas_builder_exp_dditable_t(Structure): ("pfnDestroyExp", c_void_p) ## _zeRTASBuilderDestroyExp_t ] -############################################################################### -## @brief Function-pointer for zeRTASParallelOperationCreateExt -if __use_win_types: - _zeRTASParallelOperationCreateExt_t = WINFUNCTYPE( ze_result_t, ze_driver_handle_t, POINTER(ze_rtas_parallel_operation_ext_handle_t) ) -else: - _zeRTASParallelOperationCreateExt_t = CFUNCTYPE( ze_result_t, ze_driver_handle_t, POINTER(ze_rtas_parallel_operation_ext_handle_t) ) - -############################################################################### -## @brief Function-pointer for zeRTASParallelOperationGetPropertiesExt -if __use_win_types: - _zeRTASParallelOperationGetPropertiesExt_t = WINFUNCTYPE( ze_result_t, ze_rtas_parallel_operation_ext_handle_t, POINTER(ze_rtas_parallel_operation_ext_properties_t) ) -else: - _zeRTASParallelOperationGetPropertiesExt_t = CFUNCTYPE( ze_result_t, ze_rtas_parallel_operation_ext_handle_t, POINTER(ze_rtas_parallel_operation_ext_properties_t) ) - -############################################################################### -## @brief Function-pointer for zeRTASParallelOperationJoinExt -if __use_win_types: - _zeRTASParallelOperationJoinExt_t = WINFUNCTYPE( ze_result_t, ze_rtas_parallel_operation_ext_handle_t ) -else: - _zeRTASParallelOperationJoinExt_t = CFUNCTYPE( ze_result_t, ze_rtas_parallel_operation_ext_handle_t ) - -############################################################################### -## @brief Function-pointer for zeRTASParallelOperationDestroyExt -if __use_win_types: - _zeRTASParallelOperationDestroyExt_t = WINFUNCTYPE( ze_result_t, ze_rtas_parallel_operation_ext_handle_t ) -else: - _zeRTASParallelOperationDestroyExt_t = CFUNCTYPE( ze_result_t, ze_rtas_parallel_operation_ext_handle_t ) - - -############################################################################### -## @brief Table of RTASParallelOperation functions pointers -class _ze_rtas_parallel_operation_dditable_t(Structure): - _fields_ = [ - ("pfnCreateExt", c_void_p), ## _zeRTASParallelOperationCreateExt_t - ("pfnGetPropertiesExt", c_void_p), ## _zeRTASParallelOperationGetPropertiesExt_t - ("pfnJoinExt", c_void_p), ## _zeRTASParallelOperationJoinExt_t - ("pfnDestroyExt", c_void_p) ## _zeRTASParallelOperationDestroyExt_t - ] - ############################################################################### ## @brief Function-pointer for zeRTASParallelOperationCreateExp if __use_win_types: @@ -5072,13 +4322,6 @@ class _ze_global_dditable_t(Structure): else: _zeDriverGetLastErrorDescription_t = CFUNCTYPE( ze_result_t, ze_driver_handle_t, POINTER(c_char_p) ) -############################################################################### -## @brief Function-pointer for zeDriverRTASFormatCompatibilityCheckExt -if __use_win_types: - _zeDriverRTASFormatCompatibilityCheckExt_t = WINFUNCTYPE( ze_result_t, ze_driver_handle_t, ze_rtas_format_ext_t, ze_rtas_format_ext_t ) -else: - _zeDriverRTASFormatCompatibilityCheckExt_t = CFUNCTYPE( ze_result_t, ze_driver_handle_t, ze_rtas_format_ext_t, ze_rtas_format_ext_t ) - ############################################################################### ## @brief Table of Driver functions pointers @@ -5090,8 +4333,7 @@ class _ze_driver_dditable_t(Structure): ("pfnGetIpcProperties", c_void_p), ## _zeDriverGetIpcProperties_t ("pfnGetExtensionProperties", c_void_p), ## _zeDriverGetExtensionProperties_t ("pfnGetExtensionFunctionAddress", c_void_p), ## _zeDriverGetExtensionFunctionAddress_t - ("pfnGetLastErrorDescription", c_void_p), ## _zeDriverGetLastErrorDescription_t - ("pfnRTASFormatCompatibilityCheckExt", c_void_p) ## _zeDriverRTASFormatCompatibilityCheckExt_t + ("pfnGetLastErrorDescription", c_void_p) ## _zeDriverGetLastErrorDescription_t ] ############################################################################### @@ -5256,13 +4498,6 @@ class _ze_driver_exp_dditable_t(Structure): else: _zeDeviceReleaseExternalSemaphoreExt_t = CFUNCTYPE( ze_result_t, ze_external_semaphore_ext_handle_t ) -############################################################################### -## @brief Function-pointer for zeDeviceGetVectorWidthPropertiesExt -if __use_win_types: - _zeDeviceGetVectorWidthPropertiesExt_t = WINFUNCTYPE( ze_result_t, ze_device_handle_t, POINTER(c_ulong), POINTER(ze_device_vector_width_properties_ext_t) ) -else: - _zeDeviceGetVectorWidthPropertiesExt_t = CFUNCTYPE( ze_result_t, ze_device_handle_t, POINTER(c_ulong), POINTER(ze_device_vector_width_properties_ext_t) ) - ############################################################################### ## @brief Table of Device functions pointers @@ -5288,8 +4523,7 @@ class _ze_device_dditable_t(Structure): ("pfnPciGetPropertiesExt", c_void_p), ## _zeDevicePciGetPropertiesExt_t ("pfnGetRootDevice", c_void_p), ## _zeDeviceGetRootDevice_t ("pfnImportExternalSemaphoreExt", c_void_p), ## _zeDeviceImportExternalSemaphoreExt_t - ("pfnReleaseExternalSemaphoreExt", c_void_p), ## _zeDeviceReleaseExternalSemaphoreExt_t - ("pfnGetVectorWidthPropertiesExt", c_void_p) ## _zeDeviceGetVectorWidthPropertiesExt_t + ("pfnReleaseExternalSemaphoreExt", c_void_p) ## _zeDeviceReleaseExternalSemaphoreExt_t ] ############################################################################### @@ -6673,9 +5907,7 @@ class _ze_fabric_edge_exp_dditable_t(Structure): ############################################################################### class _ze_dditable_t(Structure): _fields_ = [ - ("RTASBuilder", _ze_rtas_builder_dditable_t), ("RTASBuilderExp", _ze_rtas_builder_exp_dditable_t), - ("RTASParallelOperation", _ze_rtas_parallel_operation_dditable_t), ("RTASParallelOperationExp", _ze_rtas_parallel_operation_exp_dditable_t), ("Global", _ze_global_dditable_t), ("Driver", _ze_driver_dditable_t), @@ -6718,20 +5950,6 @@ def __init__(self, version : ze_api_version_t): # fill the ddi tables self.__dditable = _ze_dditable_t() - # call driver to get function pointers - _RTASBuilder = _ze_rtas_builder_dditable_t() - r = ze_result_v(self.__dll.zeGetRTASBuilderProcAddrTable(version, byref(_RTASBuilder))) - if r != ze_result_v.SUCCESS: - raise Exception(r) - self.__dditable.RTASBuilder = _RTASBuilder - - # attach function interface to function address - self.zeRTASBuilderCreateExt = _zeRTASBuilderCreateExt_t(self.__dditable.RTASBuilder.pfnCreateExt) - self.zeRTASBuilderGetBuildPropertiesExt = _zeRTASBuilderGetBuildPropertiesExt_t(self.__dditable.RTASBuilder.pfnGetBuildPropertiesExt) - self.zeRTASBuilderBuildExt = _zeRTASBuilderBuildExt_t(self.__dditable.RTASBuilder.pfnBuildExt) - self.zeRTASBuilderCommandListAppendCopyExt = _zeRTASBuilderCommandListAppendCopyExt_t(self.__dditable.RTASBuilder.pfnCommandListAppendCopyExt) - self.zeRTASBuilderDestroyExt = _zeRTASBuilderDestroyExt_t(self.__dditable.RTASBuilder.pfnDestroyExt) - # call driver to get function pointers _RTASBuilderExp = _ze_rtas_builder_exp_dditable_t() r = ze_result_v(self.__dll.zeGetRTASBuilderExpProcAddrTable(version, byref(_RTASBuilderExp))) @@ -6745,19 +5963,6 @@ def __init__(self, version : ze_api_version_t): self.zeRTASBuilderBuildExp = _zeRTASBuilderBuildExp_t(self.__dditable.RTASBuilderExp.pfnBuildExp) self.zeRTASBuilderDestroyExp = _zeRTASBuilderDestroyExp_t(self.__dditable.RTASBuilderExp.pfnDestroyExp) - # call driver to get function pointers - _RTASParallelOperation = _ze_rtas_parallel_operation_dditable_t() - r = ze_result_v(self.__dll.zeGetRTASParallelOperationProcAddrTable(version, byref(_RTASParallelOperation))) - if r != ze_result_v.SUCCESS: - raise Exception(r) - self.__dditable.RTASParallelOperation = _RTASParallelOperation - - # attach function interface to function address - self.zeRTASParallelOperationCreateExt = _zeRTASParallelOperationCreateExt_t(self.__dditable.RTASParallelOperation.pfnCreateExt) - self.zeRTASParallelOperationGetPropertiesExt = _zeRTASParallelOperationGetPropertiesExt_t(self.__dditable.RTASParallelOperation.pfnGetPropertiesExt) - self.zeRTASParallelOperationJoinExt = _zeRTASParallelOperationJoinExt_t(self.__dditable.RTASParallelOperation.pfnJoinExt) - self.zeRTASParallelOperationDestroyExt = _zeRTASParallelOperationDestroyExt_t(self.__dditable.RTASParallelOperation.pfnDestroyExt) - # call driver to get function pointers _RTASParallelOperationExp = _ze_rtas_parallel_operation_exp_dditable_t() r = ze_result_v(self.__dll.zeGetRTASParallelOperationExpProcAddrTable(version, byref(_RTASParallelOperationExp))) @@ -6797,7 +6002,6 @@ def __init__(self, version : ze_api_version_t): self.zeDriverGetExtensionProperties = _zeDriverGetExtensionProperties_t(self.__dditable.Driver.pfnGetExtensionProperties) self.zeDriverGetExtensionFunctionAddress = _zeDriverGetExtensionFunctionAddress_t(self.__dditable.Driver.pfnGetExtensionFunctionAddress) self.zeDriverGetLastErrorDescription = _zeDriverGetLastErrorDescription_t(self.__dditable.Driver.pfnGetLastErrorDescription) - self.zeDriverRTASFormatCompatibilityCheckExt = _zeDriverRTASFormatCompatibilityCheckExt_t(self.__dditable.Driver.pfnRTASFormatCompatibilityCheckExt) # call driver to get function pointers _DriverExp = _ze_driver_exp_dditable_t() @@ -6838,7 +6042,6 @@ def __init__(self, version : ze_api_version_t): self.zeDeviceGetRootDevice = _zeDeviceGetRootDevice_t(self.__dditable.Device.pfnGetRootDevice) self.zeDeviceImportExternalSemaphoreExt = _zeDeviceImportExternalSemaphoreExt_t(self.__dditable.Device.pfnImportExternalSemaphoreExt) self.zeDeviceReleaseExternalSemaphoreExt = _zeDeviceReleaseExternalSemaphoreExt_t(self.__dditable.Device.pfnReleaseExternalSemaphoreExt) - self.zeDeviceGetVectorWidthPropertiesExt = _zeDeviceGetVectorWidthPropertiesExt_t(self.__dditable.Device.pfnGetVectorWidthPropertiesExt) # call driver to get function pointers _DeviceExp = _ze_device_exp_dditable_t() diff --git a/include/ze_api.h b/include/ze_api.h index 03d12d03..dfb30a25 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.13-r1.13.1 + * @version v1.12-r1.12.15 * */ #ifndef _ZE_API_H @@ -249,15 +249,8 @@ typedef enum _ze_result_t ///< memory ZE_RESULT_WARNING_ACTION_REQUIRED = 0x7800001b, ///< [Sysman] an action is required to complete the desired operation ZE_RESULT_ERROR_INVALID_KERNEL_HANDLE = 0x7800001c, ///< [Core, Validation] kernel handle is invalid for the operation - ZE_RESULT_EXT_RTAS_BUILD_RETRY = 0x7800001d, ///< [Core, Extension] ray tracing acceleration structure build operation - ///< failed due to insufficient resources, retry with a larger acceleration - ///< structure buffer allocation - ZE_RESULT_EXT_RTAS_BUILD_DEFERRED = 0x7800001e, ///< [Core, Extension] ray tracing acceleration structure build operation - ///< deferred to parallel operation join - 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_UNKNOWN = 0x7ffffffe, ///< [Core] unknown or internal error - ZE_RESULT_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_RESULT_* ENUMs + ZE_RESULT_FORCE_UINT32 = 0x7fffffff } ze_result_t; @@ -358,15 +351,7 @@ typedef enum _ze_structure_type_t ZE_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_EXT = 0x00020025, ///< ::ze_external_semaphore_signal_params_ext_t ZE_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_WAIT_PARAMS_EXT = 0x00020026, ///< ::ze_external_semaphore_wait_params_ext_t ZE_STRUCTURE_TYPE_DRIVER_DDI_HANDLES_EXT_PROPERTIES = 0x00020027, ///< ::ze_driver_ddi_handles_ext_properties_t - ZE_STRUCTURE_TYPE_DEVICE_CACHELINE_SIZE_EXT = 0x00020028, ///< ::ze_device_cache_line_size_ext_t - ZE_STRUCTURE_TYPE_DEVICE_VECTOR_WIDTH_PROPERTIES_EXT = 0x00020029, ///< ::ze_device_vector_width_properties_ext_t - ZE_STRUCTURE_TYPE_RTAS_BUILDER_EXT_DESC = 0x00020030, ///< ::ze_rtas_builder_ext_desc_t - ZE_STRUCTURE_TYPE_RTAS_BUILDER_BUILD_OP_EXT_DESC = 0x00020031, ///< ::ze_rtas_builder_build_op_ext_desc_t - ZE_STRUCTURE_TYPE_RTAS_BUILDER_EXT_PROPERTIES = 0x00020032, ///< ::ze_rtas_builder_ext_properties_t - ZE_STRUCTURE_TYPE_RTAS_PARALLEL_OPERATION_EXT_PROPERTIES = 0x00020033, ///< ::ze_rtas_parallel_operation_ext_properties_t - ZE_STRUCTURE_TYPE_RTAS_DEVICE_EXT_PROPERTIES = 0x00020034, ///< ::ze_rtas_device_ext_properties_t - ZE_STRUCTURE_TYPE_RTAS_GEOMETRY_AABBS_EXT_CB_PARAMS = 0x00020035, ///< ::ze_rtas_geometry_aabbs_ext_cb_params_t - ZE_STRUCTURE_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_STRUCTURE_TYPE_* ENUMs + ZE_STRUCTURE_TYPE_FORCE_UINT32 = 0x7fffffff } ze_structure_type_t; @@ -384,7 +369,7 @@ typedef enum _ze_external_memory_type_flag_t ///< resource ZE_EXTERNAL_MEMORY_TYPE_FLAG_D3D12_HEAP = ZE_BIT(6), ///< an NT handle referring to a Direct3D 12 heap resource ZE_EXTERNAL_MEMORY_TYPE_FLAG_D3D12_RESOURCE = ZE_BIT(7), ///< an NT handle referring to a Direct3D 12 committed resource - ZE_EXTERNAL_MEMORY_TYPE_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_EXTERNAL_MEMORY_TYPE_FLAG_* ENUMs + ZE_EXTERNAL_MEMORY_TYPE_FLAG_FORCE_UINT32 = 0x7fffffff } ze_external_memory_type_flag_t; @@ -395,7 +380,7 @@ typedef enum _ze_bandwidth_unit_t ZE_BANDWIDTH_UNIT_UNKNOWN = 0, ///< The unit used for bandwidth is unknown ZE_BANDWIDTH_UNIT_BYTES_PER_NANOSEC = 1, ///< Bandwidth is provided in bytes/nanosec ZE_BANDWIDTH_UNIT_BYTES_PER_CLOCK = 2, ///< Bandwidth is provided in bytes/clock - ZE_BANDWIDTH_UNIT_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_BANDWIDTH_UNIT_* ENUMs + ZE_BANDWIDTH_UNIT_FORCE_UINT32 = 0x7fffffff } ze_bandwidth_unit_t; @@ -408,7 +393,7 @@ typedef enum _ze_latency_unit_t ZE_LATENCY_UNIT_CLOCK = 2, ///< Latency is provided in clocks ZE_LATENCY_UNIT_HOP = 3, ///< Latency is provided in hops (normalized so that the lowest latency ///< link has a latency of 1 hop) - ZE_LATENCY_UNIT_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_LATENCY_UNIT_* ENUMs + ZE_LATENCY_UNIT_FORCE_UINT32 = 0x7fffffff } ze_latency_unit_t; @@ -734,86 +719,6 @@ typedef struct _ze_external_semaphore_signal_params_ext_t ze_external_semaphore_ /// @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_cache_reservation_ext_desc_t typedef struct _ze_cache_reservation_ext_desc_t ze_cache_reservation_ext_desc_t; @@ -1085,7 +990,7 @@ 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_FORCE_UINT32 = 0x7fffffff } ze_init_flag_t; @@ -1182,7 +1087,7 @@ typedef enum _ze_init_driver_type_flag_t { ZE_INIT_DRIVER_TYPE_FLAG_GPU = ZE_BIT(0), ///< initialize and retrieve GPU drivers ZE_INIT_DRIVER_TYPE_FLAG_NPU = ZE_BIT(1), ///< initialize and retrieve NPU drivers - ZE_INIT_DRIVER_TYPE_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_INIT_DRIVER_TYPE_FLAG_* ENUMs + ZE_INIT_DRIVER_TYPE_FLAG_FORCE_UINT32 = 0x7fffffff } ze_init_driver_type_flag_t; @@ -1208,11 +1113,11 @@ typedef struct _ze_init_driver_type_desc_t /// other function. (zeInit is [Deprecated] and is replaced by /// zeInitDrivers) /// - Calls to zeInit[Deprecated] or InitDrivers will not alter the drivers -/// retrieved through either api. -/// - Drivers init through zeInit[Deprecated] or InitDrivers will not be +/// retrieved thru either api. +/// - Drivers init thru zeInit[Deprecated] or InitDrivers will not be /// reInitialized once init in an application. The Loader will determine -/// if the already init driver needs to be delivered to the user through -/// the init type flags. +/// if the already init driver needs to be delivered to the user thru the +/// init type flags. /// - Already init Drivers will not be uninitialized if the call to /// InitDrivers does not include that driver's type. Those init drivers /// which don't match the init flags will not have their driver handles @@ -1281,16 +1186,15 @@ typedef enum _ze_api_version_t ZE_API_VERSION_1_10 = ZE_MAKE_VERSION( 1, 10 ), ///< version 1.10 ZE_API_VERSION_1_11 = ZE_MAKE_VERSION( 1, 11 ), ///< version 1.11 ZE_API_VERSION_1_12 = ZE_MAKE_VERSION( 1, 12 ), ///< version 1.12 - ZE_API_VERSION_1_13 = ZE_MAKE_VERSION( 1, 13 ), ///< version 1.13 - ZE_API_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 13 ), ///< latest known version - ZE_API_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_API_VERSION_* ENUMs + ZE_API_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 12 ), ///< latest known version + ZE_API_VERSION_FORCE_UINT32 = 0x7fffffff } 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, 13 ) +#define ZE_API_VERSION_CURRENT_M ZE_MAKE_VERSION( 1, 12 ) #endif // ZE_API_VERSION_CURRENT_M /////////////////////////////////////////////////////////////////////////////// @@ -1380,7 +1284,7 @@ typedef enum _ze_ipc_property_flag_t ///< ::zeMemGetIpcHandle. ZE_IPC_PROPERTY_FLAG_EVENT_POOL = ZE_BIT(1), ///< Supports passing event pools between processes. See ///< ::zeEventPoolGetIpcHandle. - ZE_IPC_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_IPC_PROPERTY_FLAG_* ENUMs + ZE_IPC_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff } ze_ipc_property_flag_t; @@ -1647,7 +1551,7 @@ typedef enum _ze_device_type_t ZE_DEVICE_TYPE_FPGA = 3, ///< Field Programmable Gate Array ZE_DEVICE_TYPE_MCA = 4, ///< Memory Copy Accelerator ZE_DEVICE_TYPE_VPU = 5, ///< Vision Processing Unit - ZE_DEVICE_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_DEVICE_TYPE_* ENUMs + ZE_DEVICE_TYPE_FORCE_UINT32 = 0x7fffffff } ze_device_type_t; @@ -1680,7 +1584,7 @@ typedef enum _ze_device_property_flag_t ZE_DEVICE_PROPERTY_FLAG_SUBDEVICE = ZE_BIT(1), ///< Device handle used for query represents a sub-device. ZE_DEVICE_PROPERTY_FLAG_ECC = ZE_BIT(2), ///< Device supports error correction memory access. ZE_DEVICE_PROPERTY_FLAG_ONDEMANDPAGING = ZE_BIT(3), ///< Device supports on-demand page-faulting. - ZE_DEVICE_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_DEVICE_PROPERTY_FLAG_* ENUMs + ZE_DEVICE_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff } ze_device_property_flag_t; @@ -1844,7 +1748,7 @@ typedef enum _ze_device_module_flag_t ZE_DEVICE_MODULE_FLAG_FP64 = ZE_BIT(1), ///< Device supports 64-bit floating-point operations ZE_DEVICE_MODULE_FLAG_INT64_ATOMICS = ZE_BIT(2), ///< Device supports 64-bit atomic operations ZE_DEVICE_MODULE_FLAG_DP4A = ZE_BIT(3), ///< Device supports four component dot product and accumulate operations - ZE_DEVICE_MODULE_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_DEVICE_MODULE_FLAG_* ENUMs + ZE_DEVICE_MODULE_FLAG_FORCE_UINT32 = 0x7fffffff } ze_device_module_flag_t; @@ -1862,7 +1766,7 @@ typedef enum _ze_device_fp_flag_t ZE_DEVICE_FP_FLAG_ROUNDED_DIVIDE_SQRT = ZE_BIT(6), ///< Supports rounding as defined by IEEE754 for divide and sqrt ///< operations. ZE_DEVICE_FP_FLAG_SOFT_FLOAT = ZE_BIT(7), ///< Uses software implementation for basic floating-point operations. - ZE_DEVICE_FP_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_DEVICE_FP_FLAG_* ENUMs + ZE_DEVICE_FP_FLAG_FORCE_UINT32 = 0x7fffffff } ze_device_fp_flag_t; @@ -1930,7 +1834,7 @@ typedef enum _ze_command_queue_group_property_flag_t ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COOPERATIVE_KERNELS = ZE_BIT(2), ///< Command queue group supports cooperative kernels. ///< See ::zeCommandListAppendLaunchCooperativeKernel for more details. ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_METRICS = ZE_BIT(3), ///< Command queue groups supports metric queries. - ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_* ENUMs + ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff } ze_command_queue_group_property_flag_t; @@ -1999,7 +1903,7 @@ typedef uint32_t ze_device_memory_property_flags_t; typedef enum _ze_device_memory_property_flag_t { ZE_DEVICE_MEMORY_PROPERTY_FLAG_TBD = ZE_BIT(0), ///< reserved for future use - ZE_DEVICE_MEMORY_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_DEVICE_MEMORY_PROPERTY_FLAG_* ENUMs + ZE_DEVICE_MEMORY_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff } ze_device_memory_property_flag_t; @@ -2075,7 +1979,7 @@ typedef enum _ze_memory_access_cap_flag_t ZE_MEMORY_ACCESS_CAP_FLAG_ATOMIC = ZE_BIT(1), ///< Supports atomic access ZE_MEMORY_ACCESS_CAP_FLAG_CONCURRENT = ZE_BIT(2), ///< Supports concurrent access ZE_MEMORY_ACCESS_CAP_FLAG_CONCURRENT_ATOMIC = ZE_BIT(3), ///< Supports concurrent atomic access - ZE_MEMORY_ACCESS_CAP_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_MEMORY_ACCESS_CAP_FLAG_* ENUMs + ZE_MEMORY_ACCESS_CAP_FLAG_FORCE_UINT32 = 0x7fffffff } ze_memory_access_cap_flag_t; @@ -2133,7 +2037,7 @@ typedef uint32_t ze_device_cache_property_flags_t; typedef enum _ze_device_cache_property_flag_t { ZE_DEVICE_CACHE_PROPERTY_FLAG_USER_CONTROL = ZE_BIT(0), ///< Device support User Cache Control (i.e. SLM section vs Generic Cache) - ZE_DEVICE_CACHE_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_DEVICE_CACHE_PROPERTY_FLAG_* ENUMs + ZE_DEVICE_CACHE_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff } ze_device_cache_property_flag_t; @@ -2281,7 +2185,7 @@ typedef enum _ze_device_p2p_property_flag_t { ZE_DEVICE_P2P_PROPERTY_FLAG_ACCESS = ZE_BIT(0), ///< Device supports access between peer devices. ZE_DEVICE_P2P_PROPERTY_FLAG_ATOMICS = ZE_BIT(1), ///< Device supports atomics between peer devices. - ZE_DEVICE_P2P_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_DEVICE_P2P_PROPERTY_FLAG_* ENUMs + ZE_DEVICE_P2P_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff } ze_device_p2p_property_flag_t; @@ -2433,7 +2337,7 @@ typedef uint32_t ze_context_flags_t; typedef enum _ze_context_flag_t { ZE_CONTEXT_FLAG_TBD = ZE_BIT(0), ///< reserved for future use - ZE_CONTEXT_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_CONTEXT_FLAG_* ENUMs + ZE_CONTEXT_FLAG_FORCE_UINT32 = 0x7fffffff } ze_context_flag_t; @@ -2588,8 +2492,6 @@ typedef enum _ze_command_queue_flag_t ///< work across multiple engines. ///< this flag should be used when applications want full control over ///< multi-engine submission and scheduling. - ///< This flag is **DEPRECATED** as flag - ///< ${X}_COMMAND_LIST_FLAG_EXPLICIT_ONLY is **DEPRECATED**. ZE_COMMAND_QUEUE_FLAG_IN_ORDER = ZE_BIT(1), ///< To be used only when creating immediate command lists. Commands ///< appended to the immediate command ///< list are executed in-order, with driver implementation enforcing @@ -2599,7 +2501,7 @@ typedef enum _ze_command_queue_flag_t ///< the next to define an in-order list, and application is allowed to ///< pass signal and wait events ///< to each appended command to implement more complex dependency graphs. - ZE_COMMAND_QUEUE_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_COMMAND_QUEUE_FLAG_* ENUMs + ZE_COMMAND_QUEUE_FLAG_FORCE_UINT32 = 0x7fffffff } ze_command_queue_flag_t; @@ -2612,7 +2514,7 @@ typedef enum _ze_command_queue_mode_t ///< Host thread is blocked using wait on implicit synchronization object ZE_COMMAND_QUEUE_MODE_ASYNCHRONOUS = 2, ///< Device execution is scheduled and will complete in future; ///< explicit synchronization object must be used to determine completeness - ZE_COMMAND_QUEUE_MODE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_COMMAND_QUEUE_MODE_* ENUMs + ZE_COMMAND_QUEUE_MODE_FORCE_UINT32 = 0x7fffffff } ze_command_queue_mode_t; @@ -2623,7 +2525,7 @@ typedef enum _ze_command_queue_priority_t ZE_COMMAND_QUEUE_PRIORITY_NORMAL = 0, ///< [default] normal priority ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_LOW = 1, ///< lower priority than normal ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_HIGH = 2, ///< higher priority than normal - ZE_COMMAND_QUEUE_PRIORITY_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_COMMAND_QUEUE_PRIORITY_* ENUMs + ZE_COMMAND_QUEUE_PRIORITY_FORCE_UINT32 = 0x7fffffff } ze_command_queue_priority_t; @@ -2636,7 +2538,7 @@ typedef struct _ze_command_queue_desc_t ///< structure (i.e. contains stype and pNext). uint32_t ordinal; ///< [in] command queue group ordinal uint32_t index; ///< [in] command queue index within the group; - ///< must be zero. + ///< must be zero if ::ZE_COMMAND_QUEUE_FLAG_EXPLICIT_ONLY is not set ze_command_queue_flags_t flags; ///< [in] usage flags. ///< must be 0 (default) or a valid combination of ::ze_command_queue_flag_t; ///< default behavior may use implicit driver-based heuristics to balance @@ -2867,8 +2769,6 @@ typedef enum _ze_command_list_flag_t ///< work across multiple engines. ///< this flag should be used when applications want full control over ///< multi-engine submission and scheduling. - ///< This flag is **DEPRECATED** and implementations are not expected to - ///< support this feature. ZE_COMMAND_LIST_FLAG_IN_ORDER = ZE_BIT(3), ///< commands appended to this command list are executed in-order, with ///< driver implementation ///< enforcing dependencies between them. Application is not required to @@ -2880,7 +2780,7 @@ typedef enum _ze_command_list_flag_t ///< more complex dependency graphs. Cannot be combined with ::ZE_COMMAND_LIST_FLAG_RELAXED_ORDERING. ZE_COMMAND_LIST_FLAG_EXP_CLONEABLE = ZE_BIT(4), ///< this command list may be cloned using ::zeCommandListCreateCloneExp ///< after ::zeCommandListClose. - ZE_COMMAND_LIST_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_COMMAND_LIST_FLAG_* ENUMs + ZE_COMMAND_LIST_FLAG_FORCE_UINT32 = 0x7fffffff } ze_command_list_flag_t; @@ -3870,7 +3770,7 @@ typedef enum _ze_memory_advice_t ZE_MEMORY_ADVICE_SET_SYSTEM_MEMORY_PREFERRED_LOCATION = 8, ///< hint that the preferred memory location is host memory ZE_MEMORY_ADVICE_CLEAR_SYSTEM_MEMORY_PREFERRED_LOCATION = 9, ///< removes the effect of ///< ::ZE_MEMORY_ADVICE_SET_SYSTEM_MEMORY_PREFERRED_LOCATION - ZE_MEMORY_ADVICE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_MEMORY_ADVICE_* ENUMs + ZE_MEMORY_ADVICE_FORCE_UINT32 = 0x7fffffff } ze_memory_advice_t; @@ -3938,7 +3838,7 @@ typedef enum _ze_event_pool_flag_t ZE_EVENT_POOL_FLAG_KERNEL_MAPPED_TIMESTAMP = ZE_BIT(3), ///< Indicates all events in pool will contain kernel timestamps ///< synchronized to host time domain; cannot be combined with ///< ::ZE_EVENT_POOL_FLAG_KERNEL_TIMESTAMP - ZE_EVENT_POOL_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_EVENT_POOL_FLAG_* ENUMs + ZE_EVENT_POOL_FLAG_FORCE_UINT32 = 0x7fffffff } ze_event_pool_flag_t; @@ -4034,7 +3934,7 @@ typedef enum _ze_event_scope_flag_t ///< device access and peer device access ZE_EVENT_SCOPE_FLAG_HOST = ZE_BIT(2), ///< cache hierarchies are flushed or invalidated sufficient for device and ///< host access - ZE_EVENT_SCOPE_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_EVENT_SCOPE_FLAG_* ENUMs + ZE_EVENT_SCOPE_FLAG_FORCE_UINT32 = 0x7fffffff } ze_event_scope_flag_t; @@ -4708,7 +4608,7 @@ 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_FORCE_UINT32 = 0x7fffffff } ze_fence_flag_t; @@ -4888,7 +4788,7 @@ typedef enum _ze_image_flag_t { ZE_IMAGE_FLAG_KERNEL_WRITE = ZE_BIT(0), ///< kernels will write contents ZE_IMAGE_FLAG_BIAS_UNCACHED = ZE_BIT(1), ///< device should not cache contents - ZE_IMAGE_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_IMAGE_FLAG_* ENUMs + ZE_IMAGE_FLAG_FORCE_UINT32 = 0x7fffffff } ze_image_flag_t; @@ -4902,7 +4802,7 @@ typedef enum _ze_image_type_t ZE_IMAGE_TYPE_2DARRAY = 3, ///< 2D array ZE_IMAGE_TYPE_3D = 4, ///< 3D ZE_IMAGE_TYPE_BUFFER = 5, ///< Buffer - ZE_IMAGE_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_IMAGE_TYPE_* ENUMs + ZE_IMAGE_TYPE_FORCE_UINT32 = 0x7fffffff } ze_image_type_t; @@ -4956,7 +4856,7 @@ typedef enum _ze_image_format_layout_t ZE_IMAGE_FORMAT_LAYOUT_8_8_8 = 43, ///< 3-component 8-bit layout ZE_IMAGE_FORMAT_LAYOUT_16_16_16 = 44, ///< 3-component 16-bit layout ZE_IMAGE_FORMAT_LAYOUT_32_32_32 = 45, ///< 3-component 32-bit layout - ZE_IMAGE_FORMAT_LAYOUT_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_IMAGE_FORMAT_LAYOUT_* ENUMs + ZE_IMAGE_FORMAT_LAYOUT_FORCE_UINT32 = 0x7fffffff } ze_image_format_layout_t; @@ -4969,7 +4869,7 @@ typedef enum _ze_image_format_type_t ZE_IMAGE_FORMAT_TYPE_UNORM = 2, ///< Unsigned normalized integer ZE_IMAGE_FORMAT_TYPE_SNORM = 3, ///< Signed normalized integer ZE_IMAGE_FORMAT_TYPE_FLOAT = 4, ///< Float - ZE_IMAGE_FORMAT_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_IMAGE_FORMAT_TYPE_* ENUMs + ZE_IMAGE_FORMAT_TYPE_FORCE_UINT32 = 0x7fffffff } ze_image_format_type_t; @@ -4984,7 +4884,7 @@ typedef enum _ze_image_format_swizzle_t ZE_IMAGE_FORMAT_SWIZZLE_0 = 4, ///< Zero ZE_IMAGE_FORMAT_SWIZZLE_1 = 5, ///< One ZE_IMAGE_FORMAT_SWIZZLE_X = 6, ///< Don't care - ZE_IMAGE_FORMAT_SWIZZLE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_IMAGE_FORMAT_SWIZZLE_* ENUMs + ZE_IMAGE_FORMAT_SWIZZLE_FORCE_UINT32 = 0x7fffffff } ze_image_format_swizzle_t; @@ -5049,7 +4949,7 @@ typedef enum _ze_image_sampler_filter_flag_t { ZE_IMAGE_SAMPLER_FILTER_FLAG_POINT = ZE_BIT(0), ///< device supports point filtering ZE_IMAGE_SAMPLER_FILTER_FLAG_LINEAR = ZE_BIT(1), ///< device supports linear filtering - ZE_IMAGE_SAMPLER_FILTER_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_IMAGE_SAMPLER_FILTER_FLAG_* ENUMs + ZE_IMAGE_SAMPLER_FILTER_FLAG_FORCE_UINT32 = 0x7fffffff } ze_image_sampler_filter_flag_t; @@ -5171,7 +5071,7 @@ typedef enum _ze_device_mem_alloc_flag_t ZE_DEVICE_MEM_ALLOC_FLAG_BIAS_CACHED = ZE_BIT(0), ///< device should cache allocation ZE_DEVICE_MEM_ALLOC_FLAG_BIAS_UNCACHED = ZE_BIT(1), ///< device should not cache allocation (UC) ZE_DEVICE_MEM_ALLOC_FLAG_BIAS_INITIAL_PLACEMENT = ZE_BIT(2), ///< optimize shared allocation for first access on the device - ZE_DEVICE_MEM_ALLOC_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_DEVICE_MEM_ALLOC_FLAG_* ENUMs + ZE_DEVICE_MEM_ALLOC_FLAG_FORCE_UINT32 = 0x7fffffff } ze_device_mem_alloc_flag_t; @@ -5199,7 +5099,7 @@ typedef enum _ze_host_mem_alloc_flag_t ZE_HOST_MEM_ALLOC_FLAG_BIAS_UNCACHED = ZE_BIT(1), ///< host should not cache allocation (UC) ZE_HOST_MEM_ALLOC_FLAG_BIAS_WRITE_COMBINED = ZE_BIT(2), ///< host memory should be allocated write-combined (WC) ZE_HOST_MEM_ALLOC_FLAG_BIAS_INITIAL_PLACEMENT = ZE_BIT(3), ///< optimize shared allocation for first access on the host - ZE_HOST_MEM_ALLOC_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_HOST_MEM_ALLOC_FLAG_* ENUMs + ZE_HOST_MEM_ALLOC_FLAG_FORCE_UINT32 = 0x7fffffff } ze_host_mem_alloc_flag_t; @@ -5364,11 +5264,8 @@ zeMemAllocHost( /// @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 implementation of this function may immediately free all Host and +/// Device allocations associated with this memory /// - The application must **not** call this function from simultaneous /// threads with the same pointer. /// - The implementation of this function must be thread-safe. @@ -5397,7 +5294,7 @@ typedef enum _ze_memory_type_t ZE_MEMORY_TYPE_HOST = 1, ///< the memory pointed to is a host allocation ZE_MEMORY_TYPE_DEVICE = 2, ///< the memory pointed to is a device allocation ZE_MEMORY_TYPE_SHARED = 3, ///< the memory pointed to is a shared ownership allocation - ZE_MEMORY_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_MEMORY_TYPE_* ENUMs + ZE_MEMORY_TYPE_FORCE_UINT32 = 0x7fffffff } ze_memory_type_t; @@ -5589,7 +5486,7 @@ typedef enum _ze_ipc_memory_flag_t { ZE_IPC_MEMORY_FLAG_BIAS_CACHED = ZE_BIT(0), ///< device should cache allocation ZE_IPC_MEMORY_FLAG_BIAS_UNCACHED = ZE_BIT(1), ///< device should not cache allocation (UC) - ZE_IPC_MEMORY_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_IPC_MEMORY_FLAG_* ENUMs + ZE_IPC_MEMORY_FLAG_FORCE_UINT32 = 0x7fffffff } ze_ipc_memory_flag_t; @@ -5790,7 +5687,7 @@ typedef enum _ze_memory_atomic_attr_exp_flag_t ZE_MEMORY_ATOMIC_ATTR_EXP_FLAG_SYSTEM_ATOMICS = ZE_BIT(6), ///< Concurrent atomics on the pointer from both host and device are ///< allowed. Requires ::ZE_MEMORY_ACCESS_CAP_FLAG_CONCURRENT_ATOMIC ///< returned by ::zeDeviceGetMemoryAccessProperties. - ZE_MEMORY_ATOMIC_ATTR_EXP_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_MEMORY_ATOMIC_ATTR_EXP_FLAG_* ENUMs + ZE_MEMORY_ATOMIC_ATTR_EXP_FLAG_FORCE_UINT32 = 0x7fffffff } ze_memory_atomic_attr_exp_flag_t; @@ -5804,7 +5701,7 @@ typedef enum _ze_memory_atomic_attr_exp_flag_t /// 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. +/// ::ZE_RESULT_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 @@ -5883,7 +5780,7 @@ typedef enum _ze_module_format_t { ZE_MODULE_FORMAT_IL_SPIRV = 0, ///< Format is SPIRV IL format ZE_MODULE_FORMAT_NATIVE = 1, ///< Format is device native format - ZE_MODULE_FORMAT_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_MODULE_FORMAT_* ENUMs + ZE_MODULE_FORMAT_FORCE_UINT32 = 0x7fffffff } ze_module_format_t; @@ -6208,7 +6105,7 @@ typedef enum _ze_module_property_flag_t { ZE_MODULE_PROPERTY_FLAG_IMPORTS = ZE_BIT(0), ///< Module has imports (i.e. imported global variables and/or kernels). ///< See ::zeModuleDynamicLink. - ZE_MODULE_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_MODULE_PROPERTY_FLAG_* ENUMs + ZE_MODULE_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff } ze_module_property_flag_t; @@ -6254,7 +6151,7 @@ typedef enum _ze_kernel_flag_t ZE_KERNEL_FLAG_FORCE_RESIDENCY = ZE_BIT(0), ///< force all device allocations to be resident during execution ZE_KERNEL_FLAG_EXPLICIT_RESIDENCY = ZE_BIT(1), ///< application is responsible for all residency of device allocations. ///< driver may disable implicit residency management. - ZE_KERNEL_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_KERNEL_FLAG_* ENUMs + ZE_KERNEL_FLAG_FORCE_UINT32 = 0x7fffffff } ze_kernel_flag_t; @@ -6482,7 +6379,7 @@ typedef enum _ze_kernel_indirect_access_flag_t ZE_KERNEL_INDIRECT_ACCESS_FLAG_HOST = ZE_BIT(0), ///< Indicates that the kernel accesses host allocations indirectly. ZE_KERNEL_INDIRECT_ACCESS_FLAG_DEVICE = ZE_BIT(1), ///< Indicates that the kernel accesses device allocations indirectly. ZE_KERNEL_INDIRECT_ACCESS_FLAG_SHARED = ZE_BIT(2), ///< Indicates that the kernel accesses shared allocations indirectly. - ZE_KERNEL_INDIRECT_ACCESS_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_KERNEL_INDIRECT_ACCESS_FLAG_* ENUMs + ZE_KERNEL_INDIRECT_ACCESS_FLAG_FORCE_UINT32 = 0x7fffffff } ze_kernel_indirect_access_flag_t; @@ -6564,14 +6461,10 @@ zeKernelGetSourceAttributes( 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. + ///< 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. ); /////////////////////////////////////////////////////////////////////////////// @@ -6581,7 +6474,7 @@ typedef enum _ze_cache_config_flag_t { ZE_CACHE_CONFIG_FLAG_LARGE_SLM = ZE_BIT(0), ///< Large SLM size ZE_CACHE_CONFIG_FLAG_LARGE_DATA = ZE_BIT(1), ///< Large General Data size - ZE_CACHE_CONFIG_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_CACHE_CONFIG_FLAG_* ENUMs + ZE_CACHE_CONFIG_FLAG_FORCE_UINT32 = 0x7fffffff } ze_cache_config_flag_t; @@ -6940,7 +6833,7 @@ typedef enum _ze_module_program_exp_version_t { ZE_MODULE_PROGRAM_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZE_MODULE_PROGRAM_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_MODULE_PROGRAM_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_MODULE_PROGRAM_EXP_VERSION_* ENUMs + ZE_MODULE_PROGRAM_EXP_VERSION_FORCE_UINT32 = 0x7fffffff } ze_module_program_exp_version_t; @@ -6993,7 +6886,7 @@ typedef enum _ze_raytracing_ext_version_t { ZE_RAYTRACING_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZE_RAYTRACING_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_RAYTRACING_EXT_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_RAYTRACING_EXT_VERSION_* ENUMs + ZE_RAYTRACING_EXT_VERSION_FORCE_UINT32 = 0x7fffffff } ze_raytracing_ext_version_t; @@ -7003,7 +6896,7 @@ typedef uint32_t ze_device_raytracing_ext_flags_t; typedef enum _ze_device_raytracing_ext_flag_t { ZE_DEVICE_RAYTRACING_EXT_FLAG_RAYQUERY = ZE_BIT(0), ///< Supports rayquery - ZE_DEVICE_RAYTRACING_EXT_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_DEVICE_RAYTRACING_EXT_FLAG_* ENUMs + ZE_DEVICE_RAYTRACING_EXT_FLAG_FORCE_UINT32 = 0x7fffffff } ze_device_raytracing_ext_flag_t; @@ -7029,7 +6922,7 @@ typedef uint32_t ze_raytracing_mem_alloc_ext_flags_t; typedef enum _ze_raytracing_mem_alloc_ext_flag_t { ZE_RAYTRACING_MEM_ALLOC_EXT_FLAG_TBD = ZE_BIT(0), ///< reserved for future use - ZE_RAYTRACING_MEM_ALLOC_EXT_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_RAYTRACING_MEM_ALLOC_EXT_FLAG_* ENUMs + ZE_RAYTRACING_MEM_ALLOC_EXT_FLAG_FORCE_UINT32 = 0x7fffffff } ze_raytracing_mem_alloc_ext_flag_t; @@ -7191,7 +7084,7 @@ typedef enum _ze_sampler_address_mode_t ///< 0.0f, 0.0f, 0.0f) if image format swizzle contains alpha, otherwise ///< (0.0f, 0.0f, 0.0f, 1.0f). ZE_SAMPLER_ADDRESS_MODE_MIRROR = 4, ///< Out-of-bounds coordinates are mirrored starting from edge. - ZE_SAMPLER_ADDRESS_MODE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_SAMPLER_ADDRESS_MODE_* ENUMs + ZE_SAMPLER_ADDRESS_MODE_FORCE_UINT32 = 0x7fffffff } ze_sampler_address_mode_t; @@ -7201,7 +7094,7 @@ typedef enum _ze_sampler_filter_mode_t { ZE_SAMPLER_FILTER_MODE_NEAREST = 0, ///< No coordinate modifications for out of bounds image access. ZE_SAMPLER_FILTER_MODE_LINEAR = 1, ///< Out-of-bounds coordinates are wrapped back around. - ZE_SAMPLER_FILTER_MODE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_SAMPLER_FILTER_MODE_* ENUMs + ZE_SAMPLER_FILTER_MODE_FORCE_UINT32 = 0x7fffffff } ze_sampler_filter_mode_t; @@ -7291,7 +7184,7 @@ typedef enum _ze_memory_access_attribute_t ZE_MEMORY_ACCESS_ATTRIBUTE_NONE = 0, ///< Indicates the memory page is inaccessible. ZE_MEMORY_ACCESS_ATTRIBUTE_READWRITE = 1, ///< Indicates the memory page supports read write access. ZE_MEMORY_ACCESS_ATTRIBUTE_READONLY = 2, ///< Indicates the memory page supports read-only access. - ZE_MEMORY_ACCESS_ATTRIBUTE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_MEMORY_ACCESS_ATTRIBUTE_* ENUMs + ZE_MEMORY_ACCESS_ATTRIBUTE_FORCE_UINT32 = 0x7fffffff } ze_memory_access_attribute_t; @@ -7399,7 +7292,7 @@ typedef enum _ze_physical_mem_flag_t { ZE_PHYSICAL_MEM_FLAG_ALLOCATE_ON_DEVICE = ZE_BIT(0), ///< [default] allocate physical device memory. ZE_PHYSICAL_MEM_FLAG_ALLOCATE_ON_HOST = ZE_BIT(1), ///< Allocate physical host memory instead. - ZE_PHYSICAL_MEM_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_PHYSICAL_MEM_FLAG_* ENUMs + ZE_PHYSICAL_MEM_FLAG_FORCE_UINT32 = 0x7fffffff } ze_physical_mem_flag_t; @@ -7648,7 +7541,7 @@ typedef enum _ze_float_atomics_ext_version_t { ZE_FLOAT_ATOMICS_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZE_FLOAT_ATOMICS_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_FLOAT_ATOMICS_EXT_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_FLOAT_ATOMICS_EXT_VERSION_* ENUMs + ZE_FLOAT_ATOMICS_EXT_VERSION_FORCE_UINT32 = 0x7fffffff } ze_float_atomics_ext_version_t; @@ -7663,7 +7556,7 @@ typedef enum _ze_device_fp_atomic_ext_flag_t ZE_DEVICE_FP_ATOMIC_EXT_FLAG_LOCAL_LOAD_STORE = ZE_BIT(16), ///< Supports atomic load, store, and exchange ZE_DEVICE_FP_ATOMIC_EXT_FLAG_LOCAL_ADD = ZE_BIT(17), ///< Supports atomic add and subtract ZE_DEVICE_FP_ATOMIC_EXT_FLAG_LOCAL_MIN_MAX = ZE_BIT(18), ///< Supports atomic min and max - ZE_DEVICE_FP_ATOMIC_EXT_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_DEVICE_FP_ATOMIC_EXT_FLAG_* ENUMs + ZE_DEVICE_FP_ATOMIC_EXT_FLAG_FORCE_UINT32 = 0x7fffffff } ze_device_fp_atomic_ext_flag_t; @@ -7706,7 +7599,7 @@ typedef enum _ze_global_offset_exp_version_t { ZE_GLOBAL_OFFSET_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZE_GLOBAL_OFFSET_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_GLOBAL_OFFSET_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_GLOBAL_OFFSET_EXP_VERSION_* ENUMs + ZE_GLOBAL_OFFSET_EXP_VERSION_FORCE_UINT32 = 0x7fffffff } ze_global_offset_exp_version_t; @@ -7755,7 +7648,7 @@ 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_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_FORCE_UINT32 = 0x7fffffff } ze_relaxed_allocation_limits_exp_version_t; @@ -7766,7 +7659,7 @@ 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_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_RELAXED_ALLOCATION_LIMITS_EXP_FLAG_* ENUMs + ZE_RELAXED_ALLOCATION_LIMITS_EXP_FLAG_FORCE_UINT32 = 0x7fffffff } ze_relaxed_allocation_limits_exp_flag_t; @@ -7808,7 +7701,7 @@ typedef enum _ze_kernel_get_binary_exp_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_KERNEL_GET_BINARY_EXP_VERSION_FORCE_UINT32 = 0x7fffffff } ze_kernel_get_binary_exp_version_t; @@ -7859,7 +7752,7 @@ 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_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< 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_FORCE_UINT32 = 0x7fffffff } ze_driver_ddi_handles_ext_version_t; @@ -7869,7 +7762,7 @@ typedef uint32_t ze_driver_ddi_handle_ext_flags_t; typedef enum _ze_driver_ddi_handle_ext_flag_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_DRIVER_DDI_HANDLE_EXT_FLAG_FORCE_UINT32 = 0x7fffffff } ze_driver_ddi_handle_ext_flag_t; @@ -7907,7 +7800,7 @@ 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_FORCE_UINT32 = 0x7fffffff } ze_external_semaphore_ext_version_t; @@ -7929,7 +7822,7 @@ typedef enum _ze_external_semaphore_ext_flag_t 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_FORCE_UINT32 = 0x7fffffff } ze_external_semaphore_ext_flag_t; @@ -8139,1287 +8032,227 @@ zeCommandListAppendWaitExternalSemaphoreExt( #if !defined(__GNUC__) #pragma endregion #endif -// Intel 'oneAPI' Level-Zero Extension APIs for CacheLine Size +// Intel 'oneAPI' Level-Zero Extension APIs for Cache Reservation #if !defined(__GNUC__) -#pragma region CacheLineSize +#pragma region cacheReservation #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 +#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 + +} ze_cache_reservation_ext_version_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief CacheLine Size Extension Version(s) -typedef enum _ze_device_cache_line_size_ext_version_t +/// @brief Cache Reservation Region +typedef enum _ze_cache_ext_region_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_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 -} ze_device_cache_line_size_ext_version_t; +} ze_cache_ext_region_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief CacheLine Size queried using ::zeDeviceGetCacheProperties +/// @brief CacheReservation structure /// /// @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 +/// - 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 cacheLineSize; ///< [out] The cache line size in bytes. + 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_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 + ); -} ze_device_cache_line_size_ext_t; +/////////////////////////////////////////////////////////////////////////////// +/// @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_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_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 ray tracing acceleration structure. +// Intel 'oneAPI' Level-Zero Extension for supporting event query timestamps. #if !defined(__GNUC__) -#pragma region RTAS +#pragma region eventquerytimestamps #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_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 Ray tracing acceleration structure device flags -typedef uint32_t ze_rtas_device_ext_flags_t; -typedef enum _ze_rtas_device_ext_flag_t +/// @brief Event Query Timestamps Extension Version(s) +typedef enum _ze_event_query_timestamps_exp_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_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 -} ze_rtas_device_ext_flag_t; +} ze_event_query_timestamps_exp_version_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Ray tracing acceleration structure format +/// @brief Query event timestamps for a device or sub-device. /// /// @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; +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. +/// - The implementation must support +/// ::ZE_experimental_event_query_timestamps. +/// - 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_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 /////////////////////////////////////////////////////////////////////////////// -/// @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; +#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 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 Memory Properties Extension Version(s) +typedef enum _ze_image_memory_properties_exp_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_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 -/////////////////////////////////////////////////////////////////////////////// -/// @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_memory_properties_exp_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 memory properties +typedef struct _ze_image_memory_properties_exp_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; + 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. -/////////////////////////////////////////////////////////////////////////////// -/// @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; +} ze_image_memory_properties_exp_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Ray tracing acceleration structure builder build operation flags +/// @brief Query image memory properties. /// /// @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_extension_rtas 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_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_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_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_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_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_NULL_HANDLE -/// + `nullptr == hDriver` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `::ZE_RTAS_FORMAT_EXT_MAX < rtasFormatA` -/// + `::ZE_RTAS_FORMAT_EXT_MAX < rtasFormatB` -/// - ::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_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_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_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 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_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 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_extension_rtas 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_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 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. -/// -/// @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_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 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_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 Destroys a ray tracing acceleration structure builder parallel -/// operation object -/// -/// @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. -/// -/// @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_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 - ); - -#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 Device Vector Sizes Query Extension Version(s) -typedef enum _ze_device_vector_sizes_ext_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_device_vector_sizes_ext_version_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 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_device_vector_width_properties_ext_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @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_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 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_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_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_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_experimental_event_query_timestamps. -/// - 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_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 -/////////////////////////////////////////////////////////////////////////////// -#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 -/// - The application may call this function from simultaneous threads. -/// - The implementation of this function must be thread-safe. -/// - The implementation must support -/// ::ZE_experimental_image_memory_properties extension. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. +/// - The implementation must support +/// ::ZE_experimental_image_memory_properties extension. /// /// @remarks /// _Analogues_ @@ -9460,7 +8293,7 @@ typedef enum _ze_image_view_ext_version_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_IMAGE_VIEW_EXT_VERSION_FORCE_UINT32 = 0x7fffffff } ze_image_view_ext_version_t; @@ -9522,7 +8355,7 @@ typedef enum _ze_image_view_exp_version_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_IMAGE_VIEW_EXP_VERSION_FORCE_UINT32 = 0x7fffffff } ze_image_view_exp_version_t; @@ -9594,7 +8427,7 @@ 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 + ZE_IMAGE_VIEW_PLANAR_EXT_VERSION_FORCE_UINT32 = 0x7fffffff } ze_image_view_planar_ext_version_t; @@ -9621,7 +8454,7 @@ typedef enum _ze_image_view_planar_exp_version_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_IMAGE_VIEW_PLANAR_EXP_VERSION_FORCE_UINT32 = 0x7fffffff } ze_image_view_planar_exp_version_t; @@ -9632,8 +8465,7 @@ typedef struct _ze_image_view_planar_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; ///< [DEPRECATED] no longer supported, use - ///< ::ze_image_view_planar_ext_desc_t instead + uint32_t planeIndex; ///< [in] the 0-based plane index (e.g. NV12 is 0 = Y plane, 1 UV plane) } ze_image_view_planar_exp_desc_t; @@ -9656,7 +8488,7 @@ typedef enum _ze_scheduling_hints_exp_version_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_SCHEDULING_HINTS_EXP_VERSION_FORCE_UINT32 = 0x7fffffff } ze_scheduling_hints_exp_version_t; @@ -9668,7 +8500,7 @@ typedef enum _ze_scheduling_hint_exp_flag_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 + ZE_SCHEDULING_HINT_EXP_FLAG_FORCE_UINT32 = 0x7fffffff } ze_scheduling_hint_exp_flag_t; @@ -9755,7 +8587,7 @@ typedef enum _ze_linkonce_odr_ext_version_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_FORCE_UINT32 = 0x7fffffff } ze_linkonce_odr_ext_version_t; @@ -9778,7 +8610,7 @@ typedef enum _ze_power_saving_hint_exp_version_t { ZE_POWER_SAVING_HINT_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZE_POWER_SAVING_HINT_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_POWER_SAVING_HINT_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_POWER_SAVING_HINT_EXP_VERSION_* ENUMs + ZE_POWER_SAVING_HINT_EXP_VERSION_FORCE_UINT32 = 0x7fffffff } ze_power_saving_hint_exp_version_t; @@ -9790,7 +8622,7 @@ typedef enum _ze_power_saving_hint_type_t ///< while executing work submitted to this context. ZE_POWER_SAVING_HINT_TYPE_MAX = 100, ///< Maximum power savings. The device will do everything to bring power to ///< a minimum while executing work submitted to this context. - ZE_POWER_SAVING_HINT_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_POWER_SAVING_HINT_TYPE_* ENUMs + ZE_POWER_SAVING_HINT_TYPE_FORCE_UINT32 = 0x7fffffff } ze_power_saving_hint_type_t; @@ -9825,7 +8657,7 @@ typedef enum _ze_subgroup_ext_version_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_FORCE_UINT32 = 0x7fffffff } ze_subgroup_ext_version_t; @@ -9848,7 +8680,7 @@ 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_FORCE_UINT32 = 0x7fffffff } ze_eu_count_ext_version_t; @@ -9887,7 +8719,7 @@ typedef enum _ze_pci_properties_ext_version_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_PCI_PROPERTIES_EXT_VERSION_FORCE_UINT32 = 0x7fffffff } ze_pci_properties_ext_version_t; @@ -9980,7 +8812,7 @@ 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_FORCE_UINT32 = 0x7fffffff } ze_srgb_ext_version_t; @@ -10019,7 +8851,7 @@ 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_FORCE_UINT32 = 0x7fffffff } ze_image_copy_ext_version_t; @@ -10170,7 +9002,7 @@ 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_FORCE_UINT32 = 0x7fffffff } ze_image_query_alloc_properties_ext_version_t; @@ -10229,7 +9061,7 @@ 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_FORCE_UINT32 = 0x7fffffff } ze_linkage_inspection_ext_version_t; @@ -10241,7 +9073,7 @@ 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_FORCE_UINT32 = 0x7fffffff } ze_linkage_inspection_ext_flag_t; @@ -10312,7 +9144,7 @@ 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_FORCE_UINT32 = 0x7fffffff } ze_memory_compression_hints_ext_version_t; @@ -10323,7 +9155,7 @@ 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_FORCE_UINT32 = 0x7fffffff } ze_memory_compression_hints_ext_flag_t; @@ -10367,7 +9199,7 @@ 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_FORCE_UINT32 = 0x7fffffff } ze_memory_free_policies_ext_version_t; @@ -10376,16 +9208,9 @@ typedef enum _ze_memory_free_policies_ext_version_t 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_BLOCKING_FREE = ZE_BIT(0), ///< blocks until all commands using the memory are complete before freeing + ZE_DRIVER_MEMORY_FREE_POLICY_EXT_FLAG_DEFER_FREE = ZE_BIT(1), ///< schedules the memory to be freed but does not free immediately + ZE_DRIVER_MEMORY_FREE_POLICY_EXT_FLAG_FORCE_UINT32 = 0x7fffffff } ze_driver_memory_free_policy_ext_flag_t; @@ -10421,13 +9246,11 @@ typedef struct _ze_memory_free_ext_desc_t } ze_memory_free_ext_desc_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Frees allocated host memory, device memory, or shared memory on the -/// context using the specified free policy. +/// @brief Frees allocated host memory, device memory, or shared memory using the +/// specified free policy. /// /// @details -/// - Similar to zeMemFree, with added parameter to choose the free policy. -/// - Does not gaurantee memory is freed upon return. See free policy -/// descriptions for details. +/// - The memory free policy is specified by the memory free descriptor. /// - The application must **not** call this function from simultaneous /// threads with the same pointer. /// - The implementation of this function must be thread-safe. @@ -10526,7 +9349,7 @@ typedef enum _ze_device_luid_ext_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_DEVICE_LUID_EXT_VERSION_FORCE_UINT32 = 0x7fffffff } ze_device_luid_ext_version_t; @@ -10598,7 +9421,7 @@ typedef enum _ze_fabric_vertex_exp_type_t 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_FABRIC_VERTEX_EXP_TYPE_FORCE_UINT32 = 0x7fffffff } ze_fabric_vertex_exp_type_t; @@ -10611,7 +9434,7 @@ typedef enum _ze_fabric_edge_exp_duplexity_t ///< 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_FABRIC_EDGE_EXP_DUPLEXITY_FORCE_UINT32 = 0x7fffffff } ze_fabric_edge_exp_duplexity_t; @@ -10913,7 +9736,7 @@ 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_FORCE_UINT32 = 0x7fffffff } ze_device_memory_properties_ext_version_t; @@ -10943,7 +9766,7 @@ typedef enum _ze_device_memory_ext_type_t 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_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_DEVICE_MEMORY_EXT_TYPE_* ENUMs + ZE_DEVICE_MEMORY_EXT_TYPE_FORCE_UINT32 = 0x7fffffff } ze_device_memory_ext_type_t; @@ -10987,7 +9810,7 @@ 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_FORCE_UINT32 = 0x7fffffff } ze_bfloat16_conversions_ext_version_t; @@ -11010,7 +9833,7 @@ 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_FORCE_UINT32 = 0x7fffffff } ze_device_ip_version_version_t; @@ -11050,7 +9873,7 @@ 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_FORCE_UINT32 = 0x7fffffff } ze_kernel_max_group_size_properties_ext_version_t; @@ -11095,7 +9918,7 @@ typedef enum _ze_sub_allocations_exp_version_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_SUB_ALLOCATIONS_EXP_VERSION_FORCE_UINT32 = 0x7fffffff } ze_sub_allocations_exp_version_t; @@ -11149,7 +9972,7 @@ 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_FORCE_UINT32 = 0x7fffffff } ze_event_query_kernel_timestamps_ext_version_t; @@ -11160,7 +9983,7 @@ 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_FORCE_UINT32 = 0x7fffffff } ze_event_query_kernel_timestamps_ext_flag_t; @@ -11289,7 +10112,7 @@ 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_FORCE_UINT32 = 0x7fffffff } ze_rtas_builder_exp_version_t; @@ -11299,7 +10122,7 @@ 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_FORCE_UINT32 = 0x7fffffff } ze_rtas_device_exp_flag_t; @@ -11312,8 +10135,7 @@ typedef enum _ze_rtas_device_exp_flag_t 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 + ZE_RTAS_FORMAT_EXP_FORCE_UINT32 = 0x7fffffff } ze_rtas_format_exp_t; @@ -11323,7 +10145,7 @@ typedef uint32_t ze_rtas_builder_exp_flags_t; typedef enum _ze_rtas_builder_exp_flag_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_RTAS_BUILDER_EXP_FLAG_FORCE_UINT32 = 0x7fffffff } ze_rtas_builder_exp_flag_t; @@ -11333,7 +10155,7 @@ 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 + ZE_RTAS_PARALLEL_OPERATION_EXP_FLAG_FORCE_UINT32 = 0x7fffffff } ze_rtas_parallel_operation_exp_flag_t; @@ -11343,7 +10165,7 @@ 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_FORCE_UINT32 = 0x7fffffff } ze_rtas_builder_geometry_exp_flag_t; @@ -11363,7 +10185,7 @@ typedef enum _ze_rtas_builder_instance_exp_flag_t ///< 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_RTAS_BUILDER_INSTANCE_EXP_FLAG_FORCE_UINT32 = 0x7fffffff } ze_rtas_builder_instance_exp_flag_t; @@ -11389,7 +10211,7 @@ 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_FORCE_UINT32 = 0x7fffffff } ze_rtas_builder_build_op_exp_flag_t; @@ -11412,7 +10234,7 @@ 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_FORCE_UINT32 = 0x7fffffff } ze_rtas_builder_build_quality_hint_exp_t; @@ -11424,7 +10246,7 @@ typedef enum _ze_rtas_builder_geometry_type_exp_t 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_RTAS_BUILDER_GEOMETRY_TYPE_EXP_FORCE_UINT32 = 0x7fffffff } ze_rtas_builder_geometry_type_exp_t; @@ -11453,7 +10275,7 @@ typedef enum _ze_rtas_builder_input_data_format_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_FORCE_UINT32 = 0x7fffffff } ze_rtas_builder_input_data_format_exp_t; @@ -11902,7 +10724,7 @@ zeRTASBuilderCreateExp( /// + `nullptr == pBuildOpDescriptor` /// + `nullptr == pProperties` /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `::ZE_RTAS_FORMAT_EXP_MAX < pBuildOpDescriptor->rtasFormat` +/// + `::ZE_RTAS_FORMAT_EXP_INVALID < pBuildOpDescriptor->rtasFormat` /// + `::ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_HIGH < pBuildOpDescriptor->buildQuality` /// + `0x3 < pBuildOpDescriptor->buildFlags` ZE_APIEXPORT ze_result_t ZE_APICALL @@ -11928,8 +10750,8 @@ zeRTASBuilderGetBuildPropertiesExp( /// - ::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_RTAS_FORMAT_EXP_INVALID < rtasFormatA` +/// + `::ZE_RTAS_FORMAT_EXP_INVALID < rtasFormatB` /// - ::ZE_RESULT_SUCCESS /// + An acceleration structure built with `rtasFormatA` is compatible with devices that report `rtasFormatB`. /// - ::ZE_RESULT_EXP_ERROR_OPERANDS_INCOMPATIBLE @@ -12004,7 +10826,7 @@ zeDriverRTASFormatCompatibilityCheckExp( /// + `nullptr == pScratchBuffer` /// + `nullptr == pRtasBuffer` /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `::ZE_RTAS_FORMAT_EXP_MAX < pBuildOpDescriptor->rtasFormat` +/// + `::ZE_RTAS_FORMAT_EXP_INVALID < pBuildOpDescriptor->rtasFormat` /// + `::ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_HIGH < pBuildOpDescriptor->buildQuality` /// + `0x3 < pBuildOpDescriptor->buildFlags` /// - ::ZE_RESULT_EXP_RTAS_BUILD_DEFERRED @@ -12173,7 +10995,7 @@ 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_FORCE_UINT32 = 0x7fffffff } ze_event_pool_counter_based_exp_version_t; @@ -12184,7 +11006,7 @@ 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_FORCE_UINT32 = 0x7fffffff } ze_event_pool_counter_based_exp_flag_t; @@ -12223,7 +11045,7 @@ 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_FORCE_UINT32 = 0x7fffffff } ze_bindless_image_exp_version_t; @@ -12237,7 +11059,7 @@ typedef enum _ze_image_bindless_exp_flag_t 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_FORCE_UINT32 = 0x7fffffff } ze_image_bindless_exp_flag_t; @@ -12366,7 +11188,7 @@ 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_FORCE_UINT32 = 0x7fffffff } ze_command_list_clone_exp_version_t; @@ -12423,7 +11245,7 @@ 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_FORCE_UINT32 = 0x7fffffff } ze_immediate_command_list_append_exp_version_t; @@ -12485,7 +11307,7 @@ 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_FORCE_UINT32 = 0x7fffffff } ze_mutable_command_list_exp_version_t; @@ -12502,7 +11324,7 @@ typedef enum _ze_mutable_command_exp_flag_t 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_FORCE_UINT32 = 0x7fffffff } ze_mutable_command_exp_flag_t; @@ -12527,7 +11349,7 @@ 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_FORCE_UINT32 = 0x7fffffff } ze_mutable_command_list_exp_flag_t; diff --git a/include/ze_ddi.h b/include/ze_ddi.h index 86f43368..9f99592b 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.13-r1.13.1 + * @version v1.12-r1.12.15 * */ #ifndef _ZE_DDI_H @@ -19,88 +19,6 @@ extern "C" { #endif -/////////////////////////////////////////////////////////////////////////////// -/// @brief Function-pointer for zeRTASBuilderCreateExt -typedef ze_result_t (ZE_APICALL *ze_pfnRTASBuilderCreateExt_t)( - ze_driver_handle_t, - const ze_rtas_builder_ext_desc_t*, - ze_rtas_builder_ext_handle_t* - ); - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Function-pointer for zeRTASBuilderGetBuildPropertiesExt -typedef ze_result_t (ZE_APICALL *ze_pfnRTASBuilderGetBuildPropertiesExt_t)( - ze_rtas_builder_ext_handle_t, - const ze_rtas_builder_build_op_ext_desc_t*, - ze_rtas_builder_ext_properties_t* - ); - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Function-pointer for zeRTASBuilderBuildExt -typedef ze_result_t (ZE_APICALL *ze_pfnRTASBuilderBuildExt_t)( - ze_rtas_builder_ext_handle_t, - const ze_rtas_builder_build_op_ext_desc_t*, - void*, - size_t, - void*, - size_t, - ze_rtas_parallel_operation_ext_handle_t, - void*, - ze_rtas_aabb_ext_t*, - size_t* - ); - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Function-pointer for zeRTASBuilderCommandListAppendCopyExt -typedef ze_result_t (ZE_APICALL *ze_pfnRTASBuilderCommandListAppendCopyExt_t)( - ze_command_list_handle_t, - void*, - const void*, - size_t, - ze_event_handle_t, - uint32_t, - ze_event_handle_t* - ); - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Function-pointer for zeRTASBuilderDestroyExt -typedef ze_result_t (ZE_APICALL *ze_pfnRTASBuilderDestroyExt_t)( - ze_rtas_builder_ext_handle_t - ); - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Table of RTASBuilder functions pointers -typedef struct _ze_rtas_builder_dditable_t -{ - ze_pfnRTASBuilderCreateExt_t pfnCreateExt; - ze_pfnRTASBuilderGetBuildPropertiesExt_t pfnGetBuildPropertiesExt; - ze_pfnRTASBuilderBuildExt_t pfnBuildExt; - ze_pfnRTASBuilderCommandListAppendCopyExt_t pfnCommandListAppendCopyExt; - ze_pfnRTASBuilderDestroyExt_t pfnDestroyExt; -} ze_rtas_builder_dditable_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Exported function for filling application's RTASBuilder 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 -zeGetRTASBuilderProcAddrTable( - ze_api_version_t version, ///< [in] API version requested - ze_rtas_builder_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers - ); - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Function-pointer for zeGetRTASBuilderProcAddrTable -typedef ze_result_t (ZE_APICALL *ze_pfnGetRTASBuilderProcAddrTable_t)( - ze_api_version_t, - ze_rtas_builder_dditable_t* - ); - /////////////////////////////////////////////////////////////////////////////// /// @brief Function-pointer for zeRTASBuilderCreateExp typedef ze_result_t (ZE_APICALL *ze_pfnRTASBuilderCreateExp_t)( @@ -170,64 +88,6 @@ typedef ze_result_t (ZE_APICALL *ze_pfnGetRTASBuilderExpProcAddrTable_t)( ze_rtas_builder_exp_dditable_t* ); -/////////////////////////////////////////////////////////////////////////////// -/// @brief Function-pointer for zeRTASParallelOperationCreateExt -typedef ze_result_t (ZE_APICALL *ze_pfnRTASParallelOperationCreateExt_t)( - ze_driver_handle_t, - ze_rtas_parallel_operation_ext_handle_t* - ); - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Function-pointer for zeRTASParallelOperationGetPropertiesExt -typedef ze_result_t (ZE_APICALL *ze_pfnRTASParallelOperationGetPropertiesExt_t)( - ze_rtas_parallel_operation_ext_handle_t, - ze_rtas_parallel_operation_ext_properties_t* - ); - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Function-pointer for zeRTASParallelOperationJoinExt -typedef ze_result_t (ZE_APICALL *ze_pfnRTASParallelOperationJoinExt_t)( - ze_rtas_parallel_operation_ext_handle_t - ); - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Function-pointer for zeRTASParallelOperationDestroyExt -typedef ze_result_t (ZE_APICALL *ze_pfnRTASParallelOperationDestroyExt_t)( - ze_rtas_parallel_operation_ext_handle_t - ); - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Table of RTASParallelOperation functions pointers -typedef struct _ze_rtas_parallel_operation_dditable_t -{ - ze_pfnRTASParallelOperationCreateExt_t pfnCreateExt; - ze_pfnRTASParallelOperationGetPropertiesExt_t pfnGetPropertiesExt; - ze_pfnRTASParallelOperationJoinExt_t pfnJoinExt; - ze_pfnRTASParallelOperationDestroyExt_t pfnDestroyExt; -} ze_rtas_parallel_operation_dditable_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Exported function for filling application's RTASParallelOperation 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 -zeGetRTASParallelOperationProcAddrTable( - ze_api_version_t version, ///< [in] API version requested - ze_rtas_parallel_operation_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers - ); - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Function-pointer for zeGetRTASParallelOperationProcAddrTable -typedef ze_result_t (ZE_APICALL *ze_pfnGetRTASParallelOperationProcAddrTable_t)( - ze_api_version_t, - ze_rtas_parallel_operation_dditable_t* - ); - /////////////////////////////////////////////////////////////////////////////// /// @brief Function-pointer for zeRTASParallelOperationCreateExp typedef ze_result_t (ZE_APICALL *ze_pfnRTASParallelOperationCreateExp_t)( @@ -381,14 +241,6 @@ typedef ze_result_t (ZE_APICALL *ze_pfnDriverGetLastErrorDescription_t)( const char** ); -/////////////////////////////////////////////////////////////////////////////// -/// @brief Function-pointer for zeDriverRTASFormatCompatibilityCheckExt -typedef ze_result_t (ZE_APICALL *ze_pfnDriverRTASFormatCompatibilityCheckExt_t)( - ze_driver_handle_t, - ze_rtas_format_ext_t, - ze_rtas_format_ext_t - ); - /////////////////////////////////////////////////////////////////////////////// /// @brief Table of Driver functions pointers typedef struct _ze_driver_dditable_t @@ -400,7 +252,6 @@ typedef struct _ze_driver_dditable_t ze_pfnDriverGetExtensionProperties_t pfnGetExtensionProperties; ze_pfnDriverGetExtensionFunctionAddress_t pfnGetExtensionFunctionAddress; ze_pfnDriverGetLastErrorDescription_t pfnGetLastErrorDescription; - ze_pfnDriverRTASFormatCompatibilityCheckExt_t pfnRTASFormatCompatibilityCheckExt; } ze_driver_dditable_t; /////////////////////////////////////////////////////////////////////////////// @@ -619,14 +470,6 @@ typedef ze_result_t (ZE_APICALL *ze_pfnDeviceReleaseExternalSemaphoreExt_t)( ze_external_semaphore_ext_handle_t ); -/////////////////////////////////////////////////////////////////////////////// -/// @brief Function-pointer for zeDeviceGetVectorWidthPropertiesExt -typedef ze_result_t (ZE_APICALL *ze_pfnDeviceGetVectorWidthPropertiesExt_t)( - ze_device_handle_t, - uint32_t*, - ze_device_vector_width_properties_ext_t* - ); - /////////////////////////////////////////////////////////////////////////////// /// @brief Table of Device functions pointers typedef struct _ze_device_dditable_t @@ -652,7 +495,6 @@ typedef struct _ze_device_dditable_t ze_pfnDeviceGetRootDevice_t pfnGetRootDevice; ze_pfnDeviceImportExternalSemaphoreExt_t pfnImportExternalSemaphoreExt; ze_pfnDeviceReleaseExternalSemaphoreExt_t pfnReleaseExternalSemaphoreExt; - ze_pfnDeviceGetVectorWidthPropertiesExt_t pfnGetVectorWidthPropertiesExt; } ze_device_dditable_t; /////////////////////////////////////////////////////////////////////////////// @@ -2746,9 +2588,7 @@ typedef ze_result_t (ZE_APICALL *ze_pfnGetFabricEdgeExpProcAddrTable_t)( /// @brief Container for all DDI tables typedef struct _ze_dditable_t { - ze_rtas_builder_dditable_t RTASBuilder; ze_rtas_builder_exp_dditable_t RTASBuilderExp; - ze_rtas_parallel_operation_dditable_t RTASParallelOperation; ze_rtas_parallel_operation_exp_dditable_t RTASParallelOperationExp; ze_global_dditable_t Global; ze_driver_dditable_t Driver; @@ -2782,9 +2622,7 @@ typedef struct _ze_dditable_driver_t { ze_api_version_t version; uint8_t isValidFlag; - ze_rtas_builder_dditable_t * RTASBuilder; ze_rtas_builder_exp_dditable_t * RTASBuilderExp; - ze_rtas_parallel_operation_dditable_t * RTASParallelOperation; ze_rtas_parallel_operation_exp_dditable_t * RTASParallelOperationExp; ze_global_dditable_t * Global; ze_driver_dditable_t * Driver; diff --git a/include/ze_ddi_common.h b/include/ze_ddi_common.h index ca6eb50a..7831c57f 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.13-r1.13.1 + * @version v1.12-r1.12.15 * */ #ifndef _ZE_DDI_COMMON_H diff --git a/include/zes.py b/include/zes.py index b9a9ca21..2b005b07 100644 --- a/include/zes.py +++ b/include/zes.py @@ -4,7 +4,7 @@ SPDX-License-Identifier: MIT @file zes.py - @version v1.13-r1.13.1 + @version v1.12-r1.12.15 """ import platform @@ -169,7 +169,6 @@ class zes_structure_type_v(IntEnum): VF_UTIL_MEM_EXP2 = 0x00020009 ## ::zes_vf_util_mem_exp2_t VF_UTIL_ENGINE_EXP2 = 0x00020010 ## ::zes_vf_util_engine_exp2_t VF_EXP2_CAPABILITIES = 0x00020011 ## ::zes_vf_exp2_capabilities_t - DEVICE_ECC_DEFAULT_PROPERTIES_EXT = 0x00020012 ## ::zes_device_ecc_default_properties_ext_t class zes_structure_type_t(c_int): def __str__(self): @@ -2148,32 +2147,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 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 82f706e0..62705642 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.13-r1.13.1 + * @version v1.12-r1.12.15 * */ #ifndef _ZES_API_H @@ -162,8 +162,7 @@ typedef enum _zes_structure_type_t ZES_STRUCTURE_TYPE_VF_UTIL_MEM_EXP2 = 0x00020009, ///< ::zes_vf_util_mem_exp2_t ZES_STRUCTURE_TYPE_VF_UTIL_ENGINE_EXP2 = 0x00020010, ///< ::zes_vf_util_engine_exp2_t ZES_STRUCTURE_TYPE_VF_EXP2_CAPABILITIES = 0x00020011, ///< ::zes_vf_exp2_capabilities_t - ZES_STRUCTURE_TYPE_DEVICE_ECC_DEFAULT_PROPERTIES_EXT = 0x00020012, ///< ::zes_device_ecc_default_properties_ext_t - ZES_STRUCTURE_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_STRUCTURE_TYPE_* ENUMs + ZES_STRUCTURE_TYPE_FORCE_UINT32 = 0x7fffffff } zes_structure_type_t; @@ -509,10 +508,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_power_limit_ext_desc_t typedef struct _zes_power_limit_ext_desc_t zes_power_limit_ext_desc_t; @@ -587,7 +582,7 @@ typedef uint32_t zes_init_flags_t; typedef enum _zes_init_flag_t { ZES_INIT_FLAG_PLACEHOLDER = ZE_BIT(0), ///< placeholder for future use - ZES_INIT_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_INIT_FLAG_* ENUMs + ZES_INIT_FLAG_FORCE_UINT32 = 0x7fffffff } zes_init_flag_t; @@ -798,7 +793,7 @@ typedef enum _zes_engine_type_flag_t ZES_ENGINE_TYPE_FLAG_MEDIA = ZE_BIT(3), ///< Engines that process media workloads. ZES_ENGINE_TYPE_FLAG_DMA = ZE_BIT(4), ///< Engines that copy blocks of data. ZES_ENGINE_TYPE_FLAG_RENDER = ZE_BIT(5), ///< Engines that can process both 3D content and compute kernels. - ZES_ENGINE_TYPE_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_ENGINE_TYPE_FLAG_* ENUMs + ZES_ENGINE_TYPE_FLAG_FORCE_UINT32 = 0x7fffffff } zes_engine_type_flag_t; @@ -809,7 +804,7 @@ typedef enum _zes_repair_status_t ZES_REPAIR_STATUS_UNSUPPORTED = 0, ///< The device does not support in-field repairs. ZES_REPAIR_STATUS_NOT_PERFORMED = 1, ///< The device has never been repaired. ZES_REPAIR_STATUS_PERFORMED = 2, ///< The device has been repaired. - ZES_REPAIR_STATUS_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_REPAIR_STATUS_* ENUMs + ZES_REPAIR_STATUS_FORCE_UINT32 = 0x7fffffff } zes_repair_status_t; @@ -821,7 +816,7 @@ typedef enum _zes_reset_reason_flag_t ZES_RESET_REASON_FLAG_WEDGED = ZE_BIT(0), ///< The device needs to be reset because one or more parts of the hardware ///< is wedged ZES_RESET_REASON_FLAG_REPAIR = ZE_BIT(1), ///< The device needs to be reset in order to complete in-field repairs - ZES_RESET_REASON_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_RESET_REASON_FLAG_* ENUMs + ZES_RESET_REASON_FLAG_FORCE_UINT32 = 0x7fffffff } zes_reset_reason_flag_t; @@ -832,7 +827,7 @@ typedef enum _zes_reset_type_t ZES_RESET_TYPE_WARM = 0, ///< Apply warm reset ZES_RESET_TYPE_COLD = 1, ///< Apply cold reset ZES_RESET_TYPE_FLR = 2, ///< Apply FLR reset - ZES_RESET_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_RESET_TYPE_* ENUMs + ZES_RESET_TYPE_FORCE_UINT32 = 0x7fffffff } zes_reset_type_t; @@ -879,7 +874,7 @@ typedef enum _zes_device_type_t ZES_DEVICE_TYPE_FPGA = 3, ///< Field Programmable Gate Array ZES_DEVICE_TYPE_MCA = 4, ///< Memory Copy Accelerator ZES_DEVICE_TYPE_VPU = 5, ///< Vision Processing Unit - ZES_DEVICE_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_DEVICE_TYPE_* ENUMs + ZES_DEVICE_TYPE_FORCE_UINT32 = 0x7fffffff } zes_device_type_t; @@ -892,7 +887,7 @@ typedef enum _zes_device_property_flag_t ZES_DEVICE_PROPERTY_FLAG_SUBDEVICE = ZE_BIT(1), ///< Device handle used for query represents a sub-device. ZES_DEVICE_PROPERTY_FLAG_ECC = ZE_BIT(2), ///< Device supports error correction memory access. ZES_DEVICE_PROPERTY_FLAG_ONDEMANDPAGING = ZE_BIT(3), ///< Device supports on-demand page-faulting. - ZES_DEVICE_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_DEVICE_PROPERTY_FLAG_* ENUMs + ZES_DEVICE_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff } zes_device_property_flag_t; @@ -1176,7 +1171,7 @@ typedef enum _zes_pci_link_status_t ZES_PCI_LINK_STATUS_QUALITY_ISSUES = 2, ///< The link is up but has quality and/or bandwidth degradation ZES_PCI_LINK_STATUS_STABILITY_ISSUES = 3, ///< The link has stability issues and preventing workloads making forward ///< progress - ZES_PCI_LINK_STATUS_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_PCI_LINK_STATUS_* ENUMs + ZES_PCI_LINK_STATUS_FORCE_UINT32 = 0x7fffffff } zes_pci_link_status_t; @@ -1187,7 +1182,7 @@ typedef enum _zes_pci_link_qual_issue_flag_t { ZES_PCI_LINK_QUAL_ISSUE_FLAG_REPLAYS = ZE_BIT(0), ///< A significant number of replays are occurring ZES_PCI_LINK_QUAL_ISSUE_FLAG_SPEED = ZE_BIT(1), ///< There is a degradation in the maximum bandwidth of the link - ZES_PCI_LINK_QUAL_ISSUE_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_PCI_LINK_QUAL_ISSUE_FLAG_* ENUMs + ZES_PCI_LINK_QUAL_ISSUE_FLAG_FORCE_UINT32 = 0x7fffffff } zes_pci_link_qual_issue_flag_t; @@ -1197,7 +1192,7 @@ typedef uint32_t zes_pci_link_stab_issue_flags_t; typedef enum _zes_pci_link_stab_issue_flag_t { ZES_PCI_LINK_STAB_ISSUE_FLAG_RETRAINING = ZE_BIT(0), ///< Link retraining has occurred to deal with quality issues - ZES_PCI_LINK_STAB_ISSUE_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_PCI_LINK_STAB_ISSUE_FLAG_* ENUMs + ZES_PCI_LINK_STAB_ISSUE_FLAG_FORCE_UINT32 = 0x7fffffff } zes_pci_link_stab_issue_flag_t; @@ -1230,7 +1225,7 @@ typedef enum _zes_pci_bar_type_t ZES_PCI_BAR_TYPE_MMIO = 0, ///< MMIO registers ZES_PCI_BAR_TYPE_ROM = 1, ///< ROM aperture ZES_PCI_BAR_TYPE_MEM = 2, ///< Device memory - ZES_PCI_BAR_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_PCI_BAR_TYPE_* ENUMs + ZES_PCI_BAR_TYPE_FORCE_UINT32 = 0x7fffffff } zes_pci_bar_type_t; @@ -1423,7 +1418,7 @@ typedef enum _zes_overclock_domain_t ZES_OVERCLOCK_DOMAIN_GPU_MEDIA = 64, ///< Overclocking a GPU with media assets on its own PLL/VR. ZES_OVERCLOCK_DOMAIN_VRAM = 128, ///< Overclocking device local memory. ZES_OVERCLOCK_DOMAIN_ADM = 256, ///< Overclocking LLC/L4 cache. - ZES_OVERCLOCK_DOMAIN_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_OVERCLOCK_DOMAIN_* ENUMs + ZES_OVERCLOCK_DOMAIN_FORCE_UINT32 = 0x7fffffff } zes_overclock_domain_t; @@ -1446,7 +1441,7 @@ typedef enum _zes_overclock_control_t ZES_OVERCLOCK_CONTROL_TEMP_LIMIT = 512, ///< This control changes the value of TjMax. ZES_OVERCLOCK_CONTROL_ITD_DISABLE = 1024, ///< This control permits disabling the adaptive voltage feature ITD ZES_OVERCLOCK_CONTROL_ACM_DISABLE = 2048, ///< This control permits disabling the adaptive voltage feature ACM. - ZES_OVERCLOCK_CONTROL_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_OVERCLOCK_CONTROL_* ENUMs + ZES_OVERCLOCK_CONTROL_FORCE_UINT32 = 0x7fffffff } zes_overclock_control_t; @@ -1460,7 +1455,7 @@ typedef enum _zes_overclock_mode_t ZES_OVERCLOCK_MODE_MODE_UNAVAILABLE = 4, ///< Overclocking is unavailable at this time since the system is running ///< on battery. ZES_OVERCLOCK_MODE_MODE_DISABLED = 5, ///< Overclock mode is disabled. - ZES_OVERCLOCK_MODE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_OVERCLOCK_MODE_* ENUMs + ZES_OVERCLOCK_MODE_FORCE_UINT32 = 0x7fffffff } zes_overclock_mode_t; @@ -1473,7 +1468,7 @@ typedef enum _zes_control_state_t ZES_CONTROL_STATE_STATE_ACTIVE = 2, ///< The overclock control has been set and it is active. ZES_CONTROL_STATE_STATE_DISABLED = 3, ///< The overclock control value has been disabled due to the current power ///< configuration (typically when running on DC). - ZES_CONTROL_STATE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_CONTROL_STATE_* ENUMs + ZES_CONTROL_STATE_FORCE_UINT32 = 0x7fffffff } zes_control_state_t; @@ -1486,7 +1481,7 @@ typedef enum _zes_pending_action_t ZES_PENDING_ACTION_PENDING_COLD_RESET = 2, ///< The requested change requires a device cold reset (hotplug, system ///< boot). ZES_PENDING_ACTION_PENDING_WARM_RESET = 3, ///< The requested change requires a device warm reset (PCIe FLR). - ZES_PENDING_ACTION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_PENDING_ACTION_* ENUMs + ZES_PENDING_ACTION_FORCE_UINT32 = 0x7fffffff } zes_pending_action_t; @@ -1501,7 +1496,7 @@ typedef enum _zes_vf_program_type_t ///< the frequency of those points cannot be changed ZES_VF_PROGRAM_TYPE_VF_VOLT_FIXED = 2, ///< Can only program the frequency for the V-F points that is reads back - ///< the voltage of each point cannot be changed. - ZES_VF_PROGRAM_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_VF_PROGRAM_TYPE_* ENUMs + ZES_VF_PROGRAM_TYPE_FORCE_UINT32 = 0x7fffffff } zes_vf_program_type_t; @@ -1511,7 +1506,7 @@ typedef enum _zes_vf_type_t { ZES_VF_TYPE_VOLT = 0, ///< VF Voltage point ZES_VF_TYPE_FREQ = 1, ///< VF Frequency point - ZES_VF_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_VF_TYPE_* ENUMs + ZES_VF_TYPE_FORCE_UINT32 = 0x7fffffff } zes_vf_type_t; @@ -1522,7 +1517,7 @@ typedef enum _zes_vf_array_type_t ZES_VF_ARRAY_TYPE_USER_VF_ARRAY = 0, ///< User V-F array ZES_VF_ARRAY_TYPE_DEFAULT_VF_ARRAY = 1, ///< Default V-F array ZES_VF_ARRAY_TYPE_LIVE_VF_ARRAY = 2, ///< Live V-F array - ZES_VF_ARRAY_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_VF_ARRAY_TYPE_* ENUMs + ZES_VF_ARRAY_TYPE_FORCE_UINT32 = 0x7fffffff } zes_vf_array_type_t; @@ -2036,7 +2031,7 @@ typedef enum _zes_diag_result_t ZES_DIAG_RESULT_FAIL_CANT_REPAIR = 2, ///< Diagnostic had problems setting up repairs ZES_DIAG_RESULT_REBOOT_FOR_REPAIR = 3, ///< Diagnostics found errors, setup for repair and reboot is required to ///< complete the process - ZES_DIAG_RESULT_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_DIAG_RESULT_* ENUMs + ZES_DIAG_RESULT_FORCE_UINT32 = 0x7fffffff } zes_diag_result_t; @@ -2222,7 +2217,7 @@ typedef enum _zes_device_ecc_state_t ZES_DEVICE_ECC_STATE_UNAVAILABLE = 0, ///< None ZES_DEVICE_ECC_STATE_ENABLED = 1, ///< ECC enabled. ZES_DEVICE_ECC_STATE_DISABLED = 2, ///< ECC disabled. - ZES_DEVICE_ECC_STATE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_DEVICE_ECC_STATE_* ENUMs + ZES_DEVICE_ECC_STATE_FORCE_UINT32 = 0x7fffffff } zes_device_ecc_state_t; @@ -2234,7 +2229,7 @@ typedef enum _zes_device_action_t ZES_DEVICE_ACTION_WARM_CARD_RESET = 1, ///< Warm reset of the card. ZES_DEVICE_ACTION_COLD_CARD_RESET = 2, ///< Cold reset of the card. ZES_DEVICE_ACTION_COLD_SYSTEM_REBOOT = 3, ///< Cold reboot of the system. - ZES_DEVICE_ACTION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_DEVICE_ACTION_* ENUMs + ZES_DEVICE_ACTION_FORCE_UINT32 = 0x7fffffff } zes_device_action_t; @@ -2411,7 +2406,7 @@ typedef enum _zes_engine_group_t ///< engines so activity of such an engine may not be indicative of the ///< underlying resource utilization - use ::ZES_ENGINE_GROUP_MEDIA_ALL for ///< that. - ZES_ENGINE_GROUP_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_ENGINE_GROUP_* ENUMs + ZES_ENGINE_GROUP_FORCE_UINT32 = 0x7fffffff } zes_engine_group_t; @@ -2579,7 +2574,7 @@ typedef enum _zes_event_type_flag_t ZES_EVENT_TYPE_FLAG_DEVICE_RESET_REQUIRED = ZE_BIT(14), ///< Event is triggered when the device needs to be reset (use ///< ::zesDeviceGetState() to determine the reasons for the reset). ZES_EVENT_TYPE_FLAG_SURVIVABILITY_MODE_DETECTED = ZE_BIT(15), ///< Event is triggered when graphics driver encounter an error condition. - ZES_EVENT_TYPE_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_EVENT_TYPE_FLAG_* ENUMs + ZES_EVENT_TYPE_FLAG_FORCE_UINT32 = 0x7fffffff } zes_event_type_flag_t; @@ -2726,7 +2721,7 @@ typedef enum _zes_fabric_port_status_t ZES_FABRIC_PORT_STATUS_FAILED = 3, ///< Port connection instabilities are preventing workloads making forward ///< progress ZES_FABRIC_PORT_STATUS_DISABLED = 4, ///< The port is configured down - ZES_FABRIC_PORT_STATUS_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_FABRIC_PORT_STATUS_* ENUMs + ZES_FABRIC_PORT_STATUS_FORCE_UINT32 = 0x7fffffff } zes_fabric_port_status_t; @@ -2737,7 +2732,7 @@ typedef enum _zes_fabric_port_qual_issue_flag_t { ZES_FABRIC_PORT_QUAL_ISSUE_FLAG_LINK_ERRORS = ZE_BIT(0), ///< Excessive link errors are occurring ZES_FABRIC_PORT_QUAL_ISSUE_FLAG_SPEED = ZE_BIT(1), ///< There is a degradation in the bitrate and/or width of the link - ZES_FABRIC_PORT_QUAL_ISSUE_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_FABRIC_PORT_QUAL_ISSUE_FLAG_* ENUMs + ZES_FABRIC_PORT_QUAL_ISSUE_FLAG_FORCE_UINT32 = 0x7fffffff } zes_fabric_port_qual_issue_flag_t; @@ -2757,7 +2752,7 @@ typedef enum _zes_fabric_port_failure_flag_t ///< period of time. Driver will allow port to continue to train, but will ///< not enable the port for use until the port has been disabled and ///< subsequently re-enabled using ::zesFabricPortSetConfig(). - ZES_FABRIC_PORT_FAILURE_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_FABRIC_PORT_FAILURE_FLAG_* ENUMs + ZES_FABRIC_PORT_FAILURE_FLAG_FORCE_UINT32 = 0x7fffffff } zes_fabric_port_failure_flag_t; @@ -3142,7 +3137,7 @@ typedef enum _zes_fan_speed_mode_t ZES_FAN_SPEED_MODE_FIXED = 1, ///< The fan speed is currently set to a fixed value ZES_FAN_SPEED_MODE_TABLE = 2, ///< The fan speed is currently controlled dynamically by hardware based on ///< a temp/speed table - ZES_FAN_SPEED_MODE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_FAN_SPEED_MODE_* ENUMs + ZES_FAN_SPEED_MODE_FORCE_UINT32 = 0x7fffffff } zes_fan_speed_mode_t; @@ -3152,7 +3147,7 @@ typedef enum _zes_fan_speed_units_t { ZES_FAN_SPEED_UNITS_RPM = 0, ///< The fan speed is in units of revolutions per minute (rpm) ZES_FAN_SPEED_UNITS_PERCENT = 1, ///< The fan speed is a percentage of the maximum speed of the fan - ZES_FAN_SPEED_UNITS_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_FAN_SPEED_UNITS_* ENUMs + ZES_FAN_SPEED_UNITS_FORCE_UINT32 = 0x7fffffff } zes_fan_speed_units_t; @@ -3599,7 +3594,7 @@ typedef enum _zes_freq_domain_t ZES_FREQ_DOMAIN_GPU = 0, ///< GPU Core Domain. ZES_FREQ_DOMAIN_MEMORY = 1, ///< Local Memory Domain. ZES_FREQ_DOMAIN_MEDIA = 2, ///< GPU Media Domain. - ZES_FREQ_DOMAIN_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_FREQ_DOMAIN_* ENUMs + ZES_FREQ_DOMAIN_FORCE_UINT32 = 0x7fffffff } zes_freq_domain_t; @@ -3673,7 +3668,7 @@ typedef enum _zes_freq_throttle_reason_flag_t ZES_FREQ_THROTTLE_REASON_FLAG_SW_RANGE = ZE_BIT(5), ///< frequency throttled due to software supplied frequency range ZES_FREQ_THROTTLE_REASON_FLAG_HW_RANGE = ZE_BIT(6), ///< frequency throttled due to a sub block that has a lower frequency ///< range when it receives clocks - ZES_FREQ_THROTTLE_REASON_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_FREQ_THROTTLE_REASON_FLAG_* ENUMs + ZES_FREQ_THROTTLE_REASON_FLAG_FORCE_UINT32 = 0x7fffffff } zes_freq_throttle_reason_flag_t; @@ -3745,7 +3740,7 @@ typedef enum _zes_oc_mode_t ///< specified overclock values. This mode disables OVERRIDE and ///< INTERPOLATIVE modes. This mode can damage the part, most of the ///< protections are disabled on this mode. - ZES_OC_MODE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_OC_MODE_* ENUMs + ZES_OC_MODE_FORCE_UINT32 = 0x7fffffff } zes_oc_mode_t; @@ -4537,7 +4532,7 @@ typedef enum _zes_mem_type_t ZES_MEM_TYPE_GDDR6 = 17, ///< GDDR6 memory ZES_MEM_TYPE_GDDR6X = 18, ///< GDDR6X memory ZES_MEM_TYPE_GDDR7 = 19, ///< GDDR7 memory - ZES_MEM_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_MEM_TYPE_* ENUMs + ZES_MEM_TYPE_FORCE_UINT32 = 0x7fffffff } zes_mem_type_t; @@ -4547,7 +4542,7 @@ typedef enum _zes_mem_loc_t { ZES_MEM_LOC_SYSTEM = 0, ///< System memory ZES_MEM_LOC_DEVICE = 1, ///< On board local device memory - ZES_MEM_LOC_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_MEM_LOC_* ENUMs + ZES_MEM_LOC_FORCE_UINT32 = 0x7fffffff } zes_mem_loc_t; @@ -4562,7 +4557,7 @@ typedef enum _zes_mem_health_t ZES_MEM_HEALTH_CRITICAL = 3, ///< Operating with reduced memory to cover banks with too many ///< uncorrectable errors. ZES_MEM_HEALTH_REPLACE = 4, ///< Device should be replaced due to excessive uncorrectable errors. - ZES_MEM_HEALTH_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_MEM_HEALTH_* ENUMs + ZES_MEM_HEALTH_FORCE_UINT32 = 0x7fffffff } zes_mem_health_t; @@ -4900,7 +4895,7 @@ typedef enum _zes_power_domain_t ZES_POWER_DOMAIN_STACK = 3, ///< The PUnit power domain is a stack-level power domain. ZES_POWER_DOMAIN_MEMORY = 4, ///< The PUnit power domain is a memory-level power domain. ZES_POWER_DOMAIN_GPU = 5, ///< The PUnit power domain is a GPU-level power domain. - ZES_POWER_DOMAIN_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_POWER_DOMAIN_* ENUMs + ZES_POWER_DOMAIN_FORCE_UINT32 = 0x7fffffff } zes_power_domain_t; @@ -4920,7 +4915,7 @@ typedef enum _zes_power_level_t ZES_POWER_LEVEL_INSTANTANEOUS = 4, ///< The PUnit predicts effective power draw using the current device ///< configuration (frequency, voltage, etc...) & throttles proactively to ///< stay within the specified limit. - ZES_POWER_LEVEL_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_POWER_LEVEL_* ENUMs + ZES_POWER_LEVEL_FORCE_UINT32 = 0x7fffffff } zes_power_level_t; @@ -4932,7 +4927,7 @@ typedef enum _zes_power_source_t ///< battery powered. ZES_POWER_SOURCE_MAINS = 1, ///< Limit active only when the device is mains powered. ZES_POWER_SOURCE_BATTERY = 2, ///< Limit active only when the device is battery powered. - ZES_POWER_SOURCE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_POWER_SOURCE_* ENUMs + ZES_POWER_SOURCE_FORCE_UINT32 = 0x7fffffff } zes_power_source_t; @@ -4943,7 +4938,7 @@ typedef enum _zes_limit_unit_t ZES_LIMIT_UNIT_UNKNOWN = 0, ///< The PUnit power monitoring unit cannot be determined. ZES_LIMIT_UNIT_CURRENT = 1, ///< The limit is specified in milliamperes of current drawn. ZES_LIMIT_UNIT_POWER = 2, ///< The limit is specified in milliwatts of power generated. - ZES_LIMIT_UNIT_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_LIMIT_UNIT_* ENUMs + ZES_LIMIT_UNIT_FORCE_UINT32 = 0x7fffffff } zes_limit_unit_t; @@ -5310,7 +5305,7 @@ typedef enum _zes_psu_voltage_status_t ZES_PSU_VOLTAGE_STATUS_NORMAL = 1, ///< No unusual voltages have been detected ZES_PSU_VOLTAGE_STATUS_OVER = 2, ///< Over-voltage has occurred ZES_PSU_VOLTAGE_STATUS_UNDER = 3, ///< Under-voltage has occurred - ZES_PSU_VOLTAGE_STATUS_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_PSU_VOLTAGE_STATUS_* ENUMs + ZES_PSU_VOLTAGE_STATUS_FORCE_UINT32 = 0x7fffffff } zes_psu_voltage_status_t; @@ -5439,7 +5434,7 @@ typedef enum _zes_ras_error_type_t { ZES_RAS_ERROR_TYPE_CORRECTABLE = 0, ///< Errors were corrected by hardware ZES_RAS_ERROR_TYPE_UNCORRECTABLE = 1, ///< Error were not corrected - ZES_RAS_ERROR_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_RAS_ERROR_TYPE_* ENUMs + ZES_RAS_ERROR_TYPE_FORCE_UINT32 = 0x7fffffff } zes_ras_error_type_t; @@ -5458,7 +5453,7 @@ typedef enum _zes_ras_error_cat_t ZES_RAS_ERROR_CAT_CACHE_ERRORS = 5, ///< The number of errors that have occurred in caches (L1/L3/register ///< file/shared local memory/sampler) ZES_RAS_ERROR_CAT_DISPLAY_ERRORS = 6, ///< The number of errors that have occurred in the display - ZES_RAS_ERROR_CAT_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_RAS_ERROR_CAT_* ENUMs + ZES_RAS_ERROR_CAT_FORCE_UINT32 = 0x7fffffff } zes_ras_error_cat_t; @@ -5713,7 +5708,7 @@ typedef enum _zes_sched_mode_t ///< contexts must wait until the running context completes with no further ///< submitted work. ZES_SCHED_MODE_COMPUTE_UNIT_DEBUG = 3, ///< [DEPRECATED] No longer supported. - ZES_SCHED_MODE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_SCHED_MODE_* ENUMs + ZES_SCHED_MODE_FORCE_UINT32 = 0x7fffffff } zes_sched_mode_t; @@ -6065,7 +6060,7 @@ zesSchedulerSetComputeUnitDebugMode( typedef enum _zes_standby_type_t { ZES_STANDBY_TYPE_GLOBAL = 0, ///< Control the overall standby policy of the device/sub-device - ZES_STANDBY_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_STANDBY_TYPE_* ENUMs + ZES_STANDBY_TYPE_FORCE_UINT32 = 0x7fffffff } zes_standby_type_t; @@ -6090,7 +6085,7 @@ typedef enum _zes_standby_promo_mode_t ZES_STANDBY_PROMO_MODE_DEFAULT = 0, ///< Best compromise between performance and energy savings. ZES_STANDBY_PROMO_MODE_NEVER = 1, ///< The device/component will never shutdown. This can improve performance ///< but uses more energy. - ZES_STANDBY_PROMO_MODE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_STANDBY_PROMO_MODE_* ENUMs + ZES_STANDBY_PROMO_MODE_FORCE_UINT32 = 0x7fffffff } zes_standby_promo_mode_t; @@ -6218,7 +6213,7 @@ typedef enum _zes_temp_sensors_t ZES_TEMP_SENSORS_GPU_BOARD = 6, ///< The maximum temperature across all sensors in the GPU Board ZES_TEMP_SENSORS_GPU_BOARD_MIN = 7, ///< The minimum temperature across all sensors in the GPU Board ZES_TEMP_SENSORS_VOLTAGE_REGULATOR = 8, ///< The maximum temperature across all sensors in the Voltage Regulator - ZES_TEMP_SENSORS_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_TEMP_SENSORS_* ENUMs + ZES_TEMP_SENSORS_FORCE_UINT32 = 0x7fffffff } zes_temp_sensors_t; @@ -6430,41 +6425,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 @@ -6484,7 +6444,7 @@ typedef enum _zes_power_limits_ext_version_t { ZES_POWER_LIMITS_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZES_POWER_LIMITS_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZES_POWER_LIMITS_EXT_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_POWER_LIMITS_EXT_VERSION_* ENUMs + ZES_POWER_LIMITS_EXT_VERSION_FORCE_UINT32 = 0x7fffffff } zes_power_limits_ext_version_t; @@ -6624,7 +6584,7 @@ typedef enum _zes_engine_activity_ext_version_t { ZES_ENGINE_ACTIVITY_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZES_ENGINE_ACTIVITY_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZES_ENGINE_ACTIVITY_EXT_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_ENGINE_ACTIVITY_EXT_VERSION_* ENUMs + ZES_ENGINE_ACTIVITY_EXT_VERSION_FORCE_UINT32 = 0x7fffffff } zes_engine_activity_ext_version_t; @@ -6708,7 +6668,7 @@ typedef enum _zes_ras_state_exp_version_t { ZES_RAS_STATE_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZES_RAS_STATE_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZES_RAS_STATE_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_RAS_STATE_EXP_VERSION_* ENUMs + ZES_RAS_STATE_EXP_VERSION_FORCE_UINT32 = 0x7fffffff } zes_ras_state_exp_version_t; @@ -6730,7 +6690,7 @@ typedef enum _zes_ras_error_category_exp_t ZES_RAS_ERROR_CATEGORY_EXP_MEMORY_ERRORS = 7, ///< The number of errors that have occurred in Memory ZES_RAS_ERROR_CATEGORY_EXP_SCALE_ERRORS = 8, ///< The number of errors that have occurred in Scale Fabric ZES_RAS_ERROR_CATEGORY_EXP_L3FABRIC_ERRORS = 9, ///< The number of errors that have occurred in L3 Fabric - ZES_RAS_ERROR_CATEGORY_EXP_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_RAS_ERROR_CATEGORY_EXP_* ENUMs + ZES_RAS_ERROR_CATEGORY_EXP_FORCE_UINT32 = 0x7fffffff } zes_ras_error_category_exp_t; @@ -6826,7 +6786,7 @@ typedef enum _zes_mem_page_offline_state_exp_version_t { ZES_MEM_PAGE_OFFLINE_STATE_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZES_MEM_PAGE_OFFLINE_STATE_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZES_MEM_PAGE_OFFLINE_STATE_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_MEM_PAGE_OFFLINE_STATE_EXP_VERSION_* ENUMs + ZES_MEM_PAGE_OFFLINE_STATE_EXP_VERSION_FORCE_UINT32 = 0x7fffffff } zes_mem_page_offline_state_exp_version_t; @@ -6866,7 +6826,7 @@ typedef enum _zes_mem_bandwidth_counter_bits_exp_version_t { ZES_MEM_BANDWIDTH_COUNTER_BITS_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZES_MEM_BANDWIDTH_COUNTER_BITS_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZES_MEM_BANDWIDTH_COUNTER_BITS_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_MEM_BANDWIDTH_COUNTER_BITS_EXP_VERSION_* ENUMs + ZES_MEM_BANDWIDTH_COUNTER_BITS_EXP_VERSION_FORCE_UINT32 = 0x7fffffff } zes_mem_bandwidth_counter_bits_exp_version_t; @@ -6908,7 +6868,7 @@ typedef enum _zes_power_domain_properties_exp_version_t { ZES_POWER_DOMAIN_PROPERTIES_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZES_POWER_DOMAIN_PROPERTIES_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZES_POWER_DOMAIN_PROPERTIES_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_POWER_DOMAIN_PROPERTIES_EXP_VERSION_* ENUMs + ZES_POWER_DOMAIN_PROPERTIES_EXP_VERSION_FORCE_UINT32 = 0x7fffffff } zes_power_domain_properties_exp_version_t; @@ -6948,7 +6908,7 @@ typedef enum _zes_firmware_security_exp_version_t { ZES_FIRMWARE_SECURITY_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZES_FIRMWARE_SECURITY_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZES_FIRMWARE_SECURITY_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_FIRMWARE_SECURITY_EXP_VERSION_* ENUMs + ZES_FIRMWARE_SECURITY_EXP_VERSION_FORCE_UINT32 = 0x7fffffff } zes_firmware_security_exp_version_t; @@ -7019,7 +6979,7 @@ typedef enum _zes_sysman_device_mapping_exp_version_t { ZES_SYSMAN_DEVICE_MAPPING_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZES_SYSMAN_DEVICE_MAPPING_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ),///< latest known version - ZES_SYSMAN_DEVICE_MAPPING_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_SYSMAN_DEVICE_MAPPING_EXP_VERSION_* ENUMs + ZES_SYSMAN_DEVICE_MAPPING_EXP_VERSION_FORCE_UINT32 = 0x7fffffff } zes_sysman_device_mapping_exp_version_t; @@ -7117,7 +7077,7 @@ typedef enum _zes_vf_management_exp_version_t ZES_VF_MANAGEMENT_EXP_VERSION_1_1 = ZE_MAKE_VERSION( 1, 1 ), ///< version 1.1 (deprecated) ZES_VF_MANAGEMENT_EXP_VERSION_1_2 = ZE_MAKE_VERSION( 1, 2 ), ///< version 1.2 ZES_VF_MANAGEMENT_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 2 ), ///< latest known version - ZES_VF_MANAGEMENT_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_VF_MANAGEMENT_EXP_VERSION_* ENUMs + ZES_VF_MANAGEMENT_EXP_VERSION_FORCE_UINT32 = 0x7fffffff } zes_vf_management_exp_version_t; @@ -7128,7 +7088,7 @@ typedef enum _zes_vf_info_mem_type_exp_flag_t { ZES_VF_INFO_MEM_TYPE_EXP_FLAG_MEM_TYPE_SYSTEM = ZE_BIT(0), ///< System memory ZES_VF_INFO_MEM_TYPE_EXP_FLAG_MEM_TYPE_DEVICE = ZE_BIT(1), ///< Device local memory - ZES_VF_INFO_MEM_TYPE_EXP_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_VF_INFO_MEM_TYPE_EXP_FLAG_* ENUMs + ZES_VF_INFO_MEM_TYPE_EXP_FLAG_FORCE_UINT32 = 0x7fffffff } zes_vf_info_mem_type_exp_flag_t; @@ -7141,7 +7101,7 @@ typedef enum _zes_vf_info_util_exp_flag_t ZES_VF_INFO_UTIL_EXP_FLAG_INFO_MEM_CPU = ZE_BIT(1), ///< System memory utilization associated with virtual function ZES_VF_INFO_UTIL_EXP_FLAG_INFO_MEM_GPU = ZE_BIT(2), ///< Device memory utilization associated with virtual function ZES_VF_INFO_UTIL_EXP_FLAG_INFO_ENGINE = ZE_BIT(3), ///< Engine utilization associated with virtual function - ZES_VF_INFO_UTIL_EXP_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_VF_INFO_UTIL_EXP_FLAG_* ENUMs + ZES_VF_INFO_UTIL_EXP_FLAG_FORCE_UINT32 = 0x7fffffff } zes_vf_info_util_exp_flag_t; diff --git a/include/zes_ddi.h b/include/zes_ddi.h index 24b53356..3e2965ad 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.13-r1.13.1 + * @version v1.12-r1.12.15 * */ #ifndef _ZES_DDI_H diff --git a/include/zet.py b/include/zet.py index a6201bc1..90d891b0 100644 --- a/include/zet.py +++ b/include/zet.py @@ -4,7 +4,7 @@ SPDX-License-Identifier: MIT @file zet.py - @version v1.13-r1.13.1 + @version v1.12-r1.12.15 """ import platform @@ -676,7 +676,6 @@ class zet_metric_group_type_exp_flags_v(IntEnum): ## 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): @@ -708,47 +707,6 @@ class zet_export_dma_buf_exp_properties_t(Structure): ("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" @@ -1160,29 +1118,13 @@ class _zet_device_dditable_t(Structure): else: _zetDeviceCreateMetricGroupsFromMetricsExp_t = CFUNCTYPE( ze_result_t, zet_device_handle_t, c_ulong, *, *, *, *, POINTER(zet_metric_group_handle_t) ) -############################################################################### -## @brief Function-pointer for zetDeviceEnableMetricsExp -if __use_win_types: - _zetDeviceEnableMetricsExp_t = WINFUNCTYPE( ze_result_t, zet_device_handle_t ) -else: - _zetDeviceEnableMetricsExp_t = CFUNCTYPE( ze_result_t, zet_device_handle_t ) - -############################################################################### -## @brief Function-pointer for zetDeviceDisableMetricsExp -if __use_win_types: - _zetDeviceDisableMetricsExp_t = WINFUNCTYPE( ze_result_t, zet_device_handle_t ) -else: - _zetDeviceDisableMetricsExp_t = CFUNCTYPE( ze_result_t, zet_device_handle_t ) - ############################################################################### ## @brief Table of DeviceExp functions pointers class _zet_device_exp_dditable_t(Structure): _fields_ = [ ("pfnGetConcurrentMetricGroupsExp", c_void_p), ## _zetDeviceGetConcurrentMetricGroupsExp_t - ("pfnCreateMetricGroupsFromMetricsExp", c_void_p), ## _zetDeviceCreateMetricGroupsFromMetricsExp_t - ("pfnEnableMetricsExp", c_void_p), ## _zetDeviceEnableMetricsExp_t - ("pfnDisableMetricsExp", c_void_p) ## _zetDeviceDisableMetricsExp_t + ("pfnCreateMetricGroupsFromMetricsExp", c_void_p) ## _zetDeviceCreateMetricGroupsFromMetricsExp_t ] ############################################################################### @@ -1239,21 +1181,6 @@ class _zet_command_list_dditable_t(Structure): ("pfnAppendMetricMemoryBarrier", c_void_p) ## _zetCommandListAppendMetricMemoryBarrier_t ] -############################################################################### -## @brief Function-pointer for zetCommandListAppendMarkerExp -if __use_win_types: - _zetCommandListAppendMarkerExp_t = WINFUNCTYPE( ze_result_t, zet_command_list_handle_t, zet_metric_group_handle_t, c_ulong ) -else: - _zetCommandListAppendMarkerExp_t = CFUNCTYPE( ze_result_t, zet_command_list_handle_t, zet_metric_group_handle_t, c_ulong ) - - -############################################################################### -## @brief Table of CommandListExp functions pointers -class _zet_command_list_exp_dditable_t(Structure): - _fields_ = [ - ("pfnAppendMarkerExp", c_void_p) ## _zetCommandListAppendMarkerExp_t - ] - ############################################################################### ## @brief Function-pointer for zetModuleGetDebugInfo if __use_win_types: @@ -1701,7 +1628,6 @@ class _zet_dditable_t(Structure): ("DeviceExp", _zet_device_exp_dditable_t), ("Context", _zet_context_dditable_t), ("CommandList", _zet_command_list_dditable_t), - ("CommandListExp", _zet_command_list_exp_dditable_t), ("Module", _zet_module_dditable_t), ("Kernel", _zet_kernel_dditable_t), ("Metric", _zet_metric_dditable_t), @@ -1788,8 +1714,6 @@ def __init__(self, version : ze_api_version_t): # attach function interface to function address self.zetDeviceGetConcurrentMetricGroupsExp = _zetDeviceGetConcurrentMetricGroupsExp_t(self.__dditable.DeviceExp.pfnGetConcurrentMetricGroupsExp) self.zetDeviceCreateMetricGroupsFromMetricsExp = _zetDeviceCreateMetricGroupsFromMetricsExp_t(self.__dditable.DeviceExp.pfnCreateMetricGroupsFromMetricsExp) - self.zetDeviceEnableMetricsExp = _zetDeviceEnableMetricsExp_t(self.__dditable.DeviceExp.pfnEnableMetricsExp) - self.zetDeviceDisableMetricsExp = _zetDeviceDisableMetricsExp_t(self.__dditable.DeviceExp.pfnDisableMetricsExp) # call driver to get function pointers _Context = _zet_context_dditable_t() @@ -1814,16 +1738,6 @@ def __init__(self, version : ze_api_version_t): self.zetCommandListAppendMetricQueryEnd = _zetCommandListAppendMetricQueryEnd_t(self.__dditable.CommandList.pfnAppendMetricQueryEnd) self.zetCommandListAppendMetricMemoryBarrier = _zetCommandListAppendMetricMemoryBarrier_t(self.__dditable.CommandList.pfnAppendMetricMemoryBarrier) - # call driver to get function pointers - _CommandListExp = _zet_command_list_exp_dditable_t() - r = ze_result_v(self.__dll.zetGetCommandListExpProcAddrTable(version, byref(_CommandListExp))) - if r != ze_result_v.SUCCESS: - raise Exception(r) - self.__dditable.CommandListExp = _CommandListExp - - # attach function interface to function address - self.zetCommandListAppendMarkerExp = _zetCommandListAppendMarkerExp_t(self.__dditable.CommandListExp.pfnAppendMarkerExp) - # call driver to get function pointers _Module = _zet_module_dditable_t() r = ze_result_v(self.__dll.zetGetModuleProcAddrTable(version, byref(_Module))) diff --git a/include/zet_api.h b/include/zet_api.h index 13b8ea01..c8906ad7 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.13-r1.13.1 + * @version v1.12-r1.12.15 * */ #ifndef _ZET_API_H @@ -102,7 +102,7 @@ typedef enum _zet_structure_type_t ZET_STRUCTURE_TYPE_METRIC_GROUP_TYPE_EXP = 0x00010006, ///< ::zet_metric_group_type_exp_t ZET_STRUCTURE_TYPE_EXPORT_DMA_EXP_PROPERTIES = 0x00010007, ///< ::zet_export_dma_buf_exp_properties_t ZET_STRUCTURE_TYPE_METRIC_TRACER_EXP_DESC = 0x00010008, ///< ::zet_metric_tracer_exp_desc_t - ZET_STRUCTURE_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_STRUCTURE_TYPE_* ENUMs + ZET_STRUCTURE_TYPE_FORCE_UINT32 = 0x7fffffff } zet_structure_type_t; @@ -138,7 +138,7 @@ typedef enum _zet_value_type_t ZET_VALUE_TYPE_STRING = 5, ///< C string ZET_VALUE_TYPE_UINT8 = 6, ///< 8-bit unsigned-integer ZET_VALUE_TYPE_UINT16 = 7, ///< 16-bit unsigned-integer - ZET_VALUE_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_VALUE_TYPE_* ENUMs + ZET_VALUE_TYPE_FORCE_UINT32 = 0x7fffffff } zet_value_type_t; @@ -269,10 +269,6 @@ 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; @@ -339,7 +335,7 @@ typedef struct _zet_metric_programmable_param_value_exp_t zet_metric_programmabl typedef enum _zet_module_debug_info_format_t { ZET_MODULE_DEBUG_INFO_FORMAT_ELF_DWARF = 0, ///< Format is ELF/DWARF - ZET_MODULE_DEBUG_INFO_FORMAT_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_MODULE_DEBUG_INFO_FORMAT_* ENUMs + ZET_MODULE_DEBUG_INFO_FORMAT_FORCE_UINT32 = 0x7fffffff } zet_module_debug_info_format_t; @@ -387,7 +383,7 @@ typedef uint32_t zet_device_debug_property_flags_t; typedef enum _zet_device_debug_property_flag_t { ZET_DEVICE_DEBUG_PROPERTY_FLAG_ATTACH = ZE_BIT(0), ///< the device supports attaching for debug - ZET_DEVICE_DEBUG_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_DEVICE_DEBUG_PROPERTY_FLAG_* ENUMs + ZET_DEVICE_DEBUG_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff } zet_device_debug_property_flag_t; @@ -484,7 +480,7 @@ typedef enum _zet_debug_event_flag_t { ZET_DEBUG_EVENT_FLAG_NEED_ACK = ZE_BIT(0), ///< The event needs to be acknowledged by calling ///< ::zetDebugAcknowledgeEvent. - ZET_DEBUG_EVENT_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_DEBUG_EVENT_FLAG_* ENUMs + ZET_DEBUG_EVENT_FLAG_FORCE_UINT32 = 0x7fffffff } zet_debug_event_flag_t; @@ -501,7 +497,7 @@ typedef enum _zet_debug_event_type_t ZET_DEBUG_EVENT_TYPE_THREAD_STOPPED = 6, ///< The thread stopped due to a device exception ZET_DEBUG_EVENT_TYPE_THREAD_UNAVAILABLE = 7, ///< The thread is not available to be stopped ZET_DEBUG_EVENT_TYPE_PAGE_FAULT = 8, ///< A page request could not be completed on the device - ZET_DEBUG_EVENT_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_DEBUG_EVENT_TYPE_* ENUMs + ZET_DEBUG_EVENT_TYPE_FORCE_UINT32 = 0x7fffffff } zet_debug_event_type_t; @@ -511,7 +507,7 @@ typedef enum _zet_debug_detach_reason_t { ZET_DEBUG_DETACH_REASON_INVALID = 0, ///< The detach reason is not valid ZET_DEBUG_DETACH_REASON_HOST_EXIT = 1, ///< The host process exited - ZET_DEBUG_DETACH_REASON_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_DEBUG_DETACH_REASON_* ENUMs + ZET_DEBUG_DETACH_REASON_FORCE_UINT32 = 0x7fffffff } zet_debug_detach_reason_t; @@ -551,7 +547,7 @@ typedef enum _zet_debug_page_fault_reason_t ZET_DEBUG_PAGE_FAULT_REASON_INVALID = 0, ///< The page fault reason is not valid ZET_DEBUG_PAGE_FAULT_REASON_MAPPING_ERROR = 1, ///< The address is not mapped ZET_DEBUG_PAGE_FAULT_REASON_PERMISSION_ERROR = 2, ///< Invalid access permissions - ZET_DEBUG_PAGE_FAULT_REASON_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_DEBUG_PAGE_FAULT_REASON_* ENUMs + ZET_DEBUG_PAGE_FAULT_REASON_FORCE_UINT32 = 0x7fffffff } zet_debug_page_fault_reason_t; @@ -680,7 +676,7 @@ typedef enum _zet_debug_memory_space_type_t ZET_DEBUG_MEMORY_SPACE_TYPE_DEFAULT = 0, ///< default memory space (attribute may be omitted) ZET_DEBUG_MEMORY_SPACE_TYPE_SLM = 1, ///< shared local memory space (GPU-only) ZET_DEBUG_MEMORY_SPACE_TYPE_ELF = 2, ///< ELF file memory space - ZET_DEBUG_MEMORY_SPACE_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_DEBUG_MEMORY_SPACE_TYPE_* ENUMs + ZET_DEBUG_MEMORY_SPACE_TYPE_FORCE_UINT32 = 0x7fffffff } zet_debug_memory_space_type_t; @@ -767,7 +763,7 @@ typedef enum _zet_debug_regset_flag_t { ZET_DEBUG_REGSET_FLAG_READABLE = ZE_BIT(0), ///< register set is readable ZET_DEBUG_REGSET_FLAG_WRITEABLE = ZE_BIT(1), ///< register set is writeable - ZET_DEBUG_REGSET_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_DEBUG_REGSET_FLAG_* ENUMs + ZET_DEBUG_REGSET_FLAG_FORCE_UINT32 = 0x7fffffff } zet_debug_regset_flag_t; @@ -872,8 +868,8 @@ zetDebugReadRegisters( ///< than the `count` member of ::zet_debug_regset_properties_t for the ///< type uint32_t count, ///< [in] the number of registers to read; start+count must be less than or - ///< equal to the `count` member of ::zet_debug_regset_properties_t for the - ///< type + ///< equal to the `count` member of ::zet_debug_register_group_properties_t + ///< for the type void* pRegisterValues ///< [in,out][optional][range(0, count)] buffer of register values ); @@ -899,8 +895,8 @@ zetDebugWriteRegisters( ///< than the `count` member of ::zet_debug_regset_properties_t for the ///< type uint32_t count, ///< [in] the number of registers to write; start+count must be less than - ///< or equal to the `count` member of ::zet_debug_regset_properties_t for - ///< the type + ///< or equal to the `count` member of + ///< ::zet_debug_register_group_properties_t for the type void* pRegisterValues ///< [in,out][optional][range(0, count)] buffer of register values ); @@ -961,7 +957,7 @@ typedef enum _zet_metric_group_sampling_type_flag_t ZET_METRIC_GROUP_SAMPLING_TYPE_FLAG_EVENT_BASED = ZE_BIT(0), ///< Event based sampling ZET_METRIC_GROUP_SAMPLING_TYPE_FLAG_TIME_BASED = ZE_BIT(1), ///< Time based sampling ZET_METRIC_GROUP_SAMPLING_TYPE_FLAG_EXP_TRACER_BASED = ZE_BIT(2), ///< Experimental Tracer based sampling - ZET_METRIC_GROUP_SAMPLING_TYPE_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_METRIC_GROUP_SAMPLING_TYPE_FLAG_* ENUMs + ZET_METRIC_GROUP_SAMPLING_TYPE_FLAG_FORCE_UINT32 = 0x7fffffff } zet_metric_group_sampling_type_flag_t; @@ -1026,7 +1022,7 @@ typedef enum _zet_metric_type_t ZET_METRIC_TYPE_IP_EXP = 0x7ffffffe, ///< Metric type: instruction pointer. Deprecated, use ///< ::ZET_METRIC_TYPE_IP. ZET_METRIC_TYPE_IP = 0x7ffffffe, ///< Metric type: instruction pointer - ZET_METRIC_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_METRIC_TYPE_* ENUMs + ZET_METRIC_TYPE_FORCE_UINT32 = 0x7fffffff } zet_metric_type_t; @@ -1036,7 +1032,7 @@ typedef enum _zet_metric_group_calculation_type_t { ZET_METRIC_GROUP_CALCULATION_TYPE_METRIC_VALUES = 0, ///< Calculated metric values from raw data. ZET_METRIC_GROUP_CALCULATION_TYPE_MAX_METRIC_VALUES = 1, ///< Maximum metric values. - ZET_METRIC_GROUP_CALCULATION_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_METRIC_GROUP_CALCULATION_TYPE_* ENUMs + ZET_METRIC_GROUP_CALCULATION_TYPE_FORCE_UINT32 = 0x7fffffff } zet_metric_group_calculation_type_t; @@ -1352,7 +1348,7 @@ typedef enum _zet_metric_query_pool_type_t { ZET_METRIC_QUERY_POOL_TYPE_PERFORMANCE = 0, ///< Performance metric query pool. ZET_METRIC_QUERY_POOL_TYPE_EXECUTION = 1, ///< Skips workload execution between begin/end calls. - ZET_METRIC_QUERY_POOL_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_METRIC_QUERY_POOL_TYPE_* ENUMs + ZET_METRIC_QUERY_POOL_TYPE_FORCE_UINT32 = 0x7fffffff } zet_metric_query_pool_type_t; @@ -1630,7 +1626,7 @@ typedef enum _zet_profile_flag_t ZET_PROFILE_FLAG_REGISTER_REALLOCATION = ZE_BIT(0), ///< request the compiler attempt to minimize register usage as much as ///< possible to allow for instrumentation ZET_PROFILE_FLAG_FREE_REGISTER_INFO = ZE_BIT(1), ///< request the compiler generate free register info - ZET_PROFILE_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_PROFILE_FLAG_* ENUMs + ZET_PROFILE_FLAG_FORCE_UINT32 = 0x7fffffff } zet_profile_flag_t; @@ -1652,7 +1648,7 @@ typedef struct _zet_profile_properties_t typedef enum _zet_profile_token_type_t { ZET_PROFILE_TOKEN_TYPE_FREE_REGISTER = 0, ///< GRF info - ZET_PROFILE_TOKEN_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_PROFILE_TOKEN_TYPE_* ENUMs + ZET_PROFILE_TOKEN_TYPE_FORCE_UINT32 = 0x7fffffff } zet_profile_token_type_t; @@ -1725,7 +1721,7 @@ typedef enum _zet_api_tracing_exp_version_t { ZET_API_TRACING_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZET_API_TRACING_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZET_API_TRACING_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_API_TRACING_EXP_VERSION_* ENUMs + ZET_API_TRACING_EXP_VERSION_FORCE_UINT32 = 0x7fffffff } zet_api_tracing_exp_version_t; @@ -1894,7 +1890,7 @@ typedef enum _zet_concurrent_metric_groups_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 + ZET_CONCURRENT_METRIC_GROUPS_EXP_VERSION_FORCE_UINT32 = 0x7fffffff } zet_concurrent_metric_groups_exp_version_t; @@ -1946,7 +1942,7 @@ typedef enum _zet_metric_tracer_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_FORCE_UINT32 = 0x7fffffff } zet_metric_tracer_exp_version_t; @@ -2297,8 +2293,7 @@ typedef enum _zet_metric_group_type_exp_flag_t ///< 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_FORCE_UINT32 = 0x7fffffff } zet_metric_group_type_exp_flag_t; @@ -2329,145 +2324,6 @@ typedef struct _zet_export_dma_buf_exp_properties_t } 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 Append a Marker based on the Metric source of the Metric Group, to a -/// Command List. -/// -/// @details -/// - This function appends a Marker based on the Metric source of the -/// Metric Group, to Command List. -/// -/// @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_NULL_HANDLE -/// + `nullptr == hCommandList` -/// + `nullptr == hMetricGroup` -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 - ); - -#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 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 -/// - 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 -/// - ::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_NULL_HANDLE -/// + `nullptr == hDevice` -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. - ); - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Disable Metrics collection during runtime, if it was already enabled. -/// -/// @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. -/// -/// @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_NULL_HANDLE -/// + `nullptr == hDevice` -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 - ); - #if !defined(__GNUC__) #pragma endregion #endif @@ -2487,7 +2343,7 @@ 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_FORCE_UINT32 = 0x7fffffff } ze_calculate_multiple_metrics_exp_version_t; @@ -2565,7 +2421,7 @@ 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_FORCE_UINT32 = 0x7fffffff } ze_metric_global_timestamps_exp_version_t; @@ -2634,7 +2490,7 @@ 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_FORCE_UINT32 = 0x7fffffff } zet_export_metric_data_exp_version_t; @@ -2772,7 +2628,7 @@ 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_FORCE_UINT32 = 0x7fffffff } zet_metric_programmable_exp_version_t; @@ -2867,7 +2723,7 @@ typedef enum _zet_metric_programmable_param_type_exp_t 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_FORCE_UINT32 = 0x7fffffff } zet_metric_programmable_param_type_exp_t; @@ -2884,7 +2740,7 @@ typedef enum _zet_value_info_type_exp_t 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_FORCE_UINT32 = 0x7fffffff } zet_value_info_type_exp_t; @@ -3360,8 +3216,6 @@ zetMetricGroupCloseExp( /// - 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 diff --git a/include/zet_ddi.h b/include/zet_ddi.h index bf7f56c0..504106d4 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.13-r1.13.1 + * @version v1.12-r1.12.15 * */ #ifndef _ZET_DDI_H @@ -281,26 +281,12 @@ typedef ze_result_t (ZE_APICALL *zet_pfnDeviceCreateMetricGroupsFromMetricsExp_t zet_metric_group_handle_t* ); -/////////////////////////////////////////////////////////////////////////////// -/// @brief Function-pointer for zetDeviceEnableMetricsExp -typedef ze_result_t (ZE_APICALL *zet_pfnDeviceEnableMetricsExp_t)( - zet_device_handle_t - ); - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Function-pointer for zetDeviceDisableMetricsExp -typedef ze_result_t (ZE_APICALL *zet_pfnDeviceDisableMetricsExp_t)( - zet_device_handle_t - ); - /////////////////////////////////////////////////////////////////////////////// /// @brief Table of DeviceExp functions pointers typedef struct _zet_device_exp_dditable_t { zet_pfnDeviceGetConcurrentMetricGroupsExp_t pfnGetConcurrentMetricGroupsExp; zet_pfnDeviceCreateMetricGroupsFromMetricsExp_t pfnCreateMetricGroupsFromMetricsExp; - zet_pfnDeviceEnableMetricsExp_t pfnEnableMetricsExp; - zet_pfnDeviceDisableMetricsExp_t pfnDisableMetricsExp; } zet_device_exp_dditable_t; /////////////////////////////////////////////////////////////////////////////// @@ -426,43 +412,6 @@ typedef ze_result_t (ZE_APICALL *zet_pfnGetCommandListProcAddrTable_t)( zet_command_list_dditable_t* ); -/////////////////////////////////////////////////////////////////////////////// -/// @brief Function-pointer for zetCommandListAppendMarkerExp -typedef ze_result_t (ZE_APICALL *zet_pfnCommandListAppendMarkerExp_t)( - zet_command_list_handle_t, - zet_metric_group_handle_t, - uint32_t - ); - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Table of CommandListExp functions pointers -typedef struct _zet_command_list_exp_dditable_t -{ - zet_pfnCommandListAppendMarkerExp_t pfnAppendMarkerExp; -} zet_command_list_exp_dditable_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Exported function for filling application's CommandListExp 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 -zetGetCommandListExpProcAddrTable( - ze_api_version_t version, ///< [in] API version requested - zet_command_list_exp_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers - ); - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Function-pointer for zetGetCommandListExpProcAddrTable -typedef ze_result_t (ZE_APICALL *zet_pfnGetCommandListExpProcAddrTable_t)( - ze_api_version_t, - zet_command_list_exp_dditable_t* - ); - /////////////////////////////////////////////////////////////////////////////// /// @brief Function-pointer for zetModuleGetDebugInfo typedef ze_result_t (ZE_APICALL *zet_pfnModuleGetDebugInfo_t)( @@ -1205,7 +1154,6 @@ typedef struct _zet_dditable_t zet_device_exp_dditable_t DeviceExp; zet_context_dditable_t Context; zet_command_list_dditable_t CommandList; - zet_command_list_exp_dditable_t CommandListExp; zet_module_dditable_t Module; zet_kernel_dditable_t Kernel; zet_metric_dditable_t Metric; @@ -1230,7 +1178,6 @@ typedef struct _zet_dditable_driver_t zet_device_exp_dditable_t * DeviceExp; zet_context_dditable_t * Context; zet_command_list_dditable_t * CommandList; - zet_command_list_exp_dditable_t * CommandListExp; zet_module_dditable_t * Module; zet_kernel_dditable_t * Kernel; zet_metric_dditable_t * Metric; diff --git a/source/drivers/null/ze_nullddi.cpp b/source/drivers/null/ze_nullddi.cpp index e23aa7d1..b3740a94 100644 --- a/source/drivers/null/ze_nullddi.cpp +++ b/source/drivers/null/ze_nullddi.cpp @@ -3322,14 +3322,10 @@ namespace driver 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. + ///< 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. ) { ze_result_t result = ZE_RESULT_SUCCESS; @@ -4112,304 +4108,6 @@ namespace driver return result; } - /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderCreateExt - __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 - ) - { - 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 ) - { - result = pfnCreateExt( hDriver, pDescriptor, phBuilder ); - } - else - { - // generic implementation - *phBuilder = reinterpret_cast( context.get() ); - - } - - return result; - } - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderGetBuildPropertiesExt - __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 - ) - { - 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 ) - { - result = pfnGetBuildPropertiesExt( hBuilder, pBuildOpDescriptor, pProperties ); - } - else - { - // generic implementation - } - - return result; - } - - /////////////////////////////////////////////////////////////////////////////// - /// @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 - ) - { - 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 ) - { - result = pfnRTASFormatCompatibilityCheckExt( hDriver, rtasFormatA, rtasFormatB ); - } - else - { - // generic implementation - } - - return result; - } - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderBuildExt - __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 - ) - { - 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 ) - { - result = pfnBuildExt( hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes ); - } - else - { - // generic implementation - } - - return result; - } - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderCommandListAppendCopyExt - __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 - ) - { - 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 ) - { - result = pfnCommandListAppendCopyExt( hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents ); - } - else - { - // generic implementation - } - - return result; - } - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderDestroyExt - __zedlllocal ze_result_t ZE_APICALL - 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 pfnDestroyExt = context.zeDdiTable.RTASBuilder.pfnDestroyExt; - if( nullptr != pfnDestroyExt ) - { - result = pfnDestroyExt( hBuilder ); - } - else - { - // generic implementation - - } - - return result; - } - - /////////////////////////////////////////////////////////////////////////////// - /// @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 - ) - { - 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 ) - { - result = pfnCreateExt( hDriver, phParallelOperation ); - } - else - { - // generic implementation - *phParallelOperation = reinterpret_cast( context.get() ); - - } - - return result; - } - - /////////////////////////////////////////////////////////////////////////////// - /// @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 - ) - { - 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 ) - { - result = pfnGetPropertiesExt( hParallelOperation, pProperties ); - } - else - { - // generic implementation - } - - return result; - } - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASParallelOperationJoinExt - __zedlllocal ze_result_t ZE_APICALL - 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 pfnJoinExt = context.zeDdiTable.RTASParallelOperation.pfnJoinExt; - if( nullptr != pfnJoinExt ) - { - result = pfnJoinExt( hParallelOperation ); - } - else - { - // generic implementation - } - - return result; - } - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASParallelOperationDestroyExt - __zedlllocal ze_result_t ZE_APICALL - 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 pfnDestroyExt = context.zeDdiTable.RTASParallelOperation.pfnDestroyExt; - if( nullptr != pfnDestroyExt ) - { - result = pfnDestroyExt( hParallelOperation ); - } - else - { - // generic implementation - - } - - return result; - } - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDeviceGetVectorWidthPropertiesExt - __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. - ) - { - 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 ) - { - result = pfnGetVectorWidthPropertiesExt( hDevice, pCount, pVectorWidthProperties ); - } - else - { - // generic implementation - } - - return result; - } - /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zeDeviceReserveCacheExt __zedlllocal ze_result_t ZE_APICALL @@ -5596,41 +5294,6 @@ zeGetGlobalProcAddrTable( return result; } -/////////////////////////////////////////////////////////////////////////////// -/// @brief Exported function for filling application's RTASBuilder 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 -zeGetRTASBuilderProcAddrTable( - ze_api_version_t version, ///< [in] API version requested - ze_rtas_builder_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers - ) -{ - if( nullptr == pDdiTable ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - - if( driver::context.version < version ) - return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; - - ze_result_t result = ZE_RESULT_SUCCESS; - - pDdiTable->pfnCreateExt = driver::zeRTASBuilderCreateExt; - - pDdiTable->pfnGetBuildPropertiesExt = driver::zeRTASBuilderGetBuildPropertiesExt; - - pDdiTable->pfnBuildExt = driver::zeRTASBuilderBuildExt; - - pDdiTable->pfnCommandListAppendCopyExt = driver::zeRTASBuilderCommandListAppendCopyExt; - - pDdiTable->pfnDestroyExt = driver::zeRTASBuilderDestroyExt; - - return result; -} - /////////////////////////////////////////////////////////////////////////////// /// @brief Exported function for filling application's RTASBuilderExp table /// with current process' addresses @@ -5664,39 +5327,6 @@ zeGetRTASBuilderExpProcAddrTable( return result; } -/////////////////////////////////////////////////////////////////////////////// -/// @brief Exported function for filling application's RTASParallelOperation 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 -zeGetRTASParallelOperationProcAddrTable( - ze_api_version_t version, ///< [in] API version requested - ze_rtas_parallel_operation_dditable_t* pDdiTable///< [in,out] pointer to table of DDI function pointers - ) -{ - if( nullptr == pDdiTable ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - - if( driver::context.version < version ) - return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; - - ze_result_t result = ZE_RESULT_SUCCESS; - - pDdiTable->pfnCreateExt = driver::zeRTASParallelOperationCreateExt; - - pDdiTable->pfnGetPropertiesExt = driver::zeRTASParallelOperationGetPropertiesExt; - - pDdiTable->pfnJoinExt = driver::zeRTASParallelOperationJoinExt; - - pDdiTable->pfnDestroyExt = driver::zeRTASParallelOperationDestroyExt; - - return result; -} - /////////////////////////////////////////////////////////////////////////////// /// @brief Exported function for filling application's RTASParallelOperationExp table /// with current process' addresses @@ -5764,8 +5394,6 @@ zeGetDriverProcAddrTable( pDdiTable->pfnGetExtensionFunctionAddress = driver::zeDriverGetExtensionFunctionAddress; - pDdiTable->pfnRTASFormatCompatibilityCheckExt = driver::zeDriverRTASFormatCompatibilityCheckExt; - pDdiTable->pfnGetLastErrorDescription = driver::zeDriverGetLastErrorDescription; return result; @@ -5854,8 +5482,6 @@ zeGetDeviceProcAddrTable( pDdiTable->pfnReleaseExternalSemaphoreExt = driver::zeDeviceReleaseExternalSemaphoreExt; - pDdiTable->pfnGetVectorWidthPropertiesExt = driver::zeDeviceGetVectorWidthPropertiesExt; - pDdiTable->pfnReserveCacheExt = driver::zeDeviceReserveCacheExt; pDdiTable->pfnSetCacheAdviceExt = driver::zeDeviceSetCacheAdviceExt; diff --git a/source/drivers/null/zet_nullddi.cpp b/source/drivers/null/zet_nullddi.cpp index 2b79a154..fd01dbf9 100644 --- a/source/drivers/null/zet_nullddi.cpp +++ b/source/drivers/null/zet_nullddi.cpp @@ -348,8 +348,8 @@ namespace driver ///< than the `count` member of ::zet_debug_regset_properties_t for the ///< type uint32_t count, ///< [in] the number of registers to read; start+count must be less than or - ///< equal to the `count` member of ::zet_debug_regset_properties_t for the - ///< type + ///< equal to the `count` member of ::zet_debug_register_group_properties_t + ///< for the type void* pRegisterValues ///< [in,out][optional][range(0, count)] buffer of register values ) { @@ -380,8 +380,8 @@ namespace driver ///< than the `count` member of ::zet_debug_regset_properties_t for the ///< type uint32_t count, ///< [in] the number of registers to write; start+count must be less than - ///< or equal to the `count` member of ::zet_debug_regset_properties_t for - ///< the type + ///< or equal to the `count` member of + ///< ::zet_debug_register_group_properties_t for the type void* pRegisterValues ///< [in,out][optional][range(0, count)] buffer of register values ) { @@ -1401,79 +1401,6 @@ namespace driver return result; } - /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetCommandListAppendMarkerExp - __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 - ) - { - 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 ) - { - result = pfnAppendMarkerExp( hCommandList, hMetricGroup, value ); - } - else - { - // generic implementation - } - - return result; - } - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetDeviceEnableMetricsExp - __zedlllocal ze_result_t ZE_APICALL - 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 pfnEnableMetricsExp = context.zetDdiTable.DeviceExp.pfnEnableMetricsExp; - if( nullptr != pfnEnableMetricsExp ) - { - result = pfnEnableMetricsExp( hDevice ); - } - else - { - // generic implementation - } - - 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; - - // 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 ) - { - result = pfnDisableMetricsExp( hDevice ); - } - else - { - // generic implementation - } - - return result; - } - /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zetMetricGroupCalculateMultipleMetricValuesExp __zedlllocal ze_result_t ZE_APICALL @@ -2189,10 +2116,6 @@ zetGetDeviceExpProcAddrTable( pDdiTable->pfnCreateMetricGroupsFromMetricsExp = driver::zetDeviceCreateMetricGroupsFromMetricsExp; - pDdiTable->pfnEnableMetricsExp = driver::zetDeviceEnableMetricsExp; - - pDdiTable->pfnDisableMetricsExp = driver::zetDeviceDisableMetricsExp; - return result; } @@ -2256,33 +2179,6 @@ zetGetCommandListProcAddrTable( return result; } -/////////////////////////////////////////////////////////////////////////////// -/// @brief Exported function for filling application's CommandListExp 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 -zetGetCommandListExpProcAddrTable( - ze_api_version_t version, ///< [in] API version requested - zet_command_list_exp_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers - ) -{ - if( nullptr == pDdiTable ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - - if( driver::context.version < version ) - return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; - - ze_result_t result = ZE_RESULT_SUCCESS; - - pDdiTable->pfnAppendMarkerExp = driver::zetCommandListAppendMarkerExp; - - return result; -} - /////////////////////////////////////////////////////////////////////////////// /// @brief Exported function for filling application's Kernel table /// with current process' addresses diff --git a/source/layers/tracing/ze_tracing_cb_structs.h b/source/layers/tracing/ze_tracing_cb_structs.h index c1c53b2d..5e6f6e74 100644 --- a/source/layers/tracing/ze_tracing_cb_structs.h +++ b/source/layers/tracing/ze_tracing_cb_structs.h @@ -30,11 +30,6 @@ typedef struct _zel_global_callbacks_t /// @brief Table of RTASBuilder callback functions pointers typedef struct _zel_rtas_builder_callbacks_t { - ze_pfnRTASBuilderCreateExtCb_t pfnCreateExtCb; - ze_pfnRTASBuilderGetBuildPropertiesExtCb_t pfnGetBuildPropertiesExtCb; - ze_pfnRTASBuilderBuildExtCb_t pfnBuildExtCb; - ze_pfnRTASBuilderCommandListAppendCopyExtCb_t pfnCommandListAppendCopyExtCb; - ze_pfnRTASBuilderDestroyExtCb_t pfnDestroyExtCb; ze_pfnRTASBuilderCreateExpCb_t pfnCreateExpCb; ze_pfnRTASBuilderGetBuildPropertiesExpCb_t pfnGetBuildPropertiesExpCb; ze_pfnRTASBuilderBuildExpCb_t pfnBuildExpCb; @@ -45,10 +40,6 @@ typedef struct _zel_rtas_builder_callbacks_t /// @brief Table of RTASParallelOperation callback functions pointers typedef struct _zel_rtas_parallel_operation_callbacks_t { - ze_pfnRTASParallelOperationCreateExtCb_t pfnCreateExtCb; - ze_pfnRTASParallelOperationGetPropertiesExtCb_t pfnGetPropertiesExtCb; - ze_pfnRTASParallelOperationJoinExtCb_t pfnJoinExtCb; - ze_pfnRTASParallelOperationDestroyExtCb_t pfnDestroyExtCb; ze_pfnRTASParallelOperationCreateExpCb_t pfnCreateExpCb; ze_pfnRTASParallelOperationGetPropertiesExpCb_t pfnGetPropertiesExpCb; ze_pfnRTASParallelOperationJoinExpCb_t pfnJoinExpCb; @@ -65,7 +56,6 @@ typedef struct _zel_driver_callbacks_t ze_pfnDriverGetIpcPropertiesCb_t pfnGetIpcPropertiesCb; ze_pfnDriverGetExtensionPropertiesCb_t pfnGetExtensionPropertiesCb; ze_pfnDriverGetExtensionFunctionAddressCb_t pfnGetExtensionFunctionAddressCb; - ze_pfnDriverRTASFormatCompatibilityCheckExtCb_t pfnRTASFormatCompatibilityCheckExtCb; ze_pfnDriverGetLastErrorDescriptionCb_t pfnGetLastErrorDescriptionCb; ze_pfnDriverRTASFormatCompatibilityCheckExpCb_t pfnRTASFormatCompatibilityCheckExpCb; } zel_driver_callbacks_t; @@ -91,7 +81,6 @@ typedef struct _zel_device_callbacks_t ze_pfnDeviceGetGlobalTimestampsCb_t pfnGetGlobalTimestampsCb; ze_pfnDeviceImportExternalSemaphoreExtCb_t pfnImportExternalSemaphoreExtCb; ze_pfnDeviceReleaseExternalSemaphoreExtCb_t pfnReleaseExternalSemaphoreExtCb; - ze_pfnDeviceGetVectorWidthPropertiesExtCb_t pfnGetVectorWidthPropertiesExtCb; ze_pfnDeviceReserveCacheExtCb_t pfnReserveCacheExtCb; ze_pfnDeviceSetCacheAdviceExtCb_t pfnSetCacheAdviceExtCb; ze_pfnDevicePciGetPropertiesExtCb_t pfnPciGetPropertiesExtCb; diff --git a/source/layers/tracing/ze_tracing_register_cb.cpp b/source/layers/tracing/ze_tracing_register_cb.cpp index 79d8a7e6..bf2379a0 100644 --- a/source/layers/tracing/ze_tracing_register_cb.cpp +++ b/source/layers/tracing/ze_tracing_register_cb.cpp @@ -2435,182 +2435,6 @@ zelTracerCommandListAppendWaitExternalSemaphoreExtRegisterCallback( } -ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerRTASBuilderCreateExtRegisterCallback( - zel_tracer_handle_t hTracer, - zel_tracer_reg_t callback_type, - ze_pfnRTASBuilderCreateExtCb_t pfnCreateExtCb - ) { - - ze_result_t result; - auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getProEpilogues(callback_type, result); - if (result == ZE_RESULT_SUCCESS) - cbs.RTASBuilder.pfnCreateExtCb = pfnCreateExtCb; - - return result; -} - - -ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerRTASBuilderGetBuildPropertiesExtRegisterCallback( - zel_tracer_handle_t hTracer, - zel_tracer_reg_t callback_type, - ze_pfnRTASBuilderGetBuildPropertiesExtCb_t pfnGetBuildPropertiesExtCb - ) { - - ze_result_t result; - auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getProEpilogues(callback_type, result); - if (result == ZE_RESULT_SUCCESS) - cbs.RTASBuilder.pfnGetBuildPropertiesExtCb = pfnGetBuildPropertiesExtCb; - - return result; -} - - -ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerDriverRTASFormatCompatibilityCheckExtRegisterCallback( - zel_tracer_handle_t hTracer, - zel_tracer_reg_t callback_type, - ze_pfnDriverRTASFormatCompatibilityCheckExtCb_t pfnRTASFormatCompatibilityCheckExtCb - ) { - - ze_result_t result; - auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getProEpilogues(callback_type, result); - if (result == ZE_RESULT_SUCCESS) - cbs.Driver.pfnRTASFormatCompatibilityCheckExtCb = pfnRTASFormatCompatibilityCheckExtCb; - - return result; -} - - -ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerRTASBuilderBuildExtRegisterCallback( - zel_tracer_handle_t hTracer, - zel_tracer_reg_t callback_type, - ze_pfnRTASBuilderBuildExtCb_t pfnBuildExtCb - ) { - - ze_result_t result; - auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getProEpilogues(callback_type, result); - if (result == ZE_RESULT_SUCCESS) - cbs.RTASBuilder.pfnBuildExtCb = pfnBuildExtCb; - - return result; -} - - -ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerRTASBuilderCommandListAppendCopyExtRegisterCallback( - zel_tracer_handle_t hTracer, - zel_tracer_reg_t callback_type, - ze_pfnRTASBuilderCommandListAppendCopyExtCb_t pfnCommandListAppendCopyExtCb - ) { - - ze_result_t result; - auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getProEpilogues(callback_type, result); - if (result == ZE_RESULT_SUCCESS) - cbs.RTASBuilder.pfnCommandListAppendCopyExtCb = pfnCommandListAppendCopyExtCb; - - return result; -} - - -ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerRTASBuilderDestroyExtRegisterCallback( - zel_tracer_handle_t hTracer, - zel_tracer_reg_t callback_type, - ze_pfnRTASBuilderDestroyExtCb_t pfnDestroyExtCb - ) { - - ze_result_t result; - auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getProEpilogues(callback_type, result); - if (result == ZE_RESULT_SUCCESS) - cbs.RTASBuilder.pfnDestroyExtCb = pfnDestroyExtCb; - - return result; -} - - -ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerRTASParallelOperationCreateExtRegisterCallback( - zel_tracer_handle_t hTracer, - zel_tracer_reg_t callback_type, - ze_pfnRTASParallelOperationCreateExtCb_t pfnCreateExtCb - ) { - - ze_result_t result; - auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getProEpilogues(callback_type, result); - if (result == ZE_RESULT_SUCCESS) - cbs.RTASParallelOperation.pfnCreateExtCb = pfnCreateExtCb; - - return result; -} - - -ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerRTASParallelOperationGetPropertiesExtRegisterCallback( - zel_tracer_handle_t hTracer, - zel_tracer_reg_t callback_type, - ze_pfnRTASParallelOperationGetPropertiesExtCb_t pfnGetPropertiesExtCb - ) { - - ze_result_t result; - auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getProEpilogues(callback_type, result); - if (result == ZE_RESULT_SUCCESS) - cbs.RTASParallelOperation.pfnGetPropertiesExtCb = pfnGetPropertiesExtCb; - - return result; -} - - -ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerRTASParallelOperationJoinExtRegisterCallback( - zel_tracer_handle_t hTracer, - zel_tracer_reg_t callback_type, - ze_pfnRTASParallelOperationJoinExtCb_t pfnJoinExtCb - ) { - - ze_result_t result; - auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getProEpilogues(callback_type, result); - if (result == ZE_RESULT_SUCCESS) - cbs.RTASParallelOperation.pfnJoinExtCb = pfnJoinExtCb; - - return result; -} - - -ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerRTASParallelOperationDestroyExtRegisterCallback( - zel_tracer_handle_t hTracer, - zel_tracer_reg_t callback_type, - ze_pfnRTASParallelOperationDestroyExtCb_t pfnDestroyExtCb - ) { - - ze_result_t result; - auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getProEpilogues(callback_type, result); - if (result == ZE_RESULT_SUCCESS) - cbs.RTASParallelOperation.pfnDestroyExtCb = pfnDestroyExtCb; - - return result; -} - - -ZE_DLLEXPORT ze_result_t ZE_APICALL -zelTracerDeviceGetVectorWidthPropertiesExtRegisterCallback( - zel_tracer_handle_t hTracer, - zel_tracer_reg_t callback_type, - ze_pfnDeviceGetVectorWidthPropertiesExtCb_t pfnGetVectorWidthPropertiesExtCb - ) { - - ze_result_t result; - auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getProEpilogues(callback_type, result); - if (result == ZE_RESULT_SUCCESS) - cbs.Device.pfnGetVectorWidthPropertiesExtCb = pfnGetVectorWidthPropertiesExtCb; - - return result; -} - - ZE_DLLEXPORT ze_result_t ZE_APICALL zelTracerDeviceReserveCacheExtRegisterCallback( zel_tracer_handle_t hTracer, diff --git a/source/layers/tracing/ze_trcddi.cpp b/source/layers/tracing/ze_trcddi.cpp index f52237e3..9df2671d 100644 --- a/source/layers/tracing/ze_trcddi.cpp +++ b/source/layers/tracing/ze_trcddi.cpp @@ -4830,14 +4830,10 @@ namespace tracing_layer 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. + ///< 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. ) { auto pfnGetSourceAttributes = context.zeDdiTable.Kernel.pfnGetSourceAttributes; @@ -6045,447 +6041,6 @@ namespace tracing_layer *tracerParams.pphWaitEvents); } - /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderCreateExt - __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 - ) - { - auto pfnCreateExt = context.zeDdiTable.RTASBuilder.pfnCreateExt; - - if( nullptr == pfnCreateExt) - return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.RTASBuilder.pfnCreateExt, hDriver, pDescriptor, phBuilder); - - // capture parameters - ze_rtas_builder_create_ext_params_t tracerParams = { - &hDriver, - &pDescriptor, - &phBuilder - }; - - tracing_layer::APITracerCallbackDataImp apiCallbackData; - - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnRTASBuilderCreateExtCb_t, RTASBuilder, pfnCreateExtCb); - - - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.RTASBuilder.pfnCreateExt, - &tracerParams, - apiCallbackData.apiOrdinal, - apiCallbackData.prologCallbacks, - apiCallbackData.epilogCallbacks, - *tracerParams.phDriver, - *tracerParams.ppDescriptor, - *tracerParams.pphBuilder); - } - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderGetBuildPropertiesExt - __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 - ) - { - auto pfnGetBuildPropertiesExt = context.zeDdiTable.RTASBuilder.pfnGetBuildPropertiesExt; - - if( nullptr == pfnGetBuildPropertiesExt) - return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.RTASBuilder.pfnGetBuildPropertiesExt, hBuilder, pBuildOpDescriptor, pProperties); - - // capture parameters - ze_rtas_builder_get_build_properties_ext_params_t tracerParams = { - &hBuilder, - &pBuildOpDescriptor, - &pProperties - }; - - tracing_layer::APITracerCallbackDataImp apiCallbackData; - - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnRTASBuilderGetBuildPropertiesExtCb_t, RTASBuilder, pfnGetBuildPropertiesExtCb); - - - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.RTASBuilder.pfnGetBuildPropertiesExt, - &tracerParams, - apiCallbackData.apiOrdinal, - apiCallbackData.prologCallbacks, - apiCallbackData.epilogCallbacks, - *tracerParams.phBuilder, - *tracerParams.ppBuildOpDescriptor, - *tracerParams.ppProperties); - } - - /////////////////////////////////////////////////////////////////////////////// - /// @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 - ) - { - auto pfnRTASFormatCompatibilityCheckExt = context.zeDdiTable.Driver.pfnRTASFormatCompatibilityCheckExt; - - if( nullptr == pfnRTASFormatCompatibilityCheckExt) - return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.Driver.pfnRTASFormatCompatibilityCheckExt, hDriver, rtasFormatA, rtasFormatB); - - // capture parameters - ze_driver_rtas_format_compatibility_check_ext_params_t tracerParams = { - &hDriver, - &rtasFormatA, - &rtasFormatB - }; - - tracing_layer::APITracerCallbackDataImp apiCallbackData; - - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnDriverRTASFormatCompatibilityCheckExtCb_t, Driver, pfnRTASFormatCompatibilityCheckExtCb); - - - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.Driver.pfnRTASFormatCompatibilityCheckExt, - &tracerParams, - apiCallbackData.apiOrdinal, - apiCallbackData.prologCallbacks, - apiCallbackData.epilogCallbacks, - *tracerParams.phDriver, - *tracerParams.prtasFormatA, - *tracerParams.prtasFormatB); - } - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderBuildExt - __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 - ) - { - auto pfnBuildExt = context.zeDdiTable.RTASBuilder.pfnBuildExt; - - if( nullptr == pfnBuildExt) - return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.RTASBuilder.pfnBuildExt, hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes); - - // capture parameters - ze_rtas_builder_build_ext_params_t tracerParams = { - &hBuilder, - &pBuildOpDescriptor, - &pScratchBuffer, - &scratchBufferSizeBytes, - &pRtasBuffer, - &rtasBufferSizeBytes, - &hParallelOperation, - &pBuildUserPtr, - &pBounds, - &pRtasBufferSizeBytes - }; - - tracing_layer::APITracerCallbackDataImp apiCallbackData; - - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnRTASBuilderBuildExtCb_t, RTASBuilder, pfnBuildExtCb); - - - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.RTASBuilder.pfnBuildExt, - &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); - } - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderCommandListAppendCopyExt - __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 - ) - { - auto pfnCommandListAppendCopyExt = context.zeDdiTable.RTASBuilder.pfnCommandListAppendCopyExt; - - if( nullptr == pfnCommandListAppendCopyExt) - return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.RTASBuilder.pfnCommandListAppendCopyExt, hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents); - - // capture parameters - ze_rtas_builder_command_list_append_copy_ext_params_t tracerParams = { - &hCommandList, - &dstptr, - &srcptr, - &size, - &hSignalEvent, - &numWaitEvents, - &phWaitEvents - }; - - tracing_layer::APITracerCallbackDataImp apiCallbackData; - - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnRTASBuilderCommandListAppendCopyExtCb_t, RTASBuilder, pfnCommandListAppendCopyExtCb); - - - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.RTASBuilder.pfnCommandListAppendCopyExt, - &tracerParams, - apiCallbackData.apiOrdinal, - apiCallbackData.prologCallbacks, - apiCallbackData.epilogCallbacks, - *tracerParams.phCommandList, - *tracerParams.pdstptr, - *tracerParams.psrcptr, - *tracerParams.psize, - *tracerParams.phSignalEvent, - *tracerParams.pnumWaitEvents, - *tracerParams.pphWaitEvents); - } - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderDestroyExt - __zedlllocal ze_result_t ZE_APICALL - zeRTASBuilderDestroyExt( - ze_rtas_builder_ext_handle_t hBuilder ///< [in][release] handle of builder object to destroy - ) - { - auto pfnDestroyExt = context.zeDdiTable.RTASBuilder.pfnDestroyExt; - - if( nullptr == pfnDestroyExt) - return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.RTASBuilder.pfnDestroyExt, hBuilder); - - // capture parameters - ze_rtas_builder_destroy_ext_params_t tracerParams = { - &hBuilder - }; - - tracing_layer::APITracerCallbackDataImp apiCallbackData; - - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnRTASBuilderDestroyExtCb_t, RTASBuilder, pfnDestroyExtCb); - - - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.RTASBuilder.pfnDestroyExt, - &tracerParams, - apiCallbackData.apiOrdinal, - apiCallbackData.prologCallbacks, - apiCallbackData.epilogCallbacks, - *tracerParams.phBuilder); - } - - /////////////////////////////////////////////////////////////////////////////// - /// @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 - ) - { - auto pfnCreateExt = context.zeDdiTable.RTASParallelOperation.pfnCreateExt; - - if( nullptr == pfnCreateExt) - return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.RTASParallelOperation.pfnCreateExt, hDriver, phParallelOperation); - - // capture parameters - ze_rtas_parallel_operation_create_ext_params_t tracerParams = { - &hDriver, - &phParallelOperation - }; - - 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 pfnGetPropertiesExt = context.zeDdiTable.RTASParallelOperation.pfnGetPropertiesExt; - - if( nullptr == pfnGetPropertiesExt) - return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.RTASParallelOperation.pfnGetPropertiesExt, hParallelOperation, pProperties); - - // capture parameters - ze_rtas_parallel_operation_get_properties_ext_params_t tracerParams = { - &hParallelOperation, - &pProperties - }; - - tracing_layer::APITracerCallbackDataImp apiCallbackData; - - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnRTASParallelOperationGetPropertiesExtCb_t, RTASParallelOperation, pfnGetPropertiesExtCb); - - - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.RTASParallelOperation.pfnGetPropertiesExt, - &tracerParams, - apiCallbackData.apiOrdinal, - apiCallbackData.prologCallbacks, - apiCallbackData.epilogCallbacks, - *tracerParams.phParallelOperation, - *tracerParams.ppProperties); - } - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASParallelOperationJoinExt - __zedlllocal ze_result_t ZE_APICALL - zeRTASParallelOperationJoinExt( - ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in] handle of parallel operation object - ) - { - auto pfnJoinExt = context.zeDdiTable.RTASParallelOperation.pfnJoinExt; - - if( nullptr == pfnJoinExt) - return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.RTASParallelOperation.pfnJoinExt, hParallelOperation); - - // capture parameters - ze_rtas_parallel_operation_join_ext_params_t tracerParams = { - &hParallelOperation - }; - - tracing_layer::APITracerCallbackDataImp apiCallbackData; - - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnRTASParallelOperationJoinExtCb_t, RTASParallelOperation, pfnJoinExtCb); - - - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.RTASParallelOperation.pfnJoinExt, - &tracerParams, - apiCallbackData.apiOrdinal, - apiCallbackData.prologCallbacks, - apiCallbackData.epilogCallbacks, - *tracerParams.phParallelOperation); - } - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASParallelOperationDestroyExt - __zedlllocal ze_result_t ZE_APICALL - zeRTASParallelOperationDestroyExt( - ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in][release] handle of parallel operation object to destroy - ) - { - auto pfnDestroyExt = context.zeDdiTable.RTASParallelOperation.pfnDestroyExt; - - if( nullptr == pfnDestroyExt) - return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.RTASParallelOperation.pfnDestroyExt, hParallelOperation); - - // capture parameters - ze_rtas_parallel_operation_destroy_ext_params_t tracerParams = { - &hParallelOperation - }; - - tracing_layer::APITracerCallbackDataImp apiCallbackData; - - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnRTASParallelOperationDestroyExtCb_t, RTASParallelOperation, pfnDestroyExtCb); - - - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.RTASParallelOperation.pfnDestroyExt, - &tracerParams, - apiCallbackData.apiOrdinal, - apiCallbackData.prologCallbacks, - apiCallbackData.epilogCallbacks, - *tracerParams.phParallelOperation); - } - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDeviceGetVectorWidthPropertiesExt - __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. - ) - { - auto pfnGetVectorWidthPropertiesExt = context.zeDdiTable.Device.pfnGetVectorWidthPropertiesExt; - - if( nullptr == pfnGetVectorWidthPropertiesExt) - return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - - ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.Device.pfnGetVectorWidthPropertiesExt, hDevice, pCount, pVectorWidthProperties); - - // capture parameters - ze_device_get_vector_width_properties_ext_params_t tracerParams = { - &hDevice, - &pCount, - &pVectorWidthProperties - }; - - tracing_layer::APITracerCallbackDataImp apiCallbackData; - - ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnDeviceGetVectorWidthPropertiesExtCb_t, Device, pfnGetVectorWidthPropertiesExtCb); - - - return tracing_layer::APITracerWrapperImp(context.zeDdiTable.Device.pfnGetVectorWidthPropertiesExt, - &tracerParams, - apiCallbackData.apiOrdinal, - apiCallbackData.prologCallbacks, - apiCallbackData.epilogCallbacks, - *tracerParams.phDevice, - *tracerParams.ppCount, - *tracerParams.ppVectorWidthProperties); - } - /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zeDeviceReserveCacheExt __zedlllocal ze_result_t ZE_APICALL @@ -8211,49 +7766,6 @@ zeGetGlobalProcAddrTable( return result; } -/////////////////////////////////////////////////////////////////////////////// -/// @brief Exported function for filling application's RTASBuilder 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 -zeGetRTASBuilderProcAddrTable( - ze_api_version_t version, ///< [in] API version requested - ze_rtas_builder_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers - ) -{ - auto& dditable = tracing_layer::context.zeDdiTable.RTASBuilder; - - if( nullptr == pDdiTable ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - - if (ZE_MAJOR_VERSION(tracing_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(tracing_layer::context.version) > ZE_MINOR_VERSION(version)) - return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; - - ze_result_t result = ZE_RESULT_SUCCESS; - - dditable.pfnCreateExt = pDdiTable->pfnCreateExt; - pDdiTable->pfnCreateExt = tracing_layer::zeRTASBuilderCreateExt; - - dditable.pfnGetBuildPropertiesExt = pDdiTable->pfnGetBuildPropertiesExt; - pDdiTable->pfnGetBuildPropertiesExt = tracing_layer::zeRTASBuilderGetBuildPropertiesExt; - - dditable.pfnBuildExt = pDdiTable->pfnBuildExt; - pDdiTable->pfnBuildExt = tracing_layer::zeRTASBuilderBuildExt; - - dditable.pfnCommandListAppendCopyExt = pDdiTable->pfnCommandListAppendCopyExt; - pDdiTable->pfnCommandListAppendCopyExt = tracing_layer::zeRTASBuilderCommandListAppendCopyExt; - - dditable.pfnDestroyExt = pDdiTable->pfnDestroyExt; - pDdiTable->pfnDestroyExt = tracing_layer::zeRTASBuilderDestroyExt; - - return result; -} - /////////////////////////////////////////////////////////////////////////////// /// @brief Exported function for filling application's RTASBuilderExp table /// with current process' addresses @@ -8294,46 +7806,6 @@ zeGetRTASBuilderExpProcAddrTable( return result; } -/////////////////////////////////////////////////////////////////////////////// -/// @brief Exported function for filling application's RTASParallelOperation 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 -zeGetRTASParallelOperationProcAddrTable( - ze_api_version_t version, ///< [in] API version requested - ze_rtas_parallel_operation_dditable_t* pDdiTable///< [in,out] pointer to table of DDI function pointers - ) -{ - auto& dditable = tracing_layer::context.zeDdiTable.RTASParallelOperation; - - if( nullptr == pDdiTable ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - - if (ZE_MAJOR_VERSION(tracing_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(tracing_layer::context.version) > ZE_MINOR_VERSION(version)) - return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; - - ze_result_t result = ZE_RESULT_SUCCESS; - - dditable.pfnCreateExt = pDdiTable->pfnCreateExt; - pDdiTable->pfnCreateExt = tracing_layer::zeRTASParallelOperationCreateExt; - - dditable.pfnGetPropertiesExt = pDdiTable->pfnGetPropertiesExt; - pDdiTable->pfnGetPropertiesExt = tracing_layer::zeRTASParallelOperationGetPropertiesExt; - - dditable.pfnJoinExt = pDdiTable->pfnJoinExt; - pDdiTable->pfnJoinExt = tracing_layer::zeRTASParallelOperationJoinExt; - - dditable.pfnDestroyExt = pDdiTable->pfnDestroyExt; - pDdiTable->pfnDestroyExt = tracing_layer::zeRTASParallelOperationDestroyExt; - - return result; -} - /////////////////////////////////////////////////////////////////////////////// /// @brief Exported function for filling application's RTASParallelOperationExp table /// with current process' addresses @@ -8417,9 +7889,6 @@ zeGetDriverProcAddrTable( dditable.pfnGetExtensionFunctionAddress = pDdiTable->pfnGetExtensionFunctionAddress; pDdiTable->pfnGetExtensionFunctionAddress = tracing_layer::zeDriverGetExtensionFunctionAddress; - dditable.pfnRTASFormatCompatibilityCheckExt = pDdiTable->pfnRTASFormatCompatibilityCheckExt; - pDdiTable->pfnRTASFormatCompatibilityCheckExt = tracing_layer::zeDriverRTASFormatCompatibilityCheckExt; - dditable.pfnGetLastErrorDescription = pDdiTable->pfnGetLastErrorDescription; pDdiTable->pfnGetLastErrorDescription = tracing_layer::zeDriverGetLastErrorDescription; @@ -8533,9 +8002,6 @@ zeGetDeviceProcAddrTable( dditable.pfnReleaseExternalSemaphoreExt = pDdiTable->pfnReleaseExternalSemaphoreExt; pDdiTable->pfnReleaseExternalSemaphoreExt = tracing_layer::zeDeviceReleaseExternalSemaphoreExt; - dditable.pfnGetVectorWidthPropertiesExt = pDdiTable->pfnGetVectorWidthPropertiesExt; - pDdiTable->pfnGetVectorWidthPropertiesExt = tracing_layer::zeDeviceGetVectorWidthPropertiesExt; - dditable.pfnReserveCacheExt = pDdiTable->pfnReserveCacheExt; pDdiTable->pfnReserveCacheExt = tracing_layer::zeDeviceReserveCacheExt; diff --git a/source/layers/validation/checkers/parameter_validation/extension_validation.inl b/source/layers/validation/checkers/parameter_validation/extension_validation.inl index 951617a8..c7de1238 100644 --- a/source/layers/validation/checkers/parameter_validation/extension_validation.inl +++ b/source/layers/validation/checkers/parameter_validation/extension_validation.inl @@ -146,7 +146,7 @@ inline ze_result_t ParameterValidation::validateExtensions(const ze_device_cache } std::vector baseTypes = {ZE_STRUCTURE_TYPE_DEVICE_CACHE_PROPERTIES}; - std::vector types = {ZE_STRUCTURE_TYPE_CACHE_RESERVATION_EXT_DESC,ZE_STRUCTURE_TYPE_DEVICE_CACHELINE_SIZE_EXT}; + std::vector types = {ZE_STRUCTURE_TYPE_CACHE_RESERVATION_EXT_DESC}; return validateStructureTypes(descriptor, baseTypes, types); } 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 44687fd9..d51c6b3f 100644 --- a/source/layers/validation/checkers/parameter_validation/ze_parameter_validation.cpp +++ b/source/layers/validation/checkers/parameter_validation/ze_parameter_validation.cpp @@ -2497,14 +2497,10 @@ namespace validation_layer 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. + ///< 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. ) { if( nullptr == hKernel ) @@ -3175,248 +3171,6 @@ namespace validation_layer } - 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 - ) - { - if( nullptr == hDriver ) - return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - - if( nullptr == pDescriptor ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - - if( nullptr == phBuilder ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - - if( ZE_RTAS_BUILDER_EXT_VERSION_CURRENT < pDescriptor->builderVersion ) - return ZE_RESULT_ERROR_INVALID_ENUMERATION; - - return ParameterValidation::validateExtensions(pDescriptor); - } - - - 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 - ) - { - if( nullptr == hBuilder ) - return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - - if( nullptr == pBuildOpDescriptor ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - - if( nullptr == pProperties ) - 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; - - auto retVal = ZE_RESULT_SUCCESS; - retVal = ParameterValidation::validateExtensions(pBuildOpDescriptor); - if(retVal) - return retVal; - retVal = ParameterValidation::validateExtensions(pProperties); - return retVal; - } - - - 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 - ) - { - if( nullptr == hDriver ) - return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - - if( ZE_RTAS_FORMAT_EXT_MAX < rtasFormatA ) - return ZE_RESULT_ERROR_INVALID_ENUMERATION; - - if( ZE_RTAS_FORMAT_EXT_MAX < rtasFormatB ) - return ZE_RESULT_ERROR_INVALID_ENUMERATION; - - return ZE_RESULT_SUCCESS; - } - - - 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 - ) - { - if( nullptr == hBuilder ) - 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 ) - 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); - } - - - ze_result_t - 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::zeDeviceReserveCacheExtPrologue( ze_device_handle_t hDevice, ///< [in] handle of the device object @@ -3969,7 +3723,7 @@ 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_EXP_INVALID < pBuildOpDescriptor->rtasFormat ) return ZE_RESULT_ERROR_INVALID_ENUMERATION; if( ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_HIGH < pBuildOpDescriptor->buildQuality ) @@ -3997,10 +3751,10 @@ namespace validation_layer if( nullptr == hDriver ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - if( ZE_RTAS_FORMAT_EXP_MAX < rtasFormatA ) + if( ZE_RTAS_FORMAT_EXP_INVALID < rtasFormatA ) return ZE_RESULT_ERROR_INVALID_ENUMERATION; - if( ZE_RTAS_FORMAT_EXP_MAX < rtasFormatB ) + if( ZE_RTAS_FORMAT_EXP_INVALID < rtasFormatB ) return ZE_RESULT_ERROR_INVALID_ENUMERATION; return ZE_RESULT_SUCCESS; @@ -4036,7 +3790,7 @@ 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_EXP_INVALID < pBuildOpDescriptor->rtasFormat ) return ZE_RESULT_ERROR_INVALID_ENUMERATION; if( ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_HIGH < pBuildOpDescriptor->buildQuality ) 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 eb6a4069..a22a25ff 100644 --- a/source/layers/validation/checkers/parameter_validation/ze_parameter_validation.h +++ b/source/layers/validation/checkers/parameter_validation/ze_parameter_validation.h @@ -171,17 +171,6 @@ namespace validation_layer 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 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; 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 c8a3bda3..2f5468d1 100644 --- a/source/layers/validation/checkers/parameter_validation/zet_parameter_validation.cpp +++ b/source/layers/validation/checkers/parameter_validation/zet_parameter_validation.cpp @@ -259,8 +259,8 @@ namespace validation_layer ///< than the `count` member of ::zet_debug_regset_properties_t for the ///< type uint32_t count, ///< [in] the number of registers to read; start+count must be less than or - ///< equal to the `count` member of ::zet_debug_regset_properties_t for the - ///< type + ///< equal to the `count` member of ::zet_debug_register_group_properties_t + ///< for the type void* pRegisterValues ///< [in,out][optional][range(0, count)] buffer of register values ) { @@ -280,8 +280,8 @@ namespace validation_layer ///< than the `count` member of ::zet_debug_regset_properties_t for the ///< type uint32_t count, ///< [in] the number of registers to write; start+count must be less than - ///< or equal to the `count` member of ::zet_debug_regset_properties_t for - ///< the type + ///< or equal to the `count` member of + ///< ::zet_debug_register_group_properties_t for the type void* pRegisterValues ///< [in,out][optional][range(0, count)] buffer of register values ) { @@ -1014,49 +1014,6 @@ namespace validation_layer } - 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 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 eb141301..4a2d24bc 100644 --- a/source/layers/validation/checkers/parameter_validation/zet_parameter_validation.h +++ b/source/layers/validation/checkers/parameter_validation/zet_parameter_validation.h @@ -69,9 +69,6 @@ namespace validation_layer 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; diff --git a/source/layers/validation/common/ze_entry_points.h b/source/layers/validation/common/ze_entry_points.h index 971500c9..c96c1ec5 100644 --- a/source/layers/validation/common/ze_entry_points.h +++ b/source/layers/validation/common/ze_entry_points.h @@ -319,28 +319,6 @@ class ZEValidationEntryPoints { 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 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;} diff --git a/source/layers/validation/common/zet_entry_points.h b/source/layers/validation/common/zet_entry_points.h index d52be228..e5c541af 100644 --- a/source/layers/validation/common/zet_entry_points.h +++ b/source/layers/validation/common/zet_entry_points.h @@ -115,12 +115,6 @@ class ZETValidationEntryPoints { 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;} 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 fe36fcb3..b892b6c0 100644 --- a/source/layers/validation/handle_lifetime_tracking/ze_handle_lifetime.cpp +++ b/source/layers/validation/handle_lifetime_tracking/ze_handle_lifetime.cpp @@ -2032,14 +2032,10 @@ namespace validation_layer 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. + ///< 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. ) { @@ -2610,180 +2606,6 @@ namespace validation_layer 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 - ) - { - - if ( !context.handleLifetime->isHandleValid( hDriver )){ - 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 - ) - { - - if ( !context.handleLifetime->isHandleValid( hBuilder )){ - 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 - ) - { - - if ( !context.handleLifetime->isHandleValid( hDriver )){ - 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 - ) - { - - if ( !context.handleLifetime->isHandleValid( hBuilder )){ - return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - } - if (hParallelOperation && !context.handleLifetime->isHandleValid( hParallelOperation )){ - return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - } - return ZE_RESULT_SUCCESS; - } - ze_result_t - 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( 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::zeRTASBuilderDestroyExtPrologue( - ze_rtas_builder_ext_handle_t hBuilder ///< [in][release] handle of builder object to destroy - ) - { - - if ( !context.handleLifetime->isHandleValid( hBuilder )){ - 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 - ) - { - - if ( !context.handleLifetime->isHandleValid( hDriver )){ - 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 - ) - { - - if ( !context.handleLifetime->isHandleValid( hParallelOperation )){ - 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 - ) - { - - if ( !context.handleLifetime->isHandleValid( hParallelOperation )){ - 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::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 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 66bf76cc..5b598b0d 100644 --- a/source/layers/validation/handle_lifetime_tracking/ze_handle_lifetime.h +++ b/source/layers/validation/handle_lifetime_tracking/ze_handle_lifetime.h @@ -167,17 +167,6 @@ namespace validation_layer 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 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; 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 d9c92c00..bf4b9837 100644 --- a/source/layers/validation/handle_lifetime_tracking/zet_handle_lifetime.cpp +++ b/source/layers/validation/handle_lifetime_tracking/zet_handle_lifetime.cpp @@ -201,8 +201,8 @@ namespace validation_layer ///< than the `count` member of ::zet_debug_regset_properties_t for the ///< type uint32_t count, ///< [in] the number of registers to read; start+count must be less than or - ///< equal to the `count` member of ::zet_debug_regset_properties_t for the - ///< type + ///< equal to the `count` member of ::zet_debug_register_group_properties_t + ///< for the type void* pRegisterValues ///< [in,out][optional][range(0, count)] buffer of register values ) { @@ -221,8 +221,8 @@ namespace validation_layer ///< than the `count` member of ::zet_debug_regset_properties_t for the ///< type uint32_t count, ///< [in] the number of registers to write; start+count must be less than - ///< or equal to the `count` member of ::zet_debug_regset_properties_t for - ///< the type + ///< or equal to the `count` member of + ///< ::zet_debug_register_group_properties_t for the type void* pRegisterValues ///< [in,out][optional][range(0, count)] buffer of register values ) { @@ -869,49 +869,6 @@ namespace validation_layer 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 - ) - { - - 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 )){ - 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. - ) - { - - if ( !context.handleLifetime->isHandleValid( hDevice )){ - return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - } - 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 - ) - { - - if ( !context.handleLifetime->isHandleValid( hDevice )){ - 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 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 8729e8dc..bb3b6ea3 100644 --- a/source/layers/validation/handle_lifetime_tracking/zet_handle_lifetime.h +++ b/source/layers/validation/handle_lifetime_tracking/zet_handle_lifetime.h @@ -68,9 +68,6 @@ namespace validation_layer 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; diff --git a/source/layers/validation/ze_valddi.cpp b/source/layers/validation/ze_valddi.cpp index e779acf6..2a618cb8 100644 --- a/source/layers/validation/ze_valddi.cpp +++ b/source/layers/validation/ze_valddi.cpp @@ -5589,14 +5589,10 @@ namespace validation_layer 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. + ///< 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. ) { context.logger->log_trace("zeKernelGetSourceAttributes(hKernel, pSize, pString)"); @@ -6915,514 +6911,6 @@ namespace validation_layer return logAndPropagateResult("zeCommandListAppendWaitExternalSemaphoreExt", driver_result); } - /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderCreateExt - __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 - ) - { - context.logger->log_trace("zeRTASBuilderCreateExt(hDriver, pDescriptor, phBuilder)"); - - auto pfnCreateExt = context.zeDdiTable.RTASBuilder.pfnCreateExt; - - if( nullptr == pfnCreateExt ) - return logAndPropagateResult("zeRTASBuilderCreateExt", ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); - - 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); - } - - - if( context.enableThreadingValidation ){ - //Unimplemented - } - - - if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeRTASBuilderCreateExtPrologue( hDriver, pDescriptor, phBuilder ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult("zeRTASBuilderCreateExt", result); - } - - auto driver_result = pfnCreateExt( hDriver, pDescriptor, phBuilder ); - - 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); - } - - - if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ - - if (phBuilder){ - context.handleLifetime->addHandle( *phBuilder ); - context.handleLifetime->addDependent( hDriver, *phBuilder ); - - } - } - return logAndPropagateResult("zeRTASBuilderCreateExt", driver_result); - } - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderGetBuildPropertiesExt - __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 - ) - { - context.logger->log_trace("zeRTASBuilderGetBuildPropertiesExt(hBuilder, pBuildOpDescriptor, pProperties)"); - - auto pfnGetBuildPropertiesExt = context.zeDdiTable.RTASBuilder.pfnGetBuildPropertiesExt; - - if( nullptr == pfnGetBuildPropertiesExt ) - return logAndPropagateResult("zeRTASBuilderGetBuildPropertiesExt", ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); - - 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); - } - - - if( context.enableThreadingValidation ){ - //Unimplemented - } - - - if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeRTASBuilderGetBuildPropertiesExtPrologue( hBuilder, pBuildOpDescriptor, pProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult("zeRTASBuilderGetBuildPropertiesExt", result); - } - - auto driver_result = pfnGetBuildPropertiesExt( hBuilder, pBuildOpDescriptor, pProperties ); - - 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); - } - - return logAndPropagateResult("zeRTASBuilderGetBuildPropertiesExt", driver_result); - } - - /////////////////////////////////////////////////////////////////////////////// - /// @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("zeDriverRTASFormatCompatibilityCheckExt(hDriver, rtasFormatA, rtasFormatB)"); - - auto pfnRTASFormatCompatibilityCheckExt = context.zeDdiTable.Driver.pfnRTASFormatCompatibilityCheckExt; - - if( nullptr == pfnRTASFormatCompatibilityCheckExt ) - return logAndPropagateResult("zeDriverRTASFormatCompatibilityCheckExt", ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); - - 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); - } - - - if( context.enableThreadingValidation ){ - //Unimplemented - } - - - if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeDriverRTASFormatCompatibilityCheckExtPrologue( hDriver, rtasFormatA, rtasFormatB ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult("zeDriverRTASFormatCompatibilityCheckExt", result); - } - - auto driver_result = pfnRTASFormatCompatibilityCheckExt( hDriver, rtasFormatA, rtasFormatB ); - - 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); - } - - return logAndPropagateResult("zeDriverRTASFormatCompatibilityCheckExt", driver_result); - } - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderBuildExt - __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 - ) - { - context.logger->log_trace("zeRTASBuilderBuildExt(hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes)"); - - auto pfnBuildExt = context.zeDdiTable.RTASBuilder.pfnBuildExt; - - if( nullptr == pfnBuildExt ) - return logAndPropagateResult("zeRTASBuilderBuildExt", ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); - - 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); - } - - - if( context.enableThreadingValidation ){ - //Unimplemented - } - - - 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); - } - - 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->zeRTASBuilderBuildExtEpilogue( hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes ,driver_result); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult("zeRTASBuilderBuildExt", result); - } - - return logAndPropagateResult("zeRTASBuilderBuildExt", driver_result); - } - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderCommandListAppendCopyExt - __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 - ) - { - context.logger->log_trace("zeRTASBuilderCommandListAppendCopyExt(hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); - - auto pfnCommandListAppendCopyExt = context.zeDdiTable.RTASBuilder.pfnCommandListAppendCopyExt; - - if( nullptr == pfnCommandListAppendCopyExt ) - return logAndPropagateResult("zeRTASBuilderCommandListAppendCopyExt", ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); - - 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); - } - - - if( context.enableThreadingValidation ){ - //Unimplemented - } - - - 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); - } - - 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); - } - - return logAndPropagateResult("zeRTASBuilderCommandListAppendCopyExt", driver_result); - } - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderDestroyExt - __zedlllocal ze_result_t ZE_APICALL - zeRTASBuilderDestroyExt( - ze_rtas_builder_ext_handle_t hBuilder ///< [in][release] handle of builder object to destroy - ) - { - context.logger->log_trace("zeRTASBuilderDestroyExt(hBuilder)"); - - auto pfnDestroyExt = context.zeDdiTable.RTASBuilder.pfnDestroyExt; - - if( nullptr == pfnDestroyExt ) - return logAndPropagateResult("zeRTASBuilderDestroyExt", ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); - - 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); - } - - - if( context.enableThreadingValidation ){ - //Unimplemented - } - - - if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeRTASBuilderDestroyExtPrologue( hBuilder ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult("zeRTASBuilderDestroyExt", result); - } - - auto driver_result = pfnDestroyExt( hBuilder ); - - 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); - } - - return logAndPropagateResult("zeRTASBuilderDestroyExt", driver_result); - } - - /////////////////////////////////////////////////////////////////////////////// - /// @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 - ) - { - context.logger->log_trace("zeRTASParallelOperationCreateExt(hDriver, phParallelOperation)"); - - auto pfnCreateExt = context.zeDdiTable.RTASParallelOperation.pfnCreateExt; - - if( nullptr == pfnCreateExt ) - return logAndPropagateResult("zeRTASParallelOperationCreateExt", ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); - - 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); - } - - - if( context.enableThreadingValidation ){ - //Unimplemented - } - - - if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeRTASParallelOperationCreateExtPrologue( hDriver, phParallelOperation ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult("zeRTASParallelOperationCreateExt", result); - } - - auto driver_result = pfnCreateExt( hDriver, phParallelOperation ); - - 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); - } - - - if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ - - if (phParallelOperation){ - context.handleLifetime->addHandle( *phParallelOperation ); - context.handleLifetime->addDependent( hDriver, *phParallelOperation ); - - } - } - return logAndPropagateResult("zeRTASParallelOperationCreateExt", driver_result); - } - - /////////////////////////////////////////////////////////////////////////////// - /// @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("zeRTASParallelOperationGetPropertiesExt(hParallelOperation, pProperties)"); - - auto pfnGetPropertiesExt = context.zeDdiTable.RTASParallelOperation.pfnGetPropertiesExt; - - if( nullptr == pfnGetPropertiesExt ) - return logAndPropagateResult("zeRTASParallelOperationGetPropertiesExt", ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); - - 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); - } - - - if( context.enableThreadingValidation ){ - //Unimplemented - } - - - if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeRTASParallelOperationGetPropertiesExtPrologue( hParallelOperation, pProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult("zeRTASParallelOperationGetPropertiesExt", result); - } - - auto driver_result = pfnGetPropertiesExt( hParallelOperation, pProperties ); - - 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); - } - - return logAndPropagateResult("zeRTASParallelOperationGetPropertiesExt", driver_result); - } - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASParallelOperationJoinExt - __zedlllocal ze_result_t ZE_APICALL - zeRTASParallelOperationJoinExt( - ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in] handle of parallel operation object - ) - { - context.logger->log_trace("zeRTASParallelOperationJoinExt(hParallelOperation)"); - - auto pfnJoinExt = context.zeDdiTable.RTASParallelOperation.pfnJoinExt; - - if( nullptr == pfnJoinExt ) - return logAndPropagateResult("zeRTASParallelOperationJoinExt", ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); - - 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); - } - - - if( context.enableThreadingValidation ){ - //Unimplemented - } - - - if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeRTASParallelOperationJoinExtPrologue( hParallelOperation ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult("zeRTASParallelOperationJoinExt", result); - } - - auto driver_result = pfnJoinExt( hParallelOperation ); - - 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); - } - - return logAndPropagateResult("zeRTASParallelOperationJoinExt", driver_result); - } - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASParallelOperationDestroyExt - __zedlllocal ze_result_t ZE_APICALL - zeRTASParallelOperationDestroyExt( - ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in][release] handle of parallel operation object to destroy - ) - { - context.logger->log_trace("zeRTASParallelOperationDestroyExt(hParallelOperation)"); - - auto pfnDestroyExt = context.zeDdiTable.RTASParallelOperation.pfnDestroyExt; - - if( nullptr == pfnDestroyExt ) - return logAndPropagateResult("zeRTASParallelOperationDestroyExt", ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); - - 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); - } - - - if( context.enableThreadingValidation ){ - //Unimplemented - } - - - if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeRTASParallelOperationDestroyExtPrologue( hParallelOperation ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult("zeRTASParallelOperationDestroyExt", result); - } - - auto driver_result = pfnDestroyExt( hParallelOperation ); - - 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); - } - - return logAndPropagateResult("zeRTASParallelOperationDestroyExt", driver_result); - } - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeDeviceGetVectorWidthPropertiesExt - __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. - ) - { - context.logger->log_trace("zeDeviceGetVectorWidthPropertiesExt(hDevice, pCount, pVectorWidthProperties)"); - - auto pfnGetVectorWidthPropertiesExt = context.zeDdiTable.Device.pfnGetVectorWidthPropertiesExt; - - if( nullptr == pfnGetVectorWidthPropertiesExt ) - return logAndPropagateResult("zeDeviceGetVectorWidthPropertiesExt", ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); - - 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); - } - - - if( context.enableThreadingValidation ){ - //Unimplemented - } - - - if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zeHandleLifetime.zeDeviceGetVectorWidthPropertiesExtPrologue( hDevice, pCount, pVectorWidthProperties ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult("zeDeviceGetVectorWidthPropertiesExt", result); - } - - auto driver_result = pfnGetVectorWidthPropertiesExt( hDevice, pCount, pVectorWidthProperties ); - - 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); - } - - return logAndPropagateResult("zeDeviceGetVectorWidthPropertiesExt", driver_result); - } - /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zeDeviceReserveCacheExt __zedlllocal ze_result_t ZE_APICALL @@ -9452,49 +8940,6 @@ zeGetGlobalProcAddrTable( return result; } -/////////////////////////////////////////////////////////////////////////////// -/// @brief Exported function for filling application's RTASBuilder 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 -zeGetRTASBuilderProcAddrTable( - ze_api_version_t version, ///< [in] API version requested - ze_rtas_builder_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers - ) -{ - auto& dditable = validation_layer::context.zeDdiTable.RTASBuilder; - - if( nullptr == pDdiTable ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) - return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; - - ze_result_t result = ZE_RESULT_SUCCESS; - - dditable.pfnCreateExt = pDdiTable->pfnCreateExt; - pDdiTable->pfnCreateExt = validation_layer::zeRTASBuilderCreateExt; - - dditable.pfnGetBuildPropertiesExt = pDdiTable->pfnGetBuildPropertiesExt; - pDdiTable->pfnGetBuildPropertiesExt = validation_layer::zeRTASBuilderGetBuildPropertiesExt; - - dditable.pfnBuildExt = pDdiTable->pfnBuildExt; - pDdiTable->pfnBuildExt = validation_layer::zeRTASBuilderBuildExt; - - dditable.pfnCommandListAppendCopyExt = pDdiTable->pfnCommandListAppendCopyExt; - pDdiTable->pfnCommandListAppendCopyExt = validation_layer::zeRTASBuilderCommandListAppendCopyExt; - - dditable.pfnDestroyExt = pDdiTable->pfnDestroyExt; - pDdiTable->pfnDestroyExt = validation_layer::zeRTASBuilderDestroyExt; - - return result; -} - /////////////////////////////////////////////////////////////////////////////// /// @brief Exported function for filling application's RTASBuilderExp table /// with current process' addresses @@ -9535,46 +8980,6 @@ zeGetRTASBuilderExpProcAddrTable( return result; } -/////////////////////////////////////////////////////////////////////////////// -/// @brief Exported function for filling application's RTASParallelOperation 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 -zeGetRTASParallelOperationProcAddrTable( - ze_api_version_t version, ///< [in] API version requested - ze_rtas_parallel_operation_dditable_t* pDdiTable///< [in,out] pointer to table of DDI function pointers - ) -{ - auto& dditable = validation_layer::context.zeDdiTable.RTASParallelOperation; - - if( nullptr == pDdiTable ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) - return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; - - ze_result_t result = ZE_RESULT_SUCCESS; - - dditable.pfnCreateExt = pDdiTable->pfnCreateExt; - pDdiTable->pfnCreateExt = validation_layer::zeRTASParallelOperationCreateExt; - - dditable.pfnGetPropertiesExt = pDdiTable->pfnGetPropertiesExt; - pDdiTable->pfnGetPropertiesExt = validation_layer::zeRTASParallelOperationGetPropertiesExt; - - dditable.pfnJoinExt = pDdiTable->pfnJoinExt; - pDdiTable->pfnJoinExt = validation_layer::zeRTASParallelOperationJoinExt; - - dditable.pfnDestroyExt = pDdiTable->pfnDestroyExt; - pDdiTable->pfnDestroyExt = validation_layer::zeRTASParallelOperationDestroyExt; - - return result; -} - /////////////////////////////////////////////////////////////////////////////// /// @brief Exported function for filling application's RTASParallelOperationExp table /// with current process' addresses @@ -9658,9 +9063,6 @@ zeGetDriverProcAddrTable( dditable.pfnGetExtensionFunctionAddress = pDdiTable->pfnGetExtensionFunctionAddress; pDdiTable->pfnGetExtensionFunctionAddress = validation_layer::zeDriverGetExtensionFunctionAddress; - dditable.pfnRTASFormatCompatibilityCheckExt = pDdiTable->pfnRTASFormatCompatibilityCheckExt; - pDdiTable->pfnRTASFormatCompatibilityCheckExt = validation_layer::zeDriverRTASFormatCompatibilityCheckExt; - dditable.pfnGetLastErrorDescription = pDdiTable->pfnGetLastErrorDescription; pDdiTable->pfnGetLastErrorDescription = validation_layer::zeDriverGetLastErrorDescription; @@ -9774,9 +9176,6 @@ zeGetDeviceProcAddrTable( dditable.pfnReleaseExternalSemaphoreExt = pDdiTable->pfnReleaseExternalSemaphoreExt; pDdiTable->pfnReleaseExternalSemaphoreExt = validation_layer::zeDeviceReleaseExternalSemaphoreExt; - dditable.pfnGetVectorWidthPropertiesExt = pDdiTable->pfnGetVectorWidthPropertiesExt; - pDdiTable->pfnGetVectorWidthPropertiesExt = validation_layer::zeDeviceGetVectorWidthPropertiesExt; - dditable.pfnReserveCacheExt = pDdiTable->pfnReserveCacheExt; pDdiTable->pfnReserveCacheExt = validation_layer::zeDeviceReserveCacheExt; diff --git a/source/layers/validation/zet_valddi.cpp b/source/layers/validation/zet_valddi.cpp index 661037ae..0791d400 100644 --- a/source/layers/validation/zet_valddi.cpp +++ b/source/layers/validation/zet_valddi.cpp @@ -569,8 +569,8 @@ namespace validation_layer ///< than the `count` member of ::zet_debug_regset_properties_t for the ///< type uint32_t count, ///< [in] the number of registers to read; start+count must be less than or - ///< equal to the `count` member of ::zet_debug_regset_properties_t for the - ///< type + ///< equal to the `count` member of ::zet_debug_register_group_properties_t + ///< for the type void* pRegisterValues ///< [in,out][optional][range(0, count)] buffer of register values ) { @@ -619,8 +619,8 @@ namespace validation_layer ///< than the `count` member of ::zet_debug_regset_properties_t for the ///< type uint32_t count, ///< [in] the number of registers to write; start+count must be less than - ///< or equal to the `count` member of ::zet_debug_regset_properties_t for - ///< the type + ///< or equal to the `count` member of + ///< ::zet_debug_register_group_properties_t for the type void* pRegisterValues ///< [in,out][optional][range(0, count)] buffer of register values ) { @@ -2342,133 +2342,6 @@ namespace validation_layer return logAndPropagateResult("zetMetricTracerDecodeExp", driver_result); } - /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetCommandListAppendMarkerExp - __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 - ) - { - context.logger->log_trace("zetCommandListAppendMarkerExp(hCommandList, hMetricGroup, value)"); - - auto pfnAppendMarkerExp = context.zetDdiTable.CommandListExp.pfnAppendMarkerExp; - - if( nullptr == pfnAppendMarkerExp ) - return logAndPropagateResult("zetCommandListAppendMarkerExp", ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); - - 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); - } - - - if( context.enableThreadingValidation ){ - //Unimplemented - } - - - if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zetHandleLifetime.zetCommandListAppendMarkerExpPrologue( hCommandList, hMetricGroup, value ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult("zetCommandListAppendMarkerExp", result); - } - - auto driver_result = pfnAppendMarkerExp( hCommandList, hMetricGroup, value ); - - 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); - } - - return logAndPropagateResult("zetCommandListAppendMarkerExp", driver_result); - } - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetDeviceEnableMetricsExp - __zedlllocal ze_result_t ZE_APICALL - zetDeviceEnableMetricsExp( - zet_device_handle_t hDevice ///< [in] handle of the device where metrics collection has to be enabled. - ) - { - context.logger->log_trace("zetDeviceEnableMetricsExp(hDevice)"); - - auto pfnEnableMetricsExp = context.zetDdiTable.DeviceExp.pfnEnableMetricsExp; - - if( nullptr == pfnEnableMetricsExp ) - return logAndPropagateResult("zetDeviceEnableMetricsExp", ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); - - 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); - } - - - if( context.enableThreadingValidation ){ - //Unimplemented - } - - - if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zetHandleLifetime.zetDeviceEnableMetricsExpPrologue( hDevice ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult("zetDeviceEnableMetricsExp", result); - } - - auto driver_result = pfnEnableMetricsExp( hDevice ); - - 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); - } - - return logAndPropagateResult("zetDeviceEnableMetricsExp", driver_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 - ) - { - context.logger->log_trace("zetDeviceDisableMetricsExp(hDevice)"); - - auto pfnDisableMetricsExp = context.zetDdiTable.DeviceExp.pfnDisableMetricsExp; - - if( nullptr == pfnDisableMetricsExp ) - return logAndPropagateResult("zetDeviceDisableMetricsExp", ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); - - 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); - } - - - if( context.enableThreadingValidation ){ - //Unimplemented - } - - - if(context.enableHandleLifetime ){ - auto result = context.handleLifetime->zetHandleLifetime.zetDeviceDisableMetricsExpPrologue( hDevice ); - if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult("zetDeviceDisableMetricsExp", result); - } - - auto driver_result = pfnDisableMetricsExp( hDevice ); - - 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); - } - - return logAndPropagateResult("zetDeviceDisableMetricsExp", driver_result); - } - /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zetMetricGroupCalculateMultipleMetricValuesExp __zedlllocal ze_result_t ZE_APICALL @@ -3576,12 +3449,6 @@ zetGetDeviceExpProcAddrTable( dditable.pfnCreateMetricGroupsFromMetricsExp = pDdiTable->pfnCreateMetricGroupsFromMetricsExp; pDdiTable->pfnCreateMetricGroupsFromMetricsExp = validation_layer::zetDeviceCreateMetricGroupsFromMetricsExp; - dditable.pfnEnableMetricsExp = pDdiTable->pfnEnableMetricsExp; - pDdiTable->pfnEnableMetricsExp = validation_layer::zetDeviceEnableMetricsExp; - - dditable.pfnDisableMetricsExp = pDdiTable->pfnDisableMetricsExp; - pDdiTable->pfnDisableMetricsExp = validation_layer::zetDeviceDisableMetricsExp; - return result; } @@ -3656,37 +3523,6 @@ zetGetCommandListProcAddrTable( return result; } -/////////////////////////////////////////////////////////////////////////////// -/// @brief Exported function for filling application's CommandListExp 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 -zetGetCommandListExpProcAddrTable( - ze_api_version_t version, ///< [in] API version requested - zet_command_list_exp_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers - ) -{ - auto& dditable = validation_layer::context.zetDdiTable.CommandListExp; - - if( nullptr == pDdiTable ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) - return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; - - ze_result_t result = ZE_RESULT_SUCCESS; - - dditable.pfnAppendMarkerExp = pDdiTable->pfnAppendMarkerExp; - pDdiTable->pfnAppendMarkerExp = validation_layer::zetCommandListAppendMarkerExp; - - return result; -} - /////////////////////////////////////////////////////////////////////////////// /// @brief Exported function for filling application's Kernel table /// with current process' addresses diff --git a/source/lib/ze_libapi.cpp b/source/lib/ze_libapi.cpp index d6a2f55f..c2aaf622 100644 --- a/source/lib/ze_libapi.cpp +++ b/source/lib/ze_libapi.cpp @@ -6234,11 +6234,8 @@ zeMemAllocHost( /// @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 implementation of this function may immediately free all Host and +/// Device allocations associated with this memory /// - The application must **not** call this function from simultaneous /// threads with the same pointer. /// - The implementation of this function must be thread-safe. @@ -6797,7 +6794,7 @@ zeMemCloseIpcHandle( /// 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. +/// ::ZE_RESULT_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 @@ -8092,14 +8089,10 @@ zeKernelGetSourceAttributes( 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. + ///< 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. ) { #ifdef DYNAMIC_LOAD_LOADER @@ -9994,12 +9987,15 @@ zeCommandListAppendWaitExternalSemaphoreExt( } /////////////////////////////////////////////////////////////////////////////// -/// @brief Creates a ray tracing acceleration structure builder object +/// @brief Reserve Cache on 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_extension_rtas extension. +/// - 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 @@ -10008,17 +10004,15 @@ zeCommandListAppendWaitExternalSemaphoreExt( /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY /// - ::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` +/// + `nullptr == hDevice` 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 +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 DYNAMIC_LOAD_LOADER @@ -10026,40 +10020,40 @@ 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_pfnDeviceReserveCacheExt_t pfnReserveCacheExt = [&result] { + auto pfnReserveCacheExt = ze_lib::context->zeDdiTable.load()->Device.pfnReserveCacheExt; + if( nullptr == pfnReserveCacheExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCreateExt; + return pfnReserveCacheExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnCreateExt( hDriver, pDescriptor, phBuilder ); + return pfnReserveCacheExt( hDevice, cacheLevel, cacheReservationSize ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnCreateExt = ze_lib::context->zeDdiTable.load()->RTASBuilder.pfnCreateExt; - if( nullptr == pfnCreateExt ) { + 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 pfnCreateExt( hDriver, pDescriptor, phBuilder ); + return pfnReserveCacheExt( hDevice, cacheLevel, cacheReservationSize ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Retrieves ray tracing acceleration structure builder properties +/// @brief Assign VA section to use reserved section /// /// @details -/// - The application may call this function from simultaneous threads. -/// - 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 @@ -10068,19 +10062,17 @@ zeRTASBuilderCreateExt( /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hBuilder` +/// + `nullptr == hDevice` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pBuildOpDescriptor` -/// + `nullptr == pProperties` +/// + `nullptr == ptr` /// - ::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_CACHE_EXT_REGION_NON_RESERVED < cacheRegion` 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 +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 DYNAMIC_LOAD_LOADER @@ -10088,40 +10080,52 @@ 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_pfnDeviceSetCacheAdviceExt_t pfnSetCacheAdviceExt = [&result] { + auto pfnSetCacheAdviceExt = ze_lib::context->zeDdiTable.load()->Device.pfnSetCacheAdviceExt; + if( nullptr == pfnSetCacheAdviceExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetBuildPropertiesExt; + return pfnSetCacheAdviceExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnGetBuildPropertiesExt( hBuilder, pBuildOpDescriptor, pProperties ); + return pfnSetCacheAdviceExt( hDevice, ptr, regionSize, cacheRegion ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetBuildPropertiesExt = ze_lib::context->zeDdiTable.load()->RTASBuilder.pfnGetBuildPropertiesExt; - if( nullptr == pfnGetBuildPropertiesExt ) { + 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 pfnGetBuildPropertiesExt( hBuilder, pBuildOpDescriptor, pProperties ); + return pfnSetCacheAdviceExt( hDevice, ptr, regionSize, cacheRegion ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Checks ray tracing acceleration structure format compatibility +/// @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_experimental_event_query_timestamps. +/// - 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 @@ -10130,19 +10134,22 @@ zeRTASBuilderGetBuildPropertiesExt( /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY /// - ::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_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 == hEvent` +/// + `nullptr == hDevice` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pCount` 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 +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 DYNAMIC_LOAD_LOADER @@ -10150,83 +10157,46 @@ 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_pfnEventQueryTimestampsExp_t pfnQueryTimestampsExp = [&result] { + auto pfnQueryTimestampsExp = ze_lib::context->zeDdiTable.load()->EventExp.pfnQueryTimestampsExp; + if( nullptr == pfnQueryTimestampsExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnRTASFormatCompatibilityCheckExt; + return pfnQueryTimestampsExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnRTASFormatCompatibilityCheckExt( hDriver, rtasFormatA, rtasFormatB ); + return pfnQueryTimestampsExp( hEvent, hDevice, pCount, pTimestamps ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnRTASFormatCompatibilityCheckExt = ze_lib::context->zeDdiTable.load()->Driver.pfnRTASFormatCompatibilityCheckExt; - if( nullptr == pfnRTASFormatCompatibilityCheckExt ) { + 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 pfnRTASFormatCompatibilityCheckExt( hDriver, rtasFormatA, rtasFormatB ); + return pfnQueryTimestampsExp( hEvent, hDevice, pCount, pTimestamps ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Build ray tracing acceleration structure +/// @brief Query image memory 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. -/// - 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. +/// - The implementation of this function must be thread-safe. +/// - The implementation must support +/// ::ZE_experimental_image_memory_properties extension. +/// +/// @remarks +/// _Analogues_ +/// - None /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -10235,36 +10205,13 @@ zeDriverRTASFormatCompatibilityCheckExt( /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hBuilder` +/// + `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_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 == pMemoryProperties` 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 +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 DYNAMIC_LOAD_LOADER @@ -10272,55 +10219,53 @@ 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_pfnImageGetMemoryPropertiesExp_t pfnGetMemoryPropertiesExp = [&result] { + auto pfnGetMemoryPropertiesExp = ze_lib::context->zeDdiTable.load()->ImageExp.pfnGetMemoryPropertiesExp; + if( nullptr == pfnGetMemoryPropertiesExp ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnBuildExt; + return pfnGetMemoryPropertiesExp; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnBuildExt( hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes ); + return pfnGetMemoryPropertiesExp( hImage, pMemoryProperties ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnBuildExt = ze_lib::context->zeDdiTable.load()->RTASBuilder.pfnBuildExt; - if( nullptr == pfnBuildExt ) { + 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 pfnBuildExt( hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes ); + return pfnGetMemoryPropertiesExp( hImage, pMemoryProperties ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Copies a ray tracing acceleration structure (RTAS) from host to device -/// memory. +/// @brief Create image view on the context. /// /// @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. +/// - 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_extension_image_view 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 @@ -10329,26 +10274,23 @@ zeRTASBuilderBuildExt( /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hCommandList` +/// + `nullptr == hContext` +/// + `nullptr == hDevice` +/// + `nullptr == hImage` /// - ::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 == desc` +/// + `nullptr == phImageView` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `0x3 < desc->flags` +/// + `::ZE_IMAGE_TYPE_BUFFER < desc->type` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_IMAGE_FORMAT 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 +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 DYNAMIC_LOAD_LOADER @@ -10356,741 +10298,41 @@ 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_pfnImageViewCreateExt_t pfnViewCreateExt = [&result] { + auto pfnViewCreateExt = ze_lib::context->zeDdiTable.load()->Image.pfnViewCreateExt; + if( nullptr == pfnViewCreateExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnCommandListAppendCopyExt; + return pfnViewCreateExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnCommandListAppendCopyExt( hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents ); + return pfnViewCreateExt( hContext, hDevice, desc, hImage, phImageView ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnCommandListAppendCopyExt = ze_lib::context->zeDdiTable.load()->RTASBuilder.pfnCommandListAppendCopyExt; - if( nullptr == pfnCommandListAppendCopyExt ) { + 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 pfnCommandListAppendCopyExt( hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents ); + return pfnViewCreateExt( hContext, hDevice, desc, hImage, phImageView ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Destroys a ray tracing acceleration structure builder object +/// @brief Create image view on the context. /// /// @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_NULL_HANDLE -/// + `nullptr == hBuilder` -/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE -ze_result_t ZE_APICALL -zeRTASBuilderDestroyExt( - ze_rtas_builder_ext_handle_t hBuilder ///< [in][release] handle of builder object to destroy - ) -{ - #ifdef DYNAMIC_LOAD_LOADER - ze_result_t result = ZE_RESULT_SUCCESS; - 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 ) { - result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - } - return pfnDestroyExt; - }(); - if (result != ZE_RESULT_SUCCESS) { - return result; - } - return pfnDestroyExt( hBuilder ); - #else - if(ze_lib::destruction) { - return ZE_RESULT_ERROR_UNINITIALIZED; - } - - 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 pfnDestroyExt( hBuilder ); - #endif -} - -/////////////////////////////////////////////////////////////////////////////// -/// @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_extension_rtas 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_NULL_HANDLE -/// + `nullptr == hDriver` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == phParallelOperation` -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 - ) -{ - #ifdef DYNAMIC_LOAD_LOADER - ze_result_t result = ZE_RESULT_SUCCESS; - 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 ) { - result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - } - return pfnCreateExt; - }(); - if (result != ZE_RESULT_SUCCESS) { - return result; - } - return pfnCreateExt( hDriver, phParallelOperation ); - #else - if(ze_lib::destruction) { - return ZE_RESULT_ERROR_UNINITIALIZED; - } - - 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 pfnCreateExt( hDriver, phParallelOperation ); - #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. -/// -/// @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_NULL_HANDLE -/// + `nullptr == hParallelOperation` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pProperties` -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 - ) -{ - #ifdef DYNAMIC_LOAD_LOADER - ze_result_t result = ZE_RESULT_SUCCESS; - 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 ) { - result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - } - return pfnGetPropertiesExt; - }(); - if (result != ZE_RESULT_SUCCESS) { - return result; - } - return pfnGetPropertiesExt( hParallelOperation, pProperties ); - #else - if(ze_lib::destruction) { - return ZE_RESULT_ERROR_UNINITIALIZED; - } - - 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 pfnGetPropertiesExt( hParallelOperation, pProperties ); - #endif -} - -/////////////////////////////////////////////////////////////////////////////// -/// @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_NULL_HANDLE -/// + `nullptr == hParallelOperation` -ze_result_t ZE_APICALL -zeRTASParallelOperationJoinExt( - ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in] handle of parallel operation object - ) -{ - #ifdef DYNAMIC_LOAD_LOADER - ze_result_t result = ZE_RESULT_SUCCESS; - 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 ) { - result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - } - return pfnJoinExt; - }(); - if (result != ZE_RESULT_SUCCESS) { - return result; - } - return pfnJoinExt( hParallelOperation ); - #else - if(ze_lib::destruction) { - return ZE_RESULT_ERROR_UNINITIALIZED; - } - - 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 pfnJoinExt( hParallelOperation ); - #endif -} - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Destroys a ray tracing acceleration structure builder parallel -/// operation object -/// -/// @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. -/// -/// @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_NULL_HANDLE -/// + `nullptr == hParallelOperation` -ze_result_t ZE_APICALL -zeRTASParallelOperationDestroyExt( - ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in][release] handle of parallel operation object to destroy - ) -{ - #ifdef DYNAMIC_LOAD_LOADER - ze_result_t result = ZE_RESULT_SUCCESS; - 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 ) { - result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - } - return pfnDestroyExt; - }(); - if (result != ZE_RESULT_SUCCESS) { - return result; - } - return pfnDestroyExt( hParallelOperation ); - #else - if(ze_lib::destruction) { - return ZE_RESULT_ERROR_UNINITIALIZED; - } - - 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 pfnDestroyExt( hParallelOperation ); - #endif -} - -/////////////////////////////////////////////////////////////////////////////// -/// @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_NULL_HANDLE -/// + `nullptr == hDevice` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pCount` -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. - ) -{ - #ifdef DYNAMIC_LOAD_LOADER - ze_result_t result = ZE_RESULT_SUCCESS; - 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 ) { - result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - } - return pfnGetVectorWidthPropertiesExt; - }(); - if (result != ZE_RESULT_SUCCESS) { - return result; - } - return pfnGetVectorWidthPropertiesExt( hDevice, pCount, pVectorWidthProperties ); - #else - if(ze_lib::destruction) { - return ZE_RESULT_ERROR_UNINITIALIZED; - } - - 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 pfnGetVectorWidthPropertiesExt( hDevice, pCount, pVectorWidthProperties ); - #endif -} - -/////////////////////////////////////////////////////////////////////////////// -/// @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_NULL_HANDLE -/// + `nullptr == hDevice` -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 - ) -{ - #ifdef DYNAMIC_LOAD_LOADER - ze_result_t result = ZE_RESULT_SUCCESS; - 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 ) { - result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - } - return pfnReserveCacheExt; - }(); - if (result != ZE_RESULT_SUCCESS) { - return result; - } - return pfnReserveCacheExt( hDevice, cacheLevel, cacheReservationSize ); - #else - if(ze_lib::destruction) { - return ZE_RESULT_ERROR_UNINITIALIZED; - } - - 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 pfnReserveCacheExt( hDevice, cacheLevel, cacheReservationSize ); - #endif -} - -/////////////////////////////////////////////////////////////////////////////// -/// @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_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_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 - ) -{ - #ifdef DYNAMIC_LOAD_LOADER - ze_result_t result = ZE_RESULT_SUCCESS; - 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 ) { - result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - } - return pfnSetCacheAdviceExt; - }(); - if (result != ZE_RESULT_SUCCESS) { - return result; - } - return pfnSetCacheAdviceExt( hDevice, ptr, regionSize, cacheRegion ); - #else - if(ze_lib::destruction) { - return ZE_RESULT_ERROR_UNINITIALIZED; - } - - 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 pfnSetCacheAdviceExt( hDevice, ptr, regionSize, cacheRegion ); - #endif -} - -/////////////////////////////////////////////////////////////////////////////// -/// @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_experimental_event_query_timestamps. -/// - 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_NULL_HANDLE -/// + `nullptr == hEvent` -/// + `nullptr == hDevice` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pCount` -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. - ) -{ - #ifdef DYNAMIC_LOAD_LOADER - ze_result_t result = ZE_RESULT_SUCCESS; - 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 ) { - result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - } - return pfnQueryTimestampsExp; - }(); - if (result != ZE_RESULT_SUCCESS) { - return result; - } - return pfnQueryTimestampsExp( hEvent, hDevice, pCount, pTimestamps ); - #else - if(ze_lib::destruction) { - return ZE_RESULT_ERROR_UNINITIALIZED; - } - - 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 pfnQueryTimestampsExp( hEvent, hDevice, pCount, pTimestamps ); - #endif -} - -/////////////////////////////////////////////////////////////////////////////// -/// @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_experimental_image_memory_properties 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_NULL_HANDLE -/// + `nullptr == hImage` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pMemoryProperties` -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. - ) -{ - #ifdef DYNAMIC_LOAD_LOADER - ze_result_t result = ZE_RESULT_SUCCESS; - 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 ) { - result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - } - return pfnGetMemoryPropertiesExp; - }(); - if (result != ZE_RESULT_SUCCESS) { - return result; - } - return pfnGetMemoryPropertiesExp( hImage, pMemoryProperties ); - #else - if(ze_lib::destruction) { - return ZE_RESULT_ERROR_UNINITIALIZED; - } - - 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 pfnGetMemoryPropertiesExp( hImage, pMemoryProperties ); - #endif -} - -/////////////////////////////////////////////////////////////////////////////// -/// @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_extension_image_view 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_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_IMAGE_FORMAT -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 - ) -{ - #ifdef DYNAMIC_LOAD_LOADER - ze_result_t result = ZE_RESULT_SUCCESS; - 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 ) { - result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - } - return pfnViewCreateExt; - }(); - if (result != ZE_RESULT_SUCCESS) { - return result; - } - return pfnViewCreateExt( hContext, hDevice, desc, hImage, phImageView ); - #else - if(ze_lib::destruction) { - return ZE_RESULT_ERROR_UNINITIALIZED; - } - - 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 pfnViewCreateExt( hContext, hDevice, desc, hImage, phImageView ); - #endif -} - -/////////////////////////////////////////////////////////////////////////////// -/// @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 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_experimental_image_view /// extension. @@ -11609,13 +10851,11 @@ zeModuleInspectLinkageExt( } /////////////////////////////////////////////////////////////////////////////// -/// @brief Frees allocated host memory, device memory, or shared memory on the -/// context using the specified free policy. +/// @brief Frees allocated host memory, device memory, or shared memory using the +/// specified free policy. /// /// @details -/// - Similar to zeMemFree, with added parameter to choose the free policy. -/// - Does not gaurantee memory is freed upon return. See free policy -/// descriptions for details. +/// - The memory free policy is specified by the memory free descriptor. /// - The application must **not** call this function from simultaneous /// threads with the same pointer. /// - The implementation of this function must be thread-safe. @@ -12336,7 +11576,7 @@ zeRTASBuilderCreateExp( /// + `nullptr == pBuildOpDescriptor` /// + `nullptr == pProperties` /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `::ZE_RTAS_FORMAT_EXP_MAX < pBuildOpDescriptor->rtasFormat` +/// + `::ZE_RTAS_FORMAT_EXP_INVALID < pBuildOpDescriptor->rtasFormat` /// + `::ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_HIGH < pBuildOpDescriptor->buildQuality` /// + `0x3 < pBuildOpDescriptor->buildFlags` ze_result_t ZE_APICALL @@ -12395,8 +11635,8 @@ zeRTASBuilderGetBuildPropertiesExp( /// - ::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_RTAS_FORMAT_EXP_INVALID < rtasFormatA` +/// + `::ZE_RTAS_FORMAT_EXP_INVALID < rtasFormatB` /// - ::ZE_RESULT_SUCCESS /// + An acceleration structure built with `rtasFormatA` is compatible with devices that report `rtasFormatB`. /// - ::ZE_RESULT_EXP_ERROR_OPERANDS_INCOMPATIBLE @@ -12504,7 +11744,7 @@ zeDriverRTASFormatCompatibilityCheckExp( /// + `nullptr == pScratchBuffer` /// + `nullptr == pRtasBuffer` /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `::ZE_RTAS_FORMAT_EXP_MAX < pBuildOpDescriptor->rtasFormat` +/// + `::ZE_RTAS_FORMAT_EXP_INVALID < pBuildOpDescriptor->rtasFormat` /// + `::ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_HIGH < pBuildOpDescriptor->buildQuality` /// + `0x3 < pBuildOpDescriptor->buildFlags` /// - ::ZE_RESULT_EXP_RTAS_BUILD_DEFERRED diff --git a/source/lib/ze_libddi.cpp b/source/lib/ze_libddi.cpp index 2549ad93..ee61632e 100644 --- a/source/lib/ze_libddi.cpp +++ b/source/lib/ze_libddi.cpp @@ -32,24 +32,6 @@ namespace ze_lib GET_FUNCTION_PTR(loader, "zeInitDrivers") ); } - if( ZE_RESULT_SUCCESS == result ) - { - // Optional - auto getTable = reinterpret_cast( - GET_FUNCTION_PTR(loader, "zeGetRTASBuilderProcAddrTable") ); - getTableWithCheck(getTable, version, &initialzeDdiTable.RTASBuilder ); - initialzeDdiTable.RTASBuilder.pfnCreateExt = reinterpret_cast( - GET_FUNCTION_PTR(loader, "zeRTASBuilderCreateExt") ); - initialzeDdiTable.RTASBuilder.pfnGetBuildPropertiesExt = reinterpret_cast( - GET_FUNCTION_PTR(loader, "zeRTASBuilderGetBuildPropertiesExt") ); - initialzeDdiTable.RTASBuilder.pfnBuildExt = reinterpret_cast( - GET_FUNCTION_PTR(loader, "zeRTASBuilderBuildExt") ); - initialzeDdiTable.RTASBuilder.pfnCommandListAppendCopyExt = reinterpret_cast( - GET_FUNCTION_PTR(loader, "zeRTASBuilderCommandListAppendCopyExt") ); - initialzeDdiTable.RTASBuilder.pfnDestroyExt = reinterpret_cast( - GET_FUNCTION_PTR(loader, "zeRTASBuilderDestroyExt") ); - } - if( ZE_RESULT_SUCCESS == result ) { // Optional @@ -66,22 +48,6 @@ namespace ze_lib GET_FUNCTION_PTR(loader, "zeRTASBuilderDestroyExp") ); } - if( ZE_RESULT_SUCCESS == result ) - { - // Optional - auto getTable = reinterpret_cast( - GET_FUNCTION_PTR(loader, "zeGetRTASParallelOperationProcAddrTable") ); - getTableWithCheck(getTable, version, &initialzeDdiTable.RTASParallelOperation ); - initialzeDdiTable.RTASParallelOperation.pfnCreateExt = reinterpret_cast( - GET_FUNCTION_PTR(loader, "zeRTASParallelOperationCreateExt") ); - initialzeDdiTable.RTASParallelOperation.pfnGetPropertiesExt = reinterpret_cast( - GET_FUNCTION_PTR(loader, "zeRTASParallelOperationGetPropertiesExt") ); - initialzeDdiTable.RTASParallelOperation.pfnJoinExt = reinterpret_cast( - GET_FUNCTION_PTR(loader, "zeRTASParallelOperationJoinExt") ); - initialzeDdiTable.RTASParallelOperation.pfnDestroyExt = reinterpret_cast( - GET_FUNCTION_PTR(loader, "zeRTASParallelOperationDestroyExt") ); - } - if( ZE_RESULT_SUCCESS == result ) { // Optional @@ -115,8 +81,6 @@ namespace ze_lib GET_FUNCTION_PTR(loader, "zeDriverGetExtensionProperties") ); initialzeDdiTable.Driver.pfnGetExtensionFunctionAddress = reinterpret_cast( GET_FUNCTION_PTR(loader, "zeDriverGetExtensionFunctionAddress") ); - initialzeDdiTable.Driver.pfnRTASFormatCompatibilityCheckExt = reinterpret_cast( - GET_FUNCTION_PTR(loader, "zeDriverRTASFormatCompatibilityCheckExt") ); initialzeDdiTable.Driver.pfnGetLastErrorDescription = reinterpret_cast( GET_FUNCTION_PTR(loader, "zeDriverGetLastErrorDescription") ); } @@ -170,8 +134,6 @@ namespace ze_lib GET_FUNCTION_PTR(loader, "zeDeviceImportExternalSemaphoreExt") ); initialzeDdiTable.Device.pfnReleaseExternalSemaphoreExt = reinterpret_cast( GET_FUNCTION_PTR(loader, "zeDeviceReleaseExternalSemaphoreExt") ); - initialzeDdiTable.Device.pfnGetVectorWidthPropertiesExt = reinterpret_cast( - GET_FUNCTION_PTR(loader, "zeDeviceGetVectorWidthPropertiesExt") ); initialzeDdiTable.Device.pfnReserveCacheExt = reinterpret_cast( GET_FUNCTION_PTR(loader, "zeDeviceReserveCacheExt") ); initialzeDdiTable.Device.pfnSetCacheAdviceExt = reinterpret_cast( @@ -662,24 +624,12 @@ namespace ze_lib result = zeGetGlobalProcAddrTable( version, &initialzeDdiTable.Global ); } - if( ZE_RESULT_SUCCESS == result ) - { - // Optional - zeGetRTASBuilderProcAddrTable( version, &initialzeDdiTable.RTASBuilder ); - } - if( ZE_RESULT_SUCCESS == result ) { // Optional zeGetRTASBuilderExpProcAddrTable( version, &initialzeDdiTable.RTASBuilderExp ); } - if( ZE_RESULT_SUCCESS == result ) - { - // Optional - zeGetRTASParallelOperationProcAddrTable( version, &initialzeDdiTable.RTASParallelOperation ); - } - 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 a42b7412..df0192d8 100644 --- a/source/lib/ze_tracing_register_cb_libapi.cpp +++ b/source/lib/ze_tracing_register_cb_libapi.cpp @@ -3793,281 +3793,6 @@ zelTracerCommandListAppendWaitExternalSemaphoreExtRegisterCallback( } -ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerRTASBuilderCreateExtRegisterCallback( - zel_tracer_handle_t hTracer, - zel_tracer_reg_t callback_type, - ze_pfnRTASBuilderCreateExtCb_t pfnCreateExtCb - ) { - - 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_pfnRTASBuilderCreateExtCb_t pfnCreateExtCb - ); - - auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerRTASBuilderCreateExtRegisterCallback") ); - - if(func) - return func(hTracer, callback_type, pfnCreateExtCb); - - return ZE_RESULT_ERROR_UNINITIALIZED; -} - - -ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerRTASBuilderGetBuildPropertiesExtRegisterCallback( - zel_tracer_handle_t hTracer, - zel_tracer_reg_t callback_type, - ze_pfnRTASBuilderGetBuildPropertiesExtCb_t pfnGetBuildPropertiesExtCb - ) { - - 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_pfnRTASBuilderGetBuildPropertiesExtCb_t pfnGetBuildPropertiesExtCb - ); - - auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerRTASBuilderGetBuildPropertiesExtRegisterCallback") ); - - if(func) - return func(hTracer, callback_type, pfnGetBuildPropertiesExtCb); - - return ZE_RESULT_ERROR_UNINITIALIZED; -} - - -ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerDriverRTASFormatCompatibilityCheckExtRegisterCallback( - zel_tracer_handle_t hTracer, - zel_tracer_reg_t callback_type, - ze_pfnDriverRTASFormatCompatibilityCheckExtCb_t pfnRTASFormatCompatibilityCheckExtCb - ) { - - 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_pfnDriverRTASFormatCompatibilityCheckExtCb_t pfnRTASFormatCompatibilityCheckExtCb - ); - - auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerDriverRTASFormatCompatibilityCheckExtRegisterCallback") ); - - if(func) - return func(hTracer, callback_type, pfnRTASFormatCompatibilityCheckExtCb); - - return ZE_RESULT_ERROR_UNINITIALIZED; -} - - -ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerRTASBuilderBuildExtRegisterCallback( - zel_tracer_handle_t hTracer, - zel_tracer_reg_t callback_type, - ze_pfnRTASBuilderBuildExtCb_t pfnBuildExtCb - ) { - - 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_pfnRTASBuilderBuildExtCb_t pfnBuildExtCb - ); - - auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerRTASBuilderBuildExtRegisterCallback") ); - - if(func) - return func(hTracer, callback_type, pfnBuildExtCb); - - return ZE_RESULT_ERROR_UNINITIALIZED; -} - - -ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerRTASBuilderCommandListAppendCopyExtRegisterCallback( - zel_tracer_handle_t hTracer, - zel_tracer_reg_t callback_type, - ze_pfnRTASBuilderCommandListAppendCopyExtCb_t pfnCommandListAppendCopyExtCb - ) { - - 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_pfnRTASBuilderCommandListAppendCopyExtCb_t pfnCommandListAppendCopyExtCb - ); - - auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerRTASBuilderCommandListAppendCopyExtRegisterCallback") ); - - if(func) - return func(hTracer, callback_type, pfnCommandListAppendCopyExtCb); - - return ZE_RESULT_ERROR_UNINITIALIZED; -} - - -ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerRTASBuilderDestroyExtRegisterCallback( - zel_tracer_handle_t hTracer, - zel_tracer_reg_t callback_type, - ze_pfnRTASBuilderDestroyExtCb_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_pfnRTASBuilderDestroyExtCb_t pfnDestroyExtCb - ); - - auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerRTASBuilderDestroyExtRegisterCallback") ); - - if(func) - return func(hTracer, callback_type, pfnDestroyExtCb); - - return ZE_RESULT_ERROR_UNINITIALIZED; -} - - -ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerRTASParallelOperationCreateExtRegisterCallback( - zel_tracer_handle_t hTracer, - zel_tracer_reg_t callback_type, - ze_pfnRTASParallelOperationCreateExtCb_t pfnCreateExtCb - ) { - - 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_pfnRTASParallelOperationCreateExtCb_t pfnCreateExtCb - ); - - auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerRTASParallelOperationCreateExtRegisterCallback") ); - - if(func) - return func(hTracer, callback_type, pfnCreateExtCb); - - return ZE_RESULT_ERROR_UNINITIALIZED; -} - - -ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerRTASParallelOperationGetPropertiesExtRegisterCallback( - zel_tracer_handle_t hTracer, - zel_tracer_reg_t callback_type, - ze_pfnRTASParallelOperationGetPropertiesExtCb_t pfnGetPropertiesExtCb - ) { - - 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_pfnRTASParallelOperationGetPropertiesExtCb_t pfnGetPropertiesExtCb - ); - - auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerRTASParallelOperationGetPropertiesExtRegisterCallback") ); - - if(func) - return func(hTracer, callback_type, pfnGetPropertiesExtCb); - - return ZE_RESULT_ERROR_UNINITIALIZED; -} - - -ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerRTASParallelOperationJoinExtRegisterCallback( - zel_tracer_handle_t hTracer, - zel_tracer_reg_t callback_type, - ze_pfnRTASParallelOperationJoinExtCb_t pfnJoinExtCb - ) { - - 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_pfnRTASParallelOperationJoinExtCb_t pfnJoinExtCb - ); - - auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerRTASParallelOperationJoinExtRegisterCallback") ); - - if(func) - return func(hTracer, callback_type, pfnJoinExtCb); - - return ZE_RESULT_ERROR_UNINITIALIZED; -} - - -ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerRTASParallelOperationDestroyExtRegisterCallback( - zel_tracer_handle_t hTracer, - zel_tracer_reg_t callback_type, - ze_pfnRTASParallelOperationDestroyExtCb_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_pfnRTASParallelOperationDestroyExtCb_t pfnDestroyExtCb - ); - - auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerRTASParallelOperationDestroyExtRegisterCallback") ); - - if(func) - return func(hTracer, callback_type, pfnDestroyExtCb); - - return ZE_RESULT_ERROR_UNINITIALIZED; -} - - -ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerDeviceGetVectorWidthPropertiesExtRegisterCallback( - zel_tracer_handle_t hTracer, - zel_tracer_reg_t callback_type, - ze_pfnDeviceGetVectorWidthPropertiesExtCb_t pfnGetVectorWidthPropertiesExtCb - ) { - - 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_pfnDeviceGetVectorWidthPropertiesExtCb_t pfnGetVectorWidthPropertiesExtCb - ); - - auto func = reinterpret_cast( - GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerDeviceGetVectorWidthPropertiesExtRegisterCallback") ); - - if(func) - return func(hTracer, callback_type, pfnGetVectorWidthPropertiesExtCb); - - return ZE_RESULT_ERROR_UNINITIALIZED; -} - - ZE_APIEXPORT ze_result_t ZE_APICALL zelTracerDeviceReserveCacheExtRegisterCallback( zel_tracer_handle_t hTracer, diff --git a/source/lib/zet_libapi.cpp b/source/lib/zet_libapi.cpp index fb8377b2..719f8c25 100644 --- a/source/lib/zet_libapi.cpp +++ b/source/lib/zet_libapi.cpp @@ -738,8 +738,8 @@ zetDebugReadRegisters( ///< than the `count` member of ::zet_debug_regset_properties_t for the ///< type uint32_t count, ///< [in] the number of registers to read; start+count must be less than or - ///< equal to the `count` member of ::zet_debug_regset_properties_t for the - ///< type + ///< equal to the `count` member of ::zet_debug_register_group_properties_t + ///< for the type void* pRegisterValues ///< [in,out][optional][range(0, count)] buffer of register values ) { @@ -798,8 +798,8 @@ zetDebugWriteRegisters( ///< than the `count` member of ::zet_debug_regset_properties_t for the ///< type uint32_t count, ///< [in] the number of registers to write; start+count must be less than - ///< or equal to the `count` member of ::zet_debug_regset_properties_t for - ///< the type + ///< or equal to the `count` member of + ///< ::zet_debug_register_group_properties_t for the type void* pRegisterValues ///< [in,out][optional][range(0, count)] buffer of register values ) { @@ -3016,186 +3016,6 @@ zetMetricTracerDecodeExp( #endif } -/////////////////////////////////////////////////////////////////////////////// -/// @brief Append a Marker based on the Metric source of the Metric Group, to a -/// Command List. -/// -/// @details -/// - This function appends a Marker based on the Metric source of the -/// Metric Group, to Command List. -/// -/// @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_NULL_HANDLE -/// + `nullptr == hCommandList` -/// + `nullptr == hMetricGroup` -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 - ) -{ - #ifdef DYNAMIC_LOAD_LOADER - ze_result_t result = ZE_RESULT_SUCCESS; - 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 ) { - result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - } - return pfnAppendMarkerExp; - }(); - if (result != ZE_RESULT_SUCCESS) { - return result; - } - return pfnAppendMarkerExp( hCommandList, hMetricGroup, value ); - #else - if(ze_lib::destruction) { - return ZE_RESULT_ERROR_UNINITIALIZED; - } - - 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 pfnAppendMarkerExp( hCommandList, hMetricGroup, value ); - #endif -} - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Enable Metrics collection during runtime. -/// -/// @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. -/// -/// @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_NULL_HANDLE -/// + `nullptr == hDevice` -ze_result_t ZE_APICALL -zetDeviceEnableMetricsExp( - zet_device_handle_t hDevice ///< [in] handle of the device where metrics collection has to be enabled. - ) -{ - #ifdef DYNAMIC_LOAD_LOADER - ze_result_t result = ZE_RESULT_SUCCESS; - 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 ) { - result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - } - return pfnEnableMetricsExp; - }(); - if (result != ZE_RESULT_SUCCESS) { - return result; - } - return pfnEnableMetricsExp( hDevice ); - #else - if(ze_lib::destruction) { - return ZE_RESULT_ERROR_UNINITIALIZED; - } - - 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 pfnEnableMetricsExp( hDevice ); - #endif -} - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Disable Metrics collection during runtime, if it was already enabled. -/// -/// @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. -/// -/// @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_NULL_HANDLE -/// + `nullptr == hDevice` -ze_result_t ZE_APICALL -zetDeviceDisableMetricsExp( - zet_device_handle_t hDevice ///< [in] handle of the device where metrics collection has to be disabled - ) -{ - #ifdef DYNAMIC_LOAD_LOADER - ze_result_t result = ZE_RESULT_SUCCESS; - 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 ) { - result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; - } - return pfnDisableMetricsExp; - }(); - if (result != ZE_RESULT_SUCCESS) { - return result; - } - return pfnDisableMetricsExp( hDevice ); - #else - if(ze_lib::destruction) { - return ZE_RESULT_ERROR_UNINITIALIZED; - } - - 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 pfnDisableMetricsExp( hDevice ); - #endif -} - /////////////////////////////////////////////////////////////////////////////// /// @brief Calculate one or more sets of metric values from raw data. /// diff --git a/source/lib/zet_libddi.cpp b/source/lib/zet_libddi.cpp index af6143c5..91ec9e6c 100644 --- a/source/lib/zet_libddi.cpp +++ b/source/lib/zet_libddi.cpp @@ -90,10 +90,6 @@ namespace ze_lib GET_FUNCTION_PTR(loader, "zetDeviceGetConcurrentMetricGroupsExp") ); initialzetDdiTable.DeviceExp.pfnCreateMetricGroupsFromMetricsExp = reinterpret_cast( GET_FUNCTION_PTR(loader, "zetDeviceCreateMetricGroupsFromMetricsExp") ); - initialzetDdiTable.DeviceExp.pfnEnableMetricsExp = reinterpret_cast( - GET_FUNCTION_PTR(loader, "zetDeviceEnableMetricsExp") ); - initialzetDdiTable.DeviceExp.pfnDisableMetricsExp = reinterpret_cast( - GET_FUNCTION_PTR(loader, "zetDeviceDisableMetricsExp") ); } if( ZE_RESULT_SUCCESS == result ) @@ -120,16 +116,6 @@ namespace ze_lib GET_FUNCTION_PTR(loader, "zetCommandListAppendMetricMemoryBarrier") ); } - if( ZE_RESULT_SUCCESS == result ) - { - // Optional - auto getTable = reinterpret_cast( - GET_FUNCTION_PTR(loader, "zetGetCommandListExpProcAddrTable") ); - getTableWithCheck(getTable, version, &initialzetDdiTable.CommandListExp ); - initialzetDdiTable.CommandListExp.pfnAppendMarkerExp = reinterpret_cast( - GET_FUNCTION_PTR(loader, "zetCommandListAppendMarkerExp") ); - } - if( ZE_RESULT_SUCCESS == result ) { auto getTable = reinterpret_cast( @@ -345,12 +331,6 @@ namespace ze_lib result = zetGetCommandListProcAddrTable( version, &initialzetDdiTable.CommandList ); } - if( ZE_RESULT_SUCCESS == result ) - { - // Optional - zetGetCommandListExpProcAddrTable( version, &initialzetDdiTable.CommandListExp ); - } - if( ZE_RESULT_SUCCESS == result ) { result = zetGetKernelProcAddrTable( version, &initialzetDdiTable.Kernel ); diff --git a/source/loader/ze_ldrddi.cpp b/source/loader/ze_ldrddi.cpp index b4bc7c79..8d080a5c 100644 --- a/source/loader/ze_ldrddi.cpp +++ b/source/loader/ze_ldrddi.cpp @@ -4074,14 +4074,10 @@ namespace loader 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. + ///< 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. ) { ze_result_t result = ZE_RESULT_SUCCESS; @@ -5064,361 +5060,6 @@ namespace loader return result; } - /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderCreateExt - __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 - ) - { - 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 ) - return ZE_RESULT_ERROR_UNINITIALIZED; - - // convert loader handle to driver handle - hDriver = reinterpret_cast( hDriver )->handle; - - // forward to device-driver - result = pfnCreateExt( hDriver, pDescriptor, phBuilder ); - - if( ZE_RESULT_SUCCESS != result ) - return result; - - try - { - // convert driver handle to loader handle - *phBuilder = reinterpret_cast( - context->ze_rtas_builder_ext_factory.getInstance( *phBuilder, dditable ) ); - } - catch( std::bad_alloc& ) - { - result = ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY; - } - - return result; - } - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderGetBuildPropertiesExt - __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 - ) - { - 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 ) - return ZE_RESULT_ERROR_UNINITIALIZED; - - // convert loader handle to driver handle - hBuilder = reinterpret_cast( hBuilder )->handle; - - // forward to device-driver - result = pfnGetBuildPropertiesExt( hBuilder, pBuildOpDescriptor, pProperties ); - - return result; - } - - /////////////////////////////////////////////////////////////////////////////// - /// @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 - ) - { - 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 ) - return ZE_RESULT_ERROR_UNINITIALIZED; - - // convert loader handle to driver handle - hDriver = reinterpret_cast( hDriver )->handle; - - // forward to device-driver - result = pfnRTASFormatCompatibilityCheckExt( hDriver, rtasFormatA, rtasFormatB ); - - return result; - } - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderBuildExt - __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 - ) - { - 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 ) - 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; - - // forward to device-driver - result = pfnBuildExt( hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes ); - - return result; - } - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderCommandListAppendCopyExt - __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 - ) - { - ze_result_t result = ZE_RESULT_SUCCESS; - - // extract driver's function pointer table - 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 - 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 = pfnCommandListAppendCopyExt( hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEventsLocal ); - delete []phWaitEventsLocal; - - return result; - } - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASBuilderDestroyExt - __zedlllocal ze_result_t ZE_APICALL - 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( hBuilder )->dditable; - auto pfnDestroyExt = dditable->ze.RTASBuilder.pfnDestroyExt; - if( nullptr == pfnDestroyExt ) - return ZE_RESULT_ERROR_UNINITIALIZED; - - // convert loader handle to driver handle - hBuilder = reinterpret_cast( hBuilder )->handle; - - // forward to device-driver - result = pfnDestroyExt( hBuilder ); - - if( ZE_RESULT_SUCCESS != result ) - return result; - - // release loader handle - context->ze_rtas_builder_ext_factory.release( hBuilder ); - - return result; - } - - /////////////////////////////////////////////////////////////////////////////// - /// @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 - ) - { - 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 ) - return ZE_RESULT_ERROR_UNINITIALIZED; - - // convert loader handle to driver handle - hDriver = reinterpret_cast( hDriver )->handle; - - // forward to device-driver - result = pfnCreateExt( hDriver, phParallelOperation ); - - if( ZE_RESULT_SUCCESS != result ) - return result; - - try - { - // convert driver handle to loader handle - *phParallelOperation = reinterpret_cast( - context->ze_rtas_parallel_operation_ext_factory.getInstance( *phParallelOperation, dditable ) ); - } - catch( std::bad_alloc& ) - { - result = ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY; - } - - return result; - } - - /////////////////////////////////////////////////////////////////////////////// - /// @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 - ) - { - 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 ) - return ZE_RESULT_ERROR_UNINITIALIZED; - - // convert loader handle to driver handle - hParallelOperation = reinterpret_cast( hParallelOperation )->handle; - - // forward to device-driver - result = pfnGetPropertiesExt( hParallelOperation, pProperties ); - - return result; - } - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASParallelOperationJoinExt - __zedlllocal ze_result_t ZE_APICALL - 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( hParallelOperation )->dditable; - auto pfnJoinExt = dditable->ze.RTASParallelOperation.pfnJoinExt; - if( nullptr == pfnJoinExt ) - return ZE_RESULT_ERROR_UNINITIALIZED; - - // convert loader handle to driver handle - hParallelOperation = reinterpret_cast( hParallelOperation )->handle; - - // forward to device-driver - result = pfnJoinExt( hParallelOperation ); - - return result; - } - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zeRTASParallelOperationDestroyExt - __zedlllocal ze_result_t ZE_APICALL - 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( hParallelOperation )->dditable; - auto pfnDestroyExt = dditable->ze.RTASParallelOperation.pfnDestroyExt; - if( nullptr == pfnDestroyExt ) - return ZE_RESULT_ERROR_UNINITIALIZED; - - // convert loader handle to driver handle - hParallelOperation = reinterpret_cast( hParallelOperation )->handle; - - // forward to device-driver - 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 zeDeviceGetVectorWidthPropertiesExt - __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. - ) - { - 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 ) - return ZE_RESULT_ERROR_UNINITIALIZED; - - // convert loader handle to driver handle - hDevice = reinterpret_cast( hDevice )->handle; - - // forward to device-driver - result = pfnGetVectorWidthPropertiesExt( hDevice, pCount, pVectorWidthProperties ); - - return result; - } - /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zeDeviceReserveCacheExt __zedlllocal ze_result_t ZE_APICALL @@ -6967,102 +6608,6 @@ zeGetGlobalProcAddrTable( return result; } -/////////////////////////////////////////////////////////////////////////////// -/// @brief Exported function for filling application's RTASBuilder 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 -zeGetRTASBuilderProcAddrTable( - ze_api_version_t version, ///< [in] API version requested - ze_rtas_builder_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; - - ze_result_t result = ZE_RESULT_SUCCESS; - - bool atLeastOneDriverValid = false; - // Load the device-driver DDI tables - for( auto& drv : loader::context->zeDrivers ) - { - if(drv.initStatus != ZE_RESULT_SUCCESS) - continue; - auto getTable = reinterpret_cast( - GET_FUNCTION_PTR( drv.handle, "zeGetRTASBuilderProcAddrTable") ); - if(!getTable) - continue; - auto getTableResult = getTable( version, &drv.dditable.ze.RTASBuilder); - if(getTableResult == ZE_RESULT_SUCCESS) - atLeastOneDriverValid = true; - else - drv.initStatus = getTableResult; - } - - if(!atLeastOneDriverValid) - result = ZE_RESULT_ERROR_UNINITIALIZED; - else - result = ZE_RESULT_SUCCESS; - - if( ZE_RESULT_SUCCESS == result ) - { - if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) - { - // return pointers to loader's DDIs - pDdiTable->pfnCreateExt = loader::zeRTASBuilderCreateExt; - pDdiTable->pfnGetBuildPropertiesExt = loader::zeRTASBuilderGetBuildPropertiesExt; - pDdiTable->pfnBuildExt = loader::zeRTASBuilderBuildExt; - pDdiTable->pfnCommandListAppendCopyExt = loader::zeRTASBuilderCommandListAppendCopyExt; - pDdiTable->pfnDestroyExt = loader::zeRTASBuilderDestroyExt; - } - else - { - // return pointers directly to driver's DDIs - *pDdiTable = loader::context->zeDrivers.front().dditable.ze.RTASBuilder; - } - } - - // 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, "zeGetRTASBuilderProcAddrTable") ); - 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, "zeGetRTASBuilderProcAddrTable") ); - if(!getTable) - return ZE_RESULT_ERROR_UNINITIALIZED; - ze_rtas_builder_dditable_t dditable; - memcpy(&dditable, pDdiTable, sizeof(ze_rtas_builder_dditable_t)); - result = getTable( version, &dditable ); - loader::context->tracing_dditable.ze.RTASBuilder = dditable; - if ( loader::context->tracingLayerEnabled ) { - result = getTable( version, pDdiTable ); - } - } - - return result; -} - /////////////////////////////////////////////////////////////////////////////// /// @brief Exported function for filling application's RTASBuilderExp table /// with current process' addresses @@ -7149,101 +6694,6 @@ zeGetRTASBuilderExpProcAddrTable( return result; } -/////////////////////////////////////////////////////////////////////////////// -/// @brief Exported function for filling application's RTASParallelOperation 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 -zeGetRTASParallelOperationProcAddrTable( - ze_api_version_t version, ///< [in] API version requested - ze_rtas_parallel_operation_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; - - ze_result_t result = ZE_RESULT_SUCCESS; - - bool atLeastOneDriverValid = false; - // Load the device-driver DDI tables - for( auto& drv : loader::context->zeDrivers ) - { - if(drv.initStatus != ZE_RESULT_SUCCESS) - continue; - auto getTable = reinterpret_cast( - GET_FUNCTION_PTR( drv.handle, "zeGetRTASParallelOperationProcAddrTable") ); - if(!getTable) - continue; - auto getTableResult = getTable( version, &drv.dditable.ze.RTASParallelOperation); - if(getTableResult == ZE_RESULT_SUCCESS) - atLeastOneDriverValid = true; - else - drv.initStatus = getTableResult; - } - - if(!atLeastOneDriverValid) - result = ZE_RESULT_ERROR_UNINITIALIZED; - else - result = ZE_RESULT_SUCCESS; - - if( ZE_RESULT_SUCCESS == result ) - { - if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) - { - // return pointers to loader's DDIs - pDdiTable->pfnCreateExt = loader::zeRTASParallelOperationCreateExt; - pDdiTable->pfnGetPropertiesExt = loader::zeRTASParallelOperationGetPropertiesExt; - pDdiTable->pfnJoinExt = loader::zeRTASParallelOperationJoinExt; - pDdiTable->pfnDestroyExt = loader::zeRTASParallelOperationDestroyExt; - } - else - { - // return pointers directly to driver's DDIs - *pDdiTable = loader::context->zeDrivers.front().dditable.ze.RTASParallelOperation; - } - } - - // 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, "zeGetRTASParallelOperationProcAddrTable") ); - 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, "zeGetRTASParallelOperationProcAddrTable") ); - if(!getTable) - return ZE_RESULT_ERROR_UNINITIALIZED; - ze_rtas_parallel_operation_dditable_t dditable; - memcpy(&dditable, pDdiTable, sizeof(ze_rtas_parallel_operation_dditable_t)); - result = getTable( version, &dditable ); - loader::context->tracing_dditable.ze.RTASParallelOperation = dditable; - if ( loader::context->tracingLayerEnabled ) { - result = getTable( version, pDdiTable ); - } - } - - return result; -} - /////////////////////////////////////////////////////////////////////////////// /// @brief Exported function for filling application's RTASParallelOperationExp table /// with current process' addresses @@ -7390,7 +6840,6 @@ zeGetDriverProcAddrTable( pDdiTable->pfnGetIpcProperties = loader::zeDriverGetIpcProperties; pDdiTable->pfnGetExtensionProperties = loader::zeDriverGetExtensionProperties; pDdiTable->pfnGetExtensionFunctionAddress = loader::zeDriverGetExtensionFunctionAddress; - pDdiTable->pfnRTASFormatCompatibilityCheckExt = loader::zeDriverRTASFormatCompatibilityCheckExt; pDdiTable->pfnGetLastErrorDescription = loader::zeDriverGetLastErrorDescription; } else @@ -7583,7 +7032,6 @@ zeGetDeviceProcAddrTable( pDdiTable->pfnGetGlobalTimestamps = loader::zeDeviceGetGlobalTimestamps; pDdiTable->pfnImportExternalSemaphoreExt = loader::zeDeviceImportExternalSemaphoreExt; pDdiTable->pfnReleaseExternalSemaphoreExt = loader::zeDeviceReleaseExternalSemaphoreExt; - pDdiTable->pfnGetVectorWidthPropertiesExt = loader::zeDeviceGetVectorWidthPropertiesExt; pDdiTable->pfnReserveCacheExt = loader::zeDeviceReserveCacheExt; pDdiTable->pfnSetCacheAdviceExt = loader::zeDeviceSetCacheAdviceExt; pDdiTable->pfnPciGetPropertiesExt = loader::zeDevicePciGetPropertiesExt; diff --git a/source/loader/ze_ldrddi.h b/source/loader/ze_ldrddi.h index 609bb853..2643d540 100644 --- a/source/loader/ze_ldrddi.h +++ b/source/loader/ze_ldrddi.h @@ -63,12 +63,6 @@ namespace loader 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 >; - using ze_rtas_builder_ext_object_t = object_t < ze_rtas_builder_ext_handle_t >; - using ze_rtas_builder_ext_factory_t = singleton_factory_t < ze_rtas_builder_ext_object_t, ze_rtas_builder_ext_handle_t >; - - 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_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 >; diff --git a/source/loader/ze_loader_internal.h b/source/loader/ze_loader_internal.h index e391523b..295a33a2 100644 --- a/source/loader/ze_loader_internal.h +++ b/source/loader/ze_loader_internal.h @@ -84,9 +84,7 @@ namespace loader ze_module_factory_t ze_module_factory; ze_physical_mem_factory_t ze_physical_mem_factory; ze_rtas_builder_exp_factory_t ze_rtas_builder_exp_factory; - ze_rtas_builder_ext_factory_t ze_rtas_builder_ext_factory; ze_rtas_parallel_operation_exp_factory_t ze_rtas_parallel_operation_exp_factory; - ze_rtas_parallel_operation_ext_factory_t ze_rtas_parallel_operation_ext_factory; ze_sampler_factory_t ze_sampler_factory; zes_device_factory_t zes_device_factory; zes_diag_factory_t zes_diag_factory; diff --git a/source/loader/zet_ldrddi.cpp b/source/loader/zet_ldrddi.cpp index 8629d2bf..68c211ee 100644 --- a/source/loader/zet_ldrddi.cpp +++ b/source/loader/zet_ldrddi.cpp @@ -376,8 +376,8 @@ namespace loader ///< than the `count` member of ::zet_debug_regset_properties_t for the ///< type uint32_t count, ///< [in] the number of registers to read; start+count must be less than or - ///< equal to the `count` member of ::zet_debug_regset_properties_t for the - ///< type + ///< equal to the `count` member of ::zet_debug_register_group_properties_t + ///< for the type void* pRegisterValues ///< [in,out][optional][range(0, count)] buffer of register values ) { @@ -409,8 +409,8 @@ namespace loader ///< than the `count` member of ::zet_debug_regset_properties_t for the ///< type uint32_t count, ///< [in] the number of registers to write; start+count must be less than - ///< or equal to the `count` member of ::zet_debug_regset_properties_t for - ///< the type + ///< or equal to the `count` member of + ///< ::zet_debug_register_group_properties_t for the type void* pRegisterValues ///< [in,out][optional][range(0, count)] buffer of register values ) { @@ -1654,85 +1654,6 @@ namespace loader return result; } - /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetCommandListAppendMarkerExp - __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 - ) - { - 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 ) - return ZE_RESULT_ERROR_UNINITIALIZED; - - // convert loader handle to driver handle - hCommandList = reinterpret_cast( hCommandList )->handle; - - // convert loader handle to driver handle - hMetricGroup = reinterpret_cast( hMetricGroup )->handle; - - // forward to device-driver - result = pfnAppendMarkerExp( hCommandList, hMetricGroup, value ); - - return result; - } - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Intercept function for zetDeviceEnableMetricsExp - __zedlllocal ze_result_t ZE_APICALL - 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( hDevice )->dditable; - auto pfnEnableMetricsExp = dditable->zet.DeviceExp.pfnEnableMetricsExp; - if( nullptr == pfnEnableMetricsExp ) - 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; - - // convert loader handle to driver handle - hDevice = reinterpret_cast( hDevice )->handle; - - // forward to device-driver - result = pfnDisableMetricsExp( hDevice ); - - return result; - } - /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zetMetricGroupCalculateMultipleMetricValuesExp __zedlllocal ze_result_t ZE_APICALL @@ -2711,8 +2632,6 @@ zetGetDeviceExpProcAddrTable( // return pointers to loader's DDIs pDdiTable->pfnGetConcurrentMetricGroupsExp = loader::zetDeviceGetConcurrentMetricGroupsExp; pDdiTable->pfnCreateMetricGroupsFromMetricsExp = loader::zetDeviceCreateMetricGroupsFromMetricsExp; - pDdiTable->pfnEnableMetricsExp = loader::zetDeviceEnableMetricsExp; - pDdiTable->pfnDisableMetricsExp = loader::zetDeviceDisableMetricsExp; } else { @@ -2889,73 +2808,6 @@ zetGetCommandListProcAddrTable( return result; } -/////////////////////////////////////////////////////////////////////////////// -/// @brief Exported function for filling application's CommandListExp 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 -zetGetCommandListExpProcAddrTable( - ze_api_version_t version, ///< [in] API version requested - zet_command_list_exp_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; - - ze_result_t result = ZE_RESULT_SUCCESS; - - // Load the device-driver DDI tables - for( auto& drv : loader::context->zeDrivers ) - { - if(drv.initStatus != ZE_RESULT_SUCCESS) - continue; - auto getTable = reinterpret_cast( - GET_FUNCTION_PTR( drv.handle, "zetGetCommandListExpProcAddrTable") ); - if(!getTable) - continue; - result = getTable( version, &drv.dditable.zet.CommandListExp); - } - - - if( ZE_RESULT_SUCCESS == result ) - { - if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) - { - // return pointers to loader's DDIs - pDdiTable->pfnAppendMarkerExp = loader::zetCommandListAppendMarkerExp; - } - else - { - // return pointers directly to driver's DDIs - *pDdiTable = loader::context->zeDrivers.front().dditable.zet.CommandListExp; - } - } - - // 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, "zetGetCommandListExpProcAddrTable") ); - if(!getTable) - return ZE_RESULT_ERROR_UNINITIALIZED; - result = getTable( version, pDdiTable ); - } - - return result; -} - /////////////////////////////////////////////////////////////////////////////// /// @brief Exported function for filling application's Kernel table /// with current process' addresses From c182a1e4fc761f7cddb108df92dc6362c8aea6c0 Mon Sep 17 00:00:00 2001 From: "Neil R. Spruit" Date: Fri, 25 Apr 2025 11:38:21 -0700 Subject: [PATCH 06/28] Fix static loader to request current version as the latest APIs (#327) Signed-off-by: Neil R. Spruit --- source/lib/ze_lib.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source/lib/ze_lib.cpp b/source/lib/ze_lib.cpp index 43c20927..2046f5fa 100644 --- a/source/lib/ze_lib.cpp +++ b/source/lib/ze_lib.cpp @@ -101,6 +101,7 @@ namespace ze_lib } bool zeInitDriversSupport = true; + ze_api_version_t current_api_version = version; const std::string loader_name = "loader"; for (auto &component : versions) { if (loader_name == component.component_name) { @@ -121,6 +122,12 @@ namespace ze_lib } } + if (version > current_api_version) { + version = current_api_version; + std::string message = "ze_lib Context Init() Static Loader Requesting Loader API Version v" + std::to_string(ZE_MAJOR_VERSION(version)) + "." + std::to_string(ZE_MINOR_VERSION(version)); + debug_trace_message(message, ""); + } + typedef HMODULE (ZE_APICALL *getTracing_t)(); auto getTracing = reinterpret_cast( GET_FUNCTION_PTR(loader, "zeLoaderGetTracingHandle") ); From 3cb5c7249f872784a66785c145592e00779a1562 Mon Sep 17 00:00:00 2001 From: "Neil R. Spruit" Date: Fri, 25 Apr 2025 14:53:30 -0700 Subject: [PATCH 07/28] fix ddi compatibility to avoid assigning values which don't exist (#328) Signed-off-by: Neil R. Spruit --- scripts/templates/helper.py | 40 + scripts/templates/ldrddi.cpp.mako | 6 +- scripts/templates/tracing/trcddi.cpp.mako | 14 +- scripts/templates/validation/valddi.cpp.mako | 14 +- source/layers/tracing/ze_trcddi.cpp | 1428 ++++++++++-------- source/layers/validation/ze_valddi.cpp | 1428 ++++++++++-------- source/layers/validation/zes_valddi.cpp | 1115 ++++++++------ source/layers/validation/zet_valddi.cpp | 516 ++++--- source/loader/ze_ldrddi.cpp | 768 +++++++--- source/loader/zes_ldrddi.cpp | 596 ++++++-- source/loader/zet_ldrddi.cpp | 264 +++- 11 files changed, 3773 insertions(+), 2416 deletions(-) diff --git a/scripts/templates/helper.py b/scripts/templates/helper.py index b75e8655..4cf99644 100644 --- a/scripts/templates/helper.py +++ b/scripts/templates/helper.py @@ -1726,6 +1726,46 @@ def get_class_function_objs_exp(specs, cname): return objects, exp_objects, optional +""" +Public: + returns the version of a function object +""" +def get_version(obj): + if obj_traits.is_function(obj): + ret_version = "ZE_API_VERSION_FORCE_UINT32" + version = obj.get('version') + if version == "1.0": + ret_version = "ZE_API_VERSION_1_0" + if version == "1.1": + ret_version = "ZE_API_VERSION_1_1" + if version == "1.2": + ret_version = "ZE_API_VERSION_1_2" + if version == "1.3": + ret_version = "ZE_API_VERSION_1_3" + if version == "1.4": + ret_version = "ZE_API_VERSION_1_4" + if version == "1.5": + ret_version = "ZE_API_VERSION_1_5" + if version == "1.6": + ret_version = "ZE_API_VERSION_1_6" + if version == "1.7": + ret_version = "ZE_API_VERSION_1_7" + if version == "1.8": + ret_version = "ZE_API_VERSION_1_8" + if version == "1.9": + ret_version = "ZE_API_VERSION_1_9" + if version == "1.10": + ret_version = "ZE_API_VERSION_1_10" + if version == "1.11": + ret_version = "ZE_API_VERSION_1_11" + if version == "1.12": + ret_version = "ZE_API_VERSION_1_12" + if version == "1.13": + ret_version = "ZE_API_VERSION_1_13" + if (ret_version == "ZE_API_VERSION_FORCE_UINT32"): + ret_version = "ZE_API_VERSION_1_0" + return ret_version + """ Public: returns string name of DDI table for function object diff --git a/scripts/templates/ldrddi.cpp.mako b/scripts/templates/ldrddi.cpp.mako index 9381c3c2..72e5c2ed 100644 --- a/scripts/templates/ldrddi.cpp.mako +++ b/scripts/templates/ldrddi.cpp.mako @@ -443,15 +443,17 @@ ${tbl['export']['name']}( { // return pointers to loader's DDIs %for obj in tbl['functions']: + if (version >= ${th.get_version(obj)}) { %if 'condition' in obj: #if ${th.subt(n, tags, obj['condition'])} %endif - pDdiTable->${th.append_ws(th.make_pfn_name(n, tags, obj), 43)} = loader::${th.make_func_name(n, tags, obj)}; + pDdiTable->${th.append_ws(th.make_pfn_name(n, tags, obj), 43)} = loader::${th.make_func_name(n, tags, obj)}; %if 'condition' in obj: #else - pDdiTable->${th.append_ws(th.make_pfn_name(n, tags, obj), 43)} = nullptr; + pDdiTable->${th.append_ws(th.make_pfn_name(n, tags, obj), 43)} = nullptr; #endif %endif + } %endfor } else diff --git a/scripts/templates/tracing/trcddi.cpp.mako b/scripts/templates/tracing/trcddi.cpp.mako index 29e6b5ac..235ed472 100644 --- a/scripts/templates/tracing/trcddi.cpp.mako +++ b/scripts/templates/tracing/trcddi.cpp.mako @@ -91,25 +91,25 @@ ${tbl['export']['name']}( if( nullptr == pDdiTable ) return ${X}_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(tracing_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(tracing_layer::context.version) > ZE_MINOR_VERSION(version)) + if (tracing_layer::context.version < version) return ${X}_RESULT_ERROR_UNSUPPORTED_VERSION; ${x}_result_t result = ${X}_RESULT_SUCCESS; %for obj in tbl['functions']: + if (version >= ${th.get_version(obj)}) { %if 'condition' in obj: #if ${th.subt(n, tags, obj['condition'])} %endif - dditable.${th.append_ws(th.make_pfn_name(n, tags, obj), 43)} = pDdiTable->${th.make_pfn_name(n, tags, obj)}; - pDdiTable->${th.append_ws(th.make_pfn_name(n, tags, obj), 41)} = tracing_layer::${th.make_func_name(n, tags, obj)}; + dditable.${th.append_ws(th.make_pfn_name(n, tags, obj), 43)} = pDdiTable->${th.make_pfn_name(n, tags, obj)}; + pDdiTable->${th.append_ws(th.make_pfn_name(n, tags, obj), 41)} = tracing_layer::${th.make_func_name(n, tags, obj)}; %if 'condition' in obj: #else - dditable.${th.append_ws(th.make_pfn_name(n, tags, obj), 43)} = nullptr; - pDdiTable->${th.append_ws(th.make_pfn_name(n, tags, obj), 41)} = nullptr; + dditable.${th.append_ws(th.make_pfn_name(n, tags, obj), 43)} = nullptr; + pDdiTable->${th.append_ws(th.make_pfn_name(n, tags, obj), 41)} = nullptr; #endif %endif - + } %endfor return result; } diff --git a/scripts/templates/validation/valddi.cpp.mako b/scripts/templates/validation/valddi.cpp.mako index 07c7b0a7..8e28d92f 100644 --- a/scripts/templates/validation/valddi.cpp.mako +++ b/scripts/templates/validation/valddi.cpp.mako @@ -154,25 +154,25 @@ ${tbl['export']['name']}( if( nullptr == pDdiTable ) return ${X}_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ${X}_RESULT_ERROR_UNSUPPORTED_VERSION; ${x}_result_t result = ${X}_RESULT_SUCCESS; %for obj in tbl['functions']: + if (version >= ${th.get_version(obj)}) { %if 'condition' in obj: #if ${th.subt(n, tags, obj['condition'])} %endif - dditable.${th.append_ws(th.make_pfn_name(n, tags, obj), 43)} = pDdiTable->${th.make_pfn_name(n, tags, obj)}; - pDdiTable->${th.append_ws(th.make_pfn_name(n, tags, obj), 41)} = validation_layer::${th.make_func_name(n, tags, obj)}; + dditable.${th.append_ws(th.make_pfn_name(n, tags, obj), 43)} = pDdiTable->${th.make_pfn_name(n, tags, obj)}; + pDdiTable->${th.append_ws(th.make_pfn_name(n, tags, obj), 41)} = validation_layer::${th.make_func_name(n, tags, obj)}; %if 'condition' in obj: #else - dditable.${th.append_ws(th.make_pfn_name(n, tags, obj), 43)} = nullptr; - pDdiTable->${th.append_ws(th.make_pfn_name(n, tags, obj), 41)} = nullptr; + dditable.${th.append_ws(th.make_pfn_name(n, tags, obj), 43)} = nullptr; + pDdiTable->${th.append_ws(th.make_pfn_name(n, tags, obj), 41)} = nullptr; #endif %endif - + } %endfor return result; } diff --git a/source/layers/tracing/ze_trcddi.cpp b/source/layers/tracing/ze_trcddi.cpp index 9df2671d..53447bc0 100644 --- a/source/layers/tracing/ze_trcddi.cpp +++ b/source/layers/tracing/ze_trcddi.cpp @@ -7751,18 +7751,19 @@ zeGetGlobalProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(tracing_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(tracing_layer::context.version) > ZE_MINOR_VERSION(version)) + if (tracing_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnInit = pDdiTable->pfnInit; - pDdiTable->pfnInit = tracing_layer::zeInit; - - dditable.pfnInitDrivers = pDdiTable->pfnInitDrivers; - pDdiTable->pfnInitDrivers = tracing_layer::zeInitDrivers; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnInit = pDdiTable->pfnInit; + pDdiTable->pfnInit = tracing_layer::zeInit; + } + if (version >= ZE_API_VERSION_1_10) { + dditable.pfnInitDrivers = pDdiTable->pfnInitDrivers; + pDdiTable->pfnInitDrivers = tracing_layer::zeInitDrivers; + } return result; } @@ -7785,24 +7786,27 @@ zeGetRTASBuilderExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(tracing_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(tracing_layer::context.version) > ZE_MINOR_VERSION(version)) + if (tracing_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnCreateExp = pDdiTable->pfnCreateExp; - pDdiTable->pfnCreateExp = tracing_layer::zeRTASBuilderCreateExp; - - dditable.pfnGetBuildPropertiesExp = pDdiTable->pfnGetBuildPropertiesExp; - pDdiTable->pfnGetBuildPropertiesExp = tracing_layer::zeRTASBuilderGetBuildPropertiesExp; - - dditable.pfnBuildExp = pDdiTable->pfnBuildExp; - pDdiTable->pfnBuildExp = tracing_layer::zeRTASBuilderBuildExp; - - dditable.pfnDestroyExp = pDdiTable->pfnDestroyExp; - pDdiTable->pfnDestroyExp = tracing_layer::zeRTASBuilderDestroyExp; - + if (version >= ZE_API_VERSION_1_7) { + dditable.pfnCreateExp = pDdiTable->pfnCreateExp; + pDdiTable->pfnCreateExp = tracing_layer::zeRTASBuilderCreateExp; + } + if (version >= ZE_API_VERSION_1_7) { + dditable.pfnGetBuildPropertiesExp = pDdiTable->pfnGetBuildPropertiesExp; + pDdiTable->pfnGetBuildPropertiesExp = tracing_layer::zeRTASBuilderGetBuildPropertiesExp; + } + if (version >= ZE_API_VERSION_1_7) { + dditable.pfnBuildExp = pDdiTable->pfnBuildExp; + pDdiTable->pfnBuildExp = tracing_layer::zeRTASBuilderBuildExp; + } + if (version >= ZE_API_VERSION_1_7) { + dditable.pfnDestroyExp = pDdiTable->pfnDestroyExp; + pDdiTable->pfnDestroyExp = tracing_layer::zeRTASBuilderDestroyExp; + } return result; } @@ -7825,24 +7829,27 @@ zeGetRTASParallelOperationExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(tracing_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(tracing_layer::context.version) > ZE_MINOR_VERSION(version)) + if (tracing_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnCreateExp = pDdiTable->pfnCreateExp; - pDdiTable->pfnCreateExp = tracing_layer::zeRTASParallelOperationCreateExp; - - dditable.pfnGetPropertiesExp = pDdiTable->pfnGetPropertiesExp; - pDdiTable->pfnGetPropertiesExp = tracing_layer::zeRTASParallelOperationGetPropertiesExp; - - dditable.pfnJoinExp = pDdiTable->pfnJoinExp; - pDdiTable->pfnJoinExp = tracing_layer::zeRTASParallelOperationJoinExp; - - dditable.pfnDestroyExp = pDdiTable->pfnDestroyExp; - pDdiTable->pfnDestroyExp = tracing_layer::zeRTASParallelOperationDestroyExp; - + if (version >= ZE_API_VERSION_1_7) { + dditable.pfnCreateExp = pDdiTable->pfnCreateExp; + pDdiTable->pfnCreateExp = tracing_layer::zeRTASParallelOperationCreateExp; + } + if (version >= ZE_API_VERSION_1_7) { + dditable.pfnGetPropertiesExp = pDdiTable->pfnGetPropertiesExp; + pDdiTable->pfnGetPropertiesExp = tracing_layer::zeRTASParallelOperationGetPropertiesExp; + } + if (version >= ZE_API_VERSION_1_7) { + dditable.pfnJoinExp = pDdiTable->pfnJoinExp; + pDdiTable->pfnJoinExp = tracing_layer::zeRTASParallelOperationJoinExp; + } + if (version >= ZE_API_VERSION_1_7) { + dditable.pfnDestroyExp = pDdiTable->pfnDestroyExp; + pDdiTable->pfnDestroyExp = tracing_layer::zeRTASParallelOperationDestroyExp; + } return result; } @@ -7865,33 +7872,39 @@ zeGetDriverProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(tracing_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(tracing_layer::context.version) > ZE_MINOR_VERSION(version)) + if (tracing_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGet = pDdiTable->pfnGet; - pDdiTable->pfnGet = tracing_layer::zeDriverGet; - - dditable.pfnGetApiVersion = pDdiTable->pfnGetApiVersion; - pDdiTable->pfnGetApiVersion = tracing_layer::zeDriverGetApiVersion; - - dditable.pfnGetProperties = pDdiTable->pfnGetProperties; - pDdiTable->pfnGetProperties = tracing_layer::zeDriverGetProperties; - - dditable.pfnGetIpcProperties = pDdiTable->pfnGetIpcProperties; - pDdiTable->pfnGetIpcProperties = tracing_layer::zeDriverGetIpcProperties; - - dditable.pfnGetExtensionProperties = pDdiTable->pfnGetExtensionProperties; - pDdiTable->pfnGetExtensionProperties = tracing_layer::zeDriverGetExtensionProperties; - - dditable.pfnGetExtensionFunctionAddress = pDdiTable->pfnGetExtensionFunctionAddress; - pDdiTable->pfnGetExtensionFunctionAddress = tracing_layer::zeDriverGetExtensionFunctionAddress; - - dditable.pfnGetLastErrorDescription = pDdiTable->pfnGetLastErrorDescription; - pDdiTable->pfnGetLastErrorDescription = tracing_layer::zeDriverGetLastErrorDescription; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGet = pDdiTable->pfnGet; + pDdiTable->pfnGet = tracing_layer::zeDriverGet; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetApiVersion = pDdiTable->pfnGetApiVersion; + pDdiTable->pfnGetApiVersion = tracing_layer::zeDriverGetApiVersion; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetProperties = pDdiTable->pfnGetProperties; + pDdiTable->pfnGetProperties = tracing_layer::zeDriverGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetIpcProperties = pDdiTable->pfnGetIpcProperties; + pDdiTable->pfnGetIpcProperties = tracing_layer::zeDriverGetIpcProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetExtensionProperties = pDdiTable->pfnGetExtensionProperties; + pDdiTable->pfnGetExtensionProperties = tracing_layer::zeDriverGetExtensionProperties; + } + if (version >= ZE_API_VERSION_1_1) { + dditable.pfnGetExtensionFunctionAddress = pDdiTable->pfnGetExtensionFunctionAddress; + pDdiTable->pfnGetExtensionFunctionAddress = tracing_layer::zeDriverGetExtensionFunctionAddress; + } + if (version >= ZE_API_VERSION_1_6) { + dditable.pfnGetLastErrorDescription = pDdiTable->pfnGetLastErrorDescription; + pDdiTable->pfnGetLastErrorDescription = tracing_layer::zeDriverGetLastErrorDescription; + } return result; } @@ -7914,15 +7927,15 @@ zeGetDriverExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(tracing_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(tracing_layer::context.version) > ZE_MINOR_VERSION(version)) + if (tracing_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnRTASFormatCompatibilityCheckExp = pDdiTable->pfnRTASFormatCompatibilityCheckExp; - pDdiTable->pfnRTASFormatCompatibilityCheckExp = tracing_layer::zeDriverRTASFormatCompatibilityCheckExp; - + if (version >= ZE_API_VERSION_1_7) { + dditable.pfnRTASFormatCompatibilityCheckExp = pDdiTable->pfnRTASFormatCompatibilityCheckExp; + pDdiTable->pfnRTASFormatCompatibilityCheckExp = tracing_layer::zeDriverRTASFormatCompatibilityCheckExp; + } return result; } @@ -7945,75 +7958,95 @@ zeGetDeviceProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(tracing_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(tracing_layer::context.version) > ZE_MINOR_VERSION(version)) + if (tracing_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGet = pDdiTable->pfnGet; - pDdiTable->pfnGet = tracing_layer::zeDeviceGet; - - dditable.pfnGetSubDevices = pDdiTable->pfnGetSubDevices; - pDdiTable->pfnGetSubDevices = tracing_layer::zeDeviceGetSubDevices; - - dditable.pfnGetProperties = pDdiTable->pfnGetProperties; - pDdiTable->pfnGetProperties = tracing_layer::zeDeviceGetProperties; - - dditable.pfnGetComputeProperties = pDdiTable->pfnGetComputeProperties; - pDdiTable->pfnGetComputeProperties = tracing_layer::zeDeviceGetComputeProperties; - - dditable.pfnGetModuleProperties = pDdiTable->pfnGetModuleProperties; - pDdiTable->pfnGetModuleProperties = tracing_layer::zeDeviceGetModuleProperties; - - dditable.pfnGetCommandQueueGroupProperties = pDdiTable->pfnGetCommandQueueGroupProperties; - pDdiTable->pfnGetCommandQueueGroupProperties = tracing_layer::zeDeviceGetCommandQueueGroupProperties; - - dditable.pfnGetMemoryProperties = pDdiTable->pfnGetMemoryProperties; - pDdiTable->pfnGetMemoryProperties = tracing_layer::zeDeviceGetMemoryProperties; - - dditable.pfnGetMemoryAccessProperties = pDdiTable->pfnGetMemoryAccessProperties; - pDdiTable->pfnGetMemoryAccessProperties = tracing_layer::zeDeviceGetMemoryAccessProperties; - - dditable.pfnGetCacheProperties = pDdiTable->pfnGetCacheProperties; - pDdiTable->pfnGetCacheProperties = tracing_layer::zeDeviceGetCacheProperties; - - dditable.pfnGetImageProperties = pDdiTable->pfnGetImageProperties; - pDdiTable->pfnGetImageProperties = tracing_layer::zeDeviceGetImageProperties; - - dditable.pfnGetExternalMemoryProperties = pDdiTable->pfnGetExternalMemoryProperties; - pDdiTable->pfnGetExternalMemoryProperties = tracing_layer::zeDeviceGetExternalMemoryProperties; - - dditable.pfnGetP2PProperties = pDdiTable->pfnGetP2PProperties; - pDdiTable->pfnGetP2PProperties = tracing_layer::zeDeviceGetP2PProperties; - - dditable.pfnCanAccessPeer = pDdiTable->pfnCanAccessPeer; - pDdiTable->pfnCanAccessPeer = tracing_layer::zeDeviceCanAccessPeer; - - dditable.pfnGetStatus = pDdiTable->pfnGetStatus; - pDdiTable->pfnGetStatus = tracing_layer::zeDeviceGetStatus; - - dditable.pfnGetGlobalTimestamps = pDdiTable->pfnGetGlobalTimestamps; - pDdiTable->pfnGetGlobalTimestamps = tracing_layer::zeDeviceGetGlobalTimestamps; - - dditable.pfnImportExternalSemaphoreExt = pDdiTable->pfnImportExternalSemaphoreExt; - pDdiTable->pfnImportExternalSemaphoreExt = tracing_layer::zeDeviceImportExternalSemaphoreExt; - - dditable.pfnReleaseExternalSemaphoreExt = pDdiTable->pfnReleaseExternalSemaphoreExt; - pDdiTable->pfnReleaseExternalSemaphoreExt = tracing_layer::zeDeviceReleaseExternalSemaphoreExt; - - dditable.pfnReserveCacheExt = pDdiTable->pfnReserveCacheExt; - pDdiTable->pfnReserveCacheExt = tracing_layer::zeDeviceReserveCacheExt; - - dditable.pfnSetCacheAdviceExt = pDdiTable->pfnSetCacheAdviceExt; - pDdiTable->pfnSetCacheAdviceExt = tracing_layer::zeDeviceSetCacheAdviceExt; - - dditable.pfnPciGetPropertiesExt = pDdiTable->pfnPciGetPropertiesExt; - pDdiTable->pfnPciGetPropertiesExt = tracing_layer::zeDevicePciGetPropertiesExt; - - dditable.pfnGetRootDevice = pDdiTable->pfnGetRootDevice; - pDdiTable->pfnGetRootDevice = tracing_layer::zeDeviceGetRootDevice; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGet = pDdiTable->pfnGet; + pDdiTable->pfnGet = tracing_layer::zeDeviceGet; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetSubDevices = pDdiTable->pfnGetSubDevices; + pDdiTable->pfnGetSubDevices = tracing_layer::zeDeviceGetSubDevices; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetProperties = pDdiTable->pfnGetProperties; + pDdiTable->pfnGetProperties = tracing_layer::zeDeviceGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetComputeProperties = pDdiTable->pfnGetComputeProperties; + pDdiTable->pfnGetComputeProperties = tracing_layer::zeDeviceGetComputeProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetModuleProperties = pDdiTable->pfnGetModuleProperties; + pDdiTable->pfnGetModuleProperties = tracing_layer::zeDeviceGetModuleProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetCommandQueueGroupProperties = pDdiTable->pfnGetCommandQueueGroupProperties; + pDdiTable->pfnGetCommandQueueGroupProperties = tracing_layer::zeDeviceGetCommandQueueGroupProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetMemoryProperties = pDdiTable->pfnGetMemoryProperties; + pDdiTable->pfnGetMemoryProperties = tracing_layer::zeDeviceGetMemoryProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetMemoryAccessProperties = pDdiTable->pfnGetMemoryAccessProperties; + pDdiTable->pfnGetMemoryAccessProperties = tracing_layer::zeDeviceGetMemoryAccessProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetCacheProperties = pDdiTable->pfnGetCacheProperties; + pDdiTable->pfnGetCacheProperties = tracing_layer::zeDeviceGetCacheProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetImageProperties = pDdiTable->pfnGetImageProperties; + pDdiTable->pfnGetImageProperties = tracing_layer::zeDeviceGetImageProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetExternalMemoryProperties = pDdiTable->pfnGetExternalMemoryProperties; + pDdiTable->pfnGetExternalMemoryProperties = tracing_layer::zeDeviceGetExternalMemoryProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetP2PProperties = pDdiTable->pfnGetP2PProperties; + pDdiTable->pfnGetP2PProperties = tracing_layer::zeDeviceGetP2PProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCanAccessPeer = pDdiTable->pfnCanAccessPeer; + pDdiTable->pfnCanAccessPeer = tracing_layer::zeDeviceCanAccessPeer; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetStatus = pDdiTable->pfnGetStatus; + pDdiTable->pfnGetStatus = tracing_layer::zeDeviceGetStatus; + } + if (version >= ZE_API_VERSION_1_1) { + dditable.pfnGetGlobalTimestamps = pDdiTable->pfnGetGlobalTimestamps; + pDdiTable->pfnGetGlobalTimestamps = tracing_layer::zeDeviceGetGlobalTimestamps; + } + if (version >= ZE_API_VERSION_1_12) { + dditable.pfnImportExternalSemaphoreExt = pDdiTable->pfnImportExternalSemaphoreExt; + pDdiTable->pfnImportExternalSemaphoreExt = tracing_layer::zeDeviceImportExternalSemaphoreExt; + } + if (version >= ZE_API_VERSION_1_12) { + dditable.pfnReleaseExternalSemaphoreExt = pDdiTable->pfnReleaseExternalSemaphoreExt; + pDdiTable->pfnReleaseExternalSemaphoreExt = tracing_layer::zeDeviceReleaseExternalSemaphoreExt; + } + if (version >= ZE_API_VERSION_1_2) { + dditable.pfnReserveCacheExt = pDdiTable->pfnReserveCacheExt; + pDdiTable->pfnReserveCacheExt = tracing_layer::zeDeviceReserveCacheExt; + } + if (version >= ZE_API_VERSION_1_2) { + dditable.pfnSetCacheAdviceExt = pDdiTable->pfnSetCacheAdviceExt; + pDdiTable->pfnSetCacheAdviceExt = tracing_layer::zeDeviceSetCacheAdviceExt; + } + if (version >= ZE_API_VERSION_1_3) { + dditable.pfnPciGetPropertiesExt = pDdiTable->pfnPciGetPropertiesExt; + pDdiTable->pfnPciGetPropertiesExt = tracing_layer::zeDevicePciGetPropertiesExt; + } + if (version >= ZE_API_VERSION_1_7) { + dditable.pfnGetRootDevice = pDdiTable->pfnGetRootDevice; + pDdiTable->pfnGetRootDevice = tracing_layer::zeDeviceGetRootDevice; + } return result; } @@ -8036,15 +8069,15 @@ zeGetDeviceExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(tracing_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(tracing_layer::context.version) > ZE_MINOR_VERSION(version)) + if (tracing_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetFabricVertexExp = pDdiTable->pfnGetFabricVertexExp; - pDdiTable->pfnGetFabricVertexExp = tracing_layer::zeDeviceGetFabricVertexExp; - + if (version >= ZE_API_VERSION_1_4) { + dditable.pfnGetFabricVertexExp = pDdiTable->pfnGetFabricVertexExp; + pDdiTable->pfnGetFabricVertexExp = tracing_layer::zeDeviceGetFabricVertexExp; + } return result; } @@ -8067,39 +8100,47 @@ zeGetContextProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(tracing_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(tracing_layer::context.version) > ZE_MINOR_VERSION(version)) + if (tracing_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnCreate = pDdiTable->pfnCreate; - pDdiTable->pfnCreate = tracing_layer::zeContextCreate; - - dditable.pfnDestroy = pDdiTable->pfnDestroy; - pDdiTable->pfnDestroy = tracing_layer::zeContextDestroy; - - dditable.pfnGetStatus = pDdiTable->pfnGetStatus; - pDdiTable->pfnGetStatus = tracing_layer::zeContextGetStatus; - - dditable.pfnSystemBarrier = pDdiTable->pfnSystemBarrier; - pDdiTable->pfnSystemBarrier = tracing_layer::zeContextSystemBarrier; - - dditable.pfnMakeMemoryResident = pDdiTable->pfnMakeMemoryResident; - pDdiTable->pfnMakeMemoryResident = tracing_layer::zeContextMakeMemoryResident; - - dditable.pfnEvictMemory = pDdiTable->pfnEvictMemory; - pDdiTable->pfnEvictMemory = tracing_layer::zeContextEvictMemory; - - dditable.pfnMakeImageResident = pDdiTable->pfnMakeImageResident; - pDdiTable->pfnMakeImageResident = tracing_layer::zeContextMakeImageResident; - - dditable.pfnEvictImage = pDdiTable->pfnEvictImage; - pDdiTable->pfnEvictImage = tracing_layer::zeContextEvictImage; - - dditable.pfnCreateEx = pDdiTable->pfnCreateEx; - pDdiTable->pfnCreateEx = tracing_layer::zeContextCreateEx; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCreate = pDdiTable->pfnCreate; + pDdiTable->pfnCreate = tracing_layer::zeContextCreate; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnDestroy = pDdiTable->pfnDestroy; + pDdiTable->pfnDestroy = tracing_layer::zeContextDestroy; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetStatus = pDdiTable->pfnGetStatus; + pDdiTable->pfnGetStatus = tracing_layer::zeContextGetStatus; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSystemBarrier = pDdiTable->pfnSystemBarrier; + pDdiTable->pfnSystemBarrier = tracing_layer::zeContextSystemBarrier; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnMakeMemoryResident = pDdiTable->pfnMakeMemoryResident; + pDdiTable->pfnMakeMemoryResident = tracing_layer::zeContextMakeMemoryResident; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnEvictMemory = pDdiTable->pfnEvictMemory; + pDdiTable->pfnEvictMemory = tracing_layer::zeContextEvictMemory; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnMakeImageResident = pDdiTable->pfnMakeImageResident; + pDdiTable->pfnMakeImageResident = tracing_layer::zeContextMakeImageResident; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnEvictImage = pDdiTable->pfnEvictImage; + pDdiTable->pfnEvictImage = tracing_layer::zeContextEvictImage; + } + if (version >= ZE_API_VERSION_1_1) { + dditable.pfnCreateEx = pDdiTable->pfnCreateEx; + pDdiTable->pfnCreateEx = tracing_layer::zeContextCreateEx; + } return result; } @@ -8122,30 +8163,35 @@ zeGetCommandQueueProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(tracing_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(tracing_layer::context.version) > ZE_MINOR_VERSION(version)) + if (tracing_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnCreate = pDdiTable->pfnCreate; - pDdiTable->pfnCreate = tracing_layer::zeCommandQueueCreate; - - dditable.pfnDestroy = pDdiTable->pfnDestroy; - pDdiTable->pfnDestroy = tracing_layer::zeCommandQueueDestroy; - - dditable.pfnExecuteCommandLists = pDdiTable->pfnExecuteCommandLists; - pDdiTable->pfnExecuteCommandLists = tracing_layer::zeCommandQueueExecuteCommandLists; - - dditable.pfnSynchronize = pDdiTable->pfnSynchronize; - pDdiTable->pfnSynchronize = tracing_layer::zeCommandQueueSynchronize; - - dditable.pfnGetOrdinal = pDdiTable->pfnGetOrdinal; - pDdiTable->pfnGetOrdinal = tracing_layer::zeCommandQueueGetOrdinal; - - dditable.pfnGetIndex = pDdiTable->pfnGetIndex; - pDdiTable->pfnGetIndex = tracing_layer::zeCommandQueueGetIndex; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCreate = pDdiTable->pfnCreate; + pDdiTable->pfnCreate = tracing_layer::zeCommandQueueCreate; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnDestroy = pDdiTable->pfnDestroy; + pDdiTable->pfnDestroy = tracing_layer::zeCommandQueueDestroy; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnExecuteCommandLists = pDdiTable->pfnExecuteCommandLists; + pDdiTable->pfnExecuteCommandLists = tracing_layer::zeCommandQueueExecuteCommandLists; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSynchronize = pDdiTable->pfnSynchronize; + pDdiTable->pfnSynchronize = tracing_layer::zeCommandQueueSynchronize; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetOrdinal = pDdiTable->pfnGetOrdinal; + pDdiTable->pfnGetOrdinal = tracing_layer::zeCommandQueueGetOrdinal; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetIndex = pDdiTable->pfnGetIndex; + pDdiTable->pfnGetIndex = tracing_layer::zeCommandQueueGetIndex; + } return result; } @@ -8168,120 +8214,155 @@ zeGetCommandListProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(tracing_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(tracing_layer::context.version) > ZE_MINOR_VERSION(version)) + if (tracing_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnCreate = pDdiTable->pfnCreate; - pDdiTable->pfnCreate = tracing_layer::zeCommandListCreate; - - dditable.pfnCreateImmediate = pDdiTable->pfnCreateImmediate; - pDdiTable->pfnCreateImmediate = tracing_layer::zeCommandListCreateImmediate; - - dditable.pfnDestroy = pDdiTable->pfnDestroy; - pDdiTable->pfnDestroy = tracing_layer::zeCommandListDestroy; - - dditable.pfnClose = pDdiTable->pfnClose; - pDdiTable->pfnClose = tracing_layer::zeCommandListClose; - - dditable.pfnReset = pDdiTable->pfnReset; - pDdiTable->pfnReset = tracing_layer::zeCommandListReset; - - dditable.pfnAppendWriteGlobalTimestamp = pDdiTable->pfnAppendWriteGlobalTimestamp; - pDdiTable->pfnAppendWriteGlobalTimestamp = tracing_layer::zeCommandListAppendWriteGlobalTimestamp; - - dditable.pfnAppendBarrier = pDdiTable->pfnAppendBarrier; - pDdiTable->pfnAppendBarrier = tracing_layer::zeCommandListAppendBarrier; - - dditable.pfnAppendMemoryRangesBarrier = pDdiTable->pfnAppendMemoryRangesBarrier; - pDdiTable->pfnAppendMemoryRangesBarrier = tracing_layer::zeCommandListAppendMemoryRangesBarrier; - - dditable.pfnAppendMemoryCopy = pDdiTable->pfnAppendMemoryCopy; - pDdiTable->pfnAppendMemoryCopy = tracing_layer::zeCommandListAppendMemoryCopy; - - dditable.pfnAppendMemoryFill = pDdiTable->pfnAppendMemoryFill; - pDdiTable->pfnAppendMemoryFill = tracing_layer::zeCommandListAppendMemoryFill; - - dditable.pfnAppendMemoryCopyRegion = pDdiTable->pfnAppendMemoryCopyRegion; - pDdiTable->pfnAppendMemoryCopyRegion = tracing_layer::zeCommandListAppendMemoryCopyRegion; - - dditable.pfnAppendMemoryCopyFromContext = pDdiTable->pfnAppendMemoryCopyFromContext; - pDdiTable->pfnAppendMemoryCopyFromContext = tracing_layer::zeCommandListAppendMemoryCopyFromContext; - - dditable.pfnAppendImageCopy = pDdiTable->pfnAppendImageCopy; - pDdiTable->pfnAppendImageCopy = tracing_layer::zeCommandListAppendImageCopy; - - dditable.pfnAppendImageCopyRegion = pDdiTable->pfnAppendImageCopyRegion; - pDdiTable->pfnAppendImageCopyRegion = tracing_layer::zeCommandListAppendImageCopyRegion; - - dditable.pfnAppendImageCopyToMemory = pDdiTable->pfnAppendImageCopyToMemory; - pDdiTable->pfnAppendImageCopyToMemory = tracing_layer::zeCommandListAppendImageCopyToMemory; - - dditable.pfnAppendImageCopyFromMemory = pDdiTable->pfnAppendImageCopyFromMemory; - pDdiTable->pfnAppendImageCopyFromMemory = tracing_layer::zeCommandListAppendImageCopyFromMemory; - - dditable.pfnAppendMemoryPrefetch = pDdiTable->pfnAppendMemoryPrefetch; - pDdiTable->pfnAppendMemoryPrefetch = tracing_layer::zeCommandListAppendMemoryPrefetch; - - dditable.pfnAppendMemAdvise = pDdiTable->pfnAppendMemAdvise; - pDdiTable->pfnAppendMemAdvise = tracing_layer::zeCommandListAppendMemAdvise; - - dditable.pfnAppendSignalEvent = pDdiTable->pfnAppendSignalEvent; - pDdiTable->pfnAppendSignalEvent = tracing_layer::zeCommandListAppendSignalEvent; - - dditable.pfnAppendWaitOnEvents = pDdiTable->pfnAppendWaitOnEvents; - pDdiTable->pfnAppendWaitOnEvents = tracing_layer::zeCommandListAppendWaitOnEvents; - - dditable.pfnAppendEventReset = pDdiTable->pfnAppendEventReset; - pDdiTable->pfnAppendEventReset = tracing_layer::zeCommandListAppendEventReset; - - dditable.pfnAppendQueryKernelTimestamps = pDdiTable->pfnAppendQueryKernelTimestamps; - pDdiTable->pfnAppendQueryKernelTimestamps = tracing_layer::zeCommandListAppendQueryKernelTimestamps; - - dditable.pfnAppendLaunchKernel = pDdiTable->pfnAppendLaunchKernel; - pDdiTable->pfnAppendLaunchKernel = tracing_layer::zeCommandListAppendLaunchKernel; - - dditable.pfnAppendLaunchCooperativeKernel = pDdiTable->pfnAppendLaunchCooperativeKernel; - pDdiTable->pfnAppendLaunchCooperativeKernel = tracing_layer::zeCommandListAppendLaunchCooperativeKernel; - - dditable.pfnAppendLaunchKernelIndirect = pDdiTable->pfnAppendLaunchKernelIndirect; - pDdiTable->pfnAppendLaunchKernelIndirect = tracing_layer::zeCommandListAppendLaunchKernelIndirect; - - dditable.pfnAppendLaunchMultipleKernelsIndirect = pDdiTable->pfnAppendLaunchMultipleKernelsIndirect; - pDdiTable->pfnAppendLaunchMultipleKernelsIndirect = tracing_layer::zeCommandListAppendLaunchMultipleKernelsIndirect; - - dditable.pfnAppendSignalExternalSemaphoreExt = pDdiTable->pfnAppendSignalExternalSemaphoreExt; - pDdiTable->pfnAppendSignalExternalSemaphoreExt = tracing_layer::zeCommandListAppendSignalExternalSemaphoreExt; - - dditable.pfnAppendWaitExternalSemaphoreExt = pDdiTable->pfnAppendWaitExternalSemaphoreExt; - pDdiTable->pfnAppendWaitExternalSemaphoreExt = tracing_layer::zeCommandListAppendWaitExternalSemaphoreExt; - - dditable.pfnAppendImageCopyToMemoryExt = pDdiTable->pfnAppendImageCopyToMemoryExt; - pDdiTable->pfnAppendImageCopyToMemoryExt = tracing_layer::zeCommandListAppendImageCopyToMemoryExt; - - dditable.pfnAppendImageCopyFromMemoryExt = pDdiTable->pfnAppendImageCopyFromMemoryExt; - pDdiTable->pfnAppendImageCopyFromMemoryExt = tracing_layer::zeCommandListAppendImageCopyFromMemoryExt; - - dditable.pfnHostSynchronize = pDdiTable->pfnHostSynchronize; - pDdiTable->pfnHostSynchronize = tracing_layer::zeCommandListHostSynchronize; - - dditable.pfnGetDeviceHandle = pDdiTable->pfnGetDeviceHandle; - pDdiTable->pfnGetDeviceHandle = tracing_layer::zeCommandListGetDeviceHandle; - - dditable.pfnGetContextHandle = pDdiTable->pfnGetContextHandle; - pDdiTable->pfnGetContextHandle = tracing_layer::zeCommandListGetContextHandle; - - dditable.pfnGetOrdinal = pDdiTable->pfnGetOrdinal; - pDdiTable->pfnGetOrdinal = tracing_layer::zeCommandListGetOrdinal; - - dditable.pfnImmediateGetIndex = pDdiTable->pfnImmediateGetIndex; - pDdiTable->pfnImmediateGetIndex = tracing_layer::zeCommandListImmediateGetIndex; - - dditable.pfnIsImmediate = pDdiTable->pfnIsImmediate; - pDdiTable->pfnIsImmediate = tracing_layer::zeCommandListIsImmediate; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCreate = pDdiTable->pfnCreate; + pDdiTable->pfnCreate = tracing_layer::zeCommandListCreate; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCreateImmediate = pDdiTable->pfnCreateImmediate; + pDdiTable->pfnCreateImmediate = tracing_layer::zeCommandListCreateImmediate; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnDestroy = pDdiTable->pfnDestroy; + pDdiTable->pfnDestroy = tracing_layer::zeCommandListDestroy; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnClose = pDdiTable->pfnClose; + pDdiTable->pfnClose = tracing_layer::zeCommandListClose; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnReset = pDdiTable->pfnReset; + pDdiTable->pfnReset = tracing_layer::zeCommandListReset; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendWriteGlobalTimestamp = pDdiTable->pfnAppendWriteGlobalTimestamp; + pDdiTable->pfnAppendWriteGlobalTimestamp = tracing_layer::zeCommandListAppendWriteGlobalTimestamp; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendBarrier = pDdiTable->pfnAppendBarrier; + pDdiTable->pfnAppendBarrier = tracing_layer::zeCommandListAppendBarrier; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendMemoryRangesBarrier = pDdiTable->pfnAppendMemoryRangesBarrier; + pDdiTable->pfnAppendMemoryRangesBarrier = tracing_layer::zeCommandListAppendMemoryRangesBarrier; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendMemoryCopy = pDdiTable->pfnAppendMemoryCopy; + pDdiTable->pfnAppendMemoryCopy = tracing_layer::zeCommandListAppendMemoryCopy; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendMemoryFill = pDdiTable->pfnAppendMemoryFill; + pDdiTable->pfnAppendMemoryFill = tracing_layer::zeCommandListAppendMemoryFill; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendMemoryCopyRegion = pDdiTable->pfnAppendMemoryCopyRegion; + pDdiTable->pfnAppendMemoryCopyRegion = tracing_layer::zeCommandListAppendMemoryCopyRegion; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendMemoryCopyFromContext = pDdiTable->pfnAppendMemoryCopyFromContext; + pDdiTable->pfnAppendMemoryCopyFromContext = tracing_layer::zeCommandListAppendMemoryCopyFromContext; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendImageCopy = pDdiTable->pfnAppendImageCopy; + pDdiTable->pfnAppendImageCopy = tracing_layer::zeCommandListAppendImageCopy; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendImageCopyRegion = pDdiTable->pfnAppendImageCopyRegion; + pDdiTable->pfnAppendImageCopyRegion = tracing_layer::zeCommandListAppendImageCopyRegion; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendImageCopyToMemory = pDdiTable->pfnAppendImageCopyToMemory; + pDdiTable->pfnAppendImageCopyToMemory = tracing_layer::zeCommandListAppendImageCopyToMemory; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendImageCopyFromMemory = pDdiTable->pfnAppendImageCopyFromMemory; + pDdiTable->pfnAppendImageCopyFromMemory = tracing_layer::zeCommandListAppendImageCopyFromMemory; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendMemoryPrefetch = pDdiTable->pfnAppendMemoryPrefetch; + pDdiTable->pfnAppendMemoryPrefetch = tracing_layer::zeCommandListAppendMemoryPrefetch; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendMemAdvise = pDdiTable->pfnAppendMemAdvise; + pDdiTable->pfnAppendMemAdvise = tracing_layer::zeCommandListAppendMemAdvise; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendSignalEvent = pDdiTable->pfnAppendSignalEvent; + pDdiTable->pfnAppendSignalEvent = tracing_layer::zeCommandListAppendSignalEvent; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendWaitOnEvents = pDdiTable->pfnAppendWaitOnEvents; + pDdiTable->pfnAppendWaitOnEvents = tracing_layer::zeCommandListAppendWaitOnEvents; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendEventReset = pDdiTable->pfnAppendEventReset; + pDdiTable->pfnAppendEventReset = tracing_layer::zeCommandListAppendEventReset; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendQueryKernelTimestamps = pDdiTable->pfnAppendQueryKernelTimestamps; + pDdiTable->pfnAppendQueryKernelTimestamps = tracing_layer::zeCommandListAppendQueryKernelTimestamps; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendLaunchKernel = pDdiTable->pfnAppendLaunchKernel; + pDdiTable->pfnAppendLaunchKernel = tracing_layer::zeCommandListAppendLaunchKernel; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendLaunchCooperativeKernel = pDdiTable->pfnAppendLaunchCooperativeKernel; + pDdiTable->pfnAppendLaunchCooperativeKernel = tracing_layer::zeCommandListAppendLaunchCooperativeKernel; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendLaunchKernelIndirect = pDdiTable->pfnAppendLaunchKernelIndirect; + pDdiTable->pfnAppendLaunchKernelIndirect = tracing_layer::zeCommandListAppendLaunchKernelIndirect; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendLaunchMultipleKernelsIndirect = pDdiTable->pfnAppendLaunchMultipleKernelsIndirect; + pDdiTable->pfnAppendLaunchMultipleKernelsIndirect = tracing_layer::zeCommandListAppendLaunchMultipleKernelsIndirect; + } + if (version >= ZE_API_VERSION_1_12) { + dditable.pfnAppendSignalExternalSemaphoreExt = pDdiTable->pfnAppendSignalExternalSemaphoreExt; + pDdiTable->pfnAppendSignalExternalSemaphoreExt = tracing_layer::zeCommandListAppendSignalExternalSemaphoreExt; + } + if (version >= ZE_API_VERSION_1_12) { + dditable.pfnAppendWaitExternalSemaphoreExt = pDdiTable->pfnAppendWaitExternalSemaphoreExt; + pDdiTable->pfnAppendWaitExternalSemaphoreExt = tracing_layer::zeCommandListAppendWaitExternalSemaphoreExt; + } + if (version >= ZE_API_VERSION_1_3) { + dditable.pfnAppendImageCopyToMemoryExt = pDdiTable->pfnAppendImageCopyToMemoryExt; + pDdiTable->pfnAppendImageCopyToMemoryExt = tracing_layer::zeCommandListAppendImageCopyToMemoryExt; + } + if (version >= ZE_API_VERSION_1_3) { + dditable.pfnAppendImageCopyFromMemoryExt = pDdiTable->pfnAppendImageCopyFromMemoryExt; + pDdiTable->pfnAppendImageCopyFromMemoryExt = tracing_layer::zeCommandListAppendImageCopyFromMemoryExt; + } + if (version >= ZE_API_VERSION_1_6) { + dditable.pfnHostSynchronize = pDdiTable->pfnHostSynchronize; + pDdiTable->pfnHostSynchronize = tracing_layer::zeCommandListHostSynchronize; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetDeviceHandle = pDdiTable->pfnGetDeviceHandle; + pDdiTable->pfnGetDeviceHandle = tracing_layer::zeCommandListGetDeviceHandle; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetContextHandle = pDdiTable->pfnGetContextHandle; + pDdiTable->pfnGetContextHandle = tracing_layer::zeCommandListGetContextHandle; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetOrdinal = pDdiTable->pfnGetOrdinal; + pDdiTable->pfnGetOrdinal = tracing_layer::zeCommandListGetOrdinal; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnImmediateGetIndex = pDdiTable->pfnImmediateGetIndex; + pDdiTable->pfnImmediateGetIndex = tracing_layer::zeCommandListImmediateGetIndex; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnIsImmediate = pDdiTable->pfnIsImmediate; + pDdiTable->pfnIsImmediate = tracing_layer::zeCommandListIsImmediate; + } return result; } @@ -8304,36 +8385,43 @@ zeGetCommandListExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(tracing_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(tracing_layer::context.version) > ZE_MINOR_VERSION(version)) + if (tracing_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetNextCommandIdWithKernelsExp = pDdiTable->pfnGetNextCommandIdWithKernelsExp; - pDdiTable->pfnGetNextCommandIdWithKernelsExp = tracing_layer::zeCommandListGetNextCommandIdWithKernelsExp; - - dditable.pfnUpdateMutableCommandKernelsExp = pDdiTable->pfnUpdateMutableCommandKernelsExp; - pDdiTable->pfnUpdateMutableCommandKernelsExp = tracing_layer::zeCommandListUpdateMutableCommandKernelsExp; - - dditable.pfnCreateCloneExp = pDdiTable->pfnCreateCloneExp; - pDdiTable->pfnCreateCloneExp = tracing_layer::zeCommandListCreateCloneExp; - - dditable.pfnImmediateAppendCommandListsExp = pDdiTable->pfnImmediateAppendCommandListsExp; - pDdiTable->pfnImmediateAppendCommandListsExp = tracing_layer::zeCommandListImmediateAppendCommandListsExp; - - dditable.pfnGetNextCommandIdExp = pDdiTable->pfnGetNextCommandIdExp; - pDdiTable->pfnGetNextCommandIdExp = tracing_layer::zeCommandListGetNextCommandIdExp; - - dditable.pfnUpdateMutableCommandsExp = pDdiTable->pfnUpdateMutableCommandsExp; - pDdiTable->pfnUpdateMutableCommandsExp = tracing_layer::zeCommandListUpdateMutableCommandsExp; - - dditable.pfnUpdateMutableCommandSignalEventExp = pDdiTable->pfnUpdateMutableCommandSignalEventExp; - pDdiTable->pfnUpdateMutableCommandSignalEventExp = tracing_layer::zeCommandListUpdateMutableCommandSignalEventExp; - - dditable.pfnUpdateMutableCommandWaitEventsExp = pDdiTable->pfnUpdateMutableCommandWaitEventsExp; - pDdiTable->pfnUpdateMutableCommandWaitEventsExp = tracing_layer::zeCommandListUpdateMutableCommandWaitEventsExp; - + if (version >= ZE_API_VERSION_1_10) { + dditable.pfnGetNextCommandIdWithKernelsExp = pDdiTable->pfnGetNextCommandIdWithKernelsExp; + pDdiTable->pfnGetNextCommandIdWithKernelsExp = tracing_layer::zeCommandListGetNextCommandIdWithKernelsExp; + } + if (version >= ZE_API_VERSION_1_10) { + dditable.pfnUpdateMutableCommandKernelsExp = pDdiTable->pfnUpdateMutableCommandKernelsExp; + pDdiTable->pfnUpdateMutableCommandKernelsExp = tracing_layer::zeCommandListUpdateMutableCommandKernelsExp; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnCreateCloneExp = pDdiTable->pfnCreateCloneExp; + pDdiTable->pfnCreateCloneExp = tracing_layer::zeCommandListCreateCloneExp; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnImmediateAppendCommandListsExp = pDdiTable->pfnImmediateAppendCommandListsExp; + pDdiTable->pfnImmediateAppendCommandListsExp = tracing_layer::zeCommandListImmediateAppendCommandListsExp; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetNextCommandIdExp = pDdiTable->pfnGetNextCommandIdExp; + pDdiTable->pfnGetNextCommandIdExp = tracing_layer::zeCommandListGetNextCommandIdExp; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnUpdateMutableCommandsExp = pDdiTable->pfnUpdateMutableCommandsExp; + pDdiTable->pfnUpdateMutableCommandsExp = tracing_layer::zeCommandListUpdateMutableCommandsExp; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnUpdateMutableCommandSignalEventExp = pDdiTable->pfnUpdateMutableCommandSignalEventExp; + pDdiTable->pfnUpdateMutableCommandSignalEventExp = tracing_layer::zeCommandListUpdateMutableCommandSignalEventExp; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnUpdateMutableCommandWaitEventsExp = pDdiTable->pfnUpdateMutableCommandWaitEventsExp; + pDdiTable->pfnUpdateMutableCommandWaitEventsExp = tracing_layer::zeCommandListUpdateMutableCommandWaitEventsExp; + } return result; } @@ -8356,45 +8444,55 @@ zeGetEventProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(tracing_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(tracing_layer::context.version) > ZE_MINOR_VERSION(version)) + if (tracing_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnCreate = pDdiTable->pfnCreate; - pDdiTable->pfnCreate = tracing_layer::zeEventCreate; - - dditable.pfnDestroy = pDdiTable->pfnDestroy; - pDdiTable->pfnDestroy = tracing_layer::zeEventDestroy; - - dditable.pfnHostSignal = pDdiTable->pfnHostSignal; - pDdiTable->pfnHostSignal = tracing_layer::zeEventHostSignal; - - dditable.pfnHostSynchronize = pDdiTable->pfnHostSynchronize; - pDdiTable->pfnHostSynchronize = tracing_layer::zeEventHostSynchronize; - - dditable.pfnQueryStatus = pDdiTable->pfnQueryStatus; - pDdiTable->pfnQueryStatus = tracing_layer::zeEventQueryStatus; - - dditable.pfnHostReset = pDdiTable->pfnHostReset; - pDdiTable->pfnHostReset = tracing_layer::zeEventHostReset; - - dditable.pfnQueryKernelTimestamp = pDdiTable->pfnQueryKernelTimestamp; - pDdiTable->pfnQueryKernelTimestamp = tracing_layer::zeEventQueryKernelTimestamp; - - dditable.pfnQueryKernelTimestampsExt = pDdiTable->pfnQueryKernelTimestampsExt; - pDdiTable->pfnQueryKernelTimestampsExt = tracing_layer::zeEventQueryKernelTimestampsExt; - - dditable.pfnGetEventPool = pDdiTable->pfnGetEventPool; - pDdiTable->pfnGetEventPool = tracing_layer::zeEventGetEventPool; - - dditable.pfnGetSignalScope = pDdiTable->pfnGetSignalScope; - pDdiTable->pfnGetSignalScope = tracing_layer::zeEventGetSignalScope; - - dditable.pfnGetWaitScope = pDdiTable->pfnGetWaitScope; - pDdiTable->pfnGetWaitScope = tracing_layer::zeEventGetWaitScope; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCreate = pDdiTable->pfnCreate; + pDdiTable->pfnCreate = tracing_layer::zeEventCreate; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnDestroy = pDdiTable->pfnDestroy; + pDdiTable->pfnDestroy = tracing_layer::zeEventDestroy; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnHostSignal = pDdiTable->pfnHostSignal; + pDdiTable->pfnHostSignal = tracing_layer::zeEventHostSignal; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnHostSynchronize = pDdiTable->pfnHostSynchronize; + pDdiTable->pfnHostSynchronize = tracing_layer::zeEventHostSynchronize; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnQueryStatus = pDdiTable->pfnQueryStatus; + pDdiTable->pfnQueryStatus = tracing_layer::zeEventQueryStatus; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnHostReset = pDdiTable->pfnHostReset; + pDdiTable->pfnHostReset = tracing_layer::zeEventHostReset; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnQueryKernelTimestamp = pDdiTable->pfnQueryKernelTimestamp; + pDdiTable->pfnQueryKernelTimestamp = tracing_layer::zeEventQueryKernelTimestamp; + } + if (version >= ZE_API_VERSION_1_6) { + dditable.pfnQueryKernelTimestampsExt = pDdiTable->pfnQueryKernelTimestampsExt; + pDdiTable->pfnQueryKernelTimestampsExt = tracing_layer::zeEventQueryKernelTimestampsExt; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetEventPool = pDdiTable->pfnGetEventPool; + pDdiTable->pfnGetEventPool = tracing_layer::zeEventGetEventPool; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetSignalScope = pDdiTable->pfnGetSignalScope; + pDdiTable->pfnGetSignalScope = tracing_layer::zeEventGetSignalScope; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetWaitScope = pDdiTable->pfnGetWaitScope; + pDdiTable->pfnGetWaitScope = tracing_layer::zeEventGetWaitScope; + } return result; } @@ -8417,15 +8515,15 @@ zeGetEventExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(tracing_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(tracing_layer::context.version) > ZE_MINOR_VERSION(version)) + if (tracing_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnQueryTimestampsExp = pDdiTable->pfnQueryTimestampsExp; - pDdiTable->pfnQueryTimestampsExp = tracing_layer::zeEventQueryTimestampsExp; - + if (version >= ZE_API_VERSION_1_2) { + dditable.pfnQueryTimestampsExp = pDdiTable->pfnQueryTimestampsExp; + pDdiTable->pfnQueryTimestampsExp = tracing_layer::zeEventQueryTimestampsExp; + } return result; } @@ -8448,36 +8546,43 @@ zeGetEventPoolProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(tracing_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(tracing_layer::context.version) > ZE_MINOR_VERSION(version)) + if (tracing_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnCreate = pDdiTable->pfnCreate; - pDdiTable->pfnCreate = tracing_layer::zeEventPoolCreate; - - dditable.pfnDestroy = pDdiTable->pfnDestroy; - pDdiTable->pfnDestroy = tracing_layer::zeEventPoolDestroy; - - dditable.pfnGetIpcHandle = pDdiTable->pfnGetIpcHandle; - pDdiTable->pfnGetIpcHandle = tracing_layer::zeEventPoolGetIpcHandle; - - dditable.pfnOpenIpcHandle = pDdiTable->pfnOpenIpcHandle; - pDdiTable->pfnOpenIpcHandle = tracing_layer::zeEventPoolOpenIpcHandle; - - dditable.pfnCloseIpcHandle = pDdiTable->pfnCloseIpcHandle; - pDdiTable->pfnCloseIpcHandle = tracing_layer::zeEventPoolCloseIpcHandle; - - dditable.pfnPutIpcHandle = pDdiTable->pfnPutIpcHandle; - pDdiTable->pfnPutIpcHandle = tracing_layer::zeEventPoolPutIpcHandle; - - dditable.pfnGetContextHandle = pDdiTable->pfnGetContextHandle; - pDdiTable->pfnGetContextHandle = tracing_layer::zeEventPoolGetContextHandle; - - dditable.pfnGetFlags = pDdiTable->pfnGetFlags; - pDdiTable->pfnGetFlags = tracing_layer::zeEventPoolGetFlags; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCreate = pDdiTable->pfnCreate; + pDdiTable->pfnCreate = tracing_layer::zeEventPoolCreate; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnDestroy = pDdiTable->pfnDestroy; + pDdiTable->pfnDestroy = tracing_layer::zeEventPoolDestroy; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetIpcHandle = pDdiTable->pfnGetIpcHandle; + pDdiTable->pfnGetIpcHandle = tracing_layer::zeEventPoolGetIpcHandle; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnOpenIpcHandle = pDdiTable->pfnOpenIpcHandle; + pDdiTable->pfnOpenIpcHandle = tracing_layer::zeEventPoolOpenIpcHandle; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCloseIpcHandle = pDdiTable->pfnCloseIpcHandle; + pDdiTable->pfnCloseIpcHandle = tracing_layer::zeEventPoolCloseIpcHandle; + } + if (version >= ZE_API_VERSION_1_6) { + dditable.pfnPutIpcHandle = pDdiTable->pfnPutIpcHandle; + pDdiTable->pfnPutIpcHandle = tracing_layer::zeEventPoolPutIpcHandle; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetContextHandle = pDdiTable->pfnGetContextHandle; + pDdiTable->pfnGetContextHandle = tracing_layer::zeEventPoolGetContextHandle; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetFlags = pDdiTable->pfnGetFlags; + pDdiTable->pfnGetFlags = tracing_layer::zeEventPoolGetFlags; + } return result; } @@ -8500,27 +8605,31 @@ zeGetFenceProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(tracing_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(tracing_layer::context.version) > ZE_MINOR_VERSION(version)) + if (tracing_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnCreate = pDdiTable->pfnCreate; - pDdiTable->pfnCreate = tracing_layer::zeFenceCreate; - - dditable.pfnDestroy = pDdiTable->pfnDestroy; - pDdiTable->pfnDestroy = tracing_layer::zeFenceDestroy; - - dditable.pfnHostSynchronize = pDdiTable->pfnHostSynchronize; - pDdiTable->pfnHostSynchronize = tracing_layer::zeFenceHostSynchronize; - - dditable.pfnQueryStatus = pDdiTable->pfnQueryStatus; - pDdiTable->pfnQueryStatus = tracing_layer::zeFenceQueryStatus; - - dditable.pfnReset = pDdiTable->pfnReset; - pDdiTable->pfnReset = tracing_layer::zeFenceReset; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCreate = pDdiTable->pfnCreate; + pDdiTable->pfnCreate = tracing_layer::zeFenceCreate; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnDestroy = pDdiTable->pfnDestroy; + pDdiTable->pfnDestroy = tracing_layer::zeFenceDestroy; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnHostSynchronize = pDdiTable->pfnHostSynchronize; + pDdiTable->pfnHostSynchronize = tracing_layer::zeFenceHostSynchronize; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnQueryStatus = pDdiTable->pfnQueryStatus; + pDdiTable->pfnQueryStatus = tracing_layer::zeFenceQueryStatus; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnReset = pDdiTable->pfnReset; + pDdiTable->pfnReset = tracing_layer::zeFenceReset; + } return result; } @@ -8543,27 +8652,31 @@ zeGetImageProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(tracing_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(tracing_layer::context.version) > ZE_MINOR_VERSION(version)) + if (tracing_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetProperties = pDdiTable->pfnGetProperties; - pDdiTable->pfnGetProperties = tracing_layer::zeImageGetProperties; - - dditable.pfnCreate = pDdiTable->pfnCreate; - pDdiTable->pfnCreate = tracing_layer::zeImageCreate; - - dditable.pfnDestroy = pDdiTable->pfnDestroy; - pDdiTable->pfnDestroy = tracing_layer::zeImageDestroy; - - dditable.pfnGetAllocPropertiesExt = pDdiTable->pfnGetAllocPropertiesExt; - pDdiTable->pfnGetAllocPropertiesExt = tracing_layer::zeImageGetAllocPropertiesExt; - - dditable.pfnViewCreateExt = pDdiTable->pfnViewCreateExt; - pDdiTable->pfnViewCreateExt = tracing_layer::zeImageViewCreateExt; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetProperties = pDdiTable->pfnGetProperties; + pDdiTable->pfnGetProperties = tracing_layer::zeImageGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCreate = pDdiTable->pfnCreate; + pDdiTable->pfnCreate = tracing_layer::zeImageCreate; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnDestroy = pDdiTable->pfnDestroy; + pDdiTable->pfnDestroy = tracing_layer::zeImageDestroy; + } + if (version >= ZE_API_VERSION_1_3) { + dditable.pfnGetAllocPropertiesExt = pDdiTable->pfnGetAllocPropertiesExt; + pDdiTable->pfnGetAllocPropertiesExt = tracing_layer::zeImageGetAllocPropertiesExt; + } + if (version >= ZE_API_VERSION_1_5) { + dditable.pfnViewCreateExt = pDdiTable->pfnViewCreateExt; + pDdiTable->pfnViewCreateExt = tracing_layer::zeImageViewCreateExt; + } return result; } @@ -8586,21 +8699,23 @@ zeGetImageExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(tracing_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(tracing_layer::context.version) > ZE_MINOR_VERSION(version)) + if (tracing_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetMemoryPropertiesExp = pDdiTable->pfnGetMemoryPropertiesExp; - pDdiTable->pfnGetMemoryPropertiesExp = tracing_layer::zeImageGetMemoryPropertiesExp; - - dditable.pfnViewCreateExp = pDdiTable->pfnViewCreateExp; - pDdiTable->pfnViewCreateExp = tracing_layer::zeImageViewCreateExp; - - dditable.pfnGetDeviceOffsetExp = pDdiTable->pfnGetDeviceOffsetExp; - pDdiTable->pfnGetDeviceOffsetExp = tracing_layer::zeImageGetDeviceOffsetExp; - + if (version >= ZE_API_VERSION_1_2) { + dditable.pfnGetMemoryPropertiesExp = pDdiTable->pfnGetMemoryPropertiesExp; + pDdiTable->pfnGetMemoryPropertiesExp = tracing_layer::zeImageGetMemoryPropertiesExp; + } + if (version >= ZE_API_VERSION_1_2) { + dditable.pfnViewCreateExp = pDdiTable->pfnViewCreateExp; + pDdiTable->pfnViewCreateExp = tracing_layer::zeImageViewCreateExp; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetDeviceOffsetExp = pDdiTable->pfnGetDeviceOffsetExp; + pDdiTable->pfnGetDeviceOffsetExp = tracing_layer::zeImageGetDeviceOffsetExp; + } return result; } @@ -8623,48 +8738,59 @@ zeGetKernelProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(tracing_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(tracing_layer::context.version) > ZE_MINOR_VERSION(version)) + if (tracing_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnCreate = pDdiTable->pfnCreate; - pDdiTable->pfnCreate = tracing_layer::zeKernelCreate; - - dditable.pfnDestroy = pDdiTable->pfnDestroy; - pDdiTable->pfnDestroy = tracing_layer::zeKernelDestroy; - - dditable.pfnSetCacheConfig = pDdiTable->pfnSetCacheConfig; - pDdiTable->pfnSetCacheConfig = tracing_layer::zeKernelSetCacheConfig; - - dditable.pfnSetGroupSize = pDdiTable->pfnSetGroupSize; - pDdiTable->pfnSetGroupSize = tracing_layer::zeKernelSetGroupSize; - - dditable.pfnSuggestGroupSize = pDdiTable->pfnSuggestGroupSize; - pDdiTable->pfnSuggestGroupSize = tracing_layer::zeKernelSuggestGroupSize; - - dditable.pfnSuggestMaxCooperativeGroupCount = pDdiTable->pfnSuggestMaxCooperativeGroupCount; - pDdiTable->pfnSuggestMaxCooperativeGroupCount = tracing_layer::zeKernelSuggestMaxCooperativeGroupCount; - - dditable.pfnSetArgumentValue = pDdiTable->pfnSetArgumentValue; - pDdiTable->pfnSetArgumentValue = tracing_layer::zeKernelSetArgumentValue; - - dditable.pfnSetIndirectAccess = pDdiTable->pfnSetIndirectAccess; - pDdiTable->pfnSetIndirectAccess = tracing_layer::zeKernelSetIndirectAccess; - - dditable.pfnGetIndirectAccess = pDdiTable->pfnGetIndirectAccess; - pDdiTable->pfnGetIndirectAccess = tracing_layer::zeKernelGetIndirectAccess; - - dditable.pfnGetSourceAttributes = pDdiTable->pfnGetSourceAttributes; - pDdiTable->pfnGetSourceAttributes = tracing_layer::zeKernelGetSourceAttributes; - - dditable.pfnGetProperties = pDdiTable->pfnGetProperties; - pDdiTable->pfnGetProperties = tracing_layer::zeKernelGetProperties; - - dditable.pfnGetName = pDdiTable->pfnGetName; - pDdiTable->pfnGetName = tracing_layer::zeKernelGetName; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCreate = pDdiTable->pfnCreate; + pDdiTable->pfnCreate = tracing_layer::zeKernelCreate; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnDestroy = pDdiTable->pfnDestroy; + pDdiTable->pfnDestroy = tracing_layer::zeKernelDestroy; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSetCacheConfig = pDdiTable->pfnSetCacheConfig; + pDdiTable->pfnSetCacheConfig = tracing_layer::zeKernelSetCacheConfig; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSetGroupSize = pDdiTable->pfnSetGroupSize; + pDdiTable->pfnSetGroupSize = tracing_layer::zeKernelSetGroupSize; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSuggestGroupSize = pDdiTable->pfnSuggestGroupSize; + pDdiTable->pfnSuggestGroupSize = tracing_layer::zeKernelSuggestGroupSize; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSuggestMaxCooperativeGroupCount = pDdiTable->pfnSuggestMaxCooperativeGroupCount; + pDdiTable->pfnSuggestMaxCooperativeGroupCount = tracing_layer::zeKernelSuggestMaxCooperativeGroupCount; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSetArgumentValue = pDdiTable->pfnSetArgumentValue; + pDdiTable->pfnSetArgumentValue = tracing_layer::zeKernelSetArgumentValue; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSetIndirectAccess = pDdiTable->pfnSetIndirectAccess; + pDdiTable->pfnSetIndirectAccess = tracing_layer::zeKernelSetIndirectAccess; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetIndirectAccess = pDdiTable->pfnGetIndirectAccess; + pDdiTable->pfnGetIndirectAccess = tracing_layer::zeKernelGetIndirectAccess; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetSourceAttributes = pDdiTable->pfnGetSourceAttributes; + pDdiTable->pfnGetSourceAttributes = tracing_layer::zeKernelGetSourceAttributes; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetProperties = pDdiTable->pfnGetProperties; + pDdiTable->pfnGetProperties = tracing_layer::zeKernelGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetName = pDdiTable->pfnGetName; + pDdiTable->pfnGetName = tracing_layer::zeKernelGetName; + } return result; } @@ -8687,21 +8813,23 @@ zeGetKernelExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(tracing_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(tracing_layer::context.version) > ZE_MINOR_VERSION(version)) + if (tracing_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnSetGlobalOffsetExp = pDdiTable->pfnSetGlobalOffsetExp; - pDdiTable->pfnSetGlobalOffsetExp = tracing_layer::zeKernelSetGlobalOffsetExp; - - dditable.pfnGetBinaryExp = pDdiTable->pfnGetBinaryExp; - pDdiTable->pfnGetBinaryExp = tracing_layer::zeKernelGetBinaryExp; - - dditable.pfnSchedulingHintExp = pDdiTable->pfnSchedulingHintExp; - pDdiTable->pfnSchedulingHintExp = tracing_layer::zeKernelSchedulingHintExp; - + if (version >= ZE_API_VERSION_1_1) { + dditable.pfnSetGlobalOffsetExp = pDdiTable->pfnSetGlobalOffsetExp; + pDdiTable->pfnSetGlobalOffsetExp = tracing_layer::zeKernelSetGlobalOffsetExp; + } + if (version >= ZE_API_VERSION_1_11) { + dditable.pfnGetBinaryExp = pDdiTable->pfnGetBinaryExp; + pDdiTable->pfnGetBinaryExp = tracing_layer::zeKernelGetBinaryExp; + } + if (version >= ZE_API_VERSION_1_2) { + dditable.pfnSchedulingHintExp = pDdiTable->pfnSchedulingHintExp; + pDdiTable->pfnSchedulingHintExp = tracing_layer::zeKernelSchedulingHintExp; + } return result; } @@ -8724,48 +8852,59 @@ zeGetMemProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(tracing_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(tracing_layer::context.version) > ZE_MINOR_VERSION(version)) + if (tracing_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnAllocShared = pDdiTable->pfnAllocShared; - pDdiTable->pfnAllocShared = tracing_layer::zeMemAllocShared; - - dditable.pfnAllocDevice = pDdiTable->pfnAllocDevice; - pDdiTable->pfnAllocDevice = tracing_layer::zeMemAllocDevice; - - dditable.pfnAllocHost = pDdiTable->pfnAllocHost; - pDdiTable->pfnAllocHost = tracing_layer::zeMemAllocHost; - - dditable.pfnFree = pDdiTable->pfnFree; - pDdiTable->pfnFree = tracing_layer::zeMemFree; - - dditable.pfnGetAllocProperties = pDdiTable->pfnGetAllocProperties; - pDdiTable->pfnGetAllocProperties = tracing_layer::zeMemGetAllocProperties; - - dditable.pfnGetAddressRange = pDdiTable->pfnGetAddressRange; - pDdiTable->pfnGetAddressRange = tracing_layer::zeMemGetAddressRange; - - dditable.pfnGetIpcHandle = pDdiTable->pfnGetIpcHandle; - pDdiTable->pfnGetIpcHandle = tracing_layer::zeMemGetIpcHandle; - - dditable.pfnOpenIpcHandle = pDdiTable->pfnOpenIpcHandle; - pDdiTable->pfnOpenIpcHandle = tracing_layer::zeMemOpenIpcHandle; - - dditable.pfnCloseIpcHandle = pDdiTable->pfnCloseIpcHandle; - pDdiTable->pfnCloseIpcHandle = tracing_layer::zeMemCloseIpcHandle; - - dditable.pfnFreeExt = pDdiTable->pfnFreeExt; - pDdiTable->pfnFreeExt = tracing_layer::zeMemFreeExt; - - dditable.pfnPutIpcHandle = pDdiTable->pfnPutIpcHandle; - pDdiTable->pfnPutIpcHandle = tracing_layer::zeMemPutIpcHandle; - - dditable.pfnGetPitchFor2dImage = pDdiTable->pfnGetPitchFor2dImage; - pDdiTable->pfnGetPitchFor2dImage = tracing_layer::zeMemGetPitchFor2dImage; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAllocShared = pDdiTable->pfnAllocShared; + pDdiTable->pfnAllocShared = tracing_layer::zeMemAllocShared; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAllocDevice = pDdiTable->pfnAllocDevice; + pDdiTable->pfnAllocDevice = tracing_layer::zeMemAllocDevice; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAllocHost = pDdiTable->pfnAllocHost; + pDdiTable->pfnAllocHost = tracing_layer::zeMemAllocHost; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnFree = pDdiTable->pfnFree; + pDdiTable->pfnFree = tracing_layer::zeMemFree; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetAllocProperties = pDdiTable->pfnGetAllocProperties; + pDdiTable->pfnGetAllocProperties = tracing_layer::zeMemGetAllocProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetAddressRange = pDdiTable->pfnGetAddressRange; + pDdiTable->pfnGetAddressRange = tracing_layer::zeMemGetAddressRange; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetIpcHandle = pDdiTable->pfnGetIpcHandle; + pDdiTable->pfnGetIpcHandle = tracing_layer::zeMemGetIpcHandle; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnOpenIpcHandle = pDdiTable->pfnOpenIpcHandle; + pDdiTable->pfnOpenIpcHandle = tracing_layer::zeMemOpenIpcHandle; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCloseIpcHandle = pDdiTable->pfnCloseIpcHandle; + pDdiTable->pfnCloseIpcHandle = tracing_layer::zeMemCloseIpcHandle; + } + if (version >= ZE_API_VERSION_1_3) { + dditable.pfnFreeExt = pDdiTable->pfnFreeExt; + pDdiTable->pfnFreeExt = tracing_layer::zeMemFreeExt; + } + if (version >= ZE_API_VERSION_1_6) { + dditable.pfnPutIpcHandle = pDdiTable->pfnPutIpcHandle; + pDdiTable->pfnPutIpcHandle = tracing_layer::zeMemPutIpcHandle; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetPitchFor2dImage = pDdiTable->pfnGetPitchFor2dImage; + pDdiTable->pfnGetPitchFor2dImage = tracing_layer::zeMemGetPitchFor2dImage; + } return result; } @@ -8788,24 +8927,27 @@ zeGetMemExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(tracing_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(tracing_layer::context.version) > ZE_MINOR_VERSION(version)) + if (tracing_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetIpcHandleFromFileDescriptorExp = pDdiTable->pfnGetIpcHandleFromFileDescriptorExp; - pDdiTable->pfnGetIpcHandleFromFileDescriptorExp = tracing_layer::zeMemGetIpcHandleFromFileDescriptorExp; - - dditable.pfnGetFileDescriptorFromIpcHandleExp = pDdiTable->pfnGetFileDescriptorFromIpcHandleExp; - pDdiTable->pfnGetFileDescriptorFromIpcHandleExp = tracing_layer::zeMemGetFileDescriptorFromIpcHandleExp; - - dditable.pfnSetAtomicAccessAttributeExp = pDdiTable->pfnSetAtomicAccessAttributeExp; - pDdiTable->pfnSetAtomicAccessAttributeExp = tracing_layer::zeMemSetAtomicAccessAttributeExp; - - dditable.pfnGetAtomicAccessAttributeExp = pDdiTable->pfnGetAtomicAccessAttributeExp; - pDdiTable->pfnGetAtomicAccessAttributeExp = tracing_layer::zeMemGetAtomicAccessAttributeExp; - + if (version >= ZE_API_VERSION_1_6) { + dditable.pfnGetIpcHandleFromFileDescriptorExp = pDdiTable->pfnGetIpcHandleFromFileDescriptorExp; + pDdiTable->pfnGetIpcHandleFromFileDescriptorExp = tracing_layer::zeMemGetIpcHandleFromFileDescriptorExp; + } + if (version >= ZE_API_VERSION_1_6) { + dditable.pfnGetFileDescriptorFromIpcHandleExp = pDdiTable->pfnGetFileDescriptorFromIpcHandleExp; + pDdiTable->pfnGetFileDescriptorFromIpcHandleExp = tracing_layer::zeMemGetFileDescriptorFromIpcHandleExp; + } + if (version >= ZE_API_VERSION_1_7) { + dditable.pfnSetAtomicAccessAttributeExp = pDdiTable->pfnSetAtomicAccessAttributeExp; + pDdiTable->pfnSetAtomicAccessAttributeExp = tracing_layer::zeMemSetAtomicAccessAttributeExp; + } + if (version >= ZE_API_VERSION_1_7) { + dditable.pfnGetAtomicAccessAttributeExp = pDdiTable->pfnGetAtomicAccessAttributeExp; + pDdiTable->pfnGetAtomicAccessAttributeExp = tracing_layer::zeMemGetAtomicAccessAttributeExp; + } return result; } @@ -8828,39 +8970,47 @@ zeGetModuleProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(tracing_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(tracing_layer::context.version) > ZE_MINOR_VERSION(version)) + if (tracing_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnCreate = pDdiTable->pfnCreate; - pDdiTable->pfnCreate = tracing_layer::zeModuleCreate; - - dditable.pfnDestroy = pDdiTable->pfnDestroy; - pDdiTable->pfnDestroy = tracing_layer::zeModuleDestroy; - - dditable.pfnDynamicLink = pDdiTable->pfnDynamicLink; - pDdiTable->pfnDynamicLink = tracing_layer::zeModuleDynamicLink; - - dditable.pfnGetNativeBinary = pDdiTable->pfnGetNativeBinary; - pDdiTable->pfnGetNativeBinary = tracing_layer::zeModuleGetNativeBinary; - - dditable.pfnGetGlobalPointer = pDdiTable->pfnGetGlobalPointer; - pDdiTable->pfnGetGlobalPointer = tracing_layer::zeModuleGetGlobalPointer; - - dditable.pfnGetKernelNames = pDdiTable->pfnGetKernelNames; - pDdiTable->pfnGetKernelNames = tracing_layer::zeModuleGetKernelNames; - - dditable.pfnGetProperties = pDdiTable->pfnGetProperties; - pDdiTable->pfnGetProperties = tracing_layer::zeModuleGetProperties; - - dditable.pfnGetFunctionPointer = pDdiTable->pfnGetFunctionPointer; - pDdiTable->pfnGetFunctionPointer = tracing_layer::zeModuleGetFunctionPointer; - - dditable.pfnInspectLinkageExt = pDdiTable->pfnInspectLinkageExt; - pDdiTable->pfnInspectLinkageExt = tracing_layer::zeModuleInspectLinkageExt; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCreate = pDdiTable->pfnCreate; + pDdiTable->pfnCreate = tracing_layer::zeModuleCreate; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnDestroy = pDdiTable->pfnDestroy; + pDdiTable->pfnDestroy = tracing_layer::zeModuleDestroy; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnDynamicLink = pDdiTable->pfnDynamicLink; + pDdiTable->pfnDynamicLink = tracing_layer::zeModuleDynamicLink; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetNativeBinary = pDdiTable->pfnGetNativeBinary; + pDdiTable->pfnGetNativeBinary = tracing_layer::zeModuleGetNativeBinary; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetGlobalPointer = pDdiTable->pfnGetGlobalPointer; + pDdiTable->pfnGetGlobalPointer = tracing_layer::zeModuleGetGlobalPointer; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetKernelNames = pDdiTable->pfnGetKernelNames; + pDdiTable->pfnGetKernelNames = tracing_layer::zeModuleGetKernelNames; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetProperties = pDdiTable->pfnGetProperties; + pDdiTable->pfnGetProperties = tracing_layer::zeModuleGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetFunctionPointer = pDdiTable->pfnGetFunctionPointer; + pDdiTable->pfnGetFunctionPointer = tracing_layer::zeModuleGetFunctionPointer; + } + if (version >= ZE_API_VERSION_1_3) { + dditable.pfnInspectLinkageExt = pDdiTable->pfnInspectLinkageExt; + pDdiTable->pfnInspectLinkageExt = tracing_layer::zeModuleInspectLinkageExt; + } return result; } @@ -8883,18 +9033,19 @@ zeGetModuleBuildLogProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(tracing_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(tracing_layer::context.version) > ZE_MINOR_VERSION(version)) + if (tracing_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnDestroy = pDdiTable->pfnDestroy; - pDdiTable->pfnDestroy = tracing_layer::zeModuleBuildLogDestroy; - - dditable.pfnGetString = pDdiTable->pfnGetString; - pDdiTable->pfnGetString = tracing_layer::zeModuleBuildLogGetString; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnDestroy = pDdiTable->pfnDestroy; + pDdiTable->pfnDestroy = tracing_layer::zeModuleBuildLogDestroy; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetString = pDdiTable->pfnGetString; + pDdiTable->pfnGetString = tracing_layer::zeModuleBuildLogGetString; + } return result; } @@ -8917,18 +9068,19 @@ zeGetPhysicalMemProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(tracing_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(tracing_layer::context.version) > ZE_MINOR_VERSION(version)) + if (tracing_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnCreate = pDdiTable->pfnCreate; - pDdiTable->pfnCreate = tracing_layer::zePhysicalMemCreate; - - dditable.pfnDestroy = pDdiTable->pfnDestroy; - pDdiTable->pfnDestroy = tracing_layer::zePhysicalMemDestroy; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCreate = pDdiTable->pfnCreate; + pDdiTable->pfnCreate = tracing_layer::zePhysicalMemCreate; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnDestroy = pDdiTable->pfnDestroy; + pDdiTable->pfnDestroy = tracing_layer::zePhysicalMemDestroy; + } return result; } @@ -8951,18 +9103,19 @@ zeGetSamplerProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(tracing_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(tracing_layer::context.version) > ZE_MINOR_VERSION(version)) + if (tracing_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnCreate = pDdiTable->pfnCreate; - pDdiTable->pfnCreate = tracing_layer::zeSamplerCreate; - - dditable.pfnDestroy = pDdiTable->pfnDestroy; - pDdiTable->pfnDestroy = tracing_layer::zeSamplerDestroy; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCreate = pDdiTable->pfnCreate; + pDdiTable->pfnCreate = tracing_layer::zeSamplerCreate; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnDestroy = pDdiTable->pfnDestroy; + pDdiTable->pfnDestroy = tracing_layer::zeSamplerDestroy; + } return result; } @@ -8985,33 +9138,39 @@ zeGetVirtualMemProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(tracing_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(tracing_layer::context.version) > ZE_MINOR_VERSION(version)) + if (tracing_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnReserve = pDdiTable->pfnReserve; - pDdiTable->pfnReserve = tracing_layer::zeVirtualMemReserve; - - dditable.pfnFree = pDdiTable->pfnFree; - pDdiTable->pfnFree = tracing_layer::zeVirtualMemFree; - - dditable.pfnQueryPageSize = pDdiTable->pfnQueryPageSize; - pDdiTable->pfnQueryPageSize = tracing_layer::zeVirtualMemQueryPageSize; - - dditable.pfnMap = pDdiTable->pfnMap; - pDdiTable->pfnMap = tracing_layer::zeVirtualMemMap; - - dditable.pfnUnmap = pDdiTable->pfnUnmap; - pDdiTable->pfnUnmap = tracing_layer::zeVirtualMemUnmap; - - dditable.pfnSetAccessAttribute = pDdiTable->pfnSetAccessAttribute; - pDdiTable->pfnSetAccessAttribute = tracing_layer::zeVirtualMemSetAccessAttribute; - - dditable.pfnGetAccessAttribute = pDdiTable->pfnGetAccessAttribute; - pDdiTable->pfnGetAccessAttribute = tracing_layer::zeVirtualMemGetAccessAttribute; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnReserve = pDdiTable->pfnReserve; + pDdiTable->pfnReserve = tracing_layer::zeVirtualMemReserve; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnFree = pDdiTable->pfnFree; + pDdiTable->pfnFree = tracing_layer::zeVirtualMemFree; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnQueryPageSize = pDdiTable->pfnQueryPageSize; + pDdiTable->pfnQueryPageSize = tracing_layer::zeVirtualMemQueryPageSize; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnMap = pDdiTable->pfnMap; + pDdiTable->pfnMap = tracing_layer::zeVirtualMemMap; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnUnmap = pDdiTable->pfnUnmap; + pDdiTable->pfnUnmap = tracing_layer::zeVirtualMemUnmap; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSetAccessAttribute = pDdiTable->pfnSetAccessAttribute; + pDdiTable->pfnSetAccessAttribute = tracing_layer::zeVirtualMemSetAccessAttribute; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetAccessAttribute = pDdiTable->pfnGetAccessAttribute; + pDdiTable->pfnGetAccessAttribute = tracing_layer::zeVirtualMemGetAccessAttribute; + } return result; } @@ -9034,21 +9193,23 @@ zeGetFabricEdgeExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(tracing_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(tracing_layer::context.version) > ZE_MINOR_VERSION(version)) + if (tracing_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetExp = pDdiTable->pfnGetExp; - pDdiTable->pfnGetExp = tracing_layer::zeFabricEdgeGetExp; - - dditable.pfnGetVerticesExp = pDdiTable->pfnGetVerticesExp; - pDdiTable->pfnGetVerticesExp = tracing_layer::zeFabricEdgeGetVerticesExp; - - dditable.pfnGetPropertiesExp = pDdiTable->pfnGetPropertiesExp; - pDdiTable->pfnGetPropertiesExp = tracing_layer::zeFabricEdgeGetPropertiesExp; - + if (version >= ZE_API_VERSION_1_4) { + dditable.pfnGetExp = pDdiTable->pfnGetExp; + pDdiTable->pfnGetExp = tracing_layer::zeFabricEdgeGetExp; + } + if (version >= ZE_API_VERSION_1_4) { + dditable.pfnGetVerticesExp = pDdiTable->pfnGetVerticesExp; + pDdiTable->pfnGetVerticesExp = tracing_layer::zeFabricEdgeGetVerticesExp; + } + if (version >= ZE_API_VERSION_1_4) { + dditable.pfnGetPropertiesExp = pDdiTable->pfnGetPropertiesExp; + pDdiTable->pfnGetPropertiesExp = tracing_layer::zeFabricEdgeGetPropertiesExp; + } return result; } @@ -9071,24 +9232,27 @@ zeGetFabricVertexExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(tracing_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(tracing_layer::context.version) > ZE_MINOR_VERSION(version)) + if (tracing_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetExp = pDdiTable->pfnGetExp; - pDdiTable->pfnGetExp = tracing_layer::zeFabricVertexGetExp; - - dditable.pfnGetSubVerticesExp = pDdiTable->pfnGetSubVerticesExp; - pDdiTable->pfnGetSubVerticesExp = tracing_layer::zeFabricVertexGetSubVerticesExp; - - dditable.pfnGetPropertiesExp = pDdiTable->pfnGetPropertiesExp; - pDdiTable->pfnGetPropertiesExp = tracing_layer::zeFabricVertexGetPropertiesExp; - - dditable.pfnGetDeviceExp = pDdiTable->pfnGetDeviceExp; - pDdiTable->pfnGetDeviceExp = tracing_layer::zeFabricVertexGetDeviceExp; - + if (version >= ZE_API_VERSION_1_4) { + dditable.pfnGetExp = pDdiTable->pfnGetExp; + pDdiTable->pfnGetExp = tracing_layer::zeFabricVertexGetExp; + } + if (version >= ZE_API_VERSION_1_4) { + dditable.pfnGetSubVerticesExp = pDdiTable->pfnGetSubVerticesExp; + pDdiTable->pfnGetSubVerticesExp = tracing_layer::zeFabricVertexGetSubVerticesExp; + } + if (version >= ZE_API_VERSION_1_4) { + dditable.pfnGetPropertiesExp = pDdiTable->pfnGetPropertiesExp; + pDdiTable->pfnGetPropertiesExp = tracing_layer::zeFabricVertexGetPropertiesExp; + } + if (version >= ZE_API_VERSION_1_4) { + dditable.pfnGetDeviceExp = pDdiTable->pfnGetDeviceExp; + pDdiTable->pfnGetDeviceExp = tracing_layer::zeFabricVertexGetDeviceExp; + } return result; } diff --git a/source/layers/validation/ze_valddi.cpp b/source/layers/validation/ze_valddi.cpp index 2a618cb8..6a36d69e 100644 --- a/source/layers/validation/ze_valddi.cpp +++ b/source/layers/validation/ze_valddi.cpp @@ -8925,18 +8925,19 @@ zeGetGlobalProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnInit = pDdiTable->pfnInit; - pDdiTable->pfnInit = validation_layer::zeInit; - - dditable.pfnInitDrivers = pDdiTable->pfnInitDrivers; - pDdiTable->pfnInitDrivers = validation_layer::zeInitDrivers; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnInit = pDdiTable->pfnInit; + pDdiTable->pfnInit = validation_layer::zeInit; + } + if (version >= ZE_API_VERSION_1_10) { + dditable.pfnInitDrivers = pDdiTable->pfnInitDrivers; + pDdiTable->pfnInitDrivers = validation_layer::zeInitDrivers; + } return result; } @@ -8959,24 +8960,27 @@ zeGetRTASBuilderExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnCreateExp = pDdiTable->pfnCreateExp; - pDdiTable->pfnCreateExp = validation_layer::zeRTASBuilderCreateExp; - - dditable.pfnGetBuildPropertiesExp = pDdiTable->pfnGetBuildPropertiesExp; - pDdiTable->pfnGetBuildPropertiesExp = validation_layer::zeRTASBuilderGetBuildPropertiesExp; - - dditable.pfnBuildExp = pDdiTable->pfnBuildExp; - pDdiTable->pfnBuildExp = validation_layer::zeRTASBuilderBuildExp; - - dditable.pfnDestroyExp = pDdiTable->pfnDestroyExp; - pDdiTable->pfnDestroyExp = validation_layer::zeRTASBuilderDestroyExp; - + if (version >= ZE_API_VERSION_1_7) { + dditable.pfnCreateExp = pDdiTable->pfnCreateExp; + pDdiTable->pfnCreateExp = validation_layer::zeRTASBuilderCreateExp; + } + if (version >= ZE_API_VERSION_1_7) { + dditable.pfnGetBuildPropertiesExp = pDdiTable->pfnGetBuildPropertiesExp; + pDdiTable->pfnGetBuildPropertiesExp = validation_layer::zeRTASBuilderGetBuildPropertiesExp; + } + if (version >= ZE_API_VERSION_1_7) { + dditable.pfnBuildExp = pDdiTable->pfnBuildExp; + pDdiTable->pfnBuildExp = validation_layer::zeRTASBuilderBuildExp; + } + if (version >= ZE_API_VERSION_1_7) { + dditable.pfnDestroyExp = pDdiTable->pfnDestroyExp; + pDdiTable->pfnDestroyExp = validation_layer::zeRTASBuilderDestroyExp; + } return result; } @@ -8999,24 +9003,27 @@ zeGetRTASParallelOperationExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnCreateExp = pDdiTable->pfnCreateExp; - pDdiTable->pfnCreateExp = validation_layer::zeRTASParallelOperationCreateExp; - - dditable.pfnGetPropertiesExp = pDdiTable->pfnGetPropertiesExp; - pDdiTable->pfnGetPropertiesExp = validation_layer::zeRTASParallelOperationGetPropertiesExp; - - dditable.pfnJoinExp = pDdiTable->pfnJoinExp; - pDdiTable->pfnJoinExp = validation_layer::zeRTASParallelOperationJoinExp; - - dditable.pfnDestroyExp = pDdiTable->pfnDestroyExp; - pDdiTable->pfnDestroyExp = validation_layer::zeRTASParallelOperationDestroyExp; - + if (version >= ZE_API_VERSION_1_7) { + dditable.pfnCreateExp = pDdiTable->pfnCreateExp; + pDdiTable->pfnCreateExp = validation_layer::zeRTASParallelOperationCreateExp; + } + if (version >= ZE_API_VERSION_1_7) { + dditable.pfnGetPropertiesExp = pDdiTable->pfnGetPropertiesExp; + pDdiTable->pfnGetPropertiesExp = validation_layer::zeRTASParallelOperationGetPropertiesExp; + } + if (version >= ZE_API_VERSION_1_7) { + dditable.pfnJoinExp = pDdiTable->pfnJoinExp; + pDdiTable->pfnJoinExp = validation_layer::zeRTASParallelOperationJoinExp; + } + if (version >= ZE_API_VERSION_1_7) { + dditable.pfnDestroyExp = pDdiTable->pfnDestroyExp; + pDdiTable->pfnDestroyExp = validation_layer::zeRTASParallelOperationDestroyExp; + } return result; } @@ -9039,33 +9046,39 @@ zeGetDriverProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGet = pDdiTable->pfnGet; - pDdiTable->pfnGet = validation_layer::zeDriverGet; - - dditable.pfnGetApiVersion = pDdiTable->pfnGetApiVersion; - pDdiTable->pfnGetApiVersion = validation_layer::zeDriverGetApiVersion; - - dditable.pfnGetProperties = pDdiTable->pfnGetProperties; - pDdiTable->pfnGetProperties = validation_layer::zeDriverGetProperties; - - dditable.pfnGetIpcProperties = pDdiTable->pfnGetIpcProperties; - pDdiTable->pfnGetIpcProperties = validation_layer::zeDriverGetIpcProperties; - - dditable.pfnGetExtensionProperties = pDdiTable->pfnGetExtensionProperties; - pDdiTable->pfnGetExtensionProperties = validation_layer::zeDriverGetExtensionProperties; - - dditable.pfnGetExtensionFunctionAddress = pDdiTable->pfnGetExtensionFunctionAddress; - pDdiTable->pfnGetExtensionFunctionAddress = validation_layer::zeDriverGetExtensionFunctionAddress; - - dditable.pfnGetLastErrorDescription = pDdiTable->pfnGetLastErrorDescription; - pDdiTable->pfnGetLastErrorDescription = validation_layer::zeDriverGetLastErrorDescription; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGet = pDdiTable->pfnGet; + pDdiTable->pfnGet = validation_layer::zeDriverGet; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetApiVersion = pDdiTable->pfnGetApiVersion; + pDdiTable->pfnGetApiVersion = validation_layer::zeDriverGetApiVersion; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetProperties = pDdiTable->pfnGetProperties; + pDdiTable->pfnGetProperties = validation_layer::zeDriverGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetIpcProperties = pDdiTable->pfnGetIpcProperties; + pDdiTable->pfnGetIpcProperties = validation_layer::zeDriverGetIpcProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetExtensionProperties = pDdiTable->pfnGetExtensionProperties; + pDdiTable->pfnGetExtensionProperties = validation_layer::zeDriverGetExtensionProperties; + } + if (version >= ZE_API_VERSION_1_1) { + dditable.pfnGetExtensionFunctionAddress = pDdiTable->pfnGetExtensionFunctionAddress; + pDdiTable->pfnGetExtensionFunctionAddress = validation_layer::zeDriverGetExtensionFunctionAddress; + } + if (version >= ZE_API_VERSION_1_6) { + dditable.pfnGetLastErrorDescription = pDdiTable->pfnGetLastErrorDescription; + pDdiTable->pfnGetLastErrorDescription = validation_layer::zeDriverGetLastErrorDescription; + } return result; } @@ -9088,15 +9101,15 @@ zeGetDriverExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnRTASFormatCompatibilityCheckExp = pDdiTable->pfnRTASFormatCompatibilityCheckExp; - pDdiTable->pfnRTASFormatCompatibilityCheckExp = validation_layer::zeDriverRTASFormatCompatibilityCheckExp; - + if (version >= ZE_API_VERSION_1_7) { + dditable.pfnRTASFormatCompatibilityCheckExp = pDdiTable->pfnRTASFormatCompatibilityCheckExp; + pDdiTable->pfnRTASFormatCompatibilityCheckExp = validation_layer::zeDriverRTASFormatCompatibilityCheckExp; + } return result; } @@ -9119,75 +9132,95 @@ zeGetDeviceProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGet = pDdiTable->pfnGet; - pDdiTable->pfnGet = validation_layer::zeDeviceGet; - - dditable.pfnGetSubDevices = pDdiTable->pfnGetSubDevices; - pDdiTable->pfnGetSubDevices = validation_layer::zeDeviceGetSubDevices; - - dditable.pfnGetProperties = pDdiTable->pfnGetProperties; - pDdiTable->pfnGetProperties = validation_layer::zeDeviceGetProperties; - - dditable.pfnGetComputeProperties = pDdiTable->pfnGetComputeProperties; - pDdiTable->pfnGetComputeProperties = validation_layer::zeDeviceGetComputeProperties; - - dditable.pfnGetModuleProperties = pDdiTable->pfnGetModuleProperties; - pDdiTable->pfnGetModuleProperties = validation_layer::zeDeviceGetModuleProperties; - - dditable.pfnGetCommandQueueGroupProperties = pDdiTable->pfnGetCommandQueueGroupProperties; - pDdiTable->pfnGetCommandQueueGroupProperties = validation_layer::zeDeviceGetCommandQueueGroupProperties; - - dditable.pfnGetMemoryProperties = pDdiTable->pfnGetMemoryProperties; - pDdiTable->pfnGetMemoryProperties = validation_layer::zeDeviceGetMemoryProperties; - - dditable.pfnGetMemoryAccessProperties = pDdiTable->pfnGetMemoryAccessProperties; - pDdiTable->pfnGetMemoryAccessProperties = validation_layer::zeDeviceGetMemoryAccessProperties; - - dditable.pfnGetCacheProperties = pDdiTable->pfnGetCacheProperties; - pDdiTable->pfnGetCacheProperties = validation_layer::zeDeviceGetCacheProperties; - - dditable.pfnGetImageProperties = pDdiTable->pfnGetImageProperties; - pDdiTable->pfnGetImageProperties = validation_layer::zeDeviceGetImageProperties; - - dditable.pfnGetExternalMemoryProperties = pDdiTable->pfnGetExternalMemoryProperties; - pDdiTable->pfnGetExternalMemoryProperties = validation_layer::zeDeviceGetExternalMemoryProperties; - - dditable.pfnGetP2PProperties = pDdiTable->pfnGetP2PProperties; - pDdiTable->pfnGetP2PProperties = validation_layer::zeDeviceGetP2PProperties; - - dditable.pfnCanAccessPeer = pDdiTable->pfnCanAccessPeer; - pDdiTable->pfnCanAccessPeer = validation_layer::zeDeviceCanAccessPeer; - - dditable.pfnGetStatus = pDdiTable->pfnGetStatus; - pDdiTable->pfnGetStatus = validation_layer::zeDeviceGetStatus; - - dditable.pfnGetGlobalTimestamps = pDdiTable->pfnGetGlobalTimestamps; - pDdiTable->pfnGetGlobalTimestamps = validation_layer::zeDeviceGetGlobalTimestamps; - - dditable.pfnImportExternalSemaphoreExt = pDdiTable->pfnImportExternalSemaphoreExt; - pDdiTable->pfnImportExternalSemaphoreExt = validation_layer::zeDeviceImportExternalSemaphoreExt; - - dditable.pfnReleaseExternalSemaphoreExt = pDdiTable->pfnReleaseExternalSemaphoreExt; - pDdiTable->pfnReleaseExternalSemaphoreExt = validation_layer::zeDeviceReleaseExternalSemaphoreExt; - - dditable.pfnReserveCacheExt = pDdiTable->pfnReserveCacheExt; - pDdiTable->pfnReserveCacheExt = validation_layer::zeDeviceReserveCacheExt; - - dditable.pfnSetCacheAdviceExt = pDdiTable->pfnSetCacheAdviceExt; - pDdiTable->pfnSetCacheAdviceExt = validation_layer::zeDeviceSetCacheAdviceExt; - - dditable.pfnPciGetPropertiesExt = pDdiTable->pfnPciGetPropertiesExt; - pDdiTable->pfnPciGetPropertiesExt = validation_layer::zeDevicePciGetPropertiesExt; - - dditable.pfnGetRootDevice = pDdiTable->pfnGetRootDevice; - pDdiTable->pfnGetRootDevice = validation_layer::zeDeviceGetRootDevice; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGet = pDdiTable->pfnGet; + pDdiTable->pfnGet = validation_layer::zeDeviceGet; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetSubDevices = pDdiTable->pfnGetSubDevices; + pDdiTable->pfnGetSubDevices = validation_layer::zeDeviceGetSubDevices; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetProperties = pDdiTable->pfnGetProperties; + pDdiTable->pfnGetProperties = validation_layer::zeDeviceGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetComputeProperties = pDdiTable->pfnGetComputeProperties; + pDdiTable->pfnGetComputeProperties = validation_layer::zeDeviceGetComputeProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetModuleProperties = pDdiTable->pfnGetModuleProperties; + pDdiTable->pfnGetModuleProperties = validation_layer::zeDeviceGetModuleProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetCommandQueueGroupProperties = pDdiTable->pfnGetCommandQueueGroupProperties; + pDdiTable->pfnGetCommandQueueGroupProperties = validation_layer::zeDeviceGetCommandQueueGroupProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetMemoryProperties = pDdiTable->pfnGetMemoryProperties; + pDdiTable->pfnGetMemoryProperties = validation_layer::zeDeviceGetMemoryProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetMemoryAccessProperties = pDdiTable->pfnGetMemoryAccessProperties; + pDdiTable->pfnGetMemoryAccessProperties = validation_layer::zeDeviceGetMemoryAccessProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetCacheProperties = pDdiTable->pfnGetCacheProperties; + pDdiTable->pfnGetCacheProperties = validation_layer::zeDeviceGetCacheProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetImageProperties = pDdiTable->pfnGetImageProperties; + pDdiTable->pfnGetImageProperties = validation_layer::zeDeviceGetImageProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetExternalMemoryProperties = pDdiTable->pfnGetExternalMemoryProperties; + pDdiTable->pfnGetExternalMemoryProperties = validation_layer::zeDeviceGetExternalMemoryProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetP2PProperties = pDdiTable->pfnGetP2PProperties; + pDdiTable->pfnGetP2PProperties = validation_layer::zeDeviceGetP2PProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCanAccessPeer = pDdiTable->pfnCanAccessPeer; + pDdiTable->pfnCanAccessPeer = validation_layer::zeDeviceCanAccessPeer; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetStatus = pDdiTable->pfnGetStatus; + pDdiTable->pfnGetStatus = validation_layer::zeDeviceGetStatus; + } + if (version >= ZE_API_VERSION_1_1) { + dditable.pfnGetGlobalTimestamps = pDdiTable->pfnGetGlobalTimestamps; + pDdiTable->pfnGetGlobalTimestamps = validation_layer::zeDeviceGetGlobalTimestamps; + } + if (version >= ZE_API_VERSION_1_12) { + dditable.pfnImportExternalSemaphoreExt = pDdiTable->pfnImportExternalSemaphoreExt; + pDdiTable->pfnImportExternalSemaphoreExt = validation_layer::zeDeviceImportExternalSemaphoreExt; + } + if (version >= ZE_API_VERSION_1_12) { + dditable.pfnReleaseExternalSemaphoreExt = pDdiTable->pfnReleaseExternalSemaphoreExt; + pDdiTable->pfnReleaseExternalSemaphoreExt = validation_layer::zeDeviceReleaseExternalSemaphoreExt; + } + if (version >= ZE_API_VERSION_1_2) { + dditable.pfnReserveCacheExt = pDdiTable->pfnReserveCacheExt; + pDdiTable->pfnReserveCacheExt = validation_layer::zeDeviceReserveCacheExt; + } + if (version >= ZE_API_VERSION_1_2) { + dditable.pfnSetCacheAdviceExt = pDdiTable->pfnSetCacheAdviceExt; + pDdiTable->pfnSetCacheAdviceExt = validation_layer::zeDeviceSetCacheAdviceExt; + } + if (version >= ZE_API_VERSION_1_3) { + dditable.pfnPciGetPropertiesExt = pDdiTable->pfnPciGetPropertiesExt; + pDdiTable->pfnPciGetPropertiesExt = validation_layer::zeDevicePciGetPropertiesExt; + } + if (version >= ZE_API_VERSION_1_7) { + dditable.pfnGetRootDevice = pDdiTable->pfnGetRootDevice; + pDdiTable->pfnGetRootDevice = validation_layer::zeDeviceGetRootDevice; + } return result; } @@ -9210,15 +9243,15 @@ zeGetDeviceExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetFabricVertexExp = pDdiTable->pfnGetFabricVertexExp; - pDdiTable->pfnGetFabricVertexExp = validation_layer::zeDeviceGetFabricVertexExp; - + if (version >= ZE_API_VERSION_1_4) { + dditable.pfnGetFabricVertexExp = pDdiTable->pfnGetFabricVertexExp; + pDdiTable->pfnGetFabricVertexExp = validation_layer::zeDeviceGetFabricVertexExp; + } return result; } @@ -9241,39 +9274,47 @@ zeGetContextProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnCreate = pDdiTable->pfnCreate; - pDdiTable->pfnCreate = validation_layer::zeContextCreate; - - dditable.pfnDestroy = pDdiTable->pfnDestroy; - pDdiTable->pfnDestroy = validation_layer::zeContextDestroy; - - dditable.pfnGetStatus = pDdiTable->pfnGetStatus; - pDdiTable->pfnGetStatus = validation_layer::zeContextGetStatus; - - dditable.pfnSystemBarrier = pDdiTable->pfnSystemBarrier; - pDdiTable->pfnSystemBarrier = validation_layer::zeContextSystemBarrier; - - dditable.pfnMakeMemoryResident = pDdiTable->pfnMakeMemoryResident; - pDdiTable->pfnMakeMemoryResident = validation_layer::zeContextMakeMemoryResident; - - dditable.pfnEvictMemory = pDdiTable->pfnEvictMemory; - pDdiTable->pfnEvictMemory = validation_layer::zeContextEvictMemory; - - dditable.pfnMakeImageResident = pDdiTable->pfnMakeImageResident; - pDdiTable->pfnMakeImageResident = validation_layer::zeContextMakeImageResident; - - dditable.pfnEvictImage = pDdiTable->pfnEvictImage; - pDdiTable->pfnEvictImage = validation_layer::zeContextEvictImage; - - dditable.pfnCreateEx = pDdiTable->pfnCreateEx; - pDdiTable->pfnCreateEx = validation_layer::zeContextCreateEx; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCreate = pDdiTable->pfnCreate; + pDdiTable->pfnCreate = validation_layer::zeContextCreate; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnDestroy = pDdiTable->pfnDestroy; + pDdiTable->pfnDestroy = validation_layer::zeContextDestroy; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetStatus = pDdiTable->pfnGetStatus; + pDdiTable->pfnGetStatus = validation_layer::zeContextGetStatus; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSystemBarrier = pDdiTable->pfnSystemBarrier; + pDdiTable->pfnSystemBarrier = validation_layer::zeContextSystemBarrier; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnMakeMemoryResident = pDdiTable->pfnMakeMemoryResident; + pDdiTable->pfnMakeMemoryResident = validation_layer::zeContextMakeMemoryResident; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnEvictMemory = pDdiTable->pfnEvictMemory; + pDdiTable->pfnEvictMemory = validation_layer::zeContextEvictMemory; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnMakeImageResident = pDdiTable->pfnMakeImageResident; + pDdiTable->pfnMakeImageResident = validation_layer::zeContextMakeImageResident; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnEvictImage = pDdiTable->pfnEvictImage; + pDdiTable->pfnEvictImage = validation_layer::zeContextEvictImage; + } + if (version >= ZE_API_VERSION_1_1) { + dditable.pfnCreateEx = pDdiTable->pfnCreateEx; + pDdiTable->pfnCreateEx = validation_layer::zeContextCreateEx; + } return result; } @@ -9296,30 +9337,35 @@ zeGetCommandQueueProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnCreate = pDdiTable->pfnCreate; - pDdiTable->pfnCreate = validation_layer::zeCommandQueueCreate; - - dditable.pfnDestroy = pDdiTable->pfnDestroy; - pDdiTable->pfnDestroy = validation_layer::zeCommandQueueDestroy; - - dditable.pfnExecuteCommandLists = pDdiTable->pfnExecuteCommandLists; - pDdiTable->pfnExecuteCommandLists = validation_layer::zeCommandQueueExecuteCommandLists; - - dditable.pfnSynchronize = pDdiTable->pfnSynchronize; - pDdiTable->pfnSynchronize = validation_layer::zeCommandQueueSynchronize; - - dditable.pfnGetOrdinal = pDdiTable->pfnGetOrdinal; - pDdiTable->pfnGetOrdinal = validation_layer::zeCommandQueueGetOrdinal; - - dditable.pfnGetIndex = pDdiTable->pfnGetIndex; - pDdiTable->pfnGetIndex = validation_layer::zeCommandQueueGetIndex; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCreate = pDdiTable->pfnCreate; + pDdiTable->pfnCreate = validation_layer::zeCommandQueueCreate; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnDestroy = pDdiTable->pfnDestroy; + pDdiTable->pfnDestroy = validation_layer::zeCommandQueueDestroy; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnExecuteCommandLists = pDdiTable->pfnExecuteCommandLists; + pDdiTable->pfnExecuteCommandLists = validation_layer::zeCommandQueueExecuteCommandLists; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSynchronize = pDdiTable->pfnSynchronize; + pDdiTable->pfnSynchronize = validation_layer::zeCommandQueueSynchronize; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetOrdinal = pDdiTable->pfnGetOrdinal; + pDdiTable->pfnGetOrdinal = validation_layer::zeCommandQueueGetOrdinal; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetIndex = pDdiTable->pfnGetIndex; + pDdiTable->pfnGetIndex = validation_layer::zeCommandQueueGetIndex; + } return result; } @@ -9342,120 +9388,155 @@ zeGetCommandListProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnCreate = pDdiTable->pfnCreate; - pDdiTable->pfnCreate = validation_layer::zeCommandListCreate; - - dditable.pfnCreateImmediate = pDdiTable->pfnCreateImmediate; - pDdiTable->pfnCreateImmediate = validation_layer::zeCommandListCreateImmediate; - - dditable.pfnDestroy = pDdiTable->pfnDestroy; - pDdiTable->pfnDestroy = validation_layer::zeCommandListDestroy; - - dditable.pfnClose = pDdiTable->pfnClose; - pDdiTable->pfnClose = validation_layer::zeCommandListClose; - - dditable.pfnReset = pDdiTable->pfnReset; - pDdiTable->pfnReset = validation_layer::zeCommandListReset; - - dditable.pfnAppendWriteGlobalTimestamp = pDdiTable->pfnAppendWriteGlobalTimestamp; - pDdiTable->pfnAppendWriteGlobalTimestamp = validation_layer::zeCommandListAppendWriteGlobalTimestamp; - - dditable.pfnAppendBarrier = pDdiTable->pfnAppendBarrier; - pDdiTable->pfnAppendBarrier = validation_layer::zeCommandListAppendBarrier; - - dditable.pfnAppendMemoryRangesBarrier = pDdiTable->pfnAppendMemoryRangesBarrier; - pDdiTable->pfnAppendMemoryRangesBarrier = validation_layer::zeCommandListAppendMemoryRangesBarrier; - - dditable.pfnAppendMemoryCopy = pDdiTable->pfnAppendMemoryCopy; - pDdiTable->pfnAppendMemoryCopy = validation_layer::zeCommandListAppendMemoryCopy; - - dditable.pfnAppendMemoryFill = pDdiTable->pfnAppendMemoryFill; - pDdiTable->pfnAppendMemoryFill = validation_layer::zeCommandListAppendMemoryFill; - - dditable.pfnAppendMemoryCopyRegion = pDdiTable->pfnAppendMemoryCopyRegion; - pDdiTable->pfnAppendMemoryCopyRegion = validation_layer::zeCommandListAppendMemoryCopyRegion; - - dditable.pfnAppendMemoryCopyFromContext = pDdiTable->pfnAppendMemoryCopyFromContext; - pDdiTable->pfnAppendMemoryCopyFromContext = validation_layer::zeCommandListAppendMemoryCopyFromContext; - - dditable.pfnAppendImageCopy = pDdiTable->pfnAppendImageCopy; - pDdiTable->pfnAppendImageCopy = validation_layer::zeCommandListAppendImageCopy; - - dditable.pfnAppendImageCopyRegion = pDdiTable->pfnAppendImageCopyRegion; - pDdiTable->pfnAppendImageCopyRegion = validation_layer::zeCommandListAppendImageCopyRegion; - - dditable.pfnAppendImageCopyToMemory = pDdiTable->pfnAppendImageCopyToMemory; - pDdiTable->pfnAppendImageCopyToMemory = validation_layer::zeCommandListAppendImageCopyToMemory; - - dditable.pfnAppendImageCopyFromMemory = pDdiTable->pfnAppendImageCopyFromMemory; - pDdiTable->pfnAppendImageCopyFromMemory = validation_layer::zeCommandListAppendImageCopyFromMemory; - - dditable.pfnAppendMemoryPrefetch = pDdiTable->pfnAppendMemoryPrefetch; - pDdiTable->pfnAppendMemoryPrefetch = validation_layer::zeCommandListAppendMemoryPrefetch; - - dditable.pfnAppendMemAdvise = pDdiTable->pfnAppendMemAdvise; - pDdiTable->pfnAppendMemAdvise = validation_layer::zeCommandListAppendMemAdvise; - - dditable.pfnAppendSignalEvent = pDdiTable->pfnAppendSignalEvent; - pDdiTable->pfnAppendSignalEvent = validation_layer::zeCommandListAppendSignalEvent; - - dditable.pfnAppendWaitOnEvents = pDdiTable->pfnAppendWaitOnEvents; - pDdiTable->pfnAppendWaitOnEvents = validation_layer::zeCommandListAppendWaitOnEvents; - - dditable.pfnAppendEventReset = pDdiTable->pfnAppendEventReset; - pDdiTable->pfnAppendEventReset = validation_layer::zeCommandListAppendEventReset; - - dditable.pfnAppendQueryKernelTimestamps = pDdiTable->pfnAppendQueryKernelTimestamps; - pDdiTable->pfnAppendQueryKernelTimestamps = validation_layer::zeCommandListAppendQueryKernelTimestamps; - - dditable.pfnAppendLaunchKernel = pDdiTable->pfnAppendLaunchKernel; - pDdiTable->pfnAppendLaunchKernel = validation_layer::zeCommandListAppendLaunchKernel; - - dditable.pfnAppendLaunchCooperativeKernel = pDdiTable->pfnAppendLaunchCooperativeKernel; - pDdiTable->pfnAppendLaunchCooperativeKernel = validation_layer::zeCommandListAppendLaunchCooperativeKernel; - - dditable.pfnAppendLaunchKernelIndirect = pDdiTable->pfnAppendLaunchKernelIndirect; - pDdiTable->pfnAppendLaunchKernelIndirect = validation_layer::zeCommandListAppendLaunchKernelIndirect; - - dditable.pfnAppendLaunchMultipleKernelsIndirect = pDdiTable->pfnAppendLaunchMultipleKernelsIndirect; - pDdiTable->pfnAppendLaunchMultipleKernelsIndirect = validation_layer::zeCommandListAppendLaunchMultipleKernelsIndirect; - - dditable.pfnAppendSignalExternalSemaphoreExt = pDdiTable->pfnAppendSignalExternalSemaphoreExt; - pDdiTable->pfnAppendSignalExternalSemaphoreExt = validation_layer::zeCommandListAppendSignalExternalSemaphoreExt; - - dditable.pfnAppendWaitExternalSemaphoreExt = pDdiTable->pfnAppendWaitExternalSemaphoreExt; - pDdiTable->pfnAppendWaitExternalSemaphoreExt = validation_layer::zeCommandListAppendWaitExternalSemaphoreExt; - - dditable.pfnAppendImageCopyToMemoryExt = pDdiTable->pfnAppendImageCopyToMemoryExt; - pDdiTable->pfnAppendImageCopyToMemoryExt = validation_layer::zeCommandListAppendImageCopyToMemoryExt; - - dditable.pfnAppendImageCopyFromMemoryExt = pDdiTable->pfnAppendImageCopyFromMemoryExt; - pDdiTable->pfnAppendImageCopyFromMemoryExt = validation_layer::zeCommandListAppendImageCopyFromMemoryExt; - - dditable.pfnHostSynchronize = pDdiTable->pfnHostSynchronize; - pDdiTable->pfnHostSynchronize = validation_layer::zeCommandListHostSynchronize; - - dditable.pfnGetDeviceHandle = pDdiTable->pfnGetDeviceHandle; - pDdiTable->pfnGetDeviceHandle = validation_layer::zeCommandListGetDeviceHandle; - - dditable.pfnGetContextHandle = pDdiTable->pfnGetContextHandle; - pDdiTable->pfnGetContextHandle = validation_layer::zeCommandListGetContextHandle; - - dditable.pfnGetOrdinal = pDdiTable->pfnGetOrdinal; - pDdiTable->pfnGetOrdinal = validation_layer::zeCommandListGetOrdinal; - - dditable.pfnImmediateGetIndex = pDdiTable->pfnImmediateGetIndex; - pDdiTable->pfnImmediateGetIndex = validation_layer::zeCommandListImmediateGetIndex; - - dditable.pfnIsImmediate = pDdiTable->pfnIsImmediate; - pDdiTable->pfnIsImmediate = validation_layer::zeCommandListIsImmediate; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCreate = pDdiTable->pfnCreate; + pDdiTable->pfnCreate = validation_layer::zeCommandListCreate; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCreateImmediate = pDdiTable->pfnCreateImmediate; + pDdiTable->pfnCreateImmediate = validation_layer::zeCommandListCreateImmediate; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnDestroy = pDdiTable->pfnDestroy; + pDdiTable->pfnDestroy = validation_layer::zeCommandListDestroy; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnClose = pDdiTable->pfnClose; + pDdiTable->pfnClose = validation_layer::zeCommandListClose; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnReset = pDdiTable->pfnReset; + pDdiTable->pfnReset = validation_layer::zeCommandListReset; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendWriteGlobalTimestamp = pDdiTable->pfnAppendWriteGlobalTimestamp; + pDdiTable->pfnAppendWriteGlobalTimestamp = validation_layer::zeCommandListAppendWriteGlobalTimestamp; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendBarrier = pDdiTable->pfnAppendBarrier; + pDdiTable->pfnAppendBarrier = validation_layer::zeCommandListAppendBarrier; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendMemoryRangesBarrier = pDdiTable->pfnAppendMemoryRangesBarrier; + pDdiTable->pfnAppendMemoryRangesBarrier = validation_layer::zeCommandListAppendMemoryRangesBarrier; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendMemoryCopy = pDdiTable->pfnAppendMemoryCopy; + pDdiTable->pfnAppendMemoryCopy = validation_layer::zeCommandListAppendMemoryCopy; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendMemoryFill = pDdiTable->pfnAppendMemoryFill; + pDdiTable->pfnAppendMemoryFill = validation_layer::zeCommandListAppendMemoryFill; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendMemoryCopyRegion = pDdiTable->pfnAppendMemoryCopyRegion; + pDdiTable->pfnAppendMemoryCopyRegion = validation_layer::zeCommandListAppendMemoryCopyRegion; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendMemoryCopyFromContext = pDdiTable->pfnAppendMemoryCopyFromContext; + pDdiTable->pfnAppendMemoryCopyFromContext = validation_layer::zeCommandListAppendMemoryCopyFromContext; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendImageCopy = pDdiTable->pfnAppendImageCopy; + pDdiTable->pfnAppendImageCopy = validation_layer::zeCommandListAppendImageCopy; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendImageCopyRegion = pDdiTable->pfnAppendImageCopyRegion; + pDdiTable->pfnAppendImageCopyRegion = validation_layer::zeCommandListAppendImageCopyRegion; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendImageCopyToMemory = pDdiTable->pfnAppendImageCopyToMemory; + pDdiTable->pfnAppendImageCopyToMemory = validation_layer::zeCommandListAppendImageCopyToMemory; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendImageCopyFromMemory = pDdiTable->pfnAppendImageCopyFromMemory; + pDdiTable->pfnAppendImageCopyFromMemory = validation_layer::zeCommandListAppendImageCopyFromMemory; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendMemoryPrefetch = pDdiTable->pfnAppendMemoryPrefetch; + pDdiTable->pfnAppendMemoryPrefetch = validation_layer::zeCommandListAppendMemoryPrefetch; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendMemAdvise = pDdiTable->pfnAppendMemAdvise; + pDdiTable->pfnAppendMemAdvise = validation_layer::zeCommandListAppendMemAdvise; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendSignalEvent = pDdiTable->pfnAppendSignalEvent; + pDdiTable->pfnAppendSignalEvent = validation_layer::zeCommandListAppendSignalEvent; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendWaitOnEvents = pDdiTable->pfnAppendWaitOnEvents; + pDdiTable->pfnAppendWaitOnEvents = validation_layer::zeCommandListAppendWaitOnEvents; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendEventReset = pDdiTable->pfnAppendEventReset; + pDdiTable->pfnAppendEventReset = validation_layer::zeCommandListAppendEventReset; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendQueryKernelTimestamps = pDdiTable->pfnAppendQueryKernelTimestamps; + pDdiTable->pfnAppendQueryKernelTimestamps = validation_layer::zeCommandListAppendQueryKernelTimestamps; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendLaunchKernel = pDdiTable->pfnAppendLaunchKernel; + pDdiTable->pfnAppendLaunchKernel = validation_layer::zeCommandListAppendLaunchKernel; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendLaunchCooperativeKernel = pDdiTable->pfnAppendLaunchCooperativeKernel; + pDdiTable->pfnAppendLaunchCooperativeKernel = validation_layer::zeCommandListAppendLaunchCooperativeKernel; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendLaunchKernelIndirect = pDdiTable->pfnAppendLaunchKernelIndirect; + pDdiTable->pfnAppendLaunchKernelIndirect = validation_layer::zeCommandListAppendLaunchKernelIndirect; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendLaunchMultipleKernelsIndirect = pDdiTable->pfnAppendLaunchMultipleKernelsIndirect; + pDdiTable->pfnAppendLaunchMultipleKernelsIndirect = validation_layer::zeCommandListAppendLaunchMultipleKernelsIndirect; + } + if (version >= ZE_API_VERSION_1_12) { + dditable.pfnAppendSignalExternalSemaphoreExt = pDdiTable->pfnAppendSignalExternalSemaphoreExt; + pDdiTable->pfnAppendSignalExternalSemaphoreExt = validation_layer::zeCommandListAppendSignalExternalSemaphoreExt; + } + if (version >= ZE_API_VERSION_1_12) { + dditable.pfnAppendWaitExternalSemaphoreExt = pDdiTable->pfnAppendWaitExternalSemaphoreExt; + pDdiTable->pfnAppendWaitExternalSemaphoreExt = validation_layer::zeCommandListAppendWaitExternalSemaphoreExt; + } + if (version >= ZE_API_VERSION_1_3) { + dditable.pfnAppendImageCopyToMemoryExt = pDdiTable->pfnAppendImageCopyToMemoryExt; + pDdiTable->pfnAppendImageCopyToMemoryExt = validation_layer::zeCommandListAppendImageCopyToMemoryExt; + } + if (version >= ZE_API_VERSION_1_3) { + dditable.pfnAppendImageCopyFromMemoryExt = pDdiTable->pfnAppendImageCopyFromMemoryExt; + pDdiTable->pfnAppendImageCopyFromMemoryExt = validation_layer::zeCommandListAppendImageCopyFromMemoryExt; + } + if (version >= ZE_API_VERSION_1_6) { + dditable.pfnHostSynchronize = pDdiTable->pfnHostSynchronize; + pDdiTable->pfnHostSynchronize = validation_layer::zeCommandListHostSynchronize; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetDeviceHandle = pDdiTable->pfnGetDeviceHandle; + pDdiTable->pfnGetDeviceHandle = validation_layer::zeCommandListGetDeviceHandle; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetContextHandle = pDdiTable->pfnGetContextHandle; + pDdiTable->pfnGetContextHandle = validation_layer::zeCommandListGetContextHandle; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetOrdinal = pDdiTable->pfnGetOrdinal; + pDdiTable->pfnGetOrdinal = validation_layer::zeCommandListGetOrdinal; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnImmediateGetIndex = pDdiTable->pfnImmediateGetIndex; + pDdiTable->pfnImmediateGetIndex = validation_layer::zeCommandListImmediateGetIndex; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnIsImmediate = pDdiTable->pfnIsImmediate; + pDdiTable->pfnIsImmediate = validation_layer::zeCommandListIsImmediate; + } return result; } @@ -9478,36 +9559,43 @@ zeGetCommandListExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetNextCommandIdWithKernelsExp = pDdiTable->pfnGetNextCommandIdWithKernelsExp; - pDdiTable->pfnGetNextCommandIdWithKernelsExp = validation_layer::zeCommandListGetNextCommandIdWithKernelsExp; - - dditable.pfnUpdateMutableCommandKernelsExp = pDdiTable->pfnUpdateMutableCommandKernelsExp; - pDdiTable->pfnUpdateMutableCommandKernelsExp = validation_layer::zeCommandListUpdateMutableCommandKernelsExp; - - dditable.pfnCreateCloneExp = pDdiTable->pfnCreateCloneExp; - pDdiTable->pfnCreateCloneExp = validation_layer::zeCommandListCreateCloneExp; - - dditable.pfnImmediateAppendCommandListsExp = pDdiTable->pfnImmediateAppendCommandListsExp; - pDdiTable->pfnImmediateAppendCommandListsExp = validation_layer::zeCommandListImmediateAppendCommandListsExp; - - dditable.pfnGetNextCommandIdExp = pDdiTable->pfnGetNextCommandIdExp; - pDdiTable->pfnGetNextCommandIdExp = validation_layer::zeCommandListGetNextCommandIdExp; - - dditable.pfnUpdateMutableCommandsExp = pDdiTable->pfnUpdateMutableCommandsExp; - pDdiTable->pfnUpdateMutableCommandsExp = validation_layer::zeCommandListUpdateMutableCommandsExp; - - dditable.pfnUpdateMutableCommandSignalEventExp = pDdiTable->pfnUpdateMutableCommandSignalEventExp; - pDdiTable->pfnUpdateMutableCommandSignalEventExp = validation_layer::zeCommandListUpdateMutableCommandSignalEventExp; - - dditable.pfnUpdateMutableCommandWaitEventsExp = pDdiTable->pfnUpdateMutableCommandWaitEventsExp; - pDdiTable->pfnUpdateMutableCommandWaitEventsExp = validation_layer::zeCommandListUpdateMutableCommandWaitEventsExp; - + if (version >= ZE_API_VERSION_1_10) { + dditable.pfnGetNextCommandIdWithKernelsExp = pDdiTable->pfnGetNextCommandIdWithKernelsExp; + pDdiTable->pfnGetNextCommandIdWithKernelsExp = validation_layer::zeCommandListGetNextCommandIdWithKernelsExp; + } + if (version >= ZE_API_VERSION_1_10) { + dditable.pfnUpdateMutableCommandKernelsExp = pDdiTable->pfnUpdateMutableCommandKernelsExp; + pDdiTable->pfnUpdateMutableCommandKernelsExp = validation_layer::zeCommandListUpdateMutableCommandKernelsExp; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnCreateCloneExp = pDdiTable->pfnCreateCloneExp; + pDdiTable->pfnCreateCloneExp = validation_layer::zeCommandListCreateCloneExp; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnImmediateAppendCommandListsExp = pDdiTable->pfnImmediateAppendCommandListsExp; + pDdiTable->pfnImmediateAppendCommandListsExp = validation_layer::zeCommandListImmediateAppendCommandListsExp; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetNextCommandIdExp = pDdiTable->pfnGetNextCommandIdExp; + pDdiTable->pfnGetNextCommandIdExp = validation_layer::zeCommandListGetNextCommandIdExp; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnUpdateMutableCommandsExp = pDdiTable->pfnUpdateMutableCommandsExp; + pDdiTable->pfnUpdateMutableCommandsExp = validation_layer::zeCommandListUpdateMutableCommandsExp; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnUpdateMutableCommandSignalEventExp = pDdiTable->pfnUpdateMutableCommandSignalEventExp; + pDdiTable->pfnUpdateMutableCommandSignalEventExp = validation_layer::zeCommandListUpdateMutableCommandSignalEventExp; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnUpdateMutableCommandWaitEventsExp = pDdiTable->pfnUpdateMutableCommandWaitEventsExp; + pDdiTable->pfnUpdateMutableCommandWaitEventsExp = validation_layer::zeCommandListUpdateMutableCommandWaitEventsExp; + } return result; } @@ -9530,45 +9618,55 @@ zeGetEventProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnCreate = pDdiTable->pfnCreate; - pDdiTable->pfnCreate = validation_layer::zeEventCreate; - - dditable.pfnDestroy = pDdiTable->pfnDestroy; - pDdiTable->pfnDestroy = validation_layer::zeEventDestroy; - - dditable.pfnHostSignal = pDdiTable->pfnHostSignal; - pDdiTable->pfnHostSignal = validation_layer::zeEventHostSignal; - - dditable.pfnHostSynchronize = pDdiTable->pfnHostSynchronize; - pDdiTable->pfnHostSynchronize = validation_layer::zeEventHostSynchronize; - - dditable.pfnQueryStatus = pDdiTable->pfnQueryStatus; - pDdiTable->pfnQueryStatus = validation_layer::zeEventQueryStatus; - - dditable.pfnHostReset = pDdiTable->pfnHostReset; - pDdiTable->pfnHostReset = validation_layer::zeEventHostReset; - - dditable.pfnQueryKernelTimestamp = pDdiTable->pfnQueryKernelTimestamp; - pDdiTable->pfnQueryKernelTimestamp = validation_layer::zeEventQueryKernelTimestamp; - - dditable.pfnQueryKernelTimestampsExt = pDdiTable->pfnQueryKernelTimestampsExt; - pDdiTable->pfnQueryKernelTimestampsExt = validation_layer::zeEventQueryKernelTimestampsExt; - - dditable.pfnGetEventPool = pDdiTable->pfnGetEventPool; - pDdiTable->pfnGetEventPool = validation_layer::zeEventGetEventPool; - - dditable.pfnGetSignalScope = pDdiTable->pfnGetSignalScope; - pDdiTable->pfnGetSignalScope = validation_layer::zeEventGetSignalScope; - - dditable.pfnGetWaitScope = pDdiTable->pfnGetWaitScope; - pDdiTable->pfnGetWaitScope = validation_layer::zeEventGetWaitScope; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCreate = pDdiTable->pfnCreate; + pDdiTable->pfnCreate = validation_layer::zeEventCreate; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnDestroy = pDdiTable->pfnDestroy; + pDdiTable->pfnDestroy = validation_layer::zeEventDestroy; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnHostSignal = pDdiTable->pfnHostSignal; + pDdiTable->pfnHostSignal = validation_layer::zeEventHostSignal; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnHostSynchronize = pDdiTable->pfnHostSynchronize; + pDdiTable->pfnHostSynchronize = validation_layer::zeEventHostSynchronize; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnQueryStatus = pDdiTable->pfnQueryStatus; + pDdiTable->pfnQueryStatus = validation_layer::zeEventQueryStatus; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnHostReset = pDdiTable->pfnHostReset; + pDdiTable->pfnHostReset = validation_layer::zeEventHostReset; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnQueryKernelTimestamp = pDdiTable->pfnQueryKernelTimestamp; + pDdiTable->pfnQueryKernelTimestamp = validation_layer::zeEventQueryKernelTimestamp; + } + if (version >= ZE_API_VERSION_1_6) { + dditable.pfnQueryKernelTimestampsExt = pDdiTable->pfnQueryKernelTimestampsExt; + pDdiTable->pfnQueryKernelTimestampsExt = validation_layer::zeEventQueryKernelTimestampsExt; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetEventPool = pDdiTable->pfnGetEventPool; + pDdiTable->pfnGetEventPool = validation_layer::zeEventGetEventPool; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetSignalScope = pDdiTable->pfnGetSignalScope; + pDdiTable->pfnGetSignalScope = validation_layer::zeEventGetSignalScope; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetWaitScope = pDdiTable->pfnGetWaitScope; + pDdiTable->pfnGetWaitScope = validation_layer::zeEventGetWaitScope; + } return result; } @@ -9591,15 +9689,15 @@ zeGetEventExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnQueryTimestampsExp = pDdiTable->pfnQueryTimestampsExp; - pDdiTable->pfnQueryTimestampsExp = validation_layer::zeEventQueryTimestampsExp; - + if (version >= ZE_API_VERSION_1_2) { + dditable.pfnQueryTimestampsExp = pDdiTable->pfnQueryTimestampsExp; + pDdiTable->pfnQueryTimestampsExp = validation_layer::zeEventQueryTimestampsExp; + } return result; } @@ -9622,36 +9720,43 @@ zeGetEventPoolProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnCreate = pDdiTable->pfnCreate; - pDdiTable->pfnCreate = validation_layer::zeEventPoolCreate; - - dditable.pfnDestroy = pDdiTable->pfnDestroy; - pDdiTable->pfnDestroy = validation_layer::zeEventPoolDestroy; - - dditable.pfnGetIpcHandle = pDdiTable->pfnGetIpcHandle; - pDdiTable->pfnGetIpcHandle = validation_layer::zeEventPoolGetIpcHandle; - - dditable.pfnOpenIpcHandle = pDdiTable->pfnOpenIpcHandle; - pDdiTable->pfnOpenIpcHandle = validation_layer::zeEventPoolOpenIpcHandle; - - dditable.pfnCloseIpcHandle = pDdiTable->pfnCloseIpcHandle; - pDdiTable->pfnCloseIpcHandle = validation_layer::zeEventPoolCloseIpcHandle; - - dditable.pfnPutIpcHandle = pDdiTable->pfnPutIpcHandle; - pDdiTable->pfnPutIpcHandle = validation_layer::zeEventPoolPutIpcHandle; - - dditable.pfnGetContextHandle = pDdiTable->pfnGetContextHandle; - pDdiTable->pfnGetContextHandle = validation_layer::zeEventPoolGetContextHandle; - - dditable.pfnGetFlags = pDdiTable->pfnGetFlags; - pDdiTable->pfnGetFlags = validation_layer::zeEventPoolGetFlags; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCreate = pDdiTable->pfnCreate; + pDdiTable->pfnCreate = validation_layer::zeEventPoolCreate; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnDestroy = pDdiTable->pfnDestroy; + pDdiTable->pfnDestroy = validation_layer::zeEventPoolDestroy; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetIpcHandle = pDdiTable->pfnGetIpcHandle; + pDdiTable->pfnGetIpcHandle = validation_layer::zeEventPoolGetIpcHandle; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnOpenIpcHandle = pDdiTable->pfnOpenIpcHandle; + pDdiTable->pfnOpenIpcHandle = validation_layer::zeEventPoolOpenIpcHandle; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCloseIpcHandle = pDdiTable->pfnCloseIpcHandle; + pDdiTable->pfnCloseIpcHandle = validation_layer::zeEventPoolCloseIpcHandle; + } + if (version >= ZE_API_VERSION_1_6) { + dditable.pfnPutIpcHandle = pDdiTable->pfnPutIpcHandle; + pDdiTable->pfnPutIpcHandle = validation_layer::zeEventPoolPutIpcHandle; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetContextHandle = pDdiTable->pfnGetContextHandle; + pDdiTable->pfnGetContextHandle = validation_layer::zeEventPoolGetContextHandle; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetFlags = pDdiTable->pfnGetFlags; + pDdiTable->pfnGetFlags = validation_layer::zeEventPoolGetFlags; + } return result; } @@ -9674,27 +9779,31 @@ zeGetFenceProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnCreate = pDdiTable->pfnCreate; - pDdiTable->pfnCreate = validation_layer::zeFenceCreate; - - dditable.pfnDestroy = pDdiTable->pfnDestroy; - pDdiTable->pfnDestroy = validation_layer::zeFenceDestroy; - - dditable.pfnHostSynchronize = pDdiTable->pfnHostSynchronize; - pDdiTable->pfnHostSynchronize = validation_layer::zeFenceHostSynchronize; - - dditable.pfnQueryStatus = pDdiTable->pfnQueryStatus; - pDdiTable->pfnQueryStatus = validation_layer::zeFenceQueryStatus; - - dditable.pfnReset = pDdiTable->pfnReset; - pDdiTable->pfnReset = validation_layer::zeFenceReset; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCreate = pDdiTable->pfnCreate; + pDdiTable->pfnCreate = validation_layer::zeFenceCreate; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnDestroy = pDdiTable->pfnDestroy; + pDdiTable->pfnDestroy = validation_layer::zeFenceDestroy; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnHostSynchronize = pDdiTable->pfnHostSynchronize; + pDdiTable->pfnHostSynchronize = validation_layer::zeFenceHostSynchronize; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnQueryStatus = pDdiTable->pfnQueryStatus; + pDdiTable->pfnQueryStatus = validation_layer::zeFenceQueryStatus; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnReset = pDdiTable->pfnReset; + pDdiTable->pfnReset = validation_layer::zeFenceReset; + } return result; } @@ -9717,27 +9826,31 @@ zeGetImageProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetProperties = pDdiTable->pfnGetProperties; - pDdiTable->pfnGetProperties = validation_layer::zeImageGetProperties; - - dditable.pfnCreate = pDdiTable->pfnCreate; - pDdiTable->pfnCreate = validation_layer::zeImageCreate; - - dditable.pfnDestroy = pDdiTable->pfnDestroy; - pDdiTable->pfnDestroy = validation_layer::zeImageDestroy; - - dditable.pfnGetAllocPropertiesExt = pDdiTable->pfnGetAllocPropertiesExt; - pDdiTable->pfnGetAllocPropertiesExt = validation_layer::zeImageGetAllocPropertiesExt; - - dditable.pfnViewCreateExt = pDdiTable->pfnViewCreateExt; - pDdiTable->pfnViewCreateExt = validation_layer::zeImageViewCreateExt; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetProperties = pDdiTable->pfnGetProperties; + pDdiTable->pfnGetProperties = validation_layer::zeImageGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCreate = pDdiTable->pfnCreate; + pDdiTable->pfnCreate = validation_layer::zeImageCreate; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnDestroy = pDdiTable->pfnDestroy; + pDdiTable->pfnDestroy = validation_layer::zeImageDestroy; + } + if (version >= ZE_API_VERSION_1_3) { + dditable.pfnGetAllocPropertiesExt = pDdiTable->pfnGetAllocPropertiesExt; + pDdiTable->pfnGetAllocPropertiesExt = validation_layer::zeImageGetAllocPropertiesExt; + } + if (version >= ZE_API_VERSION_1_5) { + dditable.pfnViewCreateExt = pDdiTable->pfnViewCreateExt; + pDdiTable->pfnViewCreateExt = validation_layer::zeImageViewCreateExt; + } return result; } @@ -9760,21 +9873,23 @@ zeGetImageExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetMemoryPropertiesExp = pDdiTable->pfnGetMemoryPropertiesExp; - pDdiTable->pfnGetMemoryPropertiesExp = validation_layer::zeImageGetMemoryPropertiesExp; - - dditable.pfnViewCreateExp = pDdiTable->pfnViewCreateExp; - pDdiTable->pfnViewCreateExp = validation_layer::zeImageViewCreateExp; - - dditable.pfnGetDeviceOffsetExp = pDdiTable->pfnGetDeviceOffsetExp; - pDdiTable->pfnGetDeviceOffsetExp = validation_layer::zeImageGetDeviceOffsetExp; - + if (version >= ZE_API_VERSION_1_2) { + dditable.pfnGetMemoryPropertiesExp = pDdiTable->pfnGetMemoryPropertiesExp; + pDdiTable->pfnGetMemoryPropertiesExp = validation_layer::zeImageGetMemoryPropertiesExp; + } + if (version >= ZE_API_VERSION_1_2) { + dditable.pfnViewCreateExp = pDdiTable->pfnViewCreateExp; + pDdiTable->pfnViewCreateExp = validation_layer::zeImageViewCreateExp; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetDeviceOffsetExp = pDdiTable->pfnGetDeviceOffsetExp; + pDdiTable->pfnGetDeviceOffsetExp = validation_layer::zeImageGetDeviceOffsetExp; + } return result; } @@ -9797,48 +9912,59 @@ zeGetKernelProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnCreate = pDdiTable->pfnCreate; - pDdiTable->pfnCreate = validation_layer::zeKernelCreate; - - dditable.pfnDestroy = pDdiTable->pfnDestroy; - pDdiTable->pfnDestroy = validation_layer::zeKernelDestroy; - - dditable.pfnSetCacheConfig = pDdiTable->pfnSetCacheConfig; - pDdiTable->pfnSetCacheConfig = validation_layer::zeKernelSetCacheConfig; - - dditable.pfnSetGroupSize = pDdiTable->pfnSetGroupSize; - pDdiTable->pfnSetGroupSize = validation_layer::zeKernelSetGroupSize; - - dditable.pfnSuggestGroupSize = pDdiTable->pfnSuggestGroupSize; - pDdiTable->pfnSuggestGroupSize = validation_layer::zeKernelSuggestGroupSize; - - dditable.pfnSuggestMaxCooperativeGroupCount = pDdiTable->pfnSuggestMaxCooperativeGroupCount; - pDdiTable->pfnSuggestMaxCooperativeGroupCount = validation_layer::zeKernelSuggestMaxCooperativeGroupCount; - - dditable.pfnSetArgumentValue = pDdiTable->pfnSetArgumentValue; - pDdiTable->pfnSetArgumentValue = validation_layer::zeKernelSetArgumentValue; - - dditable.pfnSetIndirectAccess = pDdiTable->pfnSetIndirectAccess; - pDdiTable->pfnSetIndirectAccess = validation_layer::zeKernelSetIndirectAccess; - - dditable.pfnGetIndirectAccess = pDdiTable->pfnGetIndirectAccess; - pDdiTable->pfnGetIndirectAccess = validation_layer::zeKernelGetIndirectAccess; - - dditable.pfnGetSourceAttributes = pDdiTable->pfnGetSourceAttributes; - pDdiTable->pfnGetSourceAttributes = validation_layer::zeKernelGetSourceAttributes; - - dditable.pfnGetProperties = pDdiTable->pfnGetProperties; - pDdiTable->pfnGetProperties = validation_layer::zeKernelGetProperties; - - dditable.pfnGetName = pDdiTable->pfnGetName; - pDdiTable->pfnGetName = validation_layer::zeKernelGetName; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCreate = pDdiTable->pfnCreate; + pDdiTable->pfnCreate = validation_layer::zeKernelCreate; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnDestroy = pDdiTable->pfnDestroy; + pDdiTable->pfnDestroy = validation_layer::zeKernelDestroy; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSetCacheConfig = pDdiTable->pfnSetCacheConfig; + pDdiTable->pfnSetCacheConfig = validation_layer::zeKernelSetCacheConfig; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSetGroupSize = pDdiTable->pfnSetGroupSize; + pDdiTable->pfnSetGroupSize = validation_layer::zeKernelSetGroupSize; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSuggestGroupSize = pDdiTable->pfnSuggestGroupSize; + pDdiTable->pfnSuggestGroupSize = validation_layer::zeKernelSuggestGroupSize; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSuggestMaxCooperativeGroupCount = pDdiTable->pfnSuggestMaxCooperativeGroupCount; + pDdiTable->pfnSuggestMaxCooperativeGroupCount = validation_layer::zeKernelSuggestMaxCooperativeGroupCount; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSetArgumentValue = pDdiTable->pfnSetArgumentValue; + pDdiTable->pfnSetArgumentValue = validation_layer::zeKernelSetArgumentValue; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSetIndirectAccess = pDdiTable->pfnSetIndirectAccess; + pDdiTable->pfnSetIndirectAccess = validation_layer::zeKernelSetIndirectAccess; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetIndirectAccess = pDdiTable->pfnGetIndirectAccess; + pDdiTable->pfnGetIndirectAccess = validation_layer::zeKernelGetIndirectAccess; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetSourceAttributes = pDdiTable->pfnGetSourceAttributes; + pDdiTable->pfnGetSourceAttributes = validation_layer::zeKernelGetSourceAttributes; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetProperties = pDdiTable->pfnGetProperties; + pDdiTable->pfnGetProperties = validation_layer::zeKernelGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetName = pDdiTable->pfnGetName; + pDdiTable->pfnGetName = validation_layer::zeKernelGetName; + } return result; } @@ -9861,21 +9987,23 @@ zeGetKernelExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnSetGlobalOffsetExp = pDdiTable->pfnSetGlobalOffsetExp; - pDdiTable->pfnSetGlobalOffsetExp = validation_layer::zeKernelSetGlobalOffsetExp; - - dditable.pfnGetBinaryExp = pDdiTable->pfnGetBinaryExp; - pDdiTable->pfnGetBinaryExp = validation_layer::zeKernelGetBinaryExp; - - dditable.pfnSchedulingHintExp = pDdiTable->pfnSchedulingHintExp; - pDdiTable->pfnSchedulingHintExp = validation_layer::zeKernelSchedulingHintExp; - + if (version >= ZE_API_VERSION_1_1) { + dditable.pfnSetGlobalOffsetExp = pDdiTable->pfnSetGlobalOffsetExp; + pDdiTable->pfnSetGlobalOffsetExp = validation_layer::zeKernelSetGlobalOffsetExp; + } + if (version >= ZE_API_VERSION_1_11) { + dditable.pfnGetBinaryExp = pDdiTable->pfnGetBinaryExp; + pDdiTable->pfnGetBinaryExp = validation_layer::zeKernelGetBinaryExp; + } + if (version >= ZE_API_VERSION_1_2) { + dditable.pfnSchedulingHintExp = pDdiTable->pfnSchedulingHintExp; + pDdiTable->pfnSchedulingHintExp = validation_layer::zeKernelSchedulingHintExp; + } return result; } @@ -9898,48 +10026,59 @@ zeGetMemProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnAllocShared = pDdiTable->pfnAllocShared; - pDdiTable->pfnAllocShared = validation_layer::zeMemAllocShared; - - dditable.pfnAllocDevice = pDdiTable->pfnAllocDevice; - pDdiTable->pfnAllocDevice = validation_layer::zeMemAllocDevice; - - dditable.pfnAllocHost = pDdiTable->pfnAllocHost; - pDdiTable->pfnAllocHost = validation_layer::zeMemAllocHost; - - dditable.pfnFree = pDdiTable->pfnFree; - pDdiTable->pfnFree = validation_layer::zeMemFree; - - dditable.pfnGetAllocProperties = pDdiTable->pfnGetAllocProperties; - pDdiTable->pfnGetAllocProperties = validation_layer::zeMemGetAllocProperties; - - dditable.pfnGetAddressRange = pDdiTable->pfnGetAddressRange; - pDdiTable->pfnGetAddressRange = validation_layer::zeMemGetAddressRange; - - dditable.pfnGetIpcHandle = pDdiTable->pfnGetIpcHandle; - pDdiTable->pfnGetIpcHandle = validation_layer::zeMemGetIpcHandle; - - dditable.pfnOpenIpcHandle = pDdiTable->pfnOpenIpcHandle; - pDdiTable->pfnOpenIpcHandle = validation_layer::zeMemOpenIpcHandle; - - dditable.pfnCloseIpcHandle = pDdiTable->pfnCloseIpcHandle; - pDdiTable->pfnCloseIpcHandle = validation_layer::zeMemCloseIpcHandle; - - dditable.pfnFreeExt = pDdiTable->pfnFreeExt; - pDdiTable->pfnFreeExt = validation_layer::zeMemFreeExt; - - dditable.pfnPutIpcHandle = pDdiTable->pfnPutIpcHandle; - pDdiTable->pfnPutIpcHandle = validation_layer::zeMemPutIpcHandle; - - dditable.pfnGetPitchFor2dImage = pDdiTable->pfnGetPitchFor2dImage; - pDdiTable->pfnGetPitchFor2dImage = validation_layer::zeMemGetPitchFor2dImage; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAllocShared = pDdiTable->pfnAllocShared; + pDdiTable->pfnAllocShared = validation_layer::zeMemAllocShared; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAllocDevice = pDdiTable->pfnAllocDevice; + pDdiTable->pfnAllocDevice = validation_layer::zeMemAllocDevice; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAllocHost = pDdiTable->pfnAllocHost; + pDdiTable->pfnAllocHost = validation_layer::zeMemAllocHost; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnFree = pDdiTable->pfnFree; + pDdiTable->pfnFree = validation_layer::zeMemFree; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetAllocProperties = pDdiTable->pfnGetAllocProperties; + pDdiTable->pfnGetAllocProperties = validation_layer::zeMemGetAllocProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetAddressRange = pDdiTable->pfnGetAddressRange; + pDdiTable->pfnGetAddressRange = validation_layer::zeMemGetAddressRange; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetIpcHandle = pDdiTable->pfnGetIpcHandle; + pDdiTable->pfnGetIpcHandle = validation_layer::zeMemGetIpcHandle; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnOpenIpcHandle = pDdiTable->pfnOpenIpcHandle; + pDdiTable->pfnOpenIpcHandle = validation_layer::zeMemOpenIpcHandle; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCloseIpcHandle = pDdiTable->pfnCloseIpcHandle; + pDdiTable->pfnCloseIpcHandle = validation_layer::zeMemCloseIpcHandle; + } + if (version >= ZE_API_VERSION_1_3) { + dditable.pfnFreeExt = pDdiTable->pfnFreeExt; + pDdiTable->pfnFreeExt = validation_layer::zeMemFreeExt; + } + if (version >= ZE_API_VERSION_1_6) { + dditable.pfnPutIpcHandle = pDdiTable->pfnPutIpcHandle; + pDdiTable->pfnPutIpcHandle = validation_layer::zeMemPutIpcHandle; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetPitchFor2dImage = pDdiTable->pfnGetPitchFor2dImage; + pDdiTable->pfnGetPitchFor2dImage = validation_layer::zeMemGetPitchFor2dImage; + } return result; } @@ -9962,24 +10101,27 @@ zeGetMemExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetIpcHandleFromFileDescriptorExp = pDdiTable->pfnGetIpcHandleFromFileDescriptorExp; - pDdiTable->pfnGetIpcHandleFromFileDescriptorExp = validation_layer::zeMemGetIpcHandleFromFileDescriptorExp; - - dditable.pfnGetFileDescriptorFromIpcHandleExp = pDdiTable->pfnGetFileDescriptorFromIpcHandleExp; - pDdiTable->pfnGetFileDescriptorFromIpcHandleExp = validation_layer::zeMemGetFileDescriptorFromIpcHandleExp; - - dditable.pfnSetAtomicAccessAttributeExp = pDdiTable->pfnSetAtomicAccessAttributeExp; - pDdiTable->pfnSetAtomicAccessAttributeExp = validation_layer::zeMemSetAtomicAccessAttributeExp; - - dditable.pfnGetAtomicAccessAttributeExp = pDdiTable->pfnGetAtomicAccessAttributeExp; - pDdiTable->pfnGetAtomicAccessAttributeExp = validation_layer::zeMemGetAtomicAccessAttributeExp; - + if (version >= ZE_API_VERSION_1_6) { + dditable.pfnGetIpcHandleFromFileDescriptorExp = pDdiTable->pfnGetIpcHandleFromFileDescriptorExp; + pDdiTable->pfnGetIpcHandleFromFileDescriptorExp = validation_layer::zeMemGetIpcHandleFromFileDescriptorExp; + } + if (version >= ZE_API_VERSION_1_6) { + dditable.pfnGetFileDescriptorFromIpcHandleExp = pDdiTable->pfnGetFileDescriptorFromIpcHandleExp; + pDdiTable->pfnGetFileDescriptorFromIpcHandleExp = validation_layer::zeMemGetFileDescriptorFromIpcHandleExp; + } + if (version >= ZE_API_VERSION_1_7) { + dditable.pfnSetAtomicAccessAttributeExp = pDdiTable->pfnSetAtomicAccessAttributeExp; + pDdiTable->pfnSetAtomicAccessAttributeExp = validation_layer::zeMemSetAtomicAccessAttributeExp; + } + if (version >= ZE_API_VERSION_1_7) { + dditable.pfnGetAtomicAccessAttributeExp = pDdiTable->pfnGetAtomicAccessAttributeExp; + pDdiTable->pfnGetAtomicAccessAttributeExp = validation_layer::zeMemGetAtomicAccessAttributeExp; + } return result; } @@ -10002,39 +10144,47 @@ zeGetModuleProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnCreate = pDdiTable->pfnCreate; - pDdiTable->pfnCreate = validation_layer::zeModuleCreate; - - dditable.pfnDestroy = pDdiTable->pfnDestroy; - pDdiTable->pfnDestroy = validation_layer::zeModuleDestroy; - - dditable.pfnDynamicLink = pDdiTable->pfnDynamicLink; - pDdiTable->pfnDynamicLink = validation_layer::zeModuleDynamicLink; - - dditable.pfnGetNativeBinary = pDdiTable->pfnGetNativeBinary; - pDdiTable->pfnGetNativeBinary = validation_layer::zeModuleGetNativeBinary; - - dditable.pfnGetGlobalPointer = pDdiTable->pfnGetGlobalPointer; - pDdiTable->pfnGetGlobalPointer = validation_layer::zeModuleGetGlobalPointer; - - dditable.pfnGetKernelNames = pDdiTable->pfnGetKernelNames; - pDdiTable->pfnGetKernelNames = validation_layer::zeModuleGetKernelNames; - - dditable.pfnGetProperties = pDdiTable->pfnGetProperties; - pDdiTable->pfnGetProperties = validation_layer::zeModuleGetProperties; - - dditable.pfnGetFunctionPointer = pDdiTable->pfnGetFunctionPointer; - pDdiTable->pfnGetFunctionPointer = validation_layer::zeModuleGetFunctionPointer; - - dditable.pfnInspectLinkageExt = pDdiTable->pfnInspectLinkageExt; - pDdiTable->pfnInspectLinkageExt = validation_layer::zeModuleInspectLinkageExt; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCreate = pDdiTable->pfnCreate; + pDdiTable->pfnCreate = validation_layer::zeModuleCreate; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnDestroy = pDdiTable->pfnDestroy; + pDdiTable->pfnDestroy = validation_layer::zeModuleDestroy; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnDynamicLink = pDdiTable->pfnDynamicLink; + pDdiTable->pfnDynamicLink = validation_layer::zeModuleDynamicLink; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetNativeBinary = pDdiTable->pfnGetNativeBinary; + pDdiTable->pfnGetNativeBinary = validation_layer::zeModuleGetNativeBinary; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetGlobalPointer = pDdiTable->pfnGetGlobalPointer; + pDdiTable->pfnGetGlobalPointer = validation_layer::zeModuleGetGlobalPointer; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetKernelNames = pDdiTable->pfnGetKernelNames; + pDdiTable->pfnGetKernelNames = validation_layer::zeModuleGetKernelNames; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetProperties = pDdiTable->pfnGetProperties; + pDdiTable->pfnGetProperties = validation_layer::zeModuleGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetFunctionPointer = pDdiTable->pfnGetFunctionPointer; + pDdiTable->pfnGetFunctionPointer = validation_layer::zeModuleGetFunctionPointer; + } + if (version >= ZE_API_VERSION_1_3) { + dditable.pfnInspectLinkageExt = pDdiTable->pfnInspectLinkageExt; + pDdiTable->pfnInspectLinkageExt = validation_layer::zeModuleInspectLinkageExt; + } return result; } @@ -10057,18 +10207,19 @@ zeGetModuleBuildLogProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnDestroy = pDdiTable->pfnDestroy; - pDdiTable->pfnDestroy = validation_layer::zeModuleBuildLogDestroy; - - dditable.pfnGetString = pDdiTable->pfnGetString; - pDdiTable->pfnGetString = validation_layer::zeModuleBuildLogGetString; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnDestroy = pDdiTable->pfnDestroy; + pDdiTable->pfnDestroy = validation_layer::zeModuleBuildLogDestroy; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetString = pDdiTable->pfnGetString; + pDdiTable->pfnGetString = validation_layer::zeModuleBuildLogGetString; + } return result; } @@ -10091,18 +10242,19 @@ zeGetPhysicalMemProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnCreate = pDdiTable->pfnCreate; - pDdiTable->pfnCreate = validation_layer::zePhysicalMemCreate; - - dditable.pfnDestroy = pDdiTable->pfnDestroy; - pDdiTable->pfnDestroy = validation_layer::zePhysicalMemDestroy; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCreate = pDdiTable->pfnCreate; + pDdiTable->pfnCreate = validation_layer::zePhysicalMemCreate; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnDestroy = pDdiTable->pfnDestroy; + pDdiTable->pfnDestroy = validation_layer::zePhysicalMemDestroy; + } return result; } @@ -10125,18 +10277,19 @@ zeGetSamplerProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnCreate = pDdiTable->pfnCreate; - pDdiTable->pfnCreate = validation_layer::zeSamplerCreate; - - dditable.pfnDestroy = pDdiTable->pfnDestroy; - pDdiTable->pfnDestroy = validation_layer::zeSamplerDestroy; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCreate = pDdiTable->pfnCreate; + pDdiTable->pfnCreate = validation_layer::zeSamplerCreate; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnDestroy = pDdiTable->pfnDestroy; + pDdiTable->pfnDestroy = validation_layer::zeSamplerDestroy; + } return result; } @@ -10159,33 +10312,39 @@ zeGetVirtualMemProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnReserve = pDdiTable->pfnReserve; - pDdiTable->pfnReserve = validation_layer::zeVirtualMemReserve; - - dditable.pfnFree = pDdiTable->pfnFree; - pDdiTable->pfnFree = validation_layer::zeVirtualMemFree; - - dditable.pfnQueryPageSize = pDdiTable->pfnQueryPageSize; - pDdiTable->pfnQueryPageSize = validation_layer::zeVirtualMemQueryPageSize; - - dditable.pfnMap = pDdiTable->pfnMap; - pDdiTable->pfnMap = validation_layer::zeVirtualMemMap; - - dditable.pfnUnmap = pDdiTable->pfnUnmap; - pDdiTable->pfnUnmap = validation_layer::zeVirtualMemUnmap; - - dditable.pfnSetAccessAttribute = pDdiTable->pfnSetAccessAttribute; - pDdiTable->pfnSetAccessAttribute = validation_layer::zeVirtualMemSetAccessAttribute; - - dditable.pfnGetAccessAttribute = pDdiTable->pfnGetAccessAttribute; - pDdiTable->pfnGetAccessAttribute = validation_layer::zeVirtualMemGetAccessAttribute; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnReserve = pDdiTable->pfnReserve; + pDdiTable->pfnReserve = validation_layer::zeVirtualMemReserve; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnFree = pDdiTable->pfnFree; + pDdiTable->pfnFree = validation_layer::zeVirtualMemFree; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnQueryPageSize = pDdiTable->pfnQueryPageSize; + pDdiTable->pfnQueryPageSize = validation_layer::zeVirtualMemQueryPageSize; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnMap = pDdiTable->pfnMap; + pDdiTable->pfnMap = validation_layer::zeVirtualMemMap; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnUnmap = pDdiTable->pfnUnmap; + pDdiTable->pfnUnmap = validation_layer::zeVirtualMemUnmap; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSetAccessAttribute = pDdiTable->pfnSetAccessAttribute; + pDdiTable->pfnSetAccessAttribute = validation_layer::zeVirtualMemSetAccessAttribute; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetAccessAttribute = pDdiTable->pfnGetAccessAttribute; + pDdiTable->pfnGetAccessAttribute = validation_layer::zeVirtualMemGetAccessAttribute; + } return result; } @@ -10208,21 +10367,23 @@ zeGetFabricEdgeExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetExp = pDdiTable->pfnGetExp; - pDdiTable->pfnGetExp = validation_layer::zeFabricEdgeGetExp; - - dditable.pfnGetVerticesExp = pDdiTable->pfnGetVerticesExp; - pDdiTable->pfnGetVerticesExp = validation_layer::zeFabricEdgeGetVerticesExp; - - dditable.pfnGetPropertiesExp = pDdiTable->pfnGetPropertiesExp; - pDdiTable->pfnGetPropertiesExp = validation_layer::zeFabricEdgeGetPropertiesExp; - + if (version >= ZE_API_VERSION_1_4) { + dditable.pfnGetExp = pDdiTable->pfnGetExp; + pDdiTable->pfnGetExp = validation_layer::zeFabricEdgeGetExp; + } + if (version >= ZE_API_VERSION_1_4) { + dditable.pfnGetVerticesExp = pDdiTable->pfnGetVerticesExp; + pDdiTable->pfnGetVerticesExp = validation_layer::zeFabricEdgeGetVerticesExp; + } + if (version >= ZE_API_VERSION_1_4) { + dditable.pfnGetPropertiesExp = pDdiTable->pfnGetPropertiesExp; + pDdiTable->pfnGetPropertiesExp = validation_layer::zeFabricEdgeGetPropertiesExp; + } return result; } @@ -10245,24 +10406,27 @@ zeGetFabricVertexExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetExp = pDdiTable->pfnGetExp; - pDdiTable->pfnGetExp = validation_layer::zeFabricVertexGetExp; - - dditable.pfnGetSubVerticesExp = pDdiTable->pfnGetSubVerticesExp; - pDdiTable->pfnGetSubVerticesExp = validation_layer::zeFabricVertexGetSubVerticesExp; - - dditable.pfnGetPropertiesExp = pDdiTable->pfnGetPropertiesExp; - pDdiTable->pfnGetPropertiesExp = validation_layer::zeFabricVertexGetPropertiesExp; - - dditable.pfnGetDeviceExp = pDdiTable->pfnGetDeviceExp; - pDdiTable->pfnGetDeviceExp = validation_layer::zeFabricVertexGetDeviceExp; - + if (version >= ZE_API_VERSION_1_4) { + dditable.pfnGetExp = pDdiTable->pfnGetExp; + pDdiTable->pfnGetExp = validation_layer::zeFabricVertexGetExp; + } + if (version >= ZE_API_VERSION_1_4) { + dditable.pfnGetSubVerticesExp = pDdiTable->pfnGetSubVerticesExp; + pDdiTable->pfnGetSubVerticesExp = validation_layer::zeFabricVertexGetSubVerticesExp; + } + if (version >= ZE_API_VERSION_1_4) { + dditable.pfnGetPropertiesExp = pDdiTable->pfnGetPropertiesExp; + pDdiTable->pfnGetPropertiesExp = validation_layer::zeFabricVertexGetPropertiesExp; + } + if (version >= ZE_API_VERSION_1_4) { + dditable.pfnGetDeviceExp = pDdiTable->pfnGetDeviceExp; + pDdiTable->pfnGetDeviceExp = validation_layer::zeFabricVertexGetDeviceExp; + } return result; } diff --git a/source/layers/validation/zes_valddi.cpp b/source/layers/validation/zes_valddi.cpp index 674515b3..f0afd03b 100644 --- a/source/layers/validation/zes_valddi.cpp +++ b/source/layers/validation/zes_valddi.cpp @@ -6813,15 +6813,15 @@ zesGetGlobalProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnInit = pDdiTable->pfnInit; - pDdiTable->pfnInit = validation_layer::zesInit; - + if (version >= ZE_API_VERSION_1_5) { + dditable.pfnInit = pDdiTable->pfnInit; + pDdiTable->pfnInit = validation_layer::zesInit; + } return result; } @@ -6844,123 +6844,159 @@ zesGetDeviceProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetProperties = pDdiTable->pfnGetProperties; - pDdiTable->pfnGetProperties = validation_layer::zesDeviceGetProperties; - - dditable.pfnGetState = pDdiTable->pfnGetState; - pDdiTable->pfnGetState = validation_layer::zesDeviceGetState; - - dditable.pfnReset = pDdiTable->pfnReset; - pDdiTable->pfnReset = validation_layer::zesDeviceReset; - - dditable.pfnProcessesGetState = pDdiTable->pfnProcessesGetState; - pDdiTable->pfnProcessesGetState = validation_layer::zesDeviceProcessesGetState; - - dditable.pfnPciGetProperties = pDdiTable->pfnPciGetProperties; - pDdiTable->pfnPciGetProperties = validation_layer::zesDevicePciGetProperties; - - dditable.pfnPciGetState = pDdiTable->pfnPciGetState; - pDdiTable->pfnPciGetState = validation_layer::zesDevicePciGetState; - - dditable.pfnPciGetBars = pDdiTable->pfnPciGetBars; - pDdiTable->pfnPciGetBars = validation_layer::zesDevicePciGetBars; - - dditable.pfnPciGetStats = pDdiTable->pfnPciGetStats; - pDdiTable->pfnPciGetStats = validation_layer::zesDevicePciGetStats; - - dditable.pfnEnumDiagnosticTestSuites = pDdiTable->pfnEnumDiagnosticTestSuites; - pDdiTable->pfnEnumDiagnosticTestSuites = validation_layer::zesDeviceEnumDiagnosticTestSuites; - - dditable.pfnEnumEngineGroups = pDdiTable->pfnEnumEngineGroups; - pDdiTable->pfnEnumEngineGroups = validation_layer::zesDeviceEnumEngineGroups; - - dditable.pfnEventRegister = pDdiTable->pfnEventRegister; - pDdiTable->pfnEventRegister = validation_layer::zesDeviceEventRegister; - - dditable.pfnEnumFabricPorts = pDdiTable->pfnEnumFabricPorts; - pDdiTable->pfnEnumFabricPorts = validation_layer::zesDeviceEnumFabricPorts; - - dditable.pfnEnumFans = pDdiTable->pfnEnumFans; - pDdiTable->pfnEnumFans = validation_layer::zesDeviceEnumFans; - - dditable.pfnEnumFirmwares = pDdiTable->pfnEnumFirmwares; - pDdiTable->pfnEnumFirmwares = validation_layer::zesDeviceEnumFirmwares; - - dditable.pfnEnumFrequencyDomains = pDdiTable->pfnEnumFrequencyDomains; - pDdiTable->pfnEnumFrequencyDomains = validation_layer::zesDeviceEnumFrequencyDomains; - - dditable.pfnEnumLeds = pDdiTable->pfnEnumLeds; - pDdiTable->pfnEnumLeds = validation_layer::zesDeviceEnumLeds; - - dditable.pfnEnumMemoryModules = pDdiTable->pfnEnumMemoryModules; - pDdiTable->pfnEnumMemoryModules = validation_layer::zesDeviceEnumMemoryModules; - - dditable.pfnEnumPerformanceFactorDomains = pDdiTable->pfnEnumPerformanceFactorDomains; - pDdiTable->pfnEnumPerformanceFactorDomains = validation_layer::zesDeviceEnumPerformanceFactorDomains; - - dditable.pfnEnumPowerDomains = pDdiTable->pfnEnumPowerDomains; - pDdiTable->pfnEnumPowerDomains = validation_layer::zesDeviceEnumPowerDomains; - - dditable.pfnGetCardPowerDomain = pDdiTable->pfnGetCardPowerDomain; - pDdiTable->pfnGetCardPowerDomain = validation_layer::zesDeviceGetCardPowerDomain; - - dditable.pfnEnumPsus = pDdiTable->pfnEnumPsus; - pDdiTable->pfnEnumPsus = validation_layer::zesDeviceEnumPsus; - - dditable.pfnEnumRasErrorSets = pDdiTable->pfnEnumRasErrorSets; - pDdiTable->pfnEnumRasErrorSets = validation_layer::zesDeviceEnumRasErrorSets; - - dditable.pfnEnumSchedulers = pDdiTable->pfnEnumSchedulers; - pDdiTable->pfnEnumSchedulers = validation_layer::zesDeviceEnumSchedulers; - - dditable.pfnEnumStandbyDomains = pDdiTable->pfnEnumStandbyDomains; - pDdiTable->pfnEnumStandbyDomains = validation_layer::zesDeviceEnumStandbyDomains; - - dditable.pfnEnumTemperatureSensors = pDdiTable->pfnEnumTemperatureSensors; - pDdiTable->pfnEnumTemperatureSensors = validation_layer::zesDeviceEnumTemperatureSensors; - - dditable.pfnEccAvailable = pDdiTable->pfnEccAvailable; - pDdiTable->pfnEccAvailable = validation_layer::zesDeviceEccAvailable; - - dditable.pfnEccConfigurable = pDdiTable->pfnEccConfigurable; - pDdiTable->pfnEccConfigurable = validation_layer::zesDeviceEccConfigurable; - - dditable.pfnGetEccState = pDdiTable->pfnGetEccState; - pDdiTable->pfnGetEccState = validation_layer::zesDeviceGetEccState; - - dditable.pfnSetEccState = pDdiTable->pfnSetEccState; - pDdiTable->pfnSetEccState = validation_layer::zesDeviceSetEccState; - - dditable.pfnGet = pDdiTable->pfnGet; - pDdiTable->pfnGet = validation_layer::zesDeviceGet; - - dditable.pfnSetOverclockWaiver = pDdiTable->pfnSetOverclockWaiver; - pDdiTable->pfnSetOverclockWaiver = validation_layer::zesDeviceSetOverclockWaiver; - - dditable.pfnGetOverclockDomains = pDdiTable->pfnGetOverclockDomains; - pDdiTable->pfnGetOverclockDomains = validation_layer::zesDeviceGetOverclockDomains; - - dditable.pfnGetOverclockControls = pDdiTable->pfnGetOverclockControls; - pDdiTable->pfnGetOverclockControls = validation_layer::zesDeviceGetOverclockControls; - - dditable.pfnResetOverclockSettings = pDdiTable->pfnResetOverclockSettings; - pDdiTable->pfnResetOverclockSettings = validation_layer::zesDeviceResetOverclockSettings; - - dditable.pfnReadOverclockState = pDdiTable->pfnReadOverclockState; - pDdiTable->pfnReadOverclockState = validation_layer::zesDeviceReadOverclockState; - - dditable.pfnEnumOverclockDomains = pDdiTable->pfnEnumOverclockDomains; - pDdiTable->pfnEnumOverclockDomains = validation_layer::zesDeviceEnumOverclockDomains; - - dditable.pfnResetExt = pDdiTable->pfnResetExt; - pDdiTable->pfnResetExt = validation_layer::zesDeviceResetExt; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetProperties = pDdiTable->pfnGetProperties; + pDdiTable->pfnGetProperties = validation_layer::zesDeviceGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetState = pDdiTable->pfnGetState; + pDdiTable->pfnGetState = validation_layer::zesDeviceGetState; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnReset = pDdiTable->pfnReset; + pDdiTable->pfnReset = validation_layer::zesDeviceReset; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnProcessesGetState = pDdiTable->pfnProcessesGetState; + pDdiTable->pfnProcessesGetState = validation_layer::zesDeviceProcessesGetState; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnPciGetProperties = pDdiTable->pfnPciGetProperties; + pDdiTable->pfnPciGetProperties = validation_layer::zesDevicePciGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnPciGetState = pDdiTable->pfnPciGetState; + pDdiTable->pfnPciGetState = validation_layer::zesDevicePciGetState; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnPciGetBars = pDdiTable->pfnPciGetBars; + pDdiTable->pfnPciGetBars = validation_layer::zesDevicePciGetBars; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnPciGetStats = pDdiTable->pfnPciGetStats; + pDdiTable->pfnPciGetStats = validation_layer::zesDevicePciGetStats; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnEnumDiagnosticTestSuites = pDdiTable->pfnEnumDiagnosticTestSuites; + pDdiTable->pfnEnumDiagnosticTestSuites = validation_layer::zesDeviceEnumDiagnosticTestSuites; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnEnumEngineGroups = pDdiTable->pfnEnumEngineGroups; + pDdiTable->pfnEnumEngineGroups = validation_layer::zesDeviceEnumEngineGroups; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnEventRegister = pDdiTable->pfnEventRegister; + pDdiTable->pfnEventRegister = validation_layer::zesDeviceEventRegister; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnEnumFabricPorts = pDdiTable->pfnEnumFabricPorts; + pDdiTable->pfnEnumFabricPorts = validation_layer::zesDeviceEnumFabricPorts; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnEnumFans = pDdiTable->pfnEnumFans; + pDdiTable->pfnEnumFans = validation_layer::zesDeviceEnumFans; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnEnumFirmwares = pDdiTable->pfnEnumFirmwares; + pDdiTable->pfnEnumFirmwares = validation_layer::zesDeviceEnumFirmwares; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnEnumFrequencyDomains = pDdiTable->pfnEnumFrequencyDomains; + pDdiTable->pfnEnumFrequencyDomains = validation_layer::zesDeviceEnumFrequencyDomains; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnEnumLeds = pDdiTable->pfnEnumLeds; + pDdiTable->pfnEnumLeds = validation_layer::zesDeviceEnumLeds; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnEnumMemoryModules = pDdiTable->pfnEnumMemoryModules; + pDdiTable->pfnEnumMemoryModules = validation_layer::zesDeviceEnumMemoryModules; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnEnumPerformanceFactorDomains = pDdiTable->pfnEnumPerformanceFactorDomains; + pDdiTable->pfnEnumPerformanceFactorDomains = validation_layer::zesDeviceEnumPerformanceFactorDomains; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnEnumPowerDomains = pDdiTable->pfnEnumPowerDomains; + pDdiTable->pfnEnumPowerDomains = validation_layer::zesDeviceEnumPowerDomains; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetCardPowerDomain = pDdiTable->pfnGetCardPowerDomain; + pDdiTable->pfnGetCardPowerDomain = validation_layer::zesDeviceGetCardPowerDomain; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnEnumPsus = pDdiTable->pfnEnumPsus; + pDdiTable->pfnEnumPsus = validation_layer::zesDeviceEnumPsus; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnEnumRasErrorSets = pDdiTable->pfnEnumRasErrorSets; + pDdiTable->pfnEnumRasErrorSets = validation_layer::zesDeviceEnumRasErrorSets; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnEnumSchedulers = pDdiTable->pfnEnumSchedulers; + pDdiTable->pfnEnumSchedulers = validation_layer::zesDeviceEnumSchedulers; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnEnumStandbyDomains = pDdiTable->pfnEnumStandbyDomains; + pDdiTable->pfnEnumStandbyDomains = validation_layer::zesDeviceEnumStandbyDomains; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnEnumTemperatureSensors = pDdiTable->pfnEnumTemperatureSensors; + pDdiTable->pfnEnumTemperatureSensors = validation_layer::zesDeviceEnumTemperatureSensors; + } + if (version >= ZE_API_VERSION_1_4) { + dditable.pfnEccAvailable = pDdiTable->pfnEccAvailable; + pDdiTable->pfnEccAvailable = validation_layer::zesDeviceEccAvailable; + } + if (version >= ZE_API_VERSION_1_4) { + dditable.pfnEccConfigurable = pDdiTable->pfnEccConfigurable; + pDdiTable->pfnEccConfigurable = validation_layer::zesDeviceEccConfigurable; + } + if (version >= ZE_API_VERSION_1_4) { + dditable.pfnGetEccState = pDdiTable->pfnGetEccState; + pDdiTable->pfnGetEccState = validation_layer::zesDeviceGetEccState; + } + if (version >= ZE_API_VERSION_1_4) { + dditable.pfnSetEccState = pDdiTable->pfnSetEccState; + pDdiTable->pfnSetEccState = validation_layer::zesDeviceSetEccState; + } + if (version >= ZE_API_VERSION_1_5) { + dditable.pfnGet = pDdiTable->pfnGet; + pDdiTable->pfnGet = validation_layer::zesDeviceGet; + } + if (version >= ZE_API_VERSION_1_5) { + dditable.pfnSetOverclockWaiver = pDdiTable->pfnSetOverclockWaiver; + pDdiTable->pfnSetOverclockWaiver = validation_layer::zesDeviceSetOverclockWaiver; + } + if (version >= ZE_API_VERSION_1_5) { + dditable.pfnGetOverclockDomains = pDdiTable->pfnGetOverclockDomains; + pDdiTable->pfnGetOverclockDomains = validation_layer::zesDeviceGetOverclockDomains; + } + if (version >= ZE_API_VERSION_1_5) { + dditable.pfnGetOverclockControls = pDdiTable->pfnGetOverclockControls; + pDdiTable->pfnGetOverclockControls = validation_layer::zesDeviceGetOverclockControls; + } + if (version >= ZE_API_VERSION_1_5) { + dditable.pfnResetOverclockSettings = pDdiTable->pfnResetOverclockSettings; + pDdiTable->pfnResetOverclockSettings = validation_layer::zesDeviceResetOverclockSettings; + } + if (version >= ZE_API_VERSION_1_5) { + dditable.pfnReadOverclockState = pDdiTable->pfnReadOverclockState; + pDdiTable->pfnReadOverclockState = validation_layer::zesDeviceReadOverclockState; + } + if (version >= ZE_API_VERSION_1_5) { + dditable.pfnEnumOverclockDomains = pDdiTable->pfnEnumOverclockDomains; + pDdiTable->pfnEnumOverclockDomains = validation_layer::zesDeviceEnumOverclockDomains; + } + if (version >= ZE_API_VERSION_1_7) { + dditable.pfnResetExt = pDdiTable->pfnResetExt; + pDdiTable->pfnResetExt = validation_layer::zesDeviceResetExt; + } return result; } @@ -6983,21 +7019,23 @@ zesGetDeviceExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnEnumEnabledVFExp = pDdiTable->pfnEnumEnabledVFExp; - pDdiTable->pfnEnumEnabledVFExp = validation_layer::zesDeviceEnumEnabledVFExp; - - dditable.pfnGetSubDevicePropertiesExp = pDdiTable->pfnGetSubDevicePropertiesExp; - pDdiTable->pfnGetSubDevicePropertiesExp = validation_layer::zesDeviceGetSubDevicePropertiesExp; - - dditable.pfnEnumActiveVFExp = pDdiTable->pfnEnumActiveVFExp; - pDdiTable->pfnEnumActiveVFExp = validation_layer::zesDeviceEnumActiveVFExp; - + if (version >= ZE_API_VERSION_1_10) { + dditable.pfnEnumEnabledVFExp = pDdiTable->pfnEnumEnabledVFExp; + pDdiTable->pfnEnumEnabledVFExp = validation_layer::zesDeviceEnumEnabledVFExp; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetSubDevicePropertiesExp = pDdiTable->pfnGetSubDevicePropertiesExp; + pDdiTable->pfnGetSubDevicePropertiesExp = validation_layer::zesDeviceGetSubDevicePropertiesExp; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnEnumActiveVFExp = pDdiTable->pfnEnumActiveVFExp; + pDdiTable->pfnEnumActiveVFExp = validation_layer::zesDeviceEnumActiveVFExp; + } return result; } @@ -7020,27 +7058,31 @@ zesGetDriverProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnEventListen = pDdiTable->pfnEventListen; - pDdiTable->pfnEventListen = validation_layer::zesDriverEventListen; - - dditable.pfnEventListenEx = pDdiTable->pfnEventListenEx; - pDdiTable->pfnEventListenEx = validation_layer::zesDriverEventListenEx; - - dditable.pfnGet = pDdiTable->pfnGet; - pDdiTable->pfnGet = validation_layer::zesDriverGet; - - dditable.pfnGetExtensionProperties = pDdiTable->pfnGetExtensionProperties; - pDdiTable->pfnGetExtensionProperties = validation_layer::zesDriverGetExtensionProperties; - - dditable.pfnGetExtensionFunctionAddress = pDdiTable->pfnGetExtensionFunctionAddress; - pDdiTable->pfnGetExtensionFunctionAddress = validation_layer::zesDriverGetExtensionFunctionAddress; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnEventListen = pDdiTable->pfnEventListen; + pDdiTable->pfnEventListen = validation_layer::zesDriverEventListen; + } + if (version >= ZE_API_VERSION_1_1) { + dditable.pfnEventListenEx = pDdiTable->pfnEventListenEx; + pDdiTable->pfnEventListenEx = validation_layer::zesDriverEventListenEx; + } + if (version >= ZE_API_VERSION_1_5) { + dditable.pfnGet = pDdiTable->pfnGet; + pDdiTable->pfnGet = validation_layer::zesDriverGet; + } + if (version >= ZE_API_VERSION_1_8) { + dditable.pfnGetExtensionProperties = pDdiTable->pfnGetExtensionProperties; + pDdiTable->pfnGetExtensionProperties = validation_layer::zesDriverGetExtensionProperties; + } + if (version >= ZE_API_VERSION_1_8) { + dditable.pfnGetExtensionFunctionAddress = pDdiTable->pfnGetExtensionFunctionAddress; + pDdiTable->pfnGetExtensionFunctionAddress = validation_layer::zesDriverGetExtensionFunctionAddress; + } return result; } @@ -7063,15 +7105,15 @@ zesGetDriverExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetDeviceByUuidExp = pDdiTable->pfnGetDeviceByUuidExp; - pDdiTable->pfnGetDeviceByUuidExp = validation_layer::zesDriverGetDeviceByUuidExp; - + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetDeviceByUuidExp = pDdiTable->pfnGetDeviceByUuidExp; + pDdiTable->pfnGetDeviceByUuidExp = validation_layer::zesDriverGetDeviceByUuidExp; + } return result; } @@ -7094,21 +7136,23 @@ zesGetDiagnosticsProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetProperties = pDdiTable->pfnGetProperties; - pDdiTable->pfnGetProperties = validation_layer::zesDiagnosticsGetProperties; - - dditable.pfnGetTests = pDdiTable->pfnGetTests; - pDdiTable->pfnGetTests = validation_layer::zesDiagnosticsGetTests; - - dditable.pfnRunTests = pDdiTable->pfnRunTests; - pDdiTable->pfnRunTests = validation_layer::zesDiagnosticsRunTests; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetProperties = pDdiTable->pfnGetProperties; + pDdiTable->pfnGetProperties = validation_layer::zesDiagnosticsGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetTests = pDdiTable->pfnGetTests; + pDdiTable->pfnGetTests = validation_layer::zesDiagnosticsGetTests; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnRunTests = pDdiTable->pfnRunTests; + pDdiTable->pfnRunTests = validation_layer::zesDiagnosticsRunTests; + } return result; } @@ -7131,21 +7175,23 @@ zesGetEngineProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetProperties = pDdiTable->pfnGetProperties; - pDdiTable->pfnGetProperties = validation_layer::zesEngineGetProperties; - - dditable.pfnGetActivity = pDdiTable->pfnGetActivity; - pDdiTable->pfnGetActivity = validation_layer::zesEngineGetActivity; - - dditable.pfnGetActivityExt = pDdiTable->pfnGetActivityExt; - pDdiTable->pfnGetActivityExt = validation_layer::zesEngineGetActivityExt; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetProperties = pDdiTable->pfnGetProperties; + pDdiTable->pfnGetProperties = validation_layer::zesEngineGetProperties; + } + if (version >= ZE_API_VERSION_1_7) { + dditable.pfnGetActivity = pDdiTable->pfnGetActivity; + pDdiTable->pfnGetActivity = validation_layer::zesEngineGetActivity; + } + if (version >= ZE_API_VERSION_1_7) { + dditable.pfnGetActivityExt = pDdiTable->pfnGetActivityExt; + pDdiTable->pfnGetActivityExt = validation_layer::zesEngineGetActivityExt; + } return result; } @@ -7168,36 +7214,43 @@ zesGetFabricPortProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetProperties = pDdiTable->pfnGetProperties; - pDdiTable->pfnGetProperties = validation_layer::zesFabricPortGetProperties; - - dditable.pfnGetLinkType = pDdiTable->pfnGetLinkType; - pDdiTable->pfnGetLinkType = validation_layer::zesFabricPortGetLinkType; - - dditable.pfnGetConfig = pDdiTable->pfnGetConfig; - pDdiTable->pfnGetConfig = validation_layer::zesFabricPortGetConfig; - - dditable.pfnSetConfig = pDdiTable->pfnSetConfig; - pDdiTable->pfnSetConfig = validation_layer::zesFabricPortSetConfig; - - dditable.pfnGetState = pDdiTable->pfnGetState; - pDdiTable->pfnGetState = validation_layer::zesFabricPortGetState; - - dditable.pfnGetThroughput = pDdiTable->pfnGetThroughput; - pDdiTable->pfnGetThroughput = validation_layer::zesFabricPortGetThroughput; - - dditable.pfnGetFabricErrorCounters = pDdiTable->pfnGetFabricErrorCounters; - pDdiTable->pfnGetFabricErrorCounters = validation_layer::zesFabricPortGetFabricErrorCounters; - - dditable.pfnGetMultiPortThroughput = pDdiTable->pfnGetMultiPortThroughput; - pDdiTable->pfnGetMultiPortThroughput = validation_layer::zesFabricPortGetMultiPortThroughput; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetProperties = pDdiTable->pfnGetProperties; + pDdiTable->pfnGetProperties = validation_layer::zesFabricPortGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetLinkType = pDdiTable->pfnGetLinkType; + pDdiTable->pfnGetLinkType = validation_layer::zesFabricPortGetLinkType; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetConfig = pDdiTable->pfnGetConfig; + pDdiTable->pfnGetConfig = validation_layer::zesFabricPortGetConfig; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSetConfig = pDdiTable->pfnSetConfig; + pDdiTable->pfnSetConfig = validation_layer::zesFabricPortSetConfig; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetState = pDdiTable->pfnGetState; + pDdiTable->pfnGetState = validation_layer::zesFabricPortGetState; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetThroughput = pDdiTable->pfnGetThroughput; + pDdiTable->pfnGetThroughput = validation_layer::zesFabricPortGetThroughput; + } + if (version >= ZE_API_VERSION_1_7) { + dditable.pfnGetFabricErrorCounters = pDdiTable->pfnGetFabricErrorCounters; + pDdiTable->pfnGetFabricErrorCounters = validation_layer::zesFabricPortGetFabricErrorCounters; + } + if (version >= ZE_API_VERSION_1_7) { + dditable.pfnGetMultiPortThroughput = pDdiTable->pfnGetMultiPortThroughput; + pDdiTable->pfnGetMultiPortThroughput = validation_layer::zesFabricPortGetMultiPortThroughput; + } return result; } @@ -7220,30 +7273,35 @@ zesGetFanProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetProperties = pDdiTable->pfnGetProperties; - pDdiTable->pfnGetProperties = validation_layer::zesFanGetProperties; - - dditable.pfnGetConfig = pDdiTable->pfnGetConfig; - pDdiTable->pfnGetConfig = validation_layer::zesFanGetConfig; - - dditable.pfnSetDefaultMode = pDdiTable->pfnSetDefaultMode; - pDdiTable->pfnSetDefaultMode = validation_layer::zesFanSetDefaultMode; - - dditable.pfnSetFixedSpeedMode = pDdiTable->pfnSetFixedSpeedMode; - pDdiTable->pfnSetFixedSpeedMode = validation_layer::zesFanSetFixedSpeedMode; - - dditable.pfnSetSpeedTableMode = pDdiTable->pfnSetSpeedTableMode; - pDdiTable->pfnSetSpeedTableMode = validation_layer::zesFanSetSpeedTableMode; - - dditable.pfnGetState = pDdiTable->pfnGetState; - pDdiTable->pfnGetState = validation_layer::zesFanGetState; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetProperties = pDdiTable->pfnGetProperties; + pDdiTable->pfnGetProperties = validation_layer::zesFanGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetConfig = pDdiTable->pfnGetConfig; + pDdiTable->pfnGetConfig = validation_layer::zesFanGetConfig; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSetDefaultMode = pDdiTable->pfnSetDefaultMode; + pDdiTable->pfnSetDefaultMode = validation_layer::zesFanSetDefaultMode; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSetFixedSpeedMode = pDdiTable->pfnSetFixedSpeedMode; + pDdiTable->pfnSetFixedSpeedMode = validation_layer::zesFanSetFixedSpeedMode; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSetSpeedTableMode = pDdiTable->pfnSetSpeedTableMode; + pDdiTable->pfnSetSpeedTableMode = validation_layer::zesFanSetSpeedTableMode; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetState = pDdiTable->pfnGetState; + pDdiTable->pfnGetState = validation_layer::zesFanGetState; + } return result; } @@ -7266,24 +7324,27 @@ zesGetFirmwareProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetProperties = pDdiTable->pfnGetProperties; - pDdiTable->pfnGetProperties = validation_layer::zesFirmwareGetProperties; - - dditable.pfnFlash = pDdiTable->pfnFlash; - pDdiTable->pfnFlash = validation_layer::zesFirmwareFlash; - - dditable.pfnGetFlashProgress = pDdiTable->pfnGetFlashProgress; - pDdiTable->pfnGetFlashProgress = validation_layer::zesFirmwareGetFlashProgress; - - dditable.pfnGetConsoleLogs = pDdiTable->pfnGetConsoleLogs; - pDdiTable->pfnGetConsoleLogs = validation_layer::zesFirmwareGetConsoleLogs; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetProperties = pDdiTable->pfnGetProperties; + pDdiTable->pfnGetProperties = validation_layer::zesFirmwareGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnFlash = pDdiTable->pfnFlash; + pDdiTable->pfnFlash = validation_layer::zesFirmwareFlash; + } + if (version >= ZE_API_VERSION_1_8) { + dditable.pfnGetFlashProgress = pDdiTable->pfnGetFlashProgress; + pDdiTable->pfnGetFlashProgress = validation_layer::zesFirmwareGetFlashProgress; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetConsoleLogs = pDdiTable->pfnGetConsoleLogs; + pDdiTable->pfnGetConsoleLogs = validation_layer::zesFirmwareGetConsoleLogs; + } return result; } @@ -7306,18 +7367,19 @@ zesGetFirmwareExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetSecurityVersionExp = pDdiTable->pfnGetSecurityVersionExp; - pDdiTable->pfnGetSecurityVersionExp = validation_layer::zesFirmwareGetSecurityVersionExp; - - dditable.pfnSetSecurityVersionExp = pDdiTable->pfnSetSecurityVersionExp; - pDdiTable->pfnSetSecurityVersionExp = validation_layer::zesFirmwareSetSecurityVersionExp; - + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetSecurityVersionExp = pDdiTable->pfnGetSecurityVersionExp; + pDdiTable->pfnGetSecurityVersionExp = validation_layer::zesFirmwareGetSecurityVersionExp; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnSetSecurityVersionExp = pDdiTable->pfnSetSecurityVersionExp; + pDdiTable->pfnSetSecurityVersionExp = validation_layer::zesFirmwareSetSecurityVersionExp; + } return result; } @@ -7340,63 +7402,79 @@ zesGetFrequencyProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetProperties = pDdiTable->pfnGetProperties; - pDdiTable->pfnGetProperties = validation_layer::zesFrequencyGetProperties; - - dditable.pfnGetAvailableClocks = pDdiTable->pfnGetAvailableClocks; - pDdiTable->pfnGetAvailableClocks = validation_layer::zesFrequencyGetAvailableClocks; - - dditable.pfnGetRange = pDdiTable->pfnGetRange; - pDdiTable->pfnGetRange = validation_layer::zesFrequencyGetRange; - - dditable.pfnSetRange = pDdiTable->pfnSetRange; - pDdiTable->pfnSetRange = validation_layer::zesFrequencySetRange; - - dditable.pfnGetState = pDdiTable->pfnGetState; - pDdiTable->pfnGetState = validation_layer::zesFrequencyGetState; - - dditable.pfnGetThrottleTime = pDdiTable->pfnGetThrottleTime; - pDdiTable->pfnGetThrottleTime = validation_layer::zesFrequencyGetThrottleTime; - - dditable.pfnOcGetCapabilities = pDdiTable->pfnOcGetCapabilities; - pDdiTable->pfnOcGetCapabilities = validation_layer::zesFrequencyOcGetCapabilities; - - dditable.pfnOcGetFrequencyTarget = pDdiTable->pfnOcGetFrequencyTarget; - pDdiTable->pfnOcGetFrequencyTarget = validation_layer::zesFrequencyOcGetFrequencyTarget; - - dditable.pfnOcSetFrequencyTarget = pDdiTable->pfnOcSetFrequencyTarget; - pDdiTable->pfnOcSetFrequencyTarget = validation_layer::zesFrequencyOcSetFrequencyTarget; - - dditable.pfnOcGetVoltageTarget = pDdiTable->pfnOcGetVoltageTarget; - pDdiTable->pfnOcGetVoltageTarget = validation_layer::zesFrequencyOcGetVoltageTarget; - - dditable.pfnOcSetVoltageTarget = pDdiTable->pfnOcSetVoltageTarget; - pDdiTable->pfnOcSetVoltageTarget = validation_layer::zesFrequencyOcSetVoltageTarget; - - dditable.pfnOcSetMode = pDdiTable->pfnOcSetMode; - pDdiTable->pfnOcSetMode = validation_layer::zesFrequencyOcSetMode; - - dditable.pfnOcGetMode = pDdiTable->pfnOcGetMode; - pDdiTable->pfnOcGetMode = validation_layer::zesFrequencyOcGetMode; - - dditable.pfnOcGetIccMax = pDdiTable->pfnOcGetIccMax; - pDdiTable->pfnOcGetIccMax = validation_layer::zesFrequencyOcGetIccMax; - - dditable.pfnOcSetIccMax = pDdiTable->pfnOcSetIccMax; - pDdiTable->pfnOcSetIccMax = validation_layer::zesFrequencyOcSetIccMax; - - dditable.pfnOcGetTjMax = pDdiTable->pfnOcGetTjMax; - pDdiTable->pfnOcGetTjMax = validation_layer::zesFrequencyOcGetTjMax; - - dditable.pfnOcSetTjMax = pDdiTable->pfnOcSetTjMax; - pDdiTable->pfnOcSetTjMax = validation_layer::zesFrequencyOcSetTjMax; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetProperties = pDdiTable->pfnGetProperties; + pDdiTable->pfnGetProperties = validation_layer::zesFrequencyGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetAvailableClocks = pDdiTable->pfnGetAvailableClocks; + pDdiTable->pfnGetAvailableClocks = validation_layer::zesFrequencyGetAvailableClocks; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetRange = pDdiTable->pfnGetRange; + pDdiTable->pfnGetRange = validation_layer::zesFrequencyGetRange; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSetRange = pDdiTable->pfnSetRange; + pDdiTable->pfnSetRange = validation_layer::zesFrequencySetRange; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetState = pDdiTable->pfnGetState; + pDdiTable->pfnGetState = validation_layer::zesFrequencyGetState; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetThrottleTime = pDdiTable->pfnGetThrottleTime; + pDdiTable->pfnGetThrottleTime = validation_layer::zesFrequencyGetThrottleTime; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnOcGetCapabilities = pDdiTable->pfnOcGetCapabilities; + pDdiTable->pfnOcGetCapabilities = validation_layer::zesFrequencyOcGetCapabilities; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnOcGetFrequencyTarget = pDdiTable->pfnOcGetFrequencyTarget; + pDdiTable->pfnOcGetFrequencyTarget = validation_layer::zesFrequencyOcGetFrequencyTarget; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnOcSetFrequencyTarget = pDdiTable->pfnOcSetFrequencyTarget; + pDdiTable->pfnOcSetFrequencyTarget = validation_layer::zesFrequencyOcSetFrequencyTarget; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnOcGetVoltageTarget = pDdiTable->pfnOcGetVoltageTarget; + pDdiTable->pfnOcGetVoltageTarget = validation_layer::zesFrequencyOcGetVoltageTarget; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnOcSetVoltageTarget = pDdiTable->pfnOcSetVoltageTarget; + pDdiTable->pfnOcSetVoltageTarget = validation_layer::zesFrequencyOcSetVoltageTarget; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnOcSetMode = pDdiTable->pfnOcSetMode; + pDdiTable->pfnOcSetMode = validation_layer::zesFrequencyOcSetMode; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnOcGetMode = pDdiTable->pfnOcGetMode; + pDdiTable->pfnOcGetMode = validation_layer::zesFrequencyOcGetMode; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnOcGetIccMax = pDdiTable->pfnOcGetIccMax; + pDdiTable->pfnOcGetIccMax = validation_layer::zesFrequencyOcGetIccMax; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnOcSetIccMax = pDdiTable->pfnOcSetIccMax; + pDdiTable->pfnOcSetIccMax = validation_layer::zesFrequencyOcSetIccMax; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnOcGetTjMax = pDdiTable->pfnOcGetTjMax; + pDdiTable->pfnOcGetTjMax = validation_layer::zesFrequencyOcGetTjMax; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnOcSetTjMax = pDdiTable->pfnOcSetTjMax; + pDdiTable->pfnOcSetTjMax = validation_layer::zesFrequencyOcSetTjMax; + } return result; } @@ -7419,24 +7497,27 @@ zesGetLedProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetProperties = pDdiTable->pfnGetProperties; - pDdiTable->pfnGetProperties = validation_layer::zesLedGetProperties; - - dditable.pfnGetState = pDdiTable->pfnGetState; - pDdiTable->pfnGetState = validation_layer::zesLedGetState; - - dditable.pfnSetState = pDdiTable->pfnSetState; - pDdiTable->pfnSetState = validation_layer::zesLedSetState; - - dditable.pfnSetColor = pDdiTable->pfnSetColor; - pDdiTable->pfnSetColor = validation_layer::zesLedSetColor; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetProperties = pDdiTable->pfnGetProperties; + pDdiTable->pfnGetProperties = validation_layer::zesLedGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetState = pDdiTable->pfnGetState; + pDdiTable->pfnGetState = validation_layer::zesLedGetState; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSetState = pDdiTable->pfnSetState; + pDdiTable->pfnSetState = validation_layer::zesLedSetState; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSetColor = pDdiTable->pfnSetColor; + pDdiTable->pfnSetColor = validation_layer::zesLedSetColor; + } return result; } @@ -7459,21 +7540,23 @@ zesGetMemoryProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetProperties = pDdiTable->pfnGetProperties; - pDdiTable->pfnGetProperties = validation_layer::zesMemoryGetProperties; - - dditable.pfnGetState = pDdiTable->pfnGetState; - pDdiTable->pfnGetState = validation_layer::zesMemoryGetState; - - dditable.pfnGetBandwidth = pDdiTable->pfnGetBandwidth; - pDdiTable->pfnGetBandwidth = validation_layer::zesMemoryGetBandwidth; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetProperties = pDdiTable->pfnGetProperties; + pDdiTable->pfnGetProperties = validation_layer::zesMemoryGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetState = pDdiTable->pfnGetState; + pDdiTable->pfnGetState = validation_layer::zesMemoryGetState; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetBandwidth = pDdiTable->pfnGetBandwidth; + pDdiTable->pfnGetBandwidth = validation_layer::zesMemoryGetBandwidth; + } return result; } @@ -7496,39 +7579,47 @@ zesGetOverclockProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetDomainProperties = pDdiTable->pfnGetDomainProperties; - pDdiTable->pfnGetDomainProperties = validation_layer::zesOverclockGetDomainProperties; - - dditable.pfnGetDomainVFProperties = pDdiTable->pfnGetDomainVFProperties; - pDdiTable->pfnGetDomainVFProperties = validation_layer::zesOverclockGetDomainVFProperties; - - dditable.pfnGetDomainControlProperties = pDdiTable->pfnGetDomainControlProperties; - pDdiTable->pfnGetDomainControlProperties = validation_layer::zesOverclockGetDomainControlProperties; - - dditable.pfnGetControlCurrentValue = pDdiTable->pfnGetControlCurrentValue; - pDdiTable->pfnGetControlCurrentValue = validation_layer::zesOverclockGetControlCurrentValue; - - dditable.pfnGetControlPendingValue = pDdiTable->pfnGetControlPendingValue; - pDdiTable->pfnGetControlPendingValue = validation_layer::zesOverclockGetControlPendingValue; - - dditable.pfnSetControlUserValue = pDdiTable->pfnSetControlUserValue; - pDdiTable->pfnSetControlUserValue = validation_layer::zesOverclockSetControlUserValue; - - dditable.pfnGetControlState = pDdiTable->pfnGetControlState; - pDdiTable->pfnGetControlState = validation_layer::zesOverclockGetControlState; - - dditable.pfnGetVFPointValues = pDdiTable->pfnGetVFPointValues; - pDdiTable->pfnGetVFPointValues = validation_layer::zesOverclockGetVFPointValues; - - dditable.pfnSetVFPointValues = pDdiTable->pfnSetVFPointValues; - pDdiTable->pfnSetVFPointValues = validation_layer::zesOverclockSetVFPointValues; - + if (version >= ZE_API_VERSION_1_5) { + dditable.pfnGetDomainProperties = pDdiTable->pfnGetDomainProperties; + pDdiTable->pfnGetDomainProperties = validation_layer::zesOverclockGetDomainProperties; + } + if (version >= ZE_API_VERSION_1_5) { + dditable.pfnGetDomainVFProperties = pDdiTable->pfnGetDomainVFProperties; + pDdiTable->pfnGetDomainVFProperties = validation_layer::zesOverclockGetDomainVFProperties; + } + if (version >= ZE_API_VERSION_1_5) { + dditable.pfnGetDomainControlProperties = pDdiTable->pfnGetDomainControlProperties; + pDdiTable->pfnGetDomainControlProperties = validation_layer::zesOverclockGetDomainControlProperties; + } + if (version >= ZE_API_VERSION_1_5) { + dditable.pfnGetControlCurrentValue = pDdiTable->pfnGetControlCurrentValue; + pDdiTable->pfnGetControlCurrentValue = validation_layer::zesOverclockGetControlCurrentValue; + } + if (version >= ZE_API_VERSION_1_5) { + dditable.pfnGetControlPendingValue = pDdiTable->pfnGetControlPendingValue; + pDdiTable->pfnGetControlPendingValue = validation_layer::zesOverclockGetControlPendingValue; + } + if (version >= ZE_API_VERSION_1_5) { + dditable.pfnSetControlUserValue = pDdiTable->pfnSetControlUserValue; + pDdiTable->pfnSetControlUserValue = validation_layer::zesOverclockSetControlUserValue; + } + if (version >= ZE_API_VERSION_1_5) { + dditable.pfnGetControlState = pDdiTable->pfnGetControlState; + pDdiTable->pfnGetControlState = validation_layer::zesOverclockGetControlState; + } + if (version >= ZE_API_VERSION_1_5) { + dditable.pfnGetVFPointValues = pDdiTable->pfnGetVFPointValues; + pDdiTable->pfnGetVFPointValues = validation_layer::zesOverclockGetVFPointValues; + } + if (version >= ZE_API_VERSION_1_5) { + dditable.pfnSetVFPointValues = pDdiTable->pfnSetVFPointValues; + pDdiTable->pfnSetVFPointValues = validation_layer::zesOverclockSetVFPointValues; + } return result; } @@ -7551,21 +7642,23 @@ zesGetPerformanceFactorProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetProperties = pDdiTable->pfnGetProperties; - pDdiTable->pfnGetProperties = validation_layer::zesPerformanceFactorGetProperties; - - dditable.pfnGetConfig = pDdiTable->pfnGetConfig; - pDdiTable->pfnGetConfig = validation_layer::zesPerformanceFactorGetConfig; - - dditable.pfnSetConfig = pDdiTable->pfnSetConfig; - pDdiTable->pfnSetConfig = validation_layer::zesPerformanceFactorSetConfig; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetProperties = pDdiTable->pfnGetProperties; + pDdiTable->pfnGetProperties = validation_layer::zesPerformanceFactorGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetConfig = pDdiTable->pfnGetConfig; + pDdiTable->pfnGetConfig = validation_layer::zesPerformanceFactorGetConfig; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSetConfig = pDdiTable->pfnSetConfig; + pDdiTable->pfnSetConfig = validation_layer::zesPerformanceFactorSetConfig; + } return result; } @@ -7588,36 +7681,43 @@ zesGetPowerProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetProperties = pDdiTable->pfnGetProperties; - pDdiTable->pfnGetProperties = validation_layer::zesPowerGetProperties; - - dditable.pfnGetEnergyCounter = pDdiTable->pfnGetEnergyCounter; - pDdiTable->pfnGetEnergyCounter = validation_layer::zesPowerGetEnergyCounter; - - dditable.pfnGetLimits = pDdiTable->pfnGetLimits; - pDdiTable->pfnGetLimits = validation_layer::zesPowerGetLimits; - - dditable.pfnSetLimits = pDdiTable->pfnSetLimits; - pDdiTable->pfnSetLimits = validation_layer::zesPowerSetLimits; - - dditable.pfnGetEnergyThreshold = pDdiTable->pfnGetEnergyThreshold; - pDdiTable->pfnGetEnergyThreshold = validation_layer::zesPowerGetEnergyThreshold; - - dditable.pfnSetEnergyThreshold = pDdiTable->pfnSetEnergyThreshold; - pDdiTable->pfnSetEnergyThreshold = validation_layer::zesPowerSetEnergyThreshold; - - dditable.pfnGetLimitsExt = pDdiTable->pfnGetLimitsExt; - pDdiTable->pfnGetLimitsExt = validation_layer::zesPowerGetLimitsExt; - - dditable.pfnSetLimitsExt = pDdiTable->pfnSetLimitsExt; - pDdiTable->pfnSetLimitsExt = validation_layer::zesPowerSetLimitsExt; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetProperties = pDdiTable->pfnGetProperties; + pDdiTable->pfnGetProperties = validation_layer::zesPowerGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetEnergyCounter = pDdiTable->pfnGetEnergyCounter; + pDdiTable->pfnGetEnergyCounter = validation_layer::zesPowerGetEnergyCounter; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetLimits = pDdiTable->pfnGetLimits; + pDdiTable->pfnGetLimits = validation_layer::zesPowerGetLimits; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSetLimits = pDdiTable->pfnSetLimits; + pDdiTable->pfnSetLimits = validation_layer::zesPowerSetLimits; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetEnergyThreshold = pDdiTable->pfnGetEnergyThreshold; + pDdiTable->pfnGetEnergyThreshold = validation_layer::zesPowerGetEnergyThreshold; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSetEnergyThreshold = pDdiTable->pfnSetEnergyThreshold; + pDdiTable->pfnSetEnergyThreshold = validation_layer::zesPowerSetEnergyThreshold; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetLimitsExt = pDdiTable->pfnGetLimitsExt; + pDdiTable->pfnGetLimitsExt = validation_layer::zesPowerGetLimitsExt; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSetLimitsExt = pDdiTable->pfnSetLimitsExt; + pDdiTable->pfnSetLimitsExt = validation_layer::zesPowerSetLimitsExt; + } return result; } @@ -7640,18 +7740,19 @@ zesGetPsuProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetProperties = pDdiTable->pfnGetProperties; - pDdiTable->pfnGetProperties = validation_layer::zesPsuGetProperties; - - dditable.pfnGetState = pDdiTable->pfnGetState; - pDdiTable->pfnGetState = validation_layer::zesPsuGetState; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetProperties = pDdiTable->pfnGetProperties; + pDdiTable->pfnGetProperties = validation_layer::zesPsuGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetState = pDdiTable->pfnGetState; + pDdiTable->pfnGetState = validation_layer::zesPsuGetState; + } return result; } @@ -7674,24 +7775,27 @@ zesGetRasProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetProperties = pDdiTable->pfnGetProperties; - pDdiTable->pfnGetProperties = validation_layer::zesRasGetProperties; - - dditable.pfnGetConfig = pDdiTable->pfnGetConfig; - pDdiTable->pfnGetConfig = validation_layer::zesRasGetConfig; - - dditable.pfnSetConfig = pDdiTable->pfnSetConfig; - pDdiTable->pfnSetConfig = validation_layer::zesRasSetConfig; - - dditable.pfnGetState = pDdiTable->pfnGetState; - pDdiTable->pfnGetState = validation_layer::zesRasGetState; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetProperties = pDdiTable->pfnGetProperties; + pDdiTable->pfnGetProperties = validation_layer::zesRasGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetConfig = pDdiTable->pfnGetConfig; + pDdiTable->pfnGetConfig = validation_layer::zesRasGetConfig; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSetConfig = pDdiTable->pfnSetConfig; + pDdiTable->pfnSetConfig = validation_layer::zesRasSetConfig; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetState = pDdiTable->pfnGetState; + pDdiTable->pfnGetState = validation_layer::zesRasGetState; + } return result; } @@ -7714,18 +7818,19 @@ zesGetRasExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetStateExp = pDdiTable->pfnGetStateExp; - pDdiTable->pfnGetStateExp = validation_layer::zesRasGetStateExp; - - dditable.pfnClearStateExp = pDdiTable->pfnClearStateExp; - pDdiTable->pfnClearStateExp = validation_layer::zesRasClearStateExp; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetStateExp = pDdiTable->pfnGetStateExp; + pDdiTable->pfnGetStateExp = validation_layer::zesRasGetStateExp; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnClearStateExp = pDdiTable->pfnClearStateExp; + pDdiTable->pfnClearStateExp = validation_layer::zesRasClearStateExp; + } return result; } @@ -7748,36 +7853,43 @@ zesGetSchedulerProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetProperties = pDdiTable->pfnGetProperties; - pDdiTable->pfnGetProperties = validation_layer::zesSchedulerGetProperties; - - dditable.pfnGetCurrentMode = pDdiTable->pfnGetCurrentMode; - pDdiTable->pfnGetCurrentMode = validation_layer::zesSchedulerGetCurrentMode; - - dditable.pfnGetTimeoutModeProperties = pDdiTable->pfnGetTimeoutModeProperties; - pDdiTable->pfnGetTimeoutModeProperties = validation_layer::zesSchedulerGetTimeoutModeProperties; - - dditable.pfnGetTimesliceModeProperties = pDdiTable->pfnGetTimesliceModeProperties; - pDdiTable->pfnGetTimesliceModeProperties = validation_layer::zesSchedulerGetTimesliceModeProperties; - - dditable.pfnSetTimeoutMode = pDdiTable->pfnSetTimeoutMode; - pDdiTable->pfnSetTimeoutMode = validation_layer::zesSchedulerSetTimeoutMode; - - dditable.pfnSetTimesliceMode = pDdiTable->pfnSetTimesliceMode; - pDdiTable->pfnSetTimesliceMode = validation_layer::zesSchedulerSetTimesliceMode; - - dditable.pfnSetExclusiveMode = pDdiTable->pfnSetExclusiveMode; - pDdiTable->pfnSetExclusiveMode = validation_layer::zesSchedulerSetExclusiveMode; - - dditable.pfnSetComputeUnitDebugMode = pDdiTable->pfnSetComputeUnitDebugMode; - pDdiTable->pfnSetComputeUnitDebugMode = validation_layer::zesSchedulerSetComputeUnitDebugMode; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetProperties = pDdiTable->pfnGetProperties; + pDdiTable->pfnGetProperties = validation_layer::zesSchedulerGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetCurrentMode = pDdiTable->pfnGetCurrentMode; + pDdiTable->pfnGetCurrentMode = validation_layer::zesSchedulerGetCurrentMode; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetTimeoutModeProperties = pDdiTable->pfnGetTimeoutModeProperties; + pDdiTable->pfnGetTimeoutModeProperties = validation_layer::zesSchedulerGetTimeoutModeProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetTimesliceModeProperties = pDdiTable->pfnGetTimesliceModeProperties; + pDdiTable->pfnGetTimesliceModeProperties = validation_layer::zesSchedulerGetTimesliceModeProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSetTimeoutMode = pDdiTable->pfnSetTimeoutMode; + pDdiTable->pfnSetTimeoutMode = validation_layer::zesSchedulerSetTimeoutMode; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSetTimesliceMode = pDdiTable->pfnSetTimesliceMode; + pDdiTable->pfnSetTimesliceMode = validation_layer::zesSchedulerSetTimesliceMode; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSetExclusiveMode = pDdiTable->pfnSetExclusiveMode; + pDdiTable->pfnSetExclusiveMode = validation_layer::zesSchedulerSetExclusiveMode; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSetComputeUnitDebugMode = pDdiTable->pfnSetComputeUnitDebugMode; + pDdiTable->pfnSetComputeUnitDebugMode = validation_layer::zesSchedulerSetComputeUnitDebugMode; + } return result; } @@ -7800,21 +7912,23 @@ zesGetStandbyProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetProperties = pDdiTable->pfnGetProperties; - pDdiTable->pfnGetProperties = validation_layer::zesStandbyGetProperties; - - dditable.pfnGetMode = pDdiTable->pfnGetMode; - pDdiTable->pfnGetMode = validation_layer::zesStandbyGetMode; - - dditable.pfnSetMode = pDdiTable->pfnSetMode; - pDdiTable->pfnSetMode = validation_layer::zesStandbySetMode; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetProperties = pDdiTable->pfnGetProperties; + pDdiTable->pfnGetProperties = validation_layer::zesStandbyGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetMode = pDdiTable->pfnGetMode; + pDdiTable->pfnGetMode = validation_layer::zesStandbyGetMode; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSetMode = pDdiTable->pfnSetMode; + pDdiTable->pfnSetMode = validation_layer::zesStandbySetMode; + } return result; } @@ -7837,24 +7951,27 @@ zesGetTemperatureProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetProperties = pDdiTable->pfnGetProperties; - pDdiTable->pfnGetProperties = validation_layer::zesTemperatureGetProperties; - - dditable.pfnGetConfig = pDdiTable->pfnGetConfig; - pDdiTable->pfnGetConfig = validation_layer::zesTemperatureGetConfig; - - dditable.pfnSetConfig = pDdiTable->pfnSetConfig; - pDdiTable->pfnSetConfig = validation_layer::zesTemperatureSetConfig; - - dditable.pfnGetState = pDdiTable->pfnGetState; - pDdiTable->pfnGetState = validation_layer::zesTemperatureGetState; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetProperties = pDdiTable->pfnGetProperties; + pDdiTable->pfnGetProperties = validation_layer::zesTemperatureGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetConfig = pDdiTable->pfnGetConfig; + pDdiTable->pfnGetConfig = validation_layer::zesTemperatureGetConfig; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSetConfig = pDdiTable->pfnSetConfig; + pDdiTable->pfnSetConfig = validation_layer::zesTemperatureSetConfig; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetState = pDdiTable->pfnGetState; + pDdiTable->pfnGetState = validation_layer::zesTemperatureGetState; + } return result; } @@ -7877,39 +7994,47 @@ zesGetVFManagementExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetVFCapabilitiesExp = pDdiTable->pfnGetVFCapabilitiesExp; - pDdiTable->pfnGetVFCapabilitiesExp = validation_layer::zesVFManagementGetVFCapabilitiesExp; - - dditable.pfnGetVFMemoryUtilizationExp2 = pDdiTable->pfnGetVFMemoryUtilizationExp2; - pDdiTable->pfnGetVFMemoryUtilizationExp2 = validation_layer::zesVFManagementGetVFMemoryUtilizationExp2; - - dditable.pfnGetVFEngineUtilizationExp2 = pDdiTable->pfnGetVFEngineUtilizationExp2; - pDdiTable->pfnGetVFEngineUtilizationExp2 = validation_layer::zesVFManagementGetVFEngineUtilizationExp2; - - dditable.pfnGetVFCapabilitiesExp2 = pDdiTable->pfnGetVFCapabilitiesExp2; - pDdiTable->pfnGetVFCapabilitiesExp2 = validation_layer::zesVFManagementGetVFCapabilitiesExp2; - - dditable.pfnGetVFPropertiesExp = pDdiTable->pfnGetVFPropertiesExp; - pDdiTable->pfnGetVFPropertiesExp = validation_layer::zesVFManagementGetVFPropertiesExp; - - dditable.pfnGetVFMemoryUtilizationExp = pDdiTable->pfnGetVFMemoryUtilizationExp; - pDdiTable->pfnGetVFMemoryUtilizationExp = validation_layer::zesVFManagementGetVFMemoryUtilizationExp; - - dditable.pfnGetVFEngineUtilizationExp = pDdiTable->pfnGetVFEngineUtilizationExp; - pDdiTable->pfnGetVFEngineUtilizationExp = validation_layer::zesVFManagementGetVFEngineUtilizationExp; - - dditable.pfnSetVFTelemetryModeExp = pDdiTable->pfnSetVFTelemetryModeExp; - pDdiTable->pfnSetVFTelemetryModeExp = validation_layer::zesVFManagementSetVFTelemetryModeExp; - - dditable.pfnSetVFTelemetrySamplingIntervalExp = pDdiTable->pfnSetVFTelemetrySamplingIntervalExp; - pDdiTable->pfnSetVFTelemetrySamplingIntervalExp = validation_layer::zesVFManagementSetVFTelemetrySamplingIntervalExp; - + if (version >= ZE_API_VERSION_1_10) { + dditable.pfnGetVFCapabilitiesExp = pDdiTable->pfnGetVFCapabilitiesExp; + pDdiTable->pfnGetVFCapabilitiesExp = validation_layer::zesVFManagementGetVFCapabilitiesExp; + } + if (version >= ZE_API_VERSION_1_10) { + dditable.pfnGetVFMemoryUtilizationExp2 = pDdiTable->pfnGetVFMemoryUtilizationExp2; + pDdiTable->pfnGetVFMemoryUtilizationExp2 = validation_layer::zesVFManagementGetVFMemoryUtilizationExp2; + } + if (version >= ZE_API_VERSION_1_10) { + dditable.pfnGetVFEngineUtilizationExp2 = pDdiTable->pfnGetVFEngineUtilizationExp2; + pDdiTable->pfnGetVFEngineUtilizationExp2 = validation_layer::zesVFManagementGetVFEngineUtilizationExp2; + } + if (version >= ZE_API_VERSION_1_12) { + dditable.pfnGetVFCapabilitiesExp2 = pDdiTable->pfnGetVFCapabilitiesExp2; + pDdiTable->pfnGetVFCapabilitiesExp2 = validation_layer::zesVFManagementGetVFCapabilitiesExp2; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetVFPropertiesExp = pDdiTable->pfnGetVFPropertiesExp; + pDdiTable->pfnGetVFPropertiesExp = validation_layer::zesVFManagementGetVFPropertiesExp; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetVFMemoryUtilizationExp = pDdiTable->pfnGetVFMemoryUtilizationExp; + pDdiTable->pfnGetVFMemoryUtilizationExp = validation_layer::zesVFManagementGetVFMemoryUtilizationExp; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetVFEngineUtilizationExp = pDdiTable->pfnGetVFEngineUtilizationExp; + pDdiTable->pfnGetVFEngineUtilizationExp = validation_layer::zesVFManagementGetVFEngineUtilizationExp; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnSetVFTelemetryModeExp = pDdiTable->pfnSetVFTelemetryModeExp; + pDdiTable->pfnSetVFTelemetryModeExp = validation_layer::zesVFManagementSetVFTelemetryModeExp; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnSetVFTelemetrySamplingIntervalExp = pDdiTable->pfnSetVFTelemetrySamplingIntervalExp; + pDdiTable->pfnSetVFTelemetrySamplingIntervalExp = validation_layer::zesVFManagementSetVFTelemetrySamplingIntervalExp; + } return result; } diff --git a/source/layers/validation/zet_valddi.cpp b/source/layers/validation/zet_valddi.cpp index 0791d400..510b578f 100644 --- a/source/layers/validation/zet_valddi.cpp +++ b/source/layers/validation/zet_valddi.cpp @@ -3283,21 +3283,23 @@ zetGetMetricDecoderExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnCreateExp = pDdiTable->pfnCreateExp; - pDdiTable->pfnCreateExp = validation_layer::zetMetricDecoderCreateExp; - - dditable.pfnDestroyExp = pDdiTable->pfnDestroyExp; - pDdiTable->pfnDestroyExp = validation_layer::zetMetricDecoderDestroyExp; - - dditable.pfnGetDecodableMetricsExp = pDdiTable->pfnGetDecodableMetricsExp; - pDdiTable->pfnGetDecodableMetricsExp = validation_layer::zetMetricDecoderGetDecodableMetricsExp; - + if (version >= ZE_API_VERSION_1_10) { + dditable.pfnCreateExp = pDdiTable->pfnCreateExp; + pDdiTable->pfnCreateExp = validation_layer::zetMetricDecoderCreateExp; + } + if (version >= ZE_API_VERSION_1_10) { + dditable.pfnDestroyExp = pDdiTable->pfnDestroyExp; + pDdiTable->pfnDestroyExp = validation_layer::zetMetricDecoderDestroyExp; + } + if (version >= ZE_API_VERSION_1_10) { + dditable.pfnGetDecodableMetricsExp = pDdiTable->pfnGetDecodableMetricsExp; + pDdiTable->pfnGetDecodableMetricsExp = validation_layer::zetMetricDecoderGetDecodableMetricsExp; + } return result; } @@ -3320,24 +3322,27 @@ zetGetMetricProgrammableExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetExp = pDdiTable->pfnGetExp; - pDdiTable->pfnGetExp = validation_layer::zetMetricProgrammableGetExp; - - dditable.pfnGetPropertiesExp = pDdiTable->pfnGetPropertiesExp; - pDdiTable->pfnGetPropertiesExp = validation_layer::zetMetricProgrammableGetPropertiesExp; - - dditable.pfnGetParamInfoExp = pDdiTable->pfnGetParamInfoExp; - pDdiTable->pfnGetParamInfoExp = validation_layer::zetMetricProgrammableGetParamInfoExp; - - dditable.pfnGetParamValueInfoExp = pDdiTable->pfnGetParamValueInfoExp; - pDdiTable->pfnGetParamValueInfoExp = validation_layer::zetMetricProgrammableGetParamValueInfoExp; - + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetExp = pDdiTable->pfnGetExp; + pDdiTable->pfnGetExp = validation_layer::zetMetricProgrammableGetExp; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetPropertiesExp = pDdiTable->pfnGetPropertiesExp; + pDdiTable->pfnGetPropertiesExp = validation_layer::zetMetricProgrammableGetPropertiesExp; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetParamInfoExp = pDdiTable->pfnGetParamInfoExp; + pDdiTable->pfnGetParamInfoExp = validation_layer::zetMetricProgrammableGetParamInfoExp; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetParamValueInfoExp = pDdiTable->pfnGetParamValueInfoExp; + pDdiTable->pfnGetParamValueInfoExp = validation_layer::zetMetricProgrammableGetParamValueInfoExp; + } return result; } @@ -3360,30 +3365,35 @@ zetGetMetricTracerExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnCreateExp = pDdiTable->pfnCreateExp; - pDdiTable->pfnCreateExp = validation_layer::zetMetricTracerCreateExp; - - dditable.pfnDestroyExp = pDdiTable->pfnDestroyExp; - pDdiTable->pfnDestroyExp = validation_layer::zetMetricTracerDestroyExp; - - dditable.pfnEnableExp = pDdiTable->pfnEnableExp; - pDdiTable->pfnEnableExp = validation_layer::zetMetricTracerEnableExp; - - dditable.pfnDisableExp = pDdiTable->pfnDisableExp; - pDdiTable->pfnDisableExp = validation_layer::zetMetricTracerDisableExp; - - dditable.pfnReadDataExp = pDdiTable->pfnReadDataExp; - pDdiTable->pfnReadDataExp = validation_layer::zetMetricTracerReadDataExp; - - dditable.pfnDecodeExp = pDdiTable->pfnDecodeExp; - pDdiTable->pfnDecodeExp = validation_layer::zetMetricTracerDecodeExp; - + if (version >= ZE_API_VERSION_1_10) { + dditable.pfnCreateExp = pDdiTable->pfnCreateExp; + pDdiTable->pfnCreateExp = validation_layer::zetMetricTracerCreateExp; + } + if (version >= ZE_API_VERSION_1_10) { + dditable.pfnDestroyExp = pDdiTable->pfnDestroyExp; + pDdiTable->pfnDestroyExp = validation_layer::zetMetricTracerDestroyExp; + } + if (version >= ZE_API_VERSION_1_10) { + dditable.pfnEnableExp = pDdiTable->pfnEnableExp; + pDdiTable->pfnEnableExp = validation_layer::zetMetricTracerEnableExp; + } + if (version >= ZE_API_VERSION_1_10) { + dditable.pfnDisableExp = pDdiTable->pfnDisableExp; + pDdiTable->pfnDisableExp = validation_layer::zetMetricTracerDisableExp; + } + if (version >= ZE_API_VERSION_1_10) { + dditable.pfnReadDataExp = pDdiTable->pfnReadDataExp; + pDdiTable->pfnReadDataExp = validation_layer::zetMetricTracerReadDataExp; + } + if (version >= ZE_API_VERSION_1_10) { + dditable.pfnDecodeExp = pDdiTable->pfnDecodeExp; + pDdiTable->pfnDecodeExp = validation_layer::zetMetricTracerDecodeExp; + } return result; } @@ -3406,15 +3416,15 @@ zetGetDeviceProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetDebugProperties = pDdiTable->pfnGetDebugProperties; - pDdiTable->pfnGetDebugProperties = validation_layer::zetDeviceGetDebugProperties; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetDebugProperties = pDdiTable->pfnGetDebugProperties; + pDdiTable->pfnGetDebugProperties = validation_layer::zetDeviceGetDebugProperties; + } return result; } @@ -3437,18 +3447,19 @@ zetGetDeviceExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetConcurrentMetricGroupsExp = pDdiTable->pfnGetConcurrentMetricGroupsExp; - pDdiTable->pfnGetConcurrentMetricGroupsExp = validation_layer::zetDeviceGetConcurrentMetricGroupsExp; - - dditable.pfnCreateMetricGroupsFromMetricsExp = pDdiTable->pfnCreateMetricGroupsFromMetricsExp; - pDdiTable->pfnCreateMetricGroupsFromMetricsExp = validation_layer::zetDeviceCreateMetricGroupsFromMetricsExp; - + if (version >= ZE_API_VERSION_1_10) { + dditable.pfnGetConcurrentMetricGroupsExp = pDdiTable->pfnGetConcurrentMetricGroupsExp; + pDdiTable->pfnGetConcurrentMetricGroupsExp = validation_layer::zetDeviceGetConcurrentMetricGroupsExp; + } + if (version >= ZE_API_VERSION_1_10) { + dditable.pfnCreateMetricGroupsFromMetricsExp = pDdiTable->pfnCreateMetricGroupsFromMetricsExp; + pDdiTable->pfnCreateMetricGroupsFromMetricsExp = validation_layer::zetDeviceCreateMetricGroupsFromMetricsExp; + } return result; } @@ -3471,15 +3482,15 @@ zetGetContextProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnActivateMetricGroups = pDdiTable->pfnActivateMetricGroups; - pDdiTable->pfnActivateMetricGroups = validation_layer::zetContextActivateMetricGroups; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnActivateMetricGroups = pDdiTable->pfnActivateMetricGroups; + pDdiTable->pfnActivateMetricGroups = validation_layer::zetContextActivateMetricGroups; + } return result; } @@ -3502,24 +3513,27 @@ zetGetCommandListProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnAppendMetricStreamerMarker = pDdiTable->pfnAppendMetricStreamerMarker; - pDdiTable->pfnAppendMetricStreamerMarker = validation_layer::zetCommandListAppendMetricStreamerMarker; - - dditable.pfnAppendMetricQueryBegin = pDdiTable->pfnAppendMetricQueryBegin; - pDdiTable->pfnAppendMetricQueryBegin = validation_layer::zetCommandListAppendMetricQueryBegin; - - dditable.pfnAppendMetricQueryEnd = pDdiTable->pfnAppendMetricQueryEnd; - pDdiTable->pfnAppendMetricQueryEnd = validation_layer::zetCommandListAppendMetricQueryEnd; - - dditable.pfnAppendMetricMemoryBarrier = pDdiTable->pfnAppendMetricMemoryBarrier; - pDdiTable->pfnAppendMetricMemoryBarrier = validation_layer::zetCommandListAppendMetricMemoryBarrier; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendMetricStreamerMarker = pDdiTable->pfnAppendMetricStreamerMarker; + pDdiTable->pfnAppendMetricStreamerMarker = validation_layer::zetCommandListAppendMetricStreamerMarker; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendMetricQueryBegin = pDdiTable->pfnAppendMetricQueryBegin; + pDdiTable->pfnAppendMetricQueryBegin = validation_layer::zetCommandListAppendMetricQueryBegin; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendMetricQueryEnd = pDdiTable->pfnAppendMetricQueryEnd; + pDdiTable->pfnAppendMetricQueryEnd = validation_layer::zetCommandListAppendMetricQueryEnd; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendMetricMemoryBarrier = pDdiTable->pfnAppendMetricMemoryBarrier; + pDdiTable->pfnAppendMetricMemoryBarrier = validation_layer::zetCommandListAppendMetricMemoryBarrier; + } return result; } @@ -3542,15 +3556,15 @@ zetGetKernelProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetProfileInfo = pDdiTable->pfnGetProfileInfo; - pDdiTable->pfnGetProfileInfo = validation_layer::zetKernelGetProfileInfo; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetProfileInfo = pDdiTable->pfnGetProfileInfo; + pDdiTable->pfnGetProfileInfo = validation_layer::zetKernelGetProfileInfo; + } return result; } @@ -3573,15 +3587,15 @@ zetGetModuleProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetDebugInfo = pDdiTable->pfnGetDebugInfo; - pDdiTable->pfnGetDebugInfo = validation_layer::zetModuleGetDebugInfo; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetDebugInfo = pDdiTable->pfnGetDebugInfo; + pDdiTable->pfnGetDebugInfo = validation_layer::zetModuleGetDebugInfo; + } return result; } @@ -3604,48 +3618,59 @@ zetGetDebugProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnAttach = pDdiTable->pfnAttach; - pDdiTable->pfnAttach = validation_layer::zetDebugAttach; - - dditable.pfnDetach = pDdiTable->pfnDetach; - pDdiTable->pfnDetach = validation_layer::zetDebugDetach; - - dditable.pfnReadEvent = pDdiTable->pfnReadEvent; - pDdiTable->pfnReadEvent = validation_layer::zetDebugReadEvent; - - dditable.pfnAcknowledgeEvent = pDdiTable->pfnAcknowledgeEvent; - pDdiTable->pfnAcknowledgeEvent = validation_layer::zetDebugAcknowledgeEvent; - - dditable.pfnInterrupt = pDdiTable->pfnInterrupt; - pDdiTable->pfnInterrupt = validation_layer::zetDebugInterrupt; - - dditable.pfnResume = pDdiTable->pfnResume; - pDdiTable->pfnResume = validation_layer::zetDebugResume; - - dditable.pfnReadMemory = pDdiTable->pfnReadMemory; - pDdiTable->pfnReadMemory = validation_layer::zetDebugReadMemory; - - dditable.pfnWriteMemory = pDdiTable->pfnWriteMemory; - pDdiTable->pfnWriteMemory = validation_layer::zetDebugWriteMemory; - - dditable.pfnGetRegisterSetProperties = pDdiTable->pfnGetRegisterSetProperties; - pDdiTable->pfnGetRegisterSetProperties = validation_layer::zetDebugGetRegisterSetProperties; - - dditable.pfnReadRegisters = pDdiTable->pfnReadRegisters; - pDdiTable->pfnReadRegisters = validation_layer::zetDebugReadRegisters; - - dditable.pfnWriteRegisters = pDdiTable->pfnWriteRegisters; - pDdiTable->pfnWriteRegisters = validation_layer::zetDebugWriteRegisters; - - dditable.pfnGetThreadRegisterSetProperties = pDdiTable->pfnGetThreadRegisterSetProperties; - pDdiTable->pfnGetThreadRegisterSetProperties = validation_layer::zetDebugGetThreadRegisterSetProperties; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAttach = pDdiTable->pfnAttach; + pDdiTable->pfnAttach = validation_layer::zetDebugAttach; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnDetach = pDdiTable->pfnDetach; + pDdiTable->pfnDetach = validation_layer::zetDebugDetach; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnReadEvent = pDdiTable->pfnReadEvent; + pDdiTable->pfnReadEvent = validation_layer::zetDebugReadEvent; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAcknowledgeEvent = pDdiTable->pfnAcknowledgeEvent; + pDdiTable->pfnAcknowledgeEvent = validation_layer::zetDebugAcknowledgeEvent; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnInterrupt = pDdiTable->pfnInterrupt; + pDdiTable->pfnInterrupt = validation_layer::zetDebugInterrupt; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnResume = pDdiTable->pfnResume; + pDdiTable->pfnResume = validation_layer::zetDebugResume; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnReadMemory = pDdiTable->pfnReadMemory; + pDdiTable->pfnReadMemory = validation_layer::zetDebugReadMemory; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnWriteMemory = pDdiTable->pfnWriteMemory; + pDdiTable->pfnWriteMemory = validation_layer::zetDebugWriteMemory; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetRegisterSetProperties = pDdiTable->pfnGetRegisterSetProperties; + pDdiTable->pfnGetRegisterSetProperties = validation_layer::zetDebugGetRegisterSetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnReadRegisters = pDdiTable->pfnReadRegisters; + pDdiTable->pfnReadRegisters = validation_layer::zetDebugReadRegisters; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnWriteRegisters = pDdiTable->pfnWriteRegisters; + pDdiTable->pfnWriteRegisters = validation_layer::zetDebugWriteRegisters; + } + if (version >= ZE_API_VERSION_1_5) { + dditable.pfnGetThreadRegisterSetProperties = pDdiTable->pfnGetThreadRegisterSetProperties; + pDdiTable->pfnGetThreadRegisterSetProperties = validation_layer::zetDebugGetThreadRegisterSetProperties; + } return result; } @@ -3668,18 +3693,19 @@ zetGetMetricProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGet = pDdiTable->pfnGet; - pDdiTable->pfnGet = validation_layer::zetMetricGet; - - dditable.pfnGetProperties = pDdiTable->pfnGetProperties; - pDdiTable->pfnGetProperties = validation_layer::zetMetricGetProperties; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGet = pDdiTable->pfnGet; + pDdiTable->pfnGet = validation_layer::zetMetricGet; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetProperties = pDdiTable->pfnGetProperties; + pDdiTable->pfnGetProperties = validation_layer::zetMetricGetProperties; + } return result; } @@ -3702,21 +3728,23 @@ zetGetMetricExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnCreateFromProgrammableExp2 = pDdiTable->pfnCreateFromProgrammableExp2; - pDdiTable->pfnCreateFromProgrammableExp2 = validation_layer::zetMetricCreateFromProgrammableExp2; - - dditable.pfnCreateFromProgrammableExp = pDdiTable->pfnCreateFromProgrammableExp; - pDdiTable->pfnCreateFromProgrammableExp = validation_layer::zetMetricCreateFromProgrammableExp; - - dditable.pfnDestroyExp = pDdiTable->pfnDestroyExp; - pDdiTable->pfnDestroyExp = validation_layer::zetMetricDestroyExp; - + if (version >= ZE_API_VERSION_1_11) { + dditable.pfnCreateFromProgrammableExp2 = pDdiTable->pfnCreateFromProgrammableExp2; + pDdiTable->pfnCreateFromProgrammableExp2 = validation_layer::zetMetricCreateFromProgrammableExp2; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnCreateFromProgrammableExp = pDdiTable->pfnCreateFromProgrammableExp; + pDdiTable->pfnCreateFromProgrammableExp = validation_layer::zetMetricCreateFromProgrammableExp; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnDestroyExp = pDdiTable->pfnDestroyExp; + pDdiTable->pfnDestroyExp = validation_layer::zetMetricDestroyExp; + } return result; } @@ -3739,21 +3767,23 @@ zetGetMetricGroupProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGet = pDdiTable->pfnGet; - pDdiTable->pfnGet = validation_layer::zetMetricGroupGet; - - dditable.pfnGetProperties = pDdiTable->pfnGetProperties; - pDdiTable->pfnGetProperties = validation_layer::zetMetricGroupGetProperties; - - dditable.pfnCalculateMetricValues = pDdiTable->pfnCalculateMetricValues; - pDdiTable->pfnCalculateMetricValues = validation_layer::zetMetricGroupCalculateMetricValues; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGet = pDdiTable->pfnGet; + pDdiTable->pfnGet = validation_layer::zetMetricGroupGet; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetProperties = pDdiTable->pfnGetProperties; + pDdiTable->pfnGetProperties = validation_layer::zetMetricGroupGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCalculateMetricValues = pDdiTable->pfnCalculateMetricValues; + pDdiTable->pfnCalculateMetricValues = validation_layer::zetMetricGroupCalculateMetricValues; + } return result; } @@ -3776,39 +3806,47 @@ zetGetMetricGroupExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnCalculateMultipleMetricValuesExp = pDdiTable->pfnCalculateMultipleMetricValuesExp; - pDdiTable->pfnCalculateMultipleMetricValuesExp = validation_layer::zetMetricGroupCalculateMultipleMetricValuesExp; - - dditable.pfnGetGlobalTimestampsExp = pDdiTable->pfnGetGlobalTimestampsExp; - pDdiTable->pfnGetGlobalTimestampsExp = validation_layer::zetMetricGroupGetGlobalTimestampsExp; - - dditable.pfnGetExportDataExp = pDdiTable->pfnGetExportDataExp; - pDdiTable->pfnGetExportDataExp = validation_layer::zetMetricGroupGetExportDataExp; - - dditable.pfnCalculateMetricExportDataExp = pDdiTable->pfnCalculateMetricExportDataExp; - pDdiTable->pfnCalculateMetricExportDataExp = validation_layer::zetMetricGroupCalculateMetricExportDataExp; - - dditable.pfnCreateExp = pDdiTable->pfnCreateExp; - pDdiTable->pfnCreateExp = validation_layer::zetMetricGroupCreateExp; - - dditable.pfnAddMetricExp = pDdiTable->pfnAddMetricExp; - pDdiTable->pfnAddMetricExp = validation_layer::zetMetricGroupAddMetricExp; - - dditable.pfnRemoveMetricExp = pDdiTable->pfnRemoveMetricExp; - pDdiTable->pfnRemoveMetricExp = validation_layer::zetMetricGroupRemoveMetricExp; - - dditable.pfnCloseExp = pDdiTable->pfnCloseExp; - pDdiTable->pfnCloseExp = validation_layer::zetMetricGroupCloseExp; - - dditable.pfnDestroyExp = pDdiTable->pfnDestroyExp; - pDdiTable->pfnDestroyExp = validation_layer::zetMetricGroupDestroyExp; - + if (version >= ZE_API_VERSION_1_2) { + dditable.pfnCalculateMultipleMetricValuesExp = pDdiTable->pfnCalculateMultipleMetricValuesExp; + pDdiTable->pfnCalculateMultipleMetricValuesExp = validation_layer::zetMetricGroupCalculateMultipleMetricValuesExp; + } + if (version >= ZE_API_VERSION_1_5) { + dditable.pfnGetGlobalTimestampsExp = pDdiTable->pfnGetGlobalTimestampsExp; + pDdiTable->pfnGetGlobalTimestampsExp = validation_layer::zetMetricGroupGetGlobalTimestampsExp; + } + if (version >= ZE_API_VERSION_1_6) { + dditable.pfnGetExportDataExp = pDdiTable->pfnGetExportDataExp; + pDdiTable->pfnGetExportDataExp = validation_layer::zetMetricGroupGetExportDataExp; + } + if (version >= ZE_API_VERSION_1_6) { + dditable.pfnCalculateMetricExportDataExp = pDdiTable->pfnCalculateMetricExportDataExp; + pDdiTable->pfnCalculateMetricExportDataExp = validation_layer::zetMetricGroupCalculateMetricExportDataExp; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnCreateExp = pDdiTable->pfnCreateExp; + pDdiTable->pfnCreateExp = validation_layer::zetMetricGroupCreateExp; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnAddMetricExp = pDdiTable->pfnAddMetricExp; + pDdiTable->pfnAddMetricExp = validation_layer::zetMetricGroupAddMetricExp; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnRemoveMetricExp = pDdiTable->pfnRemoveMetricExp; + pDdiTable->pfnRemoveMetricExp = validation_layer::zetMetricGroupRemoveMetricExp; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnCloseExp = pDdiTable->pfnCloseExp; + pDdiTable->pfnCloseExp = validation_layer::zetMetricGroupCloseExp; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnDestroyExp = pDdiTable->pfnDestroyExp; + pDdiTable->pfnDestroyExp = validation_layer::zetMetricGroupDestroyExp; + } return result; } @@ -3831,24 +3869,27 @@ zetGetMetricQueryProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnCreate = pDdiTable->pfnCreate; - pDdiTable->pfnCreate = validation_layer::zetMetricQueryCreate; - - dditable.pfnDestroy = pDdiTable->pfnDestroy; - pDdiTable->pfnDestroy = validation_layer::zetMetricQueryDestroy; - - dditable.pfnReset = pDdiTable->pfnReset; - pDdiTable->pfnReset = validation_layer::zetMetricQueryReset; - - dditable.pfnGetData = pDdiTable->pfnGetData; - pDdiTable->pfnGetData = validation_layer::zetMetricQueryGetData; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCreate = pDdiTable->pfnCreate; + pDdiTable->pfnCreate = validation_layer::zetMetricQueryCreate; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnDestroy = pDdiTable->pfnDestroy; + pDdiTable->pfnDestroy = validation_layer::zetMetricQueryDestroy; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnReset = pDdiTable->pfnReset; + pDdiTable->pfnReset = validation_layer::zetMetricQueryReset; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetData = pDdiTable->pfnGetData; + pDdiTable->pfnGetData = validation_layer::zetMetricQueryGetData; + } return result; } @@ -3871,18 +3912,19 @@ zetGetMetricQueryPoolProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnCreate = pDdiTable->pfnCreate; - pDdiTable->pfnCreate = validation_layer::zetMetricQueryPoolCreate; - - dditable.pfnDestroy = pDdiTable->pfnDestroy; - pDdiTable->pfnDestroy = validation_layer::zetMetricQueryPoolDestroy; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCreate = pDdiTable->pfnCreate; + pDdiTable->pfnCreate = validation_layer::zetMetricQueryPoolCreate; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnDestroy = pDdiTable->pfnDestroy; + pDdiTable->pfnDestroy = validation_layer::zetMetricQueryPoolDestroy; + } return result; } @@ -3905,21 +3947,23 @@ zetGetMetricStreamerProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnOpen = pDdiTable->pfnOpen; - pDdiTable->pfnOpen = validation_layer::zetMetricStreamerOpen; - - dditable.pfnClose = pDdiTable->pfnClose; - pDdiTable->pfnClose = validation_layer::zetMetricStreamerClose; - - dditable.pfnReadData = pDdiTable->pfnReadData; - pDdiTable->pfnReadData = validation_layer::zetMetricStreamerReadData; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnOpen = pDdiTable->pfnOpen; + pDdiTable->pfnOpen = validation_layer::zetMetricStreamerOpen; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnClose = pDdiTable->pfnClose; + pDdiTable->pfnClose = validation_layer::zetMetricStreamerClose; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnReadData = pDdiTable->pfnReadData; + pDdiTable->pfnReadData = validation_layer::zetMetricStreamerReadData; + } return result; } @@ -3942,27 +3986,31 @@ zetGetTracerExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnCreate = pDdiTable->pfnCreate; - pDdiTable->pfnCreate = validation_layer::zetTracerExpCreate; - - dditable.pfnDestroy = pDdiTable->pfnDestroy; - pDdiTable->pfnDestroy = validation_layer::zetTracerExpDestroy; - - dditable.pfnSetPrologues = pDdiTable->pfnSetPrologues; - pDdiTable->pfnSetPrologues = validation_layer::zetTracerExpSetPrologues; - - dditable.pfnSetEpilogues = pDdiTable->pfnSetEpilogues; - pDdiTable->pfnSetEpilogues = validation_layer::zetTracerExpSetEpilogues; - - dditable.pfnSetEnabled = pDdiTable->pfnSetEnabled; - pDdiTable->pfnSetEnabled = validation_layer::zetTracerExpSetEnabled; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCreate = pDdiTable->pfnCreate; + pDdiTable->pfnCreate = validation_layer::zetTracerExpCreate; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnDestroy = pDdiTable->pfnDestroy; + pDdiTable->pfnDestroy = validation_layer::zetTracerExpDestroy; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSetPrologues = pDdiTable->pfnSetPrologues; + pDdiTable->pfnSetPrologues = validation_layer::zetTracerExpSetPrologues; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSetEpilogues = pDdiTable->pfnSetEpilogues; + pDdiTable->pfnSetEpilogues = validation_layer::zetTracerExpSetEpilogues; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSetEnabled = pDdiTable->pfnSetEnabled; + pDdiTable->pfnSetEnabled = validation_layer::zetTracerExpSetEnabled; + } return result; } diff --git a/source/loader/ze_ldrddi.cpp b/source/loader/ze_ldrddi.cpp index 8d080a5c..9890e2db 100644 --- a/source/loader/ze_ldrddi.cpp +++ b/source/loader/ze_ldrddi.cpp @@ -6569,8 +6569,12 @@ zeGetGlobalProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnInit = loader::zeInit; - pDdiTable->pfnInitDrivers = loader::zeInitDrivers; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnInit = loader::zeInit; + } + if (version >= ZE_API_VERSION_1_10) { + pDdiTable->pfnInitDrivers = loader::zeInitDrivers; + } } else { @@ -6653,10 +6657,18 @@ zeGetRTASBuilderExpProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnCreateExp = loader::zeRTASBuilderCreateExp; - pDdiTable->pfnGetBuildPropertiesExp = loader::zeRTASBuilderGetBuildPropertiesExp; - pDdiTable->pfnBuildExp = loader::zeRTASBuilderBuildExp; - pDdiTable->pfnDestroyExp = loader::zeRTASBuilderDestroyExp; + if (version >= ZE_API_VERSION_1_7) { + pDdiTable->pfnCreateExp = loader::zeRTASBuilderCreateExp; + } + if (version >= ZE_API_VERSION_1_7) { + pDdiTable->pfnGetBuildPropertiesExp = loader::zeRTASBuilderGetBuildPropertiesExp; + } + if (version >= ZE_API_VERSION_1_7) { + pDdiTable->pfnBuildExp = loader::zeRTASBuilderBuildExp; + } + if (version >= ZE_API_VERSION_1_7) { + pDdiTable->pfnDestroyExp = loader::zeRTASBuilderDestroyExp; + } } else { @@ -6739,10 +6751,18 @@ zeGetRTASParallelOperationExpProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnCreateExp = loader::zeRTASParallelOperationCreateExp; - pDdiTable->pfnGetPropertiesExp = loader::zeRTASParallelOperationGetPropertiesExp; - pDdiTable->pfnJoinExp = loader::zeRTASParallelOperationJoinExp; - pDdiTable->pfnDestroyExp = loader::zeRTASParallelOperationDestroyExp; + if (version >= ZE_API_VERSION_1_7) { + pDdiTable->pfnCreateExp = loader::zeRTASParallelOperationCreateExp; + } + if (version >= ZE_API_VERSION_1_7) { + pDdiTable->pfnGetPropertiesExp = loader::zeRTASParallelOperationGetPropertiesExp; + } + if (version >= ZE_API_VERSION_1_7) { + pDdiTable->pfnJoinExp = loader::zeRTASParallelOperationJoinExp; + } + if (version >= ZE_API_VERSION_1_7) { + pDdiTable->pfnDestroyExp = loader::zeRTASParallelOperationDestroyExp; + } } else { @@ -6834,13 +6854,27 @@ zeGetDriverProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGet = loader::zeDriverGet; - pDdiTable->pfnGetApiVersion = loader::zeDriverGetApiVersion; - pDdiTable->pfnGetProperties = loader::zeDriverGetProperties; - pDdiTable->pfnGetIpcProperties = loader::zeDriverGetIpcProperties; - pDdiTable->pfnGetExtensionProperties = loader::zeDriverGetExtensionProperties; - pDdiTable->pfnGetExtensionFunctionAddress = loader::zeDriverGetExtensionFunctionAddress; - pDdiTable->pfnGetLastErrorDescription = loader::zeDriverGetLastErrorDescription; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGet = loader::zeDriverGet; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetApiVersion = loader::zeDriverGetApiVersion; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetProperties = loader::zeDriverGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetIpcProperties = loader::zeDriverGetIpcProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetExtensionProperties = loader::zeDriverGetExtensionProperties; + } + if (version >= ZE_API_VERSION_1_1) { + pDdiTable->pfnGetExtensionFunctionAddress = loader::zeDriverGetExtensionFunctionAddress; + } + if (version >= ZE_API_VERSION_1_6) { + pDdiTable->pfnGetLastErrorDescription = loader::zeDriverGetLastErrorDescription; + } } else { @@ -6923,7 +6957,9 @@ zeGetDriverExpProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnRTASFormatCompatibilityCheckExp = loader::zeDriverRTASFormatCompatibilityCheckExp; + if (version >= ZE_API_VERSION_1_7) { + pDdiTable->pfnRTASFormatCompatibilityCheckExp = loader::zeDriverRTASFormatCompatibilityCheckExp; + } } else { @@ -7015,27 +7051,69 @@ zeGetDeviceProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGet = loader::zeDeviceGet; - pDdiTable->pfnGetSubDevices = loader::zeDeviceGetSubDevices; - pDdiTable->pfnGetProperties = loader::zeDeviceGetProperties; - pDdiTable->pfnGetComputeProperties = loader::zeDeviceGetComputeProperties; - pDdiTable->pfnGetModuleProperties = loader::zeDeviceGetModuleProperties; - pDdiTable->pfnGetCommandQueueGroupProperties = loader::zeDeviceGetCommandQueueGroupProperties; - pDdiTable->pfnGetMemoryProperties = loader::zeDeviceGetMemoryProperties; - pDdiTable->pfnGetMemoryAccessProperties = loader::zeDeviceGetMemoryAccessProperties; - pDdiTable->pfnGetCacheProperties = loader::zeDeviceGetCacheProperties; - pDdiTable->pfnGetImageProperties = loader::zeDeviceGetImageProperties; - pDdiTable->pfnGetExternalMemoryProperties = loader::zeDeviceGetExternalMemoryProperties; - pDdiTable->pfnGetP2PProperties = loader::zeDeviceGetP2PProperties; - pDdiTable->pfnCanAccessPeer = loader::zeDeviceCanAccessPeer; - pDdiTable->pfnGetStatus = loader::zeDeviceGetStatus; - pDdiTable->pfnGetGlobalTimestamps = loader::zeDeviceGetGlobalTimestamps; - pDdiTable->pfnImportExternalSemaphoreExt = loader::zeDeviceImportExternalSemaphoreExt; - pDdiTable->pfnReleaseExternalSemaphoreExt = loader::zeDeviceReleaseExternalSemaphoreExt; - pDdiTable->pfnReserveCacheExt = loader::zeDeviceReserveCacheExt; - pDdiTable->pfnSetCacheAdviceExt = loader::zeDeviceSetCacheAdviceExt; - pDdiTable->pfnPciGetPropertiesExt = loader::zeDevicePciGetPropertiesExt; - pDdiTable->pfnGetRootDevice = loader::zeDeviceGetRootDevice; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGet = loader::zeDeviceGet; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetSubDevices = loader::zeDeviceGetSubDevices; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetProperties = loader::zeDeviceGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetComputeProperties = loader::zeDeviceGetComputeProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetModuleProperties = loader::zeDeviceGetModuleProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetCommandQueueGroupProperties = loader::zeDeviceGetCommandQueueGroupProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetMemoryProperties = loader::zeDeviceGetMemoryProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetMemoryAccessProperties = loader::zeDeviceGetMemoryAccessProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetCacheProperties = loader::zeDeviceGetCacheProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetImageProperties = loader::zeDeviceGetImageProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetExternalMemoryProperties = loader::zeDeviceGetExternalMemoryProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetP2PProperties = loader::zeDeviceGetP2PProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnCanAccessPeer = loader::zeDeviceCanAccessPeer; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetStatus = loader::zeDeviceGetStatus; + } + if (version >= ZE_API_VERSION_1_1) { + pDdiTable->pfnGetGlobalTimestamps = loader::zeDeviceGetGlobalTimestamps; + } + if (version >= ZE_API_VERSION_1_12) { + pDdiTable->pfnImportExternalSemaphoreExt = loader::zeDeviceImportExternalSemaphoreExt; + } + if (version >= ZE_API_VERSION_1_12) { + pDdiTable->pfnReleaseExternalSemaphoreExt = loader::zeDeviceReleaseExternalSemaphoreExt; + } + if (version >= ZE_API_VERSION_1_2) { + pDdiTable->pfnReserveCacheExt = loader::zeDeviceReserveCacheExt; + } + if (version >= ZE_API_VERSION_1_2) { + pDdiTable->pfnSetCacheAdviceExt = loader::zeDeviceSetCacheAdviceExt; + } + if (version >= ZE_API_VERSION_1_3) { + pDdiTable->pfnPciGetPropertiesExt = loader::zeDevicePciGetPropertiesExt; + } + if (version >= ZE_API_VERSION_1_7) { + pDdiTable->pfnGetRootDevice = loader::zeDeviceGetRootDevice; + } } else { @@ -7118,7 +7196,9 @@ zeGetDeviceExpProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGetFabricVertexExp = loader::zeDeviceGetFabricVertexExp; + if (version >= ZE_API_VERSION_1_4) { + pDdiTable->pfnGetFabricVertexExp = loader::zeDeviceGetFabricVertexExp; + } } else { @@ -7210,15 +7290,33 @@ zeGetContextProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnCreate = loader::zeContextCreate; - pDdiTable->pfnDestroy = loader::zeContextDestroy; - pDdiTable->pfnGetStatus = loader::zeContextGetStatus; - pDdiTable->pfnSystemBarrier = loader::zeContextSystemBarrier; - pDdiTable->pfnMakeMemoryResident = loader::zeContextMakeMemoryResident; - pDdiTable->pfnEvictMemory = loader::zeContextEvictMemory; - pDdiTable->pfnMakeImageResident = loader::zeContextMakeImageResident; - pDdiTable->pfnEvictImage = loader::zeContextEvictImage; - pDdiTable->pfnCreateEx = loader::zeContextCreateEx; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnCreate = loader::zeContextCreate; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnDestroy = loader::zeContextDestroy; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetStatus = loader::zeContextGetStatus; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnSystemBarrier = loader::zeContextSystemBarrier; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnMakeMemoryResident = loader::zeContextMakeMemoryResident; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnEvictMemory = loader::zeContextEvictMemory; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnMakeImageResident = loader::zeContextMakeImageResident; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnEvictImage = loader::zeContextEvictImage; + } + if (version >= ZE_API_VERSION_1_1) { + pDdiTable->pfnCreateEx = loader::zeContextCreateEx; + } } else { @@ -7310,12 +7408,24 @@ zeGetCommandQueueProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnCreate = loader::zeCommandQueueCreate; - pDdiTable->pfnDestroy = loader::zeCommandQueueDestroy; - pDdiTable->pfnExecuteCommandLists = loader::zeCommandQueueExecuteCommandLists; - pDdiTable->pfnSynchronize = loader::zeCommandQueueSynchronize; - pDdiTable->pfnGetOrdinal = loader::zeCommandQueueGetOrdinal; - pDdiTable->pfnGetIndex = loader::zeCommandQueueGetIndex; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnCreate = loader::zeCommandQueueCreate; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnDestroy = loader::zeCommandQueueDestroy; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnExecuteCommandLists = loader::zeCommandQueueExecuteCommandLists; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnSynchronize = loader::zeCommandQueueSynchronize; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnGetOrdinal = loader::zeCommandQueueGetOrdinal; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnGetIndex = loader::zeCommandQueueGetIndex; + } } else { @@ -7407,42 +7517,114 @@ zeGetCommandListProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnCreate = loader::zeCommandListCreate; - pDdiTable->pfnCreateImmediate = loader::zeCommandListCreateImmediate; - pDdiTable->pfnDestroy = loader::zeCommandListDestroy; - pDdiTable->pfnClose = loader::zeCommandListClose; - pDdiTable->pfnReset = loader::zeCommandListReset; - pDdiTable->pfnAppendWriteGlobalTimestamp = loader::zeCommandListAppendWriteGlobalTimestamp; - pDdiTable->pfnAppendBarrier = loader::zeCommandListAppendBarrier; - pDdiTable->pfnAppendMemoryRangesBarrier = loader::zeCommandListAppendMemoryRangesBarrier; - pDdiTable->pfnAppendMemoryCopy = loader::zeCommandListAppendMemoryCopy; - pDdiTable->pfnAppendMemoryFill = loader::zeCommandListAppendMemoryFill; - pDdiTable->pfnAppendMemoryCopyRegion = loader::zeCommandListAppendMemoryCopyRegion; - pDdiTable->pfnAppendMemoryCopyFromContext = loader::zeCommandListAppendMemoryCopyFromContext; - pDdiTable->pfnAppendImageCopy = loader::zeCommandListAppendImageCopy; - pDdiTable->pfnAppendImageCopyRegion = loader::zeCommandListAppendImageCopyRegion; - pDdiTable->pfnAppendImageCopyToMemory = loader::zeCommandListAppendImageCopyToMemory; - pDdiTable->pfnAppendImageCopyFromMemory = loader::zeCommandListAppendImageCopyFromMemory; - pDdiTable->pfnAppendMemoryPrefetch = loader::zeCommandListAppendMemoryPrefetch; - pDdiTable->pfnAppendMemAdvise = loader::zeCommandListAppendMemAdvise; - pDdiTable->pfnAppendSignalEvent = loader::zeCommandListAppendSignalEvent; - pDdiTable->pfnAppendWaitOnEvents = loader::zeCommandListAppendWaitOnEvents; - pDdiTable->pfnAppendEventReset = loader::zeCommandListAppendEventReset; - pDdiTable->pfnAppendQueryKernelTimestamps = loader::zeCommandListAppendQueryKernelTimestamps; - pDdiTable->pfnAppendLaunchKernel = loader::zeCommandListAppendLaunchKernel; - pDdiTable->pfnAppendLaunchCooperativeKernel = loader::zeCommandListAppendLaunchCooperativeKernel; - pDdiTable->pfnAppendLaunchKernelIndirect = loader::zeCommandListAppendLaunchKernelIndirect; - pDdiTable->pfnAppendLaunchMultipleKernelsIndirect = loader::zeCommandListAppendLaunchMultipleKernelsIndirect; - pDdiTable->pfnAppendSignalExternalSemaphoreExt = loader::zeCommandListAppendSignalExternalSemaphoreExt; - pDdiTable->pfnAppendWaitExternalSemaphoreExt = loader::zeCommandListAppendWaitExternalSemaphoreExt; - pDdiTable->pfnAppendImageCopyToMemoryExt = loader::zeCommandListAppendImageCopyToMemoryExt; - pDdiTable->pfnAppendImageCopyFromMemoryExt = loader::zeCommandListAppendImageCopyFromMemoryExt; - pDdiTable->pfnHostSynchronize = loader::zeCommandListHostSynchronize; - pDdiTable->pfnGetDeviceHandle = loader::zeCommandListGetDeviceHandle; - pDdiTable->pfnGetContextHandle = loader::zeCommandListGetContextHandle; - pDdiTable->pfnGetOrdinal = loader::zeCommandListGetOrdinal; - pDdiTable->pfnImmediateGetIndex = loader::zeCommandListImmediateGetIndex; - pDdiTable->pfnIsImmediate = loader::zeCommandListIsImmediate; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnCreate = loader::zeCommandListCreate; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnCreateImmediate = loader::zeCommandListCreateImmediate; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnDestroy = loader::zeCommandListDestroy; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnClose = loader::zeCommandListClose; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnReset = loader::zeCommandListReset; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnAppendWriteGlobalTimestamp = loader::zeCommandListAppendWriteGlobalTimestamp; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnAppendBarrier = loader::zeCommandListAppendBarrier; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnAppendMemoryRangesBarrier = loader::zeCommandListAppendMemoryRangesBarrier; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnAppendMemoryCopy = loader::zeCommandListAppendMemoryCopy; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnAppendMemoryFill = loader::zeCommandListAppendMemoryFill; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnAppendMemoryCopyRegion = loader::zeCommandListAppendMemoryCopyRegion; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnAppendMemoryCopyFromContext = loader::zeCommandListAppendMemoryCopyFromContext; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnAppendImageCopy = loader::zeCommandListAppendImageCopy; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnAppendImageCopyRegion = loader::zeCommandListAppendImageCopyRegion; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnAppendImageCopyToMemory = loader::zeCommandListAppendImageCopyToMemory; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnAppendImageCopyFromMemory = loader::zeCommandListAppendImageCopyFromMemory; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnAppendMemoryPrefetch = loader::zeCommandListAppendMemoryPrefetch; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnAppendMemAdvise = loader::zeCommandListAppendMemAdvise; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnAppendSignalEvent = loader::zeCommandListAppendSignalEvent; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnAppendWaitOnEvents = loader::zeCommandListAppendWaitOnEvents; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnAppendEventReset = loader::zeCommandListAppendEventReset; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnAppendQueryKernelTimestamps = loader::zeCommandListAppendQueryKernelTimestamps; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnAppendLaunchKernel = loader::zeCommandListAppendLaunchKernel; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnAppendLaunchCooperativeKernel = loader::zeCommandListAppendLaunchCooperativeKernel; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnAppendLaunchKernelIndirect = loader::zeCommandListAppendLaunchKernelIndirect; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnAppendLaunchMultipleKernelsIndirect = loader::zeCommandListAppendLaunchMultipleKernelsIndirect; + } + if (version >= ZE_API_VERSION_1_12) { + pDdiTable->pfnAppendSignalExternalSemaphoreExt = loader::zeCommandListAppendSignalExternalSemaphoreExt; + } + if (version >= ZE_API_VERSION_1_12) { + pDdiTable->pfnAppendWaitExternalSemaphoreExt = loader::zeCommandListAppendWaitExternalSemaphoreExt; + } + if (version >= ZE_API_VERSION_1_3) { + pDdiTable->pfnAppendImageCopyToMemoryExt = loader::zeCommandListAppendImageCopyToMemoryExt; + } + if (version >= ZE_API_VERSION_1_3) { + pDdiTable->pfnAppendImageCopyFromMemoryExt = loader::zeCommandListAppendImageCopyFromMemoryExt; + } + if (version >= ZE_API_VERSION_1_6) { + pDdiTable->pfnHostSynchronize = loader::zeCommandListHostSynchronize; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnGetDeviceHandle = loader::zeCommandListGetDeviceHandle; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnGetContextHandle = loader::zeCommandListGetContextHandle; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnGetOrdinal = loader::zeCommandListGetOrdinal; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnImmediateGetIndex = loader::zeCommandListImmediateGetIndex; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnIsImmediate = loader::zeCommandListIsImmediate; + } } else { @@ -7525,14 +7707,30 @@ zeGetCommandListExpProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGetNextCommandIdWithKernelsExp = loader::zeCommandListGetNextCommandIdWithKernelsExp; - pDdiTable->pfnUpdateMutableCommandKernelsExp = loader::zeCommandListUpdateMutableCommandKernelsExp; - pDdiTable->pfnCreateCloneExp = loader::zeCommandListCreateCloneExp; - pDdiTable->pfnImmediateAppendCommandListsExp = loader::zeCommandListImmediateAppendCommandListsExp; - pDdiTable->pfnGetNextCommandIdExp = loader::zeCommandListGetNextCommandIdExp; - pDdiTable->pfnUpdateMutableCommandsExp = loader::zeCommandListUpdateMutableCommandsExp; - pDdiTable->pfnUpdateMutableCommandSignalEventExp = loader::zeCommandListUpdateMutableCommandSignalEventExp; - pDdiTable->pfnUpdateMutableCommandWaitEventsExp = loader::zeCommandListUpdateMutableCommandWaitEventsExp; + if (version >= ZE_API_VERSION_1_10) { + pDdiTable->pfnGetNextCommandIdWithKernelsExp = loader::zeCommandListGetNextCommandIdWithKernelsExp; + } + if (version >= ZE_API_VERSION_1_10) { + pDdiTable->pfnUpdateMutableCommandKernelsExp = loader::zeCommandListUpdateMutableCommandKernelsExp; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnCreateCloneExp = loader::zeCommandListCreateCloneExp; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnImmediateAppendCommandListsExp = loader::zeCommandListImmediateAppendCommandListsExp; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnGetNextCommandIdExp = loader::zeCommandListGetNextCommandIdExp; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnUpdateMutableCommandsExp = loader::zeCommandListUpdateMutableCommandsExp; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnUpdateMutableCommandSignalEventExp = loader::zeCommandListUpdateMutableCommandSignalEventExp; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnUpdateMutableCommandWaitEventsExp = loader::zeCommandListUpdateMutableCommandWaitEventsExp; + } } else { @@ -7624,17 +7822,39 @@ zeGetEventProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnCreate = loader::zeEventCreate; - pDdiTable->pfnDestroy = loader::zeEventDestroy; - pDdiTable->pfnHostSignal = loader::zeEventHostSignal; - pDdiTable->pfnHostSynchronize = loader::zeEventHostSynchronize; - pDdiTable->pfnQueryStatus = loader::zeEventQueryStatus; - pDdiTable->pfnHostReset = loader::zeEventHostReset; - pDdiTable->pfnQueryKernelTimestamp = loader::zeEventQueryKernelTimestamp; - pDdiTable->pfnQueryKernelTimestampsExt = loader::zeEventQueryKernelTimestampsExt; - pDdiTable->pfnGetEventPool = loader::zeEventGetEventPool; - pDdiTable->pfnGetSignalScope = loader::zeEventGetSignalScope; - pDdiTable->pfnGetWaitScope = loader::zeEventGetWaitScope; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnCreate = loader::zeEventCreate; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnDestroy = loader::zeEventDestroy; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnHostSignal = loader::zeEventHostSignal; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnHostSynchronize = loader::zeEventHostSynchronize; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnQueryStatus = loader::zeEventQueryStatus; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnHostReset = loader::zeEventHostReset; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnQueryKernelTimestamp = loader::zeEventQueryKernelTimestamp; + } + if (version >= ZE_API_VERSION_1_6) { + pDdiTable->pfnQueryKernelTimestampsExt = loader::zeEventQueryKernelTimestampsExt; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnGetEventPool = loader::zeEventGetEventPool; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnGetSignalScope = loader::zeEventGetSignalScope; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnGetWaitScope = loader::zeEventGetWaitScope; + } } else { @@ -7717,7 +7937,9 @@ zeGetEventExpProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnQueryTimestampsExp = loader::zeEventQueryTimestampsExp; + if (version >= ZE_API_VERSION_1_2) { + pDdiTable->pfnQueryTimestampsExp = loader::zeEventQueryTimestampsExp; + } } else { @@ -7809,14 +8031,30 @@ zeGetEventPoolProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnCreate = loader::zeEventPoolCreate; - pDdiTable->pfnDestroy = loader::zeEventPoolDestroy; - pDdiTable->pfnGetIpcHandle = loader::zeEventPoolGetIpcHandle; - pDdiTable->pfnOpenIpcHandle = loader::zeEventPoolOpenIpcHandle; - pDdiTable->pfnCloseIpcHandle = loader::zeEventPoolCloseIpcHandle; - pDdiTable->pfnPutIpcHandle = loader::zeEventPoolPutIpcHandle; - pDdiTable->pfnGetContextHandle = loader::zeEventPoolGetContextHandle; - pDdiTable->pfnGetFlags = loader::zeEventPoolGetFlags; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnCreate = loader::zeEventPoolCreate; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnDestroy = loader::zeEventPoolDestroy; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetIpcHandle = loader::zeEventPoolGetIpcHandle; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnOpenIpcHandle = loader::zeEventPoolOpenIpcHandle; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnCloseIpcHandle = loader::zeEventPoolCloseIpcHandle; + } + if (version >= ZE_API_VERSION_1_6) { + pDdiTable->pfnPutIpcHandle = loader::zeEventPoolPutIpcHandle; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnGetContextHandle = loader::zeEventPoolGetContextHandle; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnGetFlags = loader::zeEventPoolGetFlags; + } } else { @@ -7908,11 +8146,21 @@ zeGetFenceProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnCreate = loader::zeFenceCreate; - pDdiTable->pfnDestroy = loader::zeFenceDestroy; - pDdiTable->pfnHostSynchronize = loader::zeFenceHostSynchronize; - pDdiTable->pfnQueryStatus = loader::zeFenceQueryStatus; - pDdiTable->pfnReset = loader::zeFenceReset; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnCreate = loader::zeFenceCreate; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnDestroy = loader::zeFenceDestroy; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnHostSynchronize = loader::zeFenceHostSynchronize; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnQueryStatus = loader::zeFenceQueryStatus; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnReset = loader::zeFenceReset; + } } else { @@ -8004,11 +8252,21 @@ zeGetImageProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGetProperties = loader::zeImageGetProperties; - pDdiTable->pfnCreate = loader::zeImageCreate; - pDdiTable->pfnDestroy = loader::zeImageDestroy; - pDdiTable->pfnGetAllocPropertiesExt = loader::zeImageGetAllocPropertiesExt; - pDdiTable->pfnViewCreateExt = loader::zeImageViewCreateExt; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetProperties = loader::zeImageGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnCreate = loader::zeImageCreate; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnDestroy = loader::zeImageDestroy; + } + if (version >= ZE_API_VERSION_1_3) { + pDdiTable->pfnGetAllocPropertiesExt = loader::zeImageGetAllocPropertiesExt; + } + if (version >= ZE_API_VERSION_1_5) { + pDdiTable->pfnViewCreateExt = loader::zeImageViewCreateExt; + } } else { @@ -8091,9 +8349,15 @@ zeGetImageExpProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGetMemoryPropertiesExp = loader::zeImageGetMemoryPropertiesExp; - pDdiTable->pfnViewCreateExp = loader::zeImageViewCreateExp; - pDdiTable->pfnGetDeviceOffsetExp = loader::zeImageGetDeviceOffsetExp; + if (version >= ZE_API_VERSION_1_2) { + pDdiTable->pfnGetMemoryPropertiesExp = loader::zeImageGetMemoryPropertiesExp; + } + if (version >= ZE_API_VERSION_1_2) { + pDdiTable->pfnViewCreateExp = loader::zeImageViewCreateExp; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnGetDeviceOffsetExp = loader::zeImageGetDeviceOffsetExp; + } } else { @@ -8185,18 +8449,42 @@ zeGetKernelProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnCreate = loader::zeKernelCreate; - pDdiTable->pfnDestroy = loader::zeKernelDestroy; - pDdiTable->pfnSetCacheConfig = loader::zeKernelSetCacheConfig; - pDdiTable->pfnSetGroupSize = loader::zeKernelSetGroupSize; - pDdiTable->pfnSuggestGroupSize = loader::zeKernelSuggestGroupSize; - pDdiTable->pfnSuggestMaxCooperativeGroupCount = loader::zeKernelSuggestMaxCooperativeGroupCount; - pDdiTable->pfnSetArgumentValue = loader::zeKernelSetArgumentValue; - pDdiTable->pfnSetIndirectAccess = loader::zeKernelSetIndirectAccess; - pDdiTable->pfnGetIndirectAccess = loader::zeKernelGetIndirectAccess; - pDdiTable->pfnGetSourceAttributes = loader::zeKernelGetSourceAttributes; - pDdiTable->pfnGetProperties = loader::zeKernelGetProperties; - pDdiTable->pfnGetName = loader::zeKernelGetName; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnCreate = loader::zeKernelCreate; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnDestroy = loader::zeKernelDestroy; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnSetCacheConfig = loader::zeKernelSetCacheConfig; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnSetGroupSize = loader::zeKernelSetGroupSize; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnSuggestGroupSize = loader::zeKernelSuggestGroupSize; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnSuggestMaxCooperativeGroupCount = loader::zeKernelSuggestMaxCooperativeGroupCount; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnSetArgumentValue = loader::zeKernelSetArgumentValue; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnSetIndirectAccess = loader::zeKernelSetIndirectAccess; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetIndirectAccess = loader::zeKernelGetIndirectAccess; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetSourceAttributes = loader::zeKernelGetSourceAttributes; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetProperties = loader::zeKernelGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetName = loader::zeKernelGetName; + } } else { @@ -8279,9 +8567,15 @@ zeGetKernelExpProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnSetGlobalOffsetExp = loader::zeKernelSetGlobalOffsetExp; - pDdiTable->pfnGetBinaryExp = loader::zeKernelGetBinaryExp; - pDdiTable->pfnSchedulingHintExp = loader::zeKernelSchedulingHintExp; + if (version >= ZE_API_VERSION_1_1) { + pDdiTable->pfnSetGlobalOffsetExp = loader::zeKernelSetGlobalOffsetExp; + } + if (version >= ZE_API_VERSION_1_11) { + pDdiTable->pfnGetBinaryExp = loader::zeKernelGetBinaryExp; + } + if (version >= ZE_API_VERSION_1_2) { + pDdiTable->pfnSchedulingHintExp = loader::zeKernelSchedulingHintExp; + } } else { @@ -8373,18 +8667,42 @@ zeGetMemProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnAllocShared = loader::zeMemAllocShared; - pDdiTable->pfnAllocDevice = loader::zeMemAllocDevice; - pDdiTable->pfnAllocHost = loader::zeMemAllocHost; - pDdiTable->pfnFree = loader::zeMemFree; - pDdiTable->pfnGetAllocProperties = loader::zeMemGetAllocProperties; - pDdiTable->pfnGetAddressRange = loader::zeMemGetAddressRange; - pDdiTable->pfnGetIpcHandle = loader::zeMemGetIpcHandle; - pDdiTable->pfnOpenIpcHandle = loader::zeMemOpenIpcHandle; - pDdiTable->pfnCloseIpcHandle = loader::zeMemCloseIpcHandle; - pDdiTable->pfnFreeExt = loader::zeMemFreeExt; - pDdiTable->pfnPutIpcHandle = loader::zeMemPutIpcHandle; - pDdiTable->pfnGetPitchFor2dImage = loader::zeMemGetPitchFor2dImage; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnAllocShared = loader::zeMemAllocShared; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnAllocDevice = loader::zeMemAllocDevice; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnAllocHost = loader::zeMemAllocHost; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnFree = loader::zeMemFree; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetAllocProperties = loader::zeMemGetAllocProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetAddressRange = loader::zeMemGetAddressRange; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetIpcHandle = loader::zeMemGetIpcHandle; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnOpenIpcHandle = loader::zeMemOpenIpcHandle; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnCloseIpcHandle = loader::zeMemCloseIpcHandle; + } + if (version >= ZE_API_VERSION_1_3) { + pDdiTable->pfnFreeExt = loader::zeMemFreeExt; + } + if (version >= ZE_API_VERSION_1_6) { + pDdiTable->pfnPutIpcHandle = loader::zeMemPutIpcHandle; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnGetPitchFor2dImage = loader::zeMemGetPitchFor2dImage; + } } else { @@ -8467,10 +8785,18 @@ zeGetMemExpProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGetIpcHandleFromFileDescriptorExp = loader::zeMemGetIpcHandleFromFileDescriptorExp; - pDdiTable->pfnGetFileDescriptorFromIpcHandleExp = loader::zeMemGetFileDescriptorFromIpcHandleExp; - pDdiTable->pfnSetAtomicAccessAttributeExp = loader::zeMemSetAtomicAccessAttributeExp; - pDdiTable->pfnGetAtomicAccessAttributeExp = loader::zeMemGetAtomicAccessAttributeExp; + if (version >= ZE_API_VERSION_1_6) { + pDdiTable->pfnGetIpcHandleFromFileDescriptorExp = loader::zeMemGetIpcHandleFromFileDescriptorExp; + } + if (version >= ZE_API_VERSION_1_6) { + pDdiTable->pfnGetFileDescriptorFromIpcHandleExp = loader::zeMemGetFileDescriptorFromIpcHandleExp; + } + if (version >= ZE_API_VERSION_1_7) { + pDdiTable->pfnSetAtomicAccessAttributeExp = loader::zeMemSetAtomicAccessAttributeExp; + } + if (version >= ZE_API_VERSION_1_7) { + pDdiTable->pfnGetAtomicAccessAttributeExp = loader::zeMemGetAtomicAccessAttributeExp; + } } else { @@ -8562,15 +8888,33 @@ zeGetModuleProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnCreate = loader::zeModuleCreate; - pDdiTable->pfnDestroy = loader::zeModuleDestroy; - pDdiTable->pfnDynamicLink = loader::zeModuleDynamicLink; - pDdiTable->pfnGetNativeBinary = loader::zeModuleGetNativeBinary; - pDdiTable->pfnGetGlobalPointer = loader::zeModuleGetGlobalPointer; - pDdiTable->pfnGetKernelNames = loader::zeModuleGetKernelNames; - pDdiTable->pfnGetProperties = loader::zeModuleGetProperties; - pDdiTable->pfnGetFunctionPointer = loader::zeModuleGetFunctionPointer; - pDdiTable->pfnInspectLinkageExt = loader::zeModuleInspectLinkageExt; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnCreate = loader::zeModuleCreate; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnDestroy = loader::zeModuleDestroy; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnDynamicLink = loader::zeModuleDynamicLink; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetNativeBinary = loader::zeModuleGetNativeBinary; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetGlobalPointer = loader::zeModuleGetGlobalPointer; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetKernelNames = loader::zeModuleGetKernelNames; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetProperties = loader::zeModuleGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetFunctionPointer = loader::zeModuleGetFunctionPointer; + } + if (version >= ZE_API_VERSION_1_3) { + pDdiTable->pfnInspectLinkageExt = loader::zeModuleInspectLinkageExt; + } } else { @@ -8662,8 +9006,12 @@ zeGetModuleBuildLogProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnDestroy = loader::zeModuleBuildLogDestroy; - pDdiTable->pfnGetString = loader::zeModuleBuildLogGetString; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnDestroy = loader::zeModuleBuildLogDestroy; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetString = loader::zeModuleBuildLogGetString; + } } else { @@ -8755,8 +9103,12 @@ zeGetPhysicalMemProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnCreate = loader::zePhysicalMemCreate; - pDdiTable->pfnDestroy = loader::zePhysicalMemDestroy; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnCreate = loader::zePhysicalMemCreate; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnDestroy = loader::zePhysicalMemDestroy; + } } else { @@ -8848,8 +9200,12 @@ zeGetSamplerProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnCreate = loader::zeSamplerCreate; - pDdiTable->pfnDestroy = loader::zeSamplerDestroy; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnCreate = loader::zeSamplerCreate; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnDestroy = loader::zeSamplerDestroy; + } } else { @@ -8941,13 +9297,27 @@ zeGetVirtualMemProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnReserve = loader::zeVirtualMemReserve; - pDdiTable->pfnFree = loader::zeVirtualMemFree; - pDdiTable->pfnQueryPageSize = loader::zeVirtualMemQueryPageSize; - pDdiTable->pfnMap = loader::zeVirtualMemMap; - pDdiTable->pfnUnmap = loader::zeVirtualMemUnmap; - pDdiTable->pfnSetAccessAttribute = loader::zeVirtualMemSetAccessAttribute; - pDdiTable->pfnGetAccessAttribute = loader::zeVirtualMemGetAccessAttribute; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnReserve = loader::zeVirtualMemReserve; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnFree = loader::zeVirtualMemFree; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnQueryPageSize = loader::zeVirtualMemQueryPageSize; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnMap = loader::zeVirtualMemMap; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnUnmap = loader::zeVirtualMemUnmap; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnSetAccessAttribute = loader::zeVirtualMemSetAccessAttribute; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetAccessAttribute = loader::zeVirtualMemGetAccessAttribute; + } } else { @@ -9030,9 +9400,15 @@ zeGetFabricEdgeExpProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGetExp = loader::zeFabricEdgeGetExp; - pDdiTable->pfnGetVerticesExp = loader::zeFabricEdgeGetVerticesExp; - pDdiTable->pfnGetPropertiesExp = loader::zeFabricEdgeGetPropertiesExp; + if (version >= ZE_API_VERSION_1_4) { + pDdiTable->pfnGetExp = loader::zeFabricEdgeGetExp; + } + if (version >= ZE_API_VERSION_1_4) { + pDdiTable->pfnGetVerticesExp = loader::zeFabricEdgeGetVerticesExp; + } + if (version >= ZE_API_VERSION_1_4) { + pDdiTable->pfnGetPropertiesExp = loader::zeFabricEdgeGetPropertiesExp; + } } else { @@ -9115,10 +9491,18 @@ zeGetFabricVertexExpProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGetExp = loader::zeFabricVertexGetExp; - pDdiTable->pfnGetSubVerticesExp = loader::zeFabricVertexGetSubVerticesExp; - pDdiTable->pfnGetPropertiesExp = loader::zeFabricVertexGetPropertiesExp; - pDdiTable->pfnGetDeviceExp = loader::zeFabricVertexGetDeviceExp; + if (version >= ZE_API_VERSION_1_4) { + pDdiTable->pfnGetExp = loader::zeFabricVertexGetExp; + } + if (version >= ZE_API_VERSION_1_4) { + pDdiTable->pfnGetSubVerticesExp = loader::zeFabricVertexGetSubVerticesExp; + } + if (version >= ZE_API_VERSION_1_4) { + pDdiTable->pfnGetPropertiesExp = loader::zeFabricVertexGetPropertiesExp; + } + if (version >= ZE_API_VERSION_1_4) { + pDdiTable->pfnGetDeviceExp = loader::zeFabricVertexGetDeviceExp; + } } else { diff --git a/source/loader/zes_ldrddi.cpp b/source/loader/zes_ldrddi.cpp index 0edb0846..de3a665a 100644 --- a/source/loader/zes_ldrddi.cpp +++ b/source/loader/zes_ldrddi.cpp @@ -4639,7 +4639,9 @@ zesGetGlobalProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnInit = loader::zesInit; + if (version >= ZE_API_VERSION_1_5) { + pDdiTable->pfnInit = loader::zesInit; + } } else { @@ -4715,43 +4717,117 @@ zesGetDeviceProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGetProperties = loader::zesDeviceGetProperties; - pDdiTable->pfnGetState = loader::zesDeviceGetState; - pDdiTable->pfnReset = loader::zesDeviceReset; - pDdiTable->pfnProcessesGetState = loader::zesDeviceProcessesGetState; - pDdiTable->pfnPciGetProperties = loader::zesDevicePciGetProperties; - pDdiTable->pfnPciGetState = loader::zesDevicePciGetState; - pDdiTable->pfnPciGetBars = loader::zesDevicePciGetBars; - pDdiTable->pfnPciGetStats = loader::zesDevicePciGetStats; - pDdiTable->pfnEnumDiagnosticTestSuites = loader::zesDeviceEnumDiagnosticTestSuites; - pDdiTable->pfnEnumEngineGroups = loader::zesDeviceEnumEngineGroups; - pDdiTable->pfnEventRegister = loader::zesDeviceEventRegister; - pDdiTable->pfnEnumFabricPorts = loader::zesDeviceEnumFabricPorts; - pDdiTable->pfnEnumFans = loader::zesDeviceEnumFans; - pDdiTable->pfnEnumFirmwares = loader::zesDeviceEnumFirmwares; - pDdiTable->pfnEnumFrequencyDomains = loader::zesDeviceEnumFrequencyDomains; - pDdiTable->pfnEnumLeds = loader::zesDeviceEnumLeds; - pDdiTable->pfnEnumMemoryModules = loader::zesDeviceEnumMemoryModules; - pDdiTable->pfnEnumPerformanceFactorDomains = loader::zesDeviceEnumPerformanceFactorDomains; - pDdiTable->pfnEnumPowerDomains = loader::zesDeviceEnumPowerDomains; - pDdiTable->pfnGetCardPowerDomain = loader::zesDeviceGetCardPowerDomain; - pDdiTable->pfnEnumPsus = loader::zesDeviceEnumPsus; - pDdiTable->pfnEnumRasErrorSets = loader::zesDeviceEnumRasErrorSets; - pDdiTable->pfnEnumSchedulers = loader::zesDeviceEnumSchedulers; - pDdiTable->pfnEnumStandbyDomains = loader::zesDeviceEnumStandbyDomains; - pDdiTable->pfnEnumTemperatureSensors = loader::zesDeviceEnumTemperatureSensors; - pDdiTable->pfnEccAvailable = loader::zesDeviceEccAvailable; - pDdiTable->pfnEccConfigurable = loader::zesDeviceEccConfigurable; - pDdiTable->pfnGetEccState = loader::zesDeviceGetEccState; - pDdiTable->pfnSetEccState = loader::zesDeviceSetEccState; - pDdiTable->pfnGet = loader::zesDeviceGet; - pDdiTable->pfnSetOverclockWaiver = loader::zesDeviceSetOverclockWaiver; - pDdiTable->pfnGetOverclockDomains = loader::zesDeviceGetOverclockDomains; - pDdiTable->pfnGetOverclockControls = loader::zesDeviceGetOverclockControls; - pDdiTable->pfnResetOverclockSettings = loader::zesDeviceResetOverclockSettings; - pDdiTable->pfnReadOverclockState = loader::zesDeviceReadOverclockState; - pDdiTable->pfnEnumOverclockDomains = loader::zesDeviceEnumOverclockDomains; - pDdiTable->pfnResetExt = loader::zesDeviceResetExt; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetProperties = loader::zesDeviceGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetState = loader::zesDeviceGetState; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnReset = loader::zesDeviceReset; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnProcessesGetState = loader::zesDeviceProcessesGetState; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnPciGetProperties = loader::zesDevicePciGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnPciGetState = loader::zesDevicePciGetState; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnPciGetBars = loader::zesDevicePciGetBars; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnPciGetStats = loader::zesDevicePciGetStats; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnEnumDiagnosticTestSuites = loader::zesDeviceEnumDiagnosticTestSuites; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnEnumEngineGroups = loader::zesDeviceEnumEngineGroups; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnEventRegister = loader::zesDeviceEventRegister; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnEnumFabricPorts = loader::zesDeviceEnumFabricPorts; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnEnumFans = loader::zesDeviceEnumFans; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnEnumFirmwares = loader::zesDeviceEnumFirmwares; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnEnumFrequencyDomains = loader::zesDeviceEnumFrequencyDomains; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnEnumLeds = loader::zesDeviceEnumLeds; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnEnumMemoryModules = loader::zesDeviceEnumMemoryModules; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnEnumPerformanceFactorDomains = loader::zesDeviceEnumPerformanceFactorDomains; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnEnumPowerDomains = loader::zesDeviceEnumPowerDomains; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetCardPowerDomain = loader::zesDeviceGetCardPowerDomain; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnEnumPsus = loader::zesDeviceEnumPsus; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnEnumRasErrorSets = loader::zesDeviceEnumRasErrorSets; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnEnumSchedulers = loader::zesDeviceEnumSchedulers; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnEnumStandbyDomains = loader::zesDeviceEnumStandbyDomains; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnEnumTemperatureSensors = loader::zesDeviceEnumTemperatureSensors; + } + if (version >= ZE_API_VERSION_1_4) { + pDdiTable->pfnEccAvailable = loader::zesDeviceEccAvailable; + } + if (version >= ZE_API_VERSION_1_4) { + pDdiTable->pfnEccConfigurable = loader::zesDeviceEccConfigurable; + } + if (version >= ZE_API_VERSION_1_4) { + pDdiTable->pfnGetEccState = loader::zesDeviceGetEccState; + } + if (version >= ZE_API_VERSION_1_4) { + pDdiTable->pfnSetEccState = loader::zesDeviceSetEccState; + } + if (version >= ZE_API_VERSION_1_5) { + pDdiTable->pfnGet = loader::zesDeviceGet; + } + if (version >= ZE_API_VERSION_1_5) { + pDdiTable->pfnSetOverclockWaiver = loader::zesDeviceSetOverclockWaiver; + } + if (version >= ZE_API_VERSION_1_5) { + pDdiTable->pfnGetOverclockDomains = loader::zesDeviceGetOverclockDomains; + } + if (version >= ZE_API_VERSION_1_5) { + pDdiTable->pfnGetOverclockControls = loader::zesDeviceGetOverclockControls; + } + if (version >= ZE_API_VERSION_1_5) { + pDdiTable->pfnResetOverclockSettings = loader::zesDeviceResetOverclockSettings; + } + if (version >= ZE_API_VERSION_1_5) { + pDdiTable->pfnReadOverclockState = loader::zesDeviceReadOverclockState; + } + if (version >= ZE_API_VERSION_1_5) { + pDdiTable->pfnEnumOverclockDomains = loader::zesDeviceEnumOverclockDomains; + } + if (version >= ZE_API_VERSION_1_7) { + pDdiTable->pfnResetExt = loader::zesDeviceResetExt; + } } else { @@ -4818,9 +4894,15 @@ zesGetDeviceExpProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnEnumEnabledVFExp = loader::zesDeviceEnumEnabledVFExp; - pDdiTable->pfnGetSubDevicePropertiesExp = loader::zesDeviceGetSubDevicePropertiesExp; - pDdiTable->pfnEnumActiveVFExp = loader::zesDeviceEnumActiveVFExp; + if (version >= ZE_API_VERSION_1_10) { + pDdiTable->pfnEnumEnabledVFExp = loader::zesDeviceEnumEnabledVFExp; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnGetSubDevicePropertiesExp = loader::zesDeviceGetSubDevicePropertiesExp; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnEnumActiveVFExp = loader::zesDeviceEnumActiveVFExp; + } } else { @@ -4896,11 +4978,21 @@ zesGetDriverProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnEventListen = loader::zesDriverEventListen; - pDdiTable->pfnEventListenEx = loader::zesDriverEventListenEx; - pDdiTable->pfnGet = loader::zesDriverGet; - pDdiTable->pfnGetExtensionProperties = loader::zesDriverGetExtensionProperties; - pDdiTable->pfnGetExtensionFunctionAddress = loader::zesDriverGetExtensionFunctionAddress; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnEventListen = loader::zesDriverEventListen; + } + if (version >= ZE_API_VERSION_1_1) { + pDdiTable->pfnEventListenEx = loader::zesDriverEventListenEx; + } + if (version >= ZE_API_VERSION_1_5) { + pDdiTable->pfnGet = loader::zesDriverGet; + } + if (version >= ZE_API_VERSION_1_8) { + pDdiTable->pfnGetExtensionProperties = loader::zesDriverGetExtensionProperties; + } + if (version >= ZE_API_VERSION_1_8) { + pDdiTable->pfnGetExtensionFunctionAddress = loader::zesDriverGetExtensionFunctionAddress; + } } else { @@ -4967,7 +5059,9 @@ zesGetDriverExpProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGetDeviceByUuidExp = loader::zesDriverGetDeviceByUuidExp; + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnGetDeviceByUuidExp = loader::zesDriverGetDeviceByUuidExp; + } } else { @@ -5043,9 +5137,15 @@ zesGetDiagnosticsProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGetProperties = loader::zesDiagnosticsGetProperties; - pDdiTable->pfnGetTests = loader::zesDiagnosticsGetTests; - pDdiTable->pfnRunTests = loader::zesDiagnosticsRunTests; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetProperties = loader::zesDiagnosticsGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetTests = loader::zesDiagnosticsGetTests; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnRunTests = loader::zesDiagnosticsRunTests; + } } else { @@ -5121,9 +5221,15 @@ zesGetEngineProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGetProperties = loader::zesEngineGetProperties; - pDdiTable->pfnGetActivity = loader::zesEngineGetActivity; - pDdiTable->pfnGetActivityExt = loader::zesEngineGetActivityExt; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetProperties = loader::zesEngineGetProperties; + } + if (version >= ZE_API_VERSION_1_7) { + pDdiTable->pfnGetActivity = loader::zesEngineGetActivity; + } + if (version >= ZE_API_VERSION_1_7) { + pDdiTable->pfnGetActivityExt = loader::zesEngineGetActivityExt; + } } else { @@ -5199,14 +5305,30 @@ zesGetFabricPortProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGetProperties = loader::zesFabricPortGetProperties; - pDdiTable->pfnGetLinkType = loader::zesFabricPortGetLinkType; - pDdiTable->pfnGetConfig = loader::zesFabricPortGetConfig; - pDdiTable->pfnSetConfig = loader::zesFabricPortSetConfig; - pDdiTable->pfnGetState = loader::zesFabricPortGetState; - pDdiTable->pfnGetThroughput = loader::zesFabricPortGetThroughput; - pDdiTable->pfnGetFabricErrorCounters = loader::zesFabricPortGetFabricErrorCounters; - pDdiTable->pfnGetMultiPortThroughput = loader::zesFabricPortGetMultiPortThroughput; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetProperties = loader::zesFabricPortGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetLinkType = loader::zesFabricPortGetLinkType; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetConfig = loader::zesFabricPortGetConfig; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnSetConfig = loader::zesFabricPortSetConfig; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetState = loader::zesFabricPortGetState; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetThroughput = loader::zesFabricPortGetThroughput; + } + if (version >= ZE_API_VERSION_1_7) { + pDdiTable->pfnGetFabricErrorCounters = loader::zesFabricPortGetFabricErrorCounters; + } + if (version >= ZE_API_VERSION_1_7) { + pDdiTable->pfnGetMultiPortThroughput = loader::zesFabricPortGetMultiPortThroughput; + } } else { @@ -5282,12 +5404,24 @@ zesGetFanProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGetProperties = loader::zesFanGetProperties; - pDdiTable->pfnGetConfig = loader::zesFanGetConfig; - pDdiTable->pfnSetDefaultMode = loader::zesFanSetDefaultMode; - pDdiTable->pfnSetFixedSpeedMode = loader::zesFanSetFixedSpeedMode; - pDdiTable->pfnSetSpeedTableMode = loader::zesFanSetSpeedTableMode; - pDdiTable->pfnGetState = loader::zesFanGetState; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetProperties = loader::zesFanGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetConfig = loader::zesFanGetConfig; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnSetDefaultMode = loader::zesFanSetDefaultMode; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnSetFixedSpeedMode = loader::zesFanSetFixedSpeedMode; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnSetSpeedTableMode = loader::zesFanSetSpeedTableMode; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetState = loader::zesFanGetState; + } } else { @@ -5363,10 +5497,18 @@ zesGetFirmwareProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGetProperties = loader::zesFirmwareGetProperties; - pDdiTable->pfnFlash = loader::zesFirmwareFlash; - pDdiTable->pfnGetFlashProgress = loader::zesFirmwareGetFlashProgress; - pDdiTable->pfnGetConsoleLogs = loader::zesFirmwareGetConsoleLogs; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetProperties = loader::zesFirmwareGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnFlash = loader::zesFirmwareFlash; + } + if (version >= ZE_API_VERSION_1_8) { + pDdiTable->pfnGetFlashProgress = loader::zesFirmwareGetFlashProgress; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnGetConsoleLogs = loader::zesFirmwareGetConsoleLogs; + } } else { @@ -5433,8 +5575,12 @@ zesGetFirmwareExpProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGetSecurityVersionExp = loader::zesFirmwareGetSecurityVersionExp; - pDdiTable->pfnSetSecurityVersionExp = loader::zesFirmwareSetSecurityVersionExp; + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnGetSecurityVersionExp = loader::zesFirmwareGetSecurityVersionExp; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnSetSecurityVersionExp = loader::zesFirmwareSetSecurityVersionExp; + } } else { @@ -5510,23 +5656,57 @@ zesGetFrequencyProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGetProperties = loader::zesFrequencyGetProperties; - pDdiTable->pfnGetAvailableClocks = loader::zesFrequencyGetAvailableClocks; - pDdiTable->pfnGetRange = loader::zesFrequencyGetRange; - pDdiTable->pfnSetRange = loader::zesFrequencySetRange; - pDdiTable->pfnGetState = loader::zesFrequencyGetState; - pDdiTable->pfnGetThrottleTime = loader::zesFrequencyGetThrottleTime; - pDdiTable->pfnOcGetCapabilities = loader::zesFrequencyOcGetCapabilities; - pDdiTable->pfnOcGetFrequencyTarget = loader::zesFrequencyOcGetFrequencyTarget; - pDdiTable->pfnOcSetFrequencyTarget = loader::zesFrequencyOcSetFrequencyTarget; - pDdiTable->pfnOcGetVoltageTarget = loader::zesFrequencyOcGetVoltageTarget; - pDdiTable->pfnOcSetVoltageTarget = loader::zesFrequencyOcSetVoltageTarget; - pDdiTable->pfnOcSetMode = loader::zesFrequencyOcSetMode; - pDdiTable->pfnOcGetMode = loader::zesFrequencyOcGetMode; - pDdiTable->pfnOcGetIccMax = loader::zesFrequencyOcGetIccMax; - pDdiTable->pfnOcSetIccMax = loader::zesFrequencyOcSetIccMax; - pDdiTable->pfnOcGetTjMax = loader::zesFrequencyOcGetTjMax; - pDdiTable->pfnOcSetTjMax = loader::zesFrequencyOcSetTjMax; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetProperties = loader::zesFrequencyGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetAvailableClocks = loader::zesFrequencyGetAvailableClocks; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetRange = loader::zesFrequencyGetRange; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnSetRange = loader::zesFrequencySetRange; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetState = loader::zesFrequencyGetState; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetThrottleTime = loader::zesFrequencyGetThrottleTime; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnOcGetCapabilities = loader::zesFrequencyOcGetCapabilities; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnOcGetFrequencyTarget = loader::zesFrequencyOcGetFrequencyTarget; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnOcSetFrequencyTarget = loader::zesFrequencyOcSetFrequencyTarget; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnOcGetVoltageTarget = loader::zesFrequencyOcGetVoltageTarget; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnOcSetVoltageTarget = loader::zesFrequencyOcSetVoltageTarget; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnOcSetMode = loader::zesFrequencyOcSetMode; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnOcGetMode = loader::zesFrequencyOcGetMode; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnOcGetIccMax = loader::zesFrequencyOcGetIccMax; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnOcSetIccMax = loader::zesFrequencyOcSetIccMax; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnOcGetTjMax = loader::zesFrequencyOcGetTjMax; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnOcSetTjMax = loader::zesFrequencyOcSetTjMax; + } } else { @@ -5602,10 +5782,18 @@ zesGetLedProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGetProperties = loader::zesLedGetProperties; - pDdiTable->pfnGetState = loader::zesLedGetState; - pDdiTable->pfnSetState = loader::zesLedSetState; - pDdiTable->pfnSetColor = loader::zesLedSetColor; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetProperties = loader::zesLedGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetState = loader::zesLedGetState; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnSetState = loader::zesLedSetState; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnSetColor = loader::zesLedSetColor; + } } else { @@ -5681,9 +5869,15 @@ zesGetMemoryProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGetProperties = loader::zesMemoryGetProperties; - pDdiTable->pfnGetState = loader::zesMemoryGetState; - pDdiTable->pfnGetBandwidth = loader::zesMemoryGetBandwidth; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetProperties = loader::zesMemoryGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetState = loader::zesMemoryGetState; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetBandwidth = loader::zesMemoryGetBandwidth; + } } else { @@ -5763,15 +5957,33 @@ zesGetOverclockProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGetDomainProperties = loader::zesOverclockGetDomainProperties; - pDdiTable->pfnGetDomainVFProperties = loader::zesOverclockGetDomainVFProperties; - pDdiTable->pfnGetDomainControlProperties = loader::zesOverclockGetDomainControlProperties; - pDdiTable->pfnGetControlCurrentValue = loader::zesOverclockGetControlCurrentValue; - pDdiTable->pfnGetControlPendingValue = loader::zesOverclockGetControlPendingValue; - pDdiTable->pfnSetControlUserValue = loader::zesOverclockSetControlUserValue; - pDdiTable->pfnGetControlState = loader::zesOverclockGetControlState; - pDdiTable->pfnGetVFPointValues = loader::zesOverclockGetVFPointValues; - pDdiTable->pfnSetVFPointValues = loader::zesOverclockSetVFPointValues; + if (version >= ZE_API_VERSION_1_5) { + pDdiTable->pfnGetDomainProperties = loader::zesOverclockGetDomainProperties; + } + if (version >= ZE_API_VERSION_1_5) { + pDdiTable->pfnGetDomainVFProperties = loader::zesOverclockGetDomainVFProperties; + } + if (version >= ZE_API_VERSION_1_5) { + pDdiTable->pfnGetDomainControlProperties = loader::zesOverclockGetDomainControlProperties; + } + if (version >= ZE_API_VERSION_1_5) { + pDdiTable->pfnGetControlCurrentValue = loader::zesOverclockGetControlCurrentValue; + } + if (version >= ZE_API_VERSION_1_5) { + pDdiTable->pfnGetControlPendingValue = loader::zesOverclockGetControlPendingValue; + } + if (version >= ZE_API_VERSION_1_5) { + pDdiTable->pfnSetControlUserValue = loader::zesOverclockSetControlUserValue; + } + if (version >= ZE_API_VERSION_1_5) { + pDdiTable->pfnGetControlState = loader::zesOverclockGetControlState; + } + if (version >= ZE_API_VERSION_1_5) { + pDdiTable->pfnGetVFPointValues = loader::zesOverclockGetVFPointValues; + } + if (version >= ZE_API_VERSION_1_5) { + pDdiTable->pfnSetVFPointValues = loader::zesOverclockSetVFPointValues; + } } else { @@ -5847,9 +6059,15 @@ zesGetPerformanceFactorProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGetProperties = loader::zesPerformanceFactorGetProperties; - pDdiTable->pfnGetConfig = loader::zesPerformanceFactorGetConfig; - pDdiTable->pfnSetConfig = loader::zesPerformanceFactorSetConfig; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetProperties = loader::zesPerformanceFactorGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetConfig = loader::zesPerformanceFactorGetConfig; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnSetConfig = loader::zesPerformanceFactorSetConfig; + } } else { @@ -5925,14 +6143,30 @@ zesGetPowerProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGetProperties = loader::zesPowerGetProperties; - pDdiTable->pfnGetEnergyCounter = loader::zesPowerGetEnergyCounter; - pDdiTable->pfnGetLimits = loader::zesPowerGetLimits; - pDdiTable->pfnSetLimits = loader::zesPowerSetLimits; - pDdiTable->pfnGetEnergyThreshold = loader::zesPowerGetEnergyThreshold; - pDdiTable->pfnSetEnergyThreshold = loader::zesPowerSetEnergyThreshold; - pDdiTable->pfnGetLimitsExt = loader::zesPowerGetLimitsExt; - pDdiTable->pfnSetLimitsExt = loader::zesPowerSetLimitsExt; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetProperties = loader::zesPowerGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetEnergyCounter = loader::zesPowerGetEnergyCounter; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetLimits = loader::zesPowerGetLimits; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnSetLimits = loader::zesPowerSetLimits; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetEnergyThreshold = loader::zesPowerGetEnergyThreshold; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnSetEnergyThreshold = loader::zesPowerSetEnergyThreshold; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetLimitsExt = loader::zesPowerGetLimitsExt; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnSetLimitsExt = loader::zesPowerSetLimitsExt; + } } else { @@ -6008,8 +6242,12 @@ zesGetPsuProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGetProperties = loader::zesPsuGetProperties; - pDdiTable->pfnGetState = loader::zesPsuGetState; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetProperties = loader::zesPsuGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetState = loader::zesPsuGetState; + } } else { @@ -6085,10 +6323,18 @@ zesGetRasProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGetProperties = loader::zesRasGetProperties; - pDdiTable->pfnGetConfig = loader::zesRasGetConfig; - pDdiTable->pfnSetConfig = loader::zesRasSetConfig; - pDdiTable->pfnGetState = loader::zesRasGetState; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetProperties = loader::zesRasGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetConfig = loader::zesRasGetConfig; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnSetConfig = loader::zesRasSetConfig; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetState = loader::zesRasGetState; + } } else { @@ -6155,8 +6401,12 @@ zesGetRasExpProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGetStateExp = loader::zesRasGetStateExp; - pDdiTable->pfnClearStateExp = loader::zesRasClearStateExp; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetStateExp = loader::zesRasGetStateExp; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnClearStateExp = loader::zesRasClearStateExp; + } } else { @@ -6232,14 +6482,30 @@ zesGetSchedulerProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGetProperties = loader::zesSchedulerGetProperties; - pDdiTable->pfnGetCurrentMode = loader::zesSchedulerGetCurrentMode; - pDdiTable->pfnGetTimeoutModeProperties = loader::zesSchedulerGetTimeoutModeProperties; - pDdiTable->pfnGetTimesliceModeProperties = loader::zesSchedulerGetTimesliceModeProperties; - pDdiTable->pfnSetTimeoutMode = loader::zesSchedulerSetTimeoutMode; - pDdiTable->pfnSetTimesliceMode = loader::zesSchedulerSetTimesliceMode; - pDdiTable->pfnSetExclusiveMode = loader::zesSchedulerSetExclusiveMode; - pDdiTable->pfnSetComputeUnitDebugMode = loader::zesSchedulerSetComputeUnitDebugMode; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetProperties = loader::zesSchedulerGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetCurrentMode = loader::zesSchedulerGetCurrentMode; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetTimeoutModeProperties = loader::zesSchedulerGetTimeoutModeProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetTimesliceModeProperties = loader::zesSchedulerGetTimesliceModeProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnSetTimeoutMode = loader::zesSchedulerSetTimeoutMode; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnSetTimesliceMode = loader::zesSchedulerSetTimesliceMode; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnSetExclusiveMode = loader::zesSchedulerSetExclusiveMode; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnSetComputeUnitDebugMode = loader::zesSchedulerSetComputeUnitDebugMode; + } } else { @@ -6315,9 +6581,15 @@ zesGetStandbyProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGetProperties = loader::zesStandbyGetProperties; - pDdiTable->pfnGetMode = loader::zesStandbyGetMode; - pDdiTable->pfnSetMode = loader::zesStandbySetMode; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetProperties = loader::zesStandbyGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetMode = loader::zesStandbyGetMode; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnSetMode = loader::zesStandbySetMode; + } } else { @@ -6393,10 +6665,18 @@ zesGetTemperatureProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGetProperties = loader::zesTemperatureGetProperties; - pDdiTable->pfnGetConfig = loader::zesTemperatureGetConfig; - pDdiTable->pfnSetConfig = loader::zesTemperatureSetConfig; - pDdiTable->pfnGetState = loader::zesTemperatureGetState; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetProperties = loader::zesTemperatureGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetConfig = loader::zesTemperatureGetConfig; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnSetConfig = loader::zesTemperatureSetConfig; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetState = loader::zesTemperatureGetState; + } } else { @@ -6463,15 +6743,33 @@ zesGetVFManagementExpProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGetVFCapabilitiesExp = loader::zesVFManagementGetVFCapabilitiesExp; - pDdiTable->pfnGetVFMemoryUtilizationExp2 = loader::zesVFManagementGetVFMemoryUtilizationExp2; - pDdiTable->pfnGetVFEngineUtilizationExp2 = loader::zesVFManagementGetVFEngineUtilizationExp2; - pDdiTable->pfnGetVFCapabilitiesExp2 = loader::zesVFManagementGetVFCapabilitiesExp2; - pDdiTable->pfnGetVFPropertiesExp = loader::zesVFManagementGetVFPropertiesExp; - pDdiTable->pfnGetVFMemoryUtilizationExp = loader::zesVFManagementGetVFMemoryUtilizationExp; - pDdiTable->pfnGetVFEngineUtilizationExp = loader::zesVFManagementGetVFEngineUtilizationExp; - pDdiTable->pfnSetVFTelemetryModeExp = loader::zesVFManagementSetVFTelemetryModeExp; - pDdiTable->pfnSetVFTelemetrySamplingIntervalExp = loader::zesVFManagementSetVFTelemetrySamplingIntervalExp; + if (version >= ZE_API_VERSION_1_10) { + pDdiTable->pfnGetVFCapabilitiesExp = loader::zesVFManagementGetVFCapabilitiesExp; + } + if (version >= ZE_API_VERSION_1_10) { + pDdiTable->pfnGetVFMemoryUtilizationExp2 = loader::zesVFManagementGetVFMemoryUtilizationExp2; + } + if (version >= ZE_API_VERSION_1_10) { + pDdiTable->pfnGetVFEngineUtilizationExp2 = loader::zesVFManagementGetVFEngineUtilizationExp2; + } + if (version >= ZE_API_VERSION_1_12) { + pDdiTable->pfnGetVFCapabilitiesExp2 = loader::zesVFManagementGetVFCapabilitiesExp2; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnGetVFPropertiesExp = loader::zesVFManagementGetVFPropertiesExp; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnGetVFMemoryUtilizationExp = loader::zesVFManagementGetVFMemoryUtilizationExp; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnGetVFEngineUtilizationExp = loader::zesVFManagementGetVFEngineUtilizationExp; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnSetVFTelemetryModeExp = loader::zesVFManagementSetVFTelemetryModeExp; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnSetVFTelemetrySamplingIntervalExp = loader::zesVFManagementSetVFTelemetrySamplingIntervalExp; + } } else { diff --git a/source/loader/zet_ldrddi.cpp b/source/loader/zet_ldrddi.cpp index 68c211ee..572ae41b 100644 --- a/source/loader/zet_ldrddi.cpp +++ b/source/loader/zet_ldrddi.cpp @@ -2343,9 +2343,15 @@ zetGetMetricDecoderExpProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnCreateExp = loader::zetMetricDecoderCreateExp; - pDdiTable->pfnDestroyExp = loader::zetMetricDecoderDestroyExp; - pDdiTable->pfnGetDecodableMetricsExp = loader::zetMetricDecoderGetDecodableMetricsExp; + if (version >= ZE_API_VERSION_1_10) { + pDdiTable->pfnCreateExp = loader::zetMetricDecoderCreateExp; + } + if (version >= ZE_API_VERSION_1_10) { + pDdiTable->pfnDestroyExp = loader::zetMetricDecoderDestroyExp; + } + if (version >= ZE_API_VERSION_1_10) { + pDdiTable->pfnGetDecodableMetricsExp = loader::zetMetricDecoderGetDecodableMetricsExp; + } } else { @@ -2412,10 +2418,18 @@ zetGetMetricProgrammableExpProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGetExp = loader::zetMetricProgrammableGetExp; - pDdiTable->pfnGetPropertiesExp = loader::zetMetricProgrammableGetPropertiesExp; - pDdiTable->pfnGetParamInfoExp = loader::zetMetricProgrammableGetParamInfoExp; - pDdiTable->pfnGetParamValueInfoExp = loader::zetMetricProgrammableGetParamValueInfoExp; + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnGetExp = loader::zetMetricProgrammableGetExp; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnGetPropertiesExp = loader::zetMetricProgrammableGetPropertiesExp; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnGetParamInfoExp = loader::zetMetricProgrammableGetParamInfoExp; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnGetParamValueInfoExp = loader::zetMetricProgrammableGetParamValueInfoExp; + } } else { @@ -2482,12 +2496,24 @@ zetGetMetricTracerExpProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnCreateExp = loader::zetMetricTracerCreateExp; - pDdiTable->pfnDestroyExp = loader::zetMetricTracerDestroyExp; - pDdiTable->pfnEnableExp = loader::zetMetricTracerEnableExp; - pDdiTable->pfnDisableExp = loader::zetMetricTracerDisableExp; - pDdiTable->pfnReadDataExp = loader::zetMetricTracerReadDataExp; - pDdiTable->pfnDecodeExp = loader::zetMetricTracerDecodeExp; + if (version >= ZE_API_VERSION_1_10) { + pDdiTable->pfnCreateExp = loader::zetMetricTracerCreateExp; + } + if (version >= ZE_API_VERSION_1_10) { + pDdiTable->pfnDestroyExp = loader::zetMetricTracerDestroyExp; + } + if (version >= ZE_API_VERSION_1_10) { + pDdiTable->pfnEnableExp = loader::zetMetricTracerEnableExp; + } + if (version >= ZE_API_VERSION_1_10) { + pDdiTable->pfnDisableExp = loader::zetMetricTracerDisableExp; + } + if (version >= ZE_API_VERSION_1_10) { + pDdiTable->pfnReadDataExp = loader::zetMetricTracerReadDataExp; + } + if (version >= ZE_API_VERSION_1_10) { + pDdiTable->pfnDecodeExp = loader::zetMetricTracerDecodeExp; + } } else { @@ -2563,7 +2589,9 @@ zetGetDeviceProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGetDebugProperties = loader::zetDeviceGetDebugProperties; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetDebugProperties = loader::zetDeviceGetDebugProperties; + } } else { @@ -2630,8 +2658,12 @@ zetGetDeviceExpProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGetConcurrentMetricGroupsExp = loader::zetDeviceGetConcurrentMetricGroupsExp; - pDdiTable->pfnCreateMetricGroupsFromMetricsExp = loader::zetDeviceCreateMetricGroupsFromMetricsExp; + if (version >= ZE_API_VERSION_1_10) { + pDdiTable->pfnGetConcurrentMetricGroupsExp = loader::zetDeviceGetConcurrentMetricGroupsExp; + } + if (version >= ZE_API_VERSION_1_10) { + pDdiTable->pfnCreateMetricGroupsFromMetricsExp = loader::zetDeviceCreateMetricGroupsFromMetricsExp; + } } else { @@ -2707,7 +2739,9 @@ zetGetContextProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnActivateMetricGroups = loader::zetContextActivateMetricGroups; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnActivateMetricGroups = loader::zetContextActivateMetricGroups; + } } else { @@ -2783,10 +2817,18 @@ zetGetCommandListProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnAppendMetricStreamerMarker = loader::zetCommandListAppendMetricStreamerMarker; - pDdiTable->pfnAppendMetricQueryBegin = loader::zetCommandListAppendMetricQueryBegin; - pDdiTable->pfnAppendMetricQueryEnd = loader::zetCommandListAppendMetricQueryEnd; - pDdiTable->pfnAppendMetricMemoryBarrier = loader::zetCommandListAppendMetricMemoryBarrier; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnAppendMetricStreamerMarker = loader::zetCommandListAppendMetricStreamerMarker; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnAppendMetricQueryBegin = loader::zetCommandListAppendMetricQueryBegin; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnAppendMetricQueryEnd = loader::zetCommandListAppendMetricQueryEnd; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnAppendMetricMemoryBarrier = loader::zetCommandListAppendMetricMemoryBarrier; + } } else { @@ -2862,7 +2904,9 @@ zetGetKernelProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGetProfileInfo = loader::zetKernelGetProfileInfo; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetProfileInfo = loader::zetKernelGetProfileInfo; + } } else { @@ -2938,7 +2982,9 @@ zetGetModuleProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGetDebugInfo = loader::zetModuleGetDebugInfo; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetDebugInfo = loader::zetModuleGetDebugInfo; + } } else { @@ -3014,18 +3060,42 @@ zetGetDebugProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnAttach = loader::zetDebugAttach; - pDdiTable->pfnDetach = loader::zetDebugDetach; - pDdiTable->pfnReadEvent = loader::zetDebugReadEvent; - pDdiTable->pfnAcknowledgeEvent = loader::zetDebugAcknowledgeEvent; - pDdiTable->pfnInterrupt = loader::zetDebugInterrupt; - pDdiTable->pfnResume = loader::zetDebugResume; - pDdiTable->pfnReadMemory = loader::zetDebugReadMemory; - pDdiTable->pfnWriteMemory = loader::zetDebugWriteMemory; - pDdiTable->pfnGetRegisterSetProperties = loader::zetDebugGetRegisterSetProperties; - pDdiTable->pfnReadRegisters = loader::zetDebugReadRegisters; - pDdiTable->pfnWriteRegisters = loader::zetDebugWriteRegisters; - pDdiTable->pfnGetThreadRegisterSetProperties = loader::zetDebugGetThreadRegisterSetProperties; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnAttach = loader::zetDebugAttach; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnDetach = loader::zetDebugDetach; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnReadEvent = loader::zetDebugReadEvent; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnAcknowledgeEvent = loader::zetDebugAcknowledgeEvent; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnInterrupt = loader::zetDebugInterrupt; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnResume = loader::zetDebugResume; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnReadMemory = loader::zetDebugReadMemory; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnWriteMemory = loader::zetDebugWriteMemory; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetRegisterSetProperties = loader::zetDebugGetRegisterSetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnReadRegisters = loader::zetDebugReadRegisters; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnWriteRegisters = loader::zetDebugWriteRegisters; + } + if (version >= ZE_API_VERSION_1_5) { + pDdiTable->pfnGetThreadRegisterSetProperties = loader::zetDebugGetThreadRegisterSetProperties; + } } else { @@ -3101,8 +3171,12 @@ zetGetMetricProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGet = loader::zetMetricGet; - pDdiTable->pfnGetProperties = loader::zetMetricGetProperties; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGet = loader::zetMetricGet; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetProperties = loader::zetMetricGetProperties; + } } else { @@ -3169,9 +3243,15 @@ zetGetMetricExpProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnCreateFromProgrammableExp2 = loader::zetMetricCreateFromProgrammableExp2; - pDdiTable->pfnCreateFromProgrammableExp = loader::zetMetricCreateFromProgrammableExp; - pDdiTable->pfnDestroyExp = loader::zetMetricDestroyExp; + if (version >= ZE_API_VERSION_1_11) { + pDdiTable->pfnCreateFromProgrammableExp2 = loader::zetMetricCreateFromProgrammableExp2; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnCreateFromProgrammableExp = loader::zetMetricCreateFromProgrammableExp; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnDestroyExp = loader::zetMetricDestroyExp; + } } else { @@ -3247,9 +3327,15 @@ zetGetMetricGroupProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGet = loader::zetMetricGroupGet; - pDdiTable->pfnGetProperties = loader::zetMetricGroupGetProperties; - pDdiTable->pfnCalculateMetricValues = loader::zetMetricGroupCalculateMetricValues; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGet = loader::zetMetricGroupGet; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetProperties = loader::zetMetricGroupGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnCalculateMetricValues = loader::zetMetricGroupCalculateMetricValues; + } } else { @@ -3316,15 +3402,33 @@ zetGetMetricGroupExpProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnCalculateMultipleMetricValuesExp = loader::zetMetricGroupCalculateMultipleMetricValuesExp; - pDdiTable->pfnGetGlobalTimestampsExp = loader::zetMetricGroupGetGlobalTimestampsExp; - pDdiTable->pfnGetExportDataExp = loader::zetMetricGroupGetExportDataExp; - pDdiTable->pfnCalculateMetricExportDataExp = loader::zetMetricGroupCalculateMetricExportDataExp; - pDdiTable->pfnCreateExp = loader::zetMetricGroupCreateExp; - pDdiTable->pfnAddMetricExp = loader::zetMetricGroupAddMetricExp; - pDdiTable->pfnRemoveMetricExp = loader::zetMetricGroupRemoveMetricExp; - pDdiTable->pfnCloseExp = loader::zetMetricGroupCloseExp; - pDdiTable->pfnDestroyExp = loader::zetMetricGroupDestroyExp; + if (version >= ZE_API_VERSION_1_2) { + pDdiTable->pfnCalculateMultipleMetricValuesExp = loader::zetMetricGroupCalculateMultipleMetricValuesExp; + } + if (version >= ZE_API_VERSION_1_5) { + pDdiTable->pfnGetGlobalTimestampsExp = loader::zetMetricGroupGetGlobalTimestampsExp; + } + if (version >= ZE_API_VERSION_1_6) { + pDdiTable->pfnGetExportDataExp = loader::zetMetricGroupGetExportDataExp; + } + if (version >= ZE_API_VERSION_1_6) { + pDdiTable->pfnCalculateMetricExportDataExp = loader::zetMetricGroupCalculateMetricExportDataExp; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnCreateExp = loader::zetMetricGroupCreateExp; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnAddMetricExp = loader::zetMetricGroupAddMetricExp; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnRemoveMetricExp = loader::zetMetricGroupRemoveMetricExp; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnCloseExp = loader::zetMetricGroupCloseExp; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnDestroyExp = loader::zetMetricGroupDestroyExp; + } } else { @@ -3400,10 +3504,18 @@ zetGetMetricQueryProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnCreate = loader::zetMetricQueryCreate; - pDdiTable->pfnDestroy = loader::zetMetricQueryDestroy; - pDdiTable->pfnReset = loader::zetMetricQueryReset; - pDdiTable->pfnGetData = loader::zetMetricQueryGetData; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnCreate = loader::zetMetricQueryCreate; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnDestroy = loader::zetMetricQueryDestroy; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnReset = loader::zetMetricQueryReset; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetData = loader::zetMetricQueryGetData; + } } else { @@ -3479,8 +3591,12 @@ zetGetMetricQueryPoolProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnCreate = loader::zetMetricQueryPoolCreate; - pDdiTable->pfnDestroy = loader::zetMetricQueryPoolDestroy; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnCreate = loader::zetMetricQueryPoolCreate; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnDestroy = loader::zetMetricQueryPoolDestroy; + } } else { @@ -3556,9 +3672,15 @@ zetGetMetricStreamerProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnOpen = loader::zetMetricStreamerOpen; - pDdiTable->pfnClose = loader::zetMetricStreamerClose; - pDdiTable->pfnReadData = loader::zetMetricStreamerReadData; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnOpen = loader::zetMetricStreamerOpen; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnClose = loader::zetMetricStreamerClose; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnReadData = loader::zetMetricStreamerReadData; + } } else { @@ -3634,11 +3756,21 @@ zetGetTracerExpProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnCreate = loader::zetTracerExpCreate; - pDdiTable->pfnDestroy = loader::zetTracerExpDestroy; - pDdiTable->pfnSetPrologues = loader::zetTracerExpSetPrologues; - pDdiTable->pfnSetEpilogues = loader::zetTracerExpSetEpilogues; - pDdiTable->pfnSetEnabled = loader::zetTracerExpSetEnabled; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnCreate = loader::zetTracerExpCreate; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnDestroy = loader::zetTracerExpDestroy; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnSetPrologues = loader::zetTracerExpSetPrologues; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnSetEpilogues = loader::zetTracerExpSetEpilogues; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnSetEnabled = loader::zetTracerExpSetEnabled; + } } else { From 37f2501d0f01b3a51b4c357e355a8d768c88cd47 Mon Sep 17 00:00:00 2001 From: "Neil R. Spruit" Date: Fri, 25 Apr 2025 15:45:30 -0700 Subject: [PATCH 08/28] Update Level Zero Loader and Headers to support v1.13.1 of L0 Spec (#325) (#329) * Update Level Zero Loader and Headers to support v1.13.1 of L0 Spec * Update Product GUID * Add new ext ZE_STRUCTURE_TYPE_DEVICE_CACHELINE_SIZE_EXT to extension validation Signed-off-by: Neil R. Spruit --- CHANGELOG.md | 6 + CMakeLists.txt | 2 +- PRODUCT_GUID.txt | 4 +- include/layers/zel_tracing_register_cb.h | 388 ++++ include/ze.py | 815 +++++++- include/ze_api.h | 1808 ++++++++++++++--- include/ze_ddi.h | 164 +- include/ze_ddi_common.h | 2 +- include/zes.py | 29 +- include/zes_api.h | 160 +- include/zes_ddi.h | 2 +- include/zet.py | 90 +- include/zet_api.h | 208 +- include/zet_ddi.h | 55 +- source/drivers/null/ze_nullddi.cpp | 382 +++- source/drivers/null/zet_nullddi.cpp | 112 +- source/layers/tracing/ze_tracing_cb_structs.h | 11 + .../layers/tracing/ze_tracing_register_cb.cpp | 176 ++ source/layers/tracing/ze_trcddi.cpp | 551 ++++- .../extension_validation.inl | 2 +- .../ze_parameter_validation.cpp | 262 ++- .../ze_parameter_validation.h | 11 + .../zet_parameter_validation.cpp | 51 +- .../zet_parameter_validation.h | 3 + .../validation/common/ze_entry_points.h | 22 + .../validation/common/zet_entry_points.h | 6 + .../ze_handle_lifetime.cpp | 186 +- .../ze_handle_lifetime.h | 11 + .../zet_handle_lifetime.cpp | 51 +- .../zet_handle_lifetime.h | 3 + source/layers/validation/ze_valddi.cpp | 618 +++++- source/layers/validation/zet_valddi.cpp | 174 +- source/lib/ze_libapi.cpp | 1088 ++++++++-- source/lib/ze_libddi.cpp | 50 + source/lib/ze_tracing_register_cb_libapi.cpp | 275 +++ source/lib/zet_libapi.cpp | 188 +- source/lib/zet_libddi.cpp | 20 + source/loader/ze_ldrddi.cpp | 582 +++++- source/loader/ze_ldrddi.h | 6 + source/loader/ze_loader_internal.h | 2 + source/loader/zet_ldrddi.cpp | 162 +- 41 files changed, 8096 insertions(+), 642 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aab11a01..cf6f3697 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Level zero loader changelog +## v1.22.1 +* fix ddi compatibility to avoid assigning values which don't exist +* Fix static loader to request current version as the latest APIs +* Update to support v1.13.1 of the Level Zero Spec +* Add testing stdout from zeInitDrivers in CI +* Only Enable Teardown thread on windows and remove debug on success ## v1.21.9 * Fix init checks when sorting legacy drivers * Fix MSVC Link optimization flags diff --git a/CMakeLists.txt b/CMakeLists.txt index b2114c34..d3d8b34c 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.21.9) +project(level-zero VERSION 1.22.1) include(GNUInstallDirs) diff --git a/PRODUCT_GUID.txt b/PRODUCT_GUID.txt index 85c64204..a0ef1a6a 100644 --- a/PRODUCT_GUID.txt +++ b/PRODUCT_GUID.txt @@ -1,2 +1,2 @@ -1.21.9 -01037281-c9ef-43cf-bc65-f72fb3438788 \ No newline at end of file +1.22.1 +7c020ce6-fe70-4b38-8227-997082444587 \ 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 a04d08ed..18b795d9 100644 --- a/include/layers/zel_tracing_register_cb.h +++ b/include/layers/zel_tracing_register_cb.h @@ -54,6 +54,150 @@ typedef void (ZE_APICALL *ze_pfnInitDriversCb_t)( void** ppTracerInstanceUserData ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeRTASBuilderCreateExt +/// @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_rtas_builder_create_ext_params_t +{ + ze_driver_handle_t* phDriver; + const ze_rtas_builder_ext_desc_t** ppDescriptor; + ze_rtas_builder_ext_handle_t** pphBuilder; +} ze_rtas_builder_create_ext_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeRTASBuilderCreateExt +/// @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_pfnRTASBuilderCreateExtCb_t)( + ze_rtas_builder_create_ext_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeRTASBuilderGetBuildPropertiesExt +/// @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_rtas_builder_get_build_properties_ext_params_t +{ + ze_rtas_builder_ext_handle_t* phBuilder; + const ze_rtas_builder_build_op_ext_desc_t** ppBuildOpDescriptor; + ze_rtas_builder_ext_properties_t** ppProperties; +} ze_rtas_builder_get_build_properties_ext_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeRTASBuilderGetBuildPropertiesExt +/// @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_pfnRTASBuilderGetBuildPropertiesExtCb_t)( + ze_rtas_builder_get_build_properties_ext_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeRTASBuilderBuildExt +/// @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_rtas_builder_build_ext_params_t +{ + ze_rtas_builder_ext_handle_t* phBuilder; + const ze_rtas_builder_build_op_ext_desc_t** ppBuildOpDescriptor; + void** ppScratchBuffer; + size_t* pscratchBufferSizeBytes; + void** ppRtasBuffer; + size_t* prtasBufferSizeBytes; + ze_rtas_parallel_operation_ext_handle_t* phParallelOperation; + void** ppBuildUserPtr; + ze_rtas_aabb_ext_t** ppBounds; + size_t** ppRtasBufferSizeBytes; +} ze_rtas_builder_build_ext_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeRTASBuilderBuildExt +/// @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_pfnRTASBuilderBuildExtCb_t)( + ze_rtas_builder_build_ext_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeRTASBuilderCommandListAppendCopyExt +/// @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_rtas_builder_command_list_append_copy_ext_params_t +{ + ze_command_list_handle_t* phCommandList; + void** pdstptr; + const void** psrcptr; + size_t* psize; + ze_event_handle_t* phSignalEvent; + uint32_t* pnumWaitEvents; + ze_event_handle_t** pphWaitEvents; +} ze_rtas_builder_command_list_append_copy_ext_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeRTASBuilderCommandListAppendCopyExt +/// @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_pfnRTASBuilderCommandListAppendCopyExtCb_t)( + ze_rtas_builder_command_list_append_copy_ext_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeRTASBuilderDestroyExt +/// @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_rtas_builder_destroy_ext_params_t +{ + ze_rtas_builder_ext_handle_t* phBuilder; +} ze_rtas_builder_destroy_ext_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeRTASBuilderDestroyExt +/// @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_pfnRTASBuilderDestroyExtCb_t)( + ze_rtas_builder_destroy_ext_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Callback function parameters for zeRTASBuilderCreateExp /// @details Each entry is a pointer to the parameter passed to the function; @@ -167,6 +311,108 @@ typedef void (ZE_APICALL *ze_pfnRTASBuilderDestroyExpCb_t)( void** ppTracerInstanceUserData ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeRTASParallelOperationCreateExt +/// @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_rtas_parallel_operation_create_ext_params_t +{ + ze_driver_handle_t* phDriver; + ze_rtas_parallel_operation_ext_handle_t** pphParallelOperation; +} ze_rtas_parallel_operation_create_ext_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeRTASParallelOperationCreateExt +/// @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_pfnRTASParallelOperationCreateExtCb_t)( + ze_rtas_parallel_operation_create_ext_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeRTASParallelOperationGetPropertiesExt +/// @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_rtas_parallel_operation_get_properties_ext_params_t +{ + ze_rtas_parallel_operation_ext_handle_t* phParallelOperation; + ze_rtas_parallel_operation_ext_properties_t** ppProperties; +} ze_rtas_parallel_operation_get_properties_ext_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeRTASParallelOperationGetPropertiesExt +/// @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_pfnRTASParallelOperationGetPropertiesExtCb_t)( + ze_rtas_parallel_operation_get_properties_ext_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeRTASParallelOperationJoinExt +/// @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_rtas_parallel_operation_join_ext_params_t +{ + ze_rtas_parallel_operation_ext_handle_t* phParallelOperation; +} ze_rtas_parallel_operation_join_ext_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeRTASParallelOperationJoinExt +/// @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_pfnRTASParallelOperationJoinExtCb_t)( + ze_rtas_parallel_operation_join_ext_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeRTASParallelOperationDestroyExt +/// @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_rtas_parallel_operation_destroy_ext_params_t +{ + ze_rtas_parallel_operation_ext_handle_t* phParallelOperation; +} ze_rtas_parallel_operation_destroy_ext_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeRTASParallelOperationDestroyExt +/// @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_pfnRTASParallelOperationDestroyExtCb_t)( + ze_rtas_parallel_operation_destroy_ext_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Callback function parameters for zeRTASParallelOperationCreateExp /// @details Each entry is a pointer to the parameter passed to the function; @@ -296,6 +542,33 @@ typedef void (ZE_APICALL *ze_pfnDriverGetExtensionFunctionAddressCb_t)( void** ppTracerInstanceUserData ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeDriverRTASFormatCompatibilityCheckExt +/// @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_driver_rtas_format_compatibility_check_ext_params_t +{ + ze_driver_handle_t* phDriver; + ze_rtas_format_ext_t* prtasFormatA; + ze_rtas_format_ext_t* prtasFormatB; +} ze_driver_rtas_format_compatibility_check_ext_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeDriverRTASFormatCompatibilityCheckExt +/// @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_pfnDriverRTASFormatCompatibilityCheckExtCb_t)( + ze_driver_rtas_format_compatibility_check_ext_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Callback function parameters for zeDriverGetLastErrorDescription /// @details Each entry is a pointer to the parameter passed to the function; @@ -428,6 +701,33 @@ typedef void (ZE_APICALL *ze_pfnDeviceReleaseExternalSemaphoreExtCb_t)( void** ppTracerInstanceUserData ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeDeviceGetVectorWidthPropertiesExt +/// @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_vector_width_properties_ext_params_t +{ + ze_device_handle_t* phDevice; + uint32_t** ppCount; + ze_device_vector_width_properties_ext_t** ppVectorWidthProperties; +} ze_device_get_vector_width_properties_ext_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeDeviceGetVectorWidthPropertiesExt +/// @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_pfnDeviceGetVectorWidthPropertiesExtCb_t)( + ze_device_get_vector_width_properties_ext_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; @@ -3204,6 +3504,94 @@ zelTracerCommandListAppendWaitExternalSemaphoreExtRegisterCallback( ); +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerRTASBuilderCreateExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnRTASBuilderCreateExtCb_t pfnCreateExtCb + ); + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerRTASBuilderGetBuildPropertiesExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnRTASBuilderGetBuildPropertiesExtCb_t pfnGetBuildPropertiesExtCb + ); + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerDriverRTASFormatCompatibilityCheckExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnDriverRTASFormatCompatibilityCheckExtCb_t pfnRTASFormatCompatibilityCheckExtCb + ); + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerRTASBuilderBuildExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnRTASBuilderBuildExtCb_t pfnBuildExtCb + ); + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerRTASBuilderCommandListAppendCopyExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnRTASBuilderCommandListAppendCopyExtCb_t pfnCommandListAppendCopyExtCb + ); + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerRTASBuilderDestroyExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnRTASBuilderDestroyExtCb_t pfnDestroyExtCb + ); + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerRTASParallelOperationCreateExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnRTASParallelOperationCreateExtCb_t pfnCreateExtCb + ); + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerRTASParallelOperationGetPropertiesExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnRTASParallelOperationGetPropertiesExtCb_t pfnGetPropertiesExtCb + ); + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerRTASParallelOperationJoinExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnRTASParallelOperationJoinExtCb_t pfnJoinExtCb + ); + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerRTASParallelOperationDestroyExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnRTASParallelOperationDestroyExtCb_t pfnDestroyExtCb + ); + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerDeviceGetVectorWidthPropertiesExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnDeviceGetVectorWidthPropertiesExtCb_t pfnGetVectorWidthPropertiesExtCb + ); + + ZE_APIEXPORT ze_result_t ZE_APICALL zelTracerDeviceReserveCacheExtRegisterCallback( zel_tracer_handle_t hTracer, diff --git a/include/ze.py b/include/ze.py index 1fa698fc..28ff35c5 100644 --- a/include/ze.py +++ b/include/ze.py @@ -4,7 +4,7 @@ SPDX-License-Identifier: MIT @file ze.py - @version v1.12-r1.12.15 + @version v1.13-r1.13.1 """ import platform @@ -219,6 +219,13 @@ class ze_result_v(IntEnum): ## memory WARNING_ACTION_REQUIRED = 0x7800001b ## [Sysman] an action is required to complete the desired operation ERROR_INVALID_KERNEL_HANDLE = 0x7800001c ## [Core, Validation] kernel handle is invalid for the operation + EXT_RTAS_BUILD_RETRY = 0x7800001d ## [Core, Extension] ray tracing acceleration structure build operation + ## failed due to insufficient resources, retry with a larger acceleration + ## structure buffer allocation + EXT_RTAS_BUILD_DEFERRED = 0x7800001e ## [Core, Extension] ray tracing acceleration structure build operation + ## deferred to parallel operation join + 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_UNKNOWN = 0x7ffffffe ## [Core] unknown or internal error class ze_result_t(c_int): @@ -322,6 +329,14 @@ class ze_structure_type_v(IntEnum): EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_EXT = 0x00020025 ## ::ze_external_semaphore_signal_params_ext_t EXTERNAL_SEMAPHORE_WAIT_PARAMS_EXT = 0x00020026 ## ::ze_external_semaphore_wait_params_ext_t DRIVER_DDI_HANDLES_EXT_PROPERTIES = 0x00020027 ## ::ze_driver_ddi_handles_ext_properties_t + DEVICE_CACHELINE_SIZE_EXT = 0x00020028 ## ::ze_device_cache_line_size_ext_t + DEVICE_VECTOR_WIDTH_PROPERTIES_EXT = 0x00020029 ## ::ze_device_vector_width_properties_ext_t + RTAS_BUILDER_EXT_DESC = 0x00020030 ## ::ze_rtas_builder_ext_desc_t + RTAS_BUILDER_BUILD_OP_EXT_DESC = 0x00020031 ## ::ze_rtas_builder_build_op_ext_desc_t + RTAS_BUILDER_EXT_PROPERTIES = 0x00020032 ## ::ze_rtas_builder_ext_properties_t + RTAS_PARALLEL_OPERATION_EXT_PROPERTIES = 0x00020033 ## ::ze_rtas_parallel_operation_ext_properties_t + RTAS_DEVICE_EXT_PROPERTIES = 0x00020034 ## ::ze_rtas_device_ext_properties_t + RTAS_GEOMETRY_AABBS_EXT_CB_PARAMS = 0x00020035 ## ::ze_rtas_geometry_aabbs_ext_cb_params_t class ze_structure_type_t(c_int): def __str__(self): @@ -492,7 +507,8 @@ class ze_api_version_v(IntEnum): _1_10 = ZE_MAKE_VERSION( 1, 10 ) ## version 1.10 _1_11 = ZE_MAKE_VERSION( 1, 11 ) ## version 1.11 _1_12 = ZE_MAKE_VERSION( 1, 12 ) ## version 1.12 - CURRENT = ZE_MAKE_VERSION( 1, 12 ) ## latest known version + _1_13 = ZE_MAKE_VERSION( 1, 13 ) ## version 1.13 + CURRENT = ZE_MAKE_VERSION( 1, 13 ) ## latest known version class ze_api_version_t(c_int): def __str__(self): @@ -501,7 +517,7 @@ def __str__(self): ############################################################################### ## @brief Current API version as a macro -ZE_API_VERSION_CURRENT_M = ZE_MAKE_VERSION( 1, 12 ) +ZE_API_VERSION_CURRENT_M = ZE_MAKE_VERSION( 1, 13 ) ############################################################################### ## @brief Maximum driver universal unique id (UUID) size in bytes @@ -961,6 +977,8 @@ class ze_command_queue_flags_v(IntEnum): ## work across multiple engines. ## this flag should be used when applications want full control over ## multi-engine submission and scheduling. + ## This flag is **DEPRECATED** as flag + ## ${X}_COMMAND_LIST_FLAG_EXPLICIT_ONLY is **DEPRECATED**. IN_ORDER = ZE_BIT(1) ## To be used only when creating immediate command lists. Commands ## appended to the immediate command ## list are executed in-order, with driver implementation enforcing @@ -1011,7 +1029,7 @@ class ze_command_queue_desc_t(Structure): ## structure (i.e. contains stype and pNext). ("ordinal", c_ulong), ## [in] command queue group ordinal ("index", c_ulong), ## [in] command queue index within the group; - ## must be zero if ::ZE_COMMAND_QUEUE_FLAG_EXPLICIT_ONLY is not set + ## must be zero. ("flags", ze_command_queue_flags_t), ## [in] usage flags. ## must be 0 (default) or a valid combination of ::ze_command_queue_flag_t; ## default behavior may use implicit driver-based heuristics to balance @@ -1037,6 +1055,8 @@ class ze_command_list_flags_v(IntEnum): ## work across multiple engines. ## this flag should be used when applications want full control over ## multi-engine submission and scheduling. + ## This flag is **DEPRECATED** and implementations are not expected to + ## support this feature. IN_ORDER = ZE_BIT(3) ## commands appended to this command list are executed in-order, with ## driver implementation ## enforcing dependencies between them. Application is not required to @@ -2270,6 +2290,641 @@ class ze_external_semaphore_wait_params_ext_t(Structure): ## such as ::ZE_EXTERNAL_SEMAPHORE_EXT_FLAG_D3D12_FENCE. ] +############################################################################### +## @brief CacheLine Size Extension Name +ZE_CACHELINE_SIZE_EXT_NAME = "ZE_extension_device_cache_line_size" + +############################################################################### +## @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_device_cache_line_size_ext_version_t(c_int): + def __str__(self): + return str(ze_device_cache_line_size_ext_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): + _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. + ] + +############################################################################### +## @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_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_ext_version_t(c_int): + def __str__(self): + return str(ze_rtas_builder_ext_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 + +class ze_rtas_device_ext_flags_t(c_int): + def __str__(self): + return hex(self.value) + + +############################################################################### +## @brief Ray tracing acceleration structure format +## +## @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)) + + +############################################################################### +## @brief Ray tracing acceleration structure builder flags +class ze_rtas_builder_ext_flags_v(IntEnum): + RESERVED = ZE_BIT(0) ## Reserved for future use + +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_ext_flags_v(IntEnum): + RESERVED = ZE_BIT(0) ## Reserved for future use + +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_ext_flags_v(IntEnum): + NON_OPAQUE = ZE_BIT(0) ## non-opaque geometries invoke an any-hit shader + +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_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_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 + +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_ext_flags_t) +class ze_rtas_builder_packed_instance_ext_flags_t(c_ubyte): + pass + +############################################################################### +## @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 + +class ze_rtas_builder_build_op_ext_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_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)) + + +############################################################################### +## @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 + +class ze_rtas_builder_geometry_type_ext_t(c_int): + def __str__(self): + 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_ext_t) +class ze_rtas_builder_packed_geometry_type_ext_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_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 + +############################################################################### +## @brief Ray tracing acceleration structure builder descriptor +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_ext_version_t) ## [in] ray tracing acceleration structure builder version + ] + +############################################################################### +## @brief Ray tracing acceleration structure builder properties +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_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. + ] + +############################################################################### +## @brief Ray tracing acceleration structure builder parallel operation +## properties +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_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 + ] + +############################################################################### +## @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): + _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 + ] + +############################################################################### +## @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 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 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 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_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 + ("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_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 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_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 + ## 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_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 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 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 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_ext_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 + ] + +############################################################################### +## @brief AABB callback function parameters +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 + ## 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 + ] + +############################################################################### +## @brief Callback function pointer type to return AABBs for a range of +## procedural primitives + +############################################################################### +## @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 Ray tracing acceleration structure builder instance geometry info +class ze_rtas_builder_instance_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_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 + ] + +############################################################################### +## @brief +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_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 + ] + +############################################################################### +## @brief Device Vector Sizes Query Extension Name +ZE_DEVICE_VECTOR_SIZES_EXT_NAME = "ZE_extension_device_vector_sizes" + +############################################################################### +## @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_device_vector_sizes_ext_version_t(c_int): + def __str__(self): + return str(ze_device_vector_sizes_ext_version_v(self.value)) + + +############################################################################### +## @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,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. + ] + ############################################################################### ## @brief Cache_Reservation Extension Name ZE_CACHE_RESERVATION_EXT_NAME = "ZE_extension_cache_reservation" @@ -2438,7 +3093,8 @@ class ze_image_view_planar_exp_desc_t(Structure): ("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). - ("planeIndex", c_ulong) ## [in] the 0-based plane index (e.g. NV12 is 0 = Y plane, 1 UV plane) + ("planeIndex", c_ulong) ## [DEPRECATED] no longer supported, use + ## ::ze_image_view_planar_ext_desc_t instead ] ############################################################################### @@ -2828,8 +3484,15 @@ def __str__(self): ############################################################################### ## @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 freeing - DEFER_FREE = ZE_BIT(1) ## schedules the memory to be freed but does not free immediately + 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): @@ -3341,6 +4004,7 @@ def __str__(self): ## identifier. class ze_rtas_format_exp_v(IntEnum): INVALID = 0 ## Invalid acceleration structure format + MAX = 0x7ffffffe ## Maximum acceleration structure format code class ze_rtas_format_exp_t(c_int): def __str__(self): @@ -4172,6 +4836,53 @@ class ze_mutable_graph_argument_exp_desc_t(Structure): ############################################################################### __use_win_types = "Windows" == platform.uname()[0] +############################################################################### +## @brief Function-pointer for zeRTASBuilderCreateExt +if __use_win_types: + _zeRTASBuilderCreateExt_t = WINFUNCTYPE( ze_result_t, ze_driver_handle_t, POINTER(ze_rtas_builder_ext_desc_t), POINTER(ze_rtas_builder_ext_handle_t) ) +else: + _zeRTASBuilderCreateExt_t = CFUNCTYPE( ze_result_t, ze_driver_handle_t, POINTER(ze_rtas_builder_ext_desc_t), POINTER(ze_rtas_builder_ext_handle_t) ) + +############################################################################### +## @brief Function-pointer for zeRTASBuilderGetBuildPropertiesExt +if __use_win_types: + _zeRTASBuilderGetBuildPropertiesExt_t = WINFUNCTYPE( ze_result_t, ze_rtas_builder_ext_handle_t, POINTER(ze_rtas_builder_build_op_ext_desc_t), POINTER(ze_rtas_builder_ext_properties_t) ) +else: + _zeRTASBuilderGetBuildPropertiesExt_t = CFUNCTYPE( ze_result_t, ze_rtas_builder_ext_handle_t, POINTER(ze_rtas_builder_build_op_ext_desc_t), POINTER(ze_rtas_builder_ext_properties_t) ) + +############################################################################### +## @brief Function-pointer for zeRTASBuilderBuildExt +if __use_win_types: + _zeRTASBuilderBuildExt_t = WINFUNCTYPE( ze_result_t, ze_rtas_builder_ext_handle_t, POINTER(ze_rtas_builder_build_op_ext_desc_t), c_void_p, c_size_t, c_void_p, c_size_t, ze_rtas_parallel_operation_ext_handle_t, c_void_p, POINTER(ze_rtas_aabb_ext_t), POINTER(c_size_t) ) +else: + _zeRTASBuilderBuildExt_t = CFUNCTYPE( ze_result_t, ze_rtas_builder_ext_handle_t, POINTER(ze_rtas_builder_build_op_ext_desc_t), c_void_p, c_size_t, c_void_p, c_size_t, ze_rtas_parallel_operation_ext_handle_t, c_void_p, POINTER(ze_rtas_aabb_ext_t), POINTER(c_size_t) ) + +############################################################################### +## @brief Function-pointer for zeRTASBuilderCommandListAppendCopyExt +if __use_win_types: + _zeRTASBuilderCommandListAppendCopyExt_t = WINFUNCTYPE( ze_result_t, ze_command_list_handle_t, c_void_p, c_void_p, c_size_t, ze_event_handle_t, c_ulong, POINTER(ze_event_handle_t) ) +else: + _zeRTASBuilderCommandListAppendCopyExt_t = CFUNCTYPE( ze_result_t, ze_command_list_handle_t, c_void_p, c_void_p, c_size_t, ze_event_handle_t, c_ulong, POINTER(ze_event_handle_t) ) + +############################################################################### +## @brief Function-pointer for zeRTASBuilderDestroyExt +if __use_win_types: + _zeRTASBuilderDestroyExt_t = WINFUNCTYPE( ze_result_t, ze_rtas_builder_ext_handle_t ) +else: + _zeRTASBuilderDestroyExt_t = CFUNCTYPE( ze_result_t, ze_rtas_builder_ext_handle_t ) + + +############################################################################### +## @brief Table of RTASBuilder functions pointers +class _ze_rtas_builder_dditable_t(Structure): + _fields_ = [ + ("pfnCreateExt", c_void_p), ## _zeRTASBuilderCreateExt_t + ("pfnGetBuildPropertiesExt", c_void_p), ## _zeRTASBuilderGetBuildPropertiesExt_t + ("pfnBuildExt", c_void_p), ## _zeRTASBuilderBuildExt_t + ("pfnCommandListAppendCopyExt", c_void_p), ## _zeRTASBuilderCommandListAppendCopyExt_t + ("pfnDestroyExt", c_void_p) ## _zeRTASBuilderDestroyExt_t + ] + ############################################################################### ## @brief Function-pointer for zeRTASBuilderCreateExp if __use_win_types: @@ -4211,6 +4922,45 @@ class _ze_rtas_builder_exp_dditable_t(Structure): ("pfnDestroyExp", c_void_p) ## _zeRTASBuilderDestroyExp_t ] +############################################################################### +## @brief Function-pointer for zeRTASParallelOperationCreateExt +if __use_win_types: + _zeRTASParallelOperationCreateExt_t = WINFUNCTYPE( ze_result_t, ze_driver_handle_t, POINTER(ze_rtas_parallel_operation_ext_handle_t) ) +else: + _zeRTASParallelOperationCreateExt_t = CFUNCTYPE( ze_result_t, ze_driver_handle_t, POINTER(ze_rtas_parallel_operation_ext_handle_t) ) + +############################################################################### +## @brief Function-pointer for zeRTASParallelOperationGetPropertiesExt +if __use_win_types: + _zeRTASParallelOperationGetPropertiesExt_t = WINFUNCTYPE( ze_result_t, ze_rtas_parallel_operation_ext_handle_t, POINTER(ze_rtas_parallel_operation_ext_properties_t) ) +else: + _zeRTASParallelOperationGetPropertiesExt_t = CFUNCTYPE( ze_result_t, ze_rtas_parallel_operation_ext_handle_t, POINTER(ze_rtas_parallel_operation_ext_properties_t) ) + +############################################################################### +## @brief Function-pointer for zeRTASParallelOperationJoinExt +if __use_win_types: + _zeRTASParallelOperationJoinExt_t = WINFUNCTYPE( ze_result_t, ze_rtas_parallel_operation_ext_handle_t ) +else: + _zeRTASParallelOperationJoinExt_t = CFUNCTYPE( ze_result_t, ze_rtas_parallel_operation_ext_handle_t ) + +############################################################################### +## @brief Function-pointer for zeRTASParallelOperationDestroyExt +if __use_win_types: + _zeRTASParallelOperationDestroyExt_t = WINFUNCTYPE( ze_result_t, ze_rtas_parallel_operation_ext_handle_t ) +else: + _zeRTASParallelOperationDestroyExt_t = CFUNCTYPE( ze_result_t, ze_rtas_parallel_operation_ext_handle_t ) + + +############################################################################### +## @brief Table of RTASParallelOperation functions pointers +class _ze_rtas_parallel_operation_dditable_t(Structure): + _fields_ = [ + ("pfnCreateExt", c_void_p), ## _zeRTASParallelOperationCreateExt_t + ("pfnGetPropertiesExt", c_void_p), ## _zeRTASParallelOperationGetPropertiesExt_t + ("pfnJoinExt", c_void_p), ## _zeRTASParallelOperationJoinExt_t + ("pfnDestroyExt", c_void_p) ## _zeRTASParallelOperationDestroyExt_t + ] + ############################################################################### ## @brief Function-pointer for zeRTASParallelOperationCreateExp if __use_win_types: @@ -4322,6 +5072,13 @@ class _ze_global_dditable_t(Structure): else: _zeDriverGetLastErrorDescription_t = CFUNCTYPE( ze_result_t, ze_driver_handle_t, POINTER(c_char_p) ) +############################################################################### +## @brief Function-pointer for zeDriverRTASFormatCompatibilityCheckExt +if __use_win_types: + _zeDriverRTASFormatCompatibilityCheckExt_t = WINFUNCTYPE( ze_result_t, ze_driver_handle_t, ze_rtas_format_ext_t, ze_rtas_format_ext_t ) +else: + _zeDriverRTASFormatCompatibilityCheckExt_t = CFUNCTYPE( ze_result_t, ze_driver_handle_t, ze_rtas_format_ext_t, ze_rtas_format_ext_t ) + ############################################################################### ## @brief Table of Driver functions pointers @@ -4333,7 +5090,8 @@ class _ze_driver_dditable_t(Structure): ("pfnGetIpcProperties", c_void_p), ## _zeDriverGetIpcProperties_t ("pfnGetExtensionProperties", c_void_p), ## _zeDriverGetExtensionProperties_t ("pfnGetExtensionFunctionAddress", c_void_p), ## _zeDriverGetExtensionFunctionAddress_t - ("pfnGetLastErrorDescription", c_void_p) ## _zeDriverGetLastErrorDescription_t + ("pfnGetLastErrorDescription", c_void_p), ## _zeDriverGetLastErrorDescription_t + ("pfnRTASFormatCompatibilityCheckExt", c_void_p) ## _zeDriverRTASFormatCompatibilityCheckExt_t ] ############################################################################### @@ -4498,6 +5256,13 @@ class _ze_driver_exp_dditable_t(Structure): else: _zeDeviceReleaseExternalSemaphoreExt_t = CFUNCTYPE( ze_result_t, ze_external_semaphore_ext_handle_t ) +############################################################################### +## @brief Function-pointer for zeDeviceGetVectorWidthPropertiesExt +if __use_win_types: + _zeDeviceGetVectorWidthPropertiesExt_t = WINFUNCTYPE( ze_result_t, ze_device_handle_t, POINTER(c_ulong), POINTER(ze_device_vector_width_properties_ext_t) ) +else: + _zeDeviceGetVectorWidthPropertiesExt_t = CFUNCTYPE( ze_result_t, ze_device_handle_t, POINTER(c_ulong), POINTER(ze_device_vector_width_properties_ext_t) ) + ############################################################################### ## @brief Table of Device functions pointers @@ -4523,7 +5288,8 @@ class _ze_device_dditable_t(Structure): ("pfnPciGetPropertiesExt", c_void_p), ## _zeDevicePciGetPropertiesExt_t ("pfnGetRootDevice", c_void_p), ## _zeDeviceGetRootDevice_t ("pfnImportExternalSemaphoreExt", c_void_p), ## _zeDeviceImportExternalSemaphoreExt_t - ("pfnReleaseExternalSemaphoreExt", c_void_p) ## _zeDeviceReleaseExternalSemaphoreExt_t + ("pfnReleaseExternalSemaphoreExt", c_void_p), ## _zeDeviceReleaseExternalSemaphoreExt_t + ("pfnGetVectorWidthPropertiesExt", c_void_p) ## _zeDeviceGetVectorWidthPropertiesExt_t ] ############################################################################### @@ -5907,7 +6673,9 @@ class _ze_fabric_edge_exp_dditable_t(Structure): ############################################################################### class _ze_dditable_t(Structure): _fields_ = [ + ("RTASBuilder", _ze_rtas_builder_dditable_t), ("RTASBuilderExp", _ze_rtas_builder_exp_dditable_t), + ("RTASParallelOperation", _ze_rtas_parallel_operation_dditable_t), ("RTASParallelOperationExp", _ze_rtas_parallel_operation_exp_dditable_t), ("Global", _ze_global_dditable_t), ("Driver", _ze_driver_dditable_t), @@ -5950,6 +6718,20 @@ def __init__(self, version : ze_api_version_t): # fill the ddi tables self.__dditable = _ze_dditable_t() + # call driver to get function pointers + _RTASBuilder = _ze_rtas_builder_dditable_t() + r = ze_result_v(self.__dll.zeGetRTASBuilderProcAddrTable(version, byref(_RTASBuilder))) + if r != ze_result_v.SUCCESS: + raise Exception(r) + self.__dditable.RTASBuilder = _RTASBuilder + + # attach function interface to function address + self.zeRTASBuilderCreateExt = _zeRTASBuilderCreateExt_t(self.__dditable.RTASBuilder.pfnCreateExt) + self.zeRTASBuilderGetBuildPropertiesExt = _zeRTASBuilderGetBuildPropertiesExt_t(self.__dditable.RTASBuilder.pfnGetBuildPropertiesExt) + self.zeRTASBuilderBuildExt = _zeRTASBuilderBuildExt_t(self.__dditable.RTASBuilder.pfnBuildExt) + self.zeRTASBuilderCommandListAppendCopyExt = _zeRTASBuilderCommandListAppendCopyExt_t(self.__dditable.RTASBuilder.pfnCommandListAppendCopyExt) + self.zeRTASBuilderDestroyExt = _zeRTASBuilderDestroyExt_t(self.__dditable.RTASBuilder.pfnDestroyExt) + # call driver to get function pointers _RTASBuilderExp = _ze_rtas_builder_exp_dditable_t() r = ze_result_v(self.__dll.zeGetRTASBuilderExpProcAddrTable(version, byref(_RTASBuilderExp))) @@ -5963,6 +6745,19 @@ def __init__(self, version : ze_api_version_t): self.zeRTASBuilderBuildExp = _zeRTASBuilderBuildExp_t(self.__dditable.RTASBuilderExp.pfnBuildExp) self.zeRTASBuilderDestroyExp = _zeRTASBuilderDestroyExp_t(self.__dditable.RTASBuilderExp.pfnDestroyExp) + # call driver to get function pointers + _RTASParallelOperation = _ze_rtas_parallel_operation_dditable_t() + r = ze_result_v(self.__dll.zeGetRTASParallelOperationProcAddrTable(version, byref(_RTASParallelOperation))) + if r != ze_result_v.SUCCESS: + raise Exception(r) + self.__dditable.RTASParallelOperation = _RTASParallelOperation + + # attach function interface to function address + self.zeRTASParallelOperationCreateExt = _zeRTASParallelOperationCreateExt_t(self.__dditable.RTASParallelOperation.pfnCreateExt) + self.zeRTASParallelOperationGetPropertiesExt = _zeRTASParallelOperationGetPropertiesExt_t(self.__dditable.RTASParallelOperation.pfnGetPropertiesExt) + self.zeRTASParallelOperationJoinExt = _zeRTASParallelOperationJoinExt_t(self.__dditable.RTASParallelOperation.pfnJoinExt) + self.zeRTASParallelOperationDestroyExt = _zeRTASParallelOperationDestroyExt_t(self.__dditable.RTASParallelOperation.pfnDestroyExt) + # call driver to get function pointers _RTASParallelOperationExp = _ze_rtas_parallel_operation_exp_dditable_t() r = ze_result_v(self.__dll.zeGetRTASParallelOperationExpProcAddrTable(version, byref(_RTASParallelOperationExp))) @@ -6002,6 +6797,7 @@ def __init__(self, version : ze_api_version_t): self.zeDriverGetExtensionProperties = _zeDriverGetExtensionProperties_t(self.__dditable.Driver.pfnGetExtensionProperties) self.zeDriverGetExtensionFunctionAddress = _zeDriverGetExtensionFunctionAddress_t(self.__dditable.Driver.pfnGetExtensionFunctionAddress) self.zeDriverGetLastErrorDescription = _zeDriverGetLastErrorDescription_t(self.__dditable.Driver.pfnGetLastErrorDescription) + self.zeDriverRTASFormatCompatibilityCheckExt = _zeDriverRTASFormatCompatibilityCheckExt_t(self.__dditable.Driver.pfnRTASFormatCompatibilityCheckExt) # call driver to get function pointers _DriverExp = _ze_driver_exp_dditable_t() @@ -6042,6 +6838,7 @@ def __init__(self, version : ze_api_version_t): self.zeDeviceGetRootDevice = _zeDeviceGetRootDevice_t(self.__dditable.Device.pfnGetRootDevice) self.zeDeviceImportExternalSemaphoreExt = _zeDeviceImportExternalSemaphoreExt_t(self.__dditable.Device.pfnImportExternalSemaphoreExt) self.zeDeviceReleaseExternalSemaphoreExt = _zeDeviceReleaseExternalSemaphoreExt_t(self.__dditable.Device.pfnReleaseExternalSemaphoreExt) + self.zeDeviceGetVectorWidthPropertiesExt = _zeDeviceGetVectorWidthPropertiesExt_t(self.__dditable.Device.pfnGetVectorWidthPropertiesExt) # call driver to get function pointers _DeviceExp = _ze_device_exp_dditable_t() diff --git a/include/ze_api.h b/include/ze_api.h index dfb30a25..03d12d03 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.12-r1.12.15 + * @version v1.13-r1.13.1 * */ #ifndef _ZE_API_H @@ -249,8 +249,15 @@ typedef enum _ze_result_t ///< memory ZE_RESULT_WARNING_ACTION_REQUIRED = 0x7800001b, ///< [Sysman] an action is required to complete the desired operation ZE_RESULT_ERROR_INVALID_KERNEL_HANDLE = 0x7800001c, ///< [Core, Validation] kernel handle is invalid for the operation + ZE_RESULT_EXT_RTAS_BUILD_RETRY = 0x7800001d, ///< [Core, Extension] ray tracing acceleration structure build operation + ///< failed due to insufficient resources, retry with a larger acceleration + ///< structure buffer allocation + ZE_RESULT_EXT_RTAS_BUILD_DEFERRED = 0x7800001e, ///< [Core, Extension] ray tracing acceleration structure build operation + ///< deferred to parallel operation join + 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_UNKNOWN = 0x7ffffffe, ///< [Core] unknown or internal error - ZE_RESULT_FORCE_UINT32 = 0x7fffffff + ZE_RESULT_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_RESULT_* ENUMs } ze_result_t; @@ -351,7 +358,15 @@ typedef enum _ze_structure_type_t ZE_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_EXT = 0x00020025, ///< ::ze_external_semaphore_signal_params_ext_t ZE_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_WAIT_PARAMS_EXT = 0x00020026, ///< ::ze_external_semaphore_wait_params_ext_t ZE_STRUCTURE_TYPE_DRIVER_DDI_HANDLES_EXT_PROPERTIES = 0x00020027, ///< ::ze_driver_ddi_handles_ext_properties_t - ZE_STRUCTURE_TYPE_FORCE_UINT32 = 0x7fffffff + ZE_STRUCTURE_TYPE_DEVICE_CACHELINE_SIZE_EXT = 0x00020028, ///< ::ze_device_cache_line_size_ext_t + ZE_STRUCTURE_TYPE_DEVICE_VECTOR_WIDTH_PROPERTIES_EXT = 0x00020029, ///< ::ze_device_vector_width_properties_ext_t + ZE_STRUCTURE_TYPE_RTAS_BUILDER_EXT_DESC = 0x00020030, ///< ::ze_rtas_builder_ext_desc_t + ZE_STRUCTURE_TYPE_RTAS_BUILDER_BUILD_OP_EXT_DESC = 0x00020031, ///< ::ze_rtas_builder_build_op_ext_desc_t + ZE_STRUCTURE_TYPE_RTAS_BUILDER_EXT_PROPERTIES = 0x00020032, ///< ::ze_rtas_builder_ext_properties_t + ZE_STRUCTURE_TYPE_RTAS_PARALLEL_OPERATION_EXT_PROPERTIES = 0x00020033, ///< ::ze_rtas_parallel_operation_ext_properties_t + ZE_STRUCTURE_TYPE_RTAS_DEVICE_EXT_PROPERTIES = 0x00020034, ///< ::ze_rtas_device_ext_properties_t + ZE_STRUCTURE_TYPE_RTAS_GEOMETRY_AABBS_EXT_CB_PARAMS = 0x00020035, ///< ::ze_rtas_geometry_aabbs_ext_cb_params_t + ZE_STRUCTURE_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_STRUCTURE_TYPE_* ENUMs } ze_structure_type_t; @@ -369,7 +384,7 @@ typedef enum _ze_external_memory_type_flag_t ///< resource ZE_EXTERNAL_MEMORY_TYPE_FLAG_D3D12_HEAP = ZE_BIT(6), ///< an NT handle referring to a Direct3D 12 heap resource ZE_EXTERNAL_MEMORY_TYPE_FLAG_D3D12_RESOURCE = ZE_BIT(7), ///< an NT handle referring to a Direct3D 12 committed resource - ZE_EXTERNAL_MEMORY_TYPE_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_EXTERNAL_MEMORY_TYPE_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_EXTERNAL_MEMORY_TYPE_FLAG_* ENUMs } ze_external_memory_type_flag_t; @@ -380,7 +395,7 @@ typedef enum _ze_bandwidth_unit_t ZE_BANDWIDTH_UNIT_UNKNOWN = 0, ///< The unit used for bandwidth is unknown ZE_BANDWIDTH_UNIT_BYTES_PER_NANOSEC = 1, ///< Bandwidth is provided in bytes/nanosec ZE_BANDWIDTH_UNIT_BYTES_PER_CLOCK = 2, ///< Bandwidth is provided in bytes/clock - ZE_BANDWIDTH_UNIT_FORCE_UINT32 = 0x7fffffff + ZE_BANDWIDTH_UNIT_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_BANDWIDTH_UNIT_* ENUMs } ze_bandwidth_unit_t; @@ -393,7 +408,7 @@ typedef enum _ze_latency_unit_t ZE_LATENCY_UNIT_CLOCK = 2, ///< Latency is provided in clocks ZE_LATENCY_UNIT_HOP = 3, ///< Latency is provided in hops (normalized so that the lowest latency ///< link has a latency of 1 hop) - ZE_LATENCY_UNIT_FORCE_UINT32 = 0x7fffffff + ZE_LATENCY_UNIT_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_LATENCY_UNIT_* ENUMs } ze_latency_unit_t; @@ -719,6 +734,86 @@ typedef struct _ze_external_semaphore_signal_params_ext_t ze_external_semaphore_ /// @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_cache_reservation_ext_desc_t typedef struct _ze_cache_reservation_ext_desc_t ze_cache_reservation_ext_desc_t; @@ -990,7 +1085,7 @@ 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 + ZE_INIT_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_INIT_FLAG_* ENUMs } ze_init_flag_t; @@ -1087,7 +1182,7 @@ typedef enum _ze_init_driver_type_flag_t { ZE_INIT_DRIVER_TYPE_FLAG_GPU = ZE_BIT(0), ///< initialize and retrieve GPU drivers ZE_INIT_DRIVER_TYPE_FLAG_NPU = ZE_BIT(1), ///< initialize and retrieve NPU drivers - ZE_INIT_DRIVER_TYPE_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_INIT_DRIVER_TYPE_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_INIT_DRIVER_TYPE_FLAG_* ENUMs } ze_init_driver_type_flag_t; @@ -1113,11 +1208,11 @@ typedef struct _ze_init_driver_type_desc_t /// other function. (zeInit is [Deprecated] and is replaced by /// zeInitDrivers) /// - Calls to zeInit[Deprecated] or InitDrivers will not alter the drivers -/// retrieved thru either api. -/// - Drivers init thru zeInit[Deprecated] or InitDrivers will not be +/// retrieved through either api. +/// - Drivers init through zeInit[Deprecated] or InitDrivers will not be /// reInitialized once init in an application. The Loader will determine -/// if the already init driver needs to be delivered to the user thru the -/// init type flags. +/// if the already init driver needs to be delivered to the user through +/// the init type flags. /// - Already init Drivers will not be uninitialized if the call to /// InitDrivers does not include that driver's type. Those init drivers /// which don't match the init flags will not have their driver handles @@ -1186,15 +1281,16 @@ typedef enum _ze_api_version_t ZE_API_VERSION_1_10 = ZE_MAKE_VERSION( 1, 10 ), ///< version 1.10 ZE_API_VERSION_1_11 = ZE_MAKE_VERSION( 1, 11 ), ///< version 1.11 ZE_API_VERSION_1_12 = ZE_MAKE_VERSION( 1, 12 ), ///< version 1.12 - ZE_API_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 12 ), ///< latest known version - ZE_API_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_API_VERSION_1_13 = ZE_MAKE_VERSION( 1, 13 ), ///< version 1.13 + ZE_API_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 13 ), ///< latest known version + ZE_API_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_API_VERSION_* ENUMs } 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, 12 ) +#define ZE_API_VERSION_CURRENT_M ZE_MAKE_VERSION( 1, 13 ) #endif // ZE_API_VERSION_CURRENT_M /////////////////////////////////////////////////////////////////////////////// @@ -1284,7 +1380,7 @@ typedef enum _ze_ipc_property_flag_t ///< ::zeMemGetIpcHandle. ZE_IPC_PROPERTY_FLAG_EVENT_POOL = ZE_BIT(1), ///< Supports passing event pools between processes. See ///< ::zeEventPoolGetIpcHandle. - ZE_IPC_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_IPC_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_IPC_PROPERTY_FLAG_* ENUMs } ze_ipc_property_flag_t; @@ -1551,7 +1647,7 @@ typedef enum _ze_device_type_t ZE_DEVICE_TYPE_FPGA = 3, ///< Field Programmable Gate Array ZE_DEVICE_TYPE_MCA = 4, ///< Memory Copy Accelerator ZE_DEVICE_TYPE_VPU = 5, ///< Vision Processing Unit - ZE_DEVICE_TYPE_FORCE_UINT32 = 0x7fffffff + ZE_DEVICE_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_DEVICE_TYPE_* ENUMs } ze_device_type_t; @@ -1584,7 +1680,7 @@ typedef enum _ze_device_property_flag_t ZE_DEVICE_PROPERTY_FLAG_SUBDEVICE = ZE_BIT(1), ///< Device handle used for query represents a sub-device. ZE_DEVICE_PROPERTY_FLAG_ECC = ZE_BIT(2), ///< Device supports error correction memory access. ZE_DEVICE_PROPERTY_FLAG_ONDEMANDPAGING = ZE_BIT(3), ///< Device supports on-demand page-faulting. - ZE_DEVICE_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_DEVICE_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_DEVICE_PROPERTY_FLAG_* ENUMs } ze_device_property_flag_t; @@ -1748,7 +1844,7 @@ typedef enum _ze_device_module_flag_t ZE_DEVICE_MODULE_FLAG_FP64 = ZE_BIT(1), ///< Device supports 64-bit floating-point operations ZE_DEVICE_MODULE_FLAG_INT64_ATOMICS = ZE_BIT(2), ///< Device supports 64-bit atomic operations ZE_DEVICE_MODULE_FLAG_DP4A = ZE_BIT(3), ///< Device supports four component dot product and accumulate operations - ZE_DEVICE_MODULE_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_DEVICE_MODULE_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_DEVICE_MODULE_FLAG_* ENUMs } ze_device_module_flag_t; @@ -1766,7 +1862,7 @@ typedef enum _ze_device_fp_flag_t ZE_DEVICE_FP_FLAG_ROUNDED_DIVIDE_SQRT = ZE_BIT(6), ///< Supports rounding as defined by IEEE754 for divide and sqrt ///< operations. ZE_DEVICE_FP_FLAG_SOFT_FLOAT = ZE_BIT(7), ///< Uses software implementation for basic floating-point operations. - ZE_DEVICE_FP_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_DEVICE_FP_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_DEVICE_FP_FLAG_* ENUMs } ze_device_fp_flag_t; @@ -1834,7 +1930,7 @@ typedef enum _ze_command_queue_group_property_flag_t ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COOPERATIVE_KERNELS = ZE_BIT(2), ///< Command queue group supports cooperative kernels. ///< See ::zeCommandListAppendLaunchCooperativeKernel for more details. ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_METRICS = ZE_BIT(3), ///< Command queue groups supports metric queries. - ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_* ENUMs } ze_command_queue_group_property_flag_t; @@ -1903,7 +1999,7 @@ typedef uint32_t ze_device_memory_property_flags_t; typedef enum _ze_device_memory_property_flag_t { ZE_DEVICE_MEMORY_PROPERTY_FLAG_TBD = ZE_BIT(0), ///< reserved for future use - ZE_DEVICE_MEMORY_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_DEVICE_MEMORY_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_DEVICE_MEMORY_PROPERTY_FLAG_* ENUMs } ze_device_memory_property_flag_t; @@ -1979,7 +2075,7 @@ typedef enum _ze_memory_access_cap_flag_t ZE_MEMORY_ACCESS_CAP_FLAG_ATOMIC = ZE_BIT(1), ///< Supports atomic access ZE_MEMORY_ACCESS_CAP_FLAG_CONCURRENT = ZE_BIT(2), ///< Supports concurrent access ZE_MEMORY_ACCESS_CAP_FLAG_CONCURRENT_ATOMIC = ZE_BIT(3), ///< Supports concurrent atomic access - ZE_MEMORY_ACCESS_CAP_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_MEMORY_ACCESS_CAP_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_MEMORY_ACCESS_CAP_FLAG_* ENUMs } ze_memory_access_cap_flag_t; @@ -2037,7 +2133,7 @@ typedef uint32_t ze_device_cache_property_flags_t; typedef enum _ze_device_cache_property_flag_t { ZE_DEVICE_CACHE_PROPERTY_FLAG_USER_CONTROL = ZE_BIT(0), ///< Device support User Cache Control (i.e. SLM section vs Generic Cache) - ZE_DEVICE_CACHE_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_DEVICE_CACHE_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_DEVICE_CACHE_PROPERTY_FLAG_* ENUMs } ze_device_cache_property_flag_t; @@ -2185,7 +2281,7 @@ typedef enum _ze_device_p2p_property_flag_t { ZE_DEVICE_P2P_PROPERTY_FLAG_ACCESS = ZE_BIT(0), ///< Device supports access between peer devices. ZE_DEVICE_P2P_PROPERTY_FLAG_ATOMICS = ZE_BIT(1), ///< Device supports atomics between peer devices. - ZE_DEVICE_P2P_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_DEVICE_P2P_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_DEVICE_P2P_PROPERTY_FLAG_* ENUMs } ze_device_p2p_property_flag_t; @@ -2337,7 +2433,7 @@ typedef uint32_t ze_context_flags_t; typedef enum _ze_context_flag_t { ZE_CONTEXT_FLAG_TBD = ZE_BIT(0), ///< reserved for future use - ZE_CONTEXT_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_CONTEXT_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_CONTEXT_FLAG_* ENUMs } ze_context_flag_t; @@ -2492,6 +2588,8 @@ typedef enum _ze_command_queue_flag_t ///< work across multiple engines. ///< this flag should be used when applications want full control over ///< multi-engine submission and scheduling. + ///< This flag is **DEPRECATED** as flag + ///< ${X}_COMMAND_LIST_FLAG_EXPLICIT_ONLY is **DEPRECATED**. ZE_COMMAND_QUEUE_FLAG_IN_ORDER = ZE_BIT(1), ///< To be used only when creating immediate command lists. Commands ///< appended to the immediate command ///< list are executed in-order, with driver implementation enforcing @@ -2501,7 +2599,7 @@ typedef enum _ze_command_queue_flag_t ///< the next to define an in-order list, and application is allowed to ///< pass signal and wait events ///< to each appended command to implement more complex dependency graphs. - ZE_COMMAND_QUEUE_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_COMMAND_QUEUE_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_COMMAND_QUEUE_FLAG_* ENUMs } ze_command_queue_flag_t; @@ -2514,7 +2612,7 @@ typedef enum _ze_command_queue_mode_t ///< Host thread is blocked using wait on implicit synchronization object ZE_COMMAND_QUEUE_MODE_ASYNCHRONOUS = 2, ///< Device execution is scheduled and will complete in future; ///< explicit synchronization object must be used to determine completeness - ZE_COMMAND_QUEUE_MODE_FORCE_UINT32 = 0x7fffffff + ZE_COMMAND_QUEUE_MODE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_COMMAND_QUEUE_MODE_* ENUMs } ze_command_queue_mode_t; @@ -2525,7 +2623,7 @@ typedef enum _ze_command_queue_priority_t ZE_COMMAND_QUEUE_PRIORITY_NORMAL = 0, ///< [default] normal priority ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_LOW = 1, ///< lower priority than normal ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_HIGH = 2, ///< higher priority than normal - ZE_COMMAND_QUEUE_PRIORITY_FORCE_UINT32 = 0x7fffffff + ZE_COMMAND_QUEUE_PRIORITY_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_COMMAND_QUEUE_PRIORITY_* ENUMs } ze_command_queue_priority_t; @@ -2538,7 +2636,7 @@ typedef struct _ze_command_queue_desc_t ///< structure (i.e. contains stype and pNext). uint32_t ordinal; ///< [in] command queue group ordinal uint32_t index; ///< [in] command queue index within the group; - ///< must be zero if ::ZE_COMMAND_QUEUE_FLAG_EXPLICIT_ONLY is not set + ///< must be zero. ze_command_queue_flags_t flags; ///< [in] usage flags. ///< must be 0 (default) or a valid combination of ::ze_command_queue_flag_t; ///< default behavior may use implicit driver-based heuristics to balance @@ -2769,6 +2867,8 @@ typedef enum _ze_command_list_flag_t ///< work across multiple engines. ///< this flag should be used when applications want full control over ///< multi-engine submission and scheduling. + ///< This flag is **DEPRECATED** and implementations are not expected to + ///< support this feature. ZE_COMMAND_LIST_FLAG_IN_ORDER = ZE_BIT(3), ///< commands appended to this command list are executed in-order, with ///< driver implementation ///< enforcing dependencies between them. Application is not required to @@ -2780,7 +2880,7 @@ typedef enum _ze_command_list_flag_t ///< more complex dependency graphs. Cannot be combined with ::ZE_COMMAND_LIST_FLAG_RELAXED_ORDERING. ZE_COMMAND_LIST_FLAG_EXP_CLONEABLE = ZE_BIT(4), ///< this command list may be cloned using ::zeCommandListCreateCloneExp ///< after ::zeCommandListClose. - ZE_COMMAND_LIST_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_COMMAND_LIST_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_COMMAND_LIST_FLAG_* ENUMs } ze_command_list_flag_t; @@ -3770,7 +3870,7 @@ typedef enum _ze_memory_advice_t ZE_MEMORY_ADVICE_SET_SYSTEM_MEMORY_PREFERRED_LOCATION = 8, ///< hint that the preferred memory location is host memory ZE_MEMORY_ADVICE_CLEAR_SYSTEM_MEMORY_PREFERRED_LOCATION = 9, ///< removes the effect of ///< ::ZE_MEMORY_ADVICE_SET_SYSTEM_MEMORY_PREFERRED_LOCATION - ZE_MEMORY_ADVICE_FORCE_UINT32 = 0x7fffffff + ZE_MEMORY_ADVICE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_MEMORY_ADVICE_* ENUMs } ze_memory_advice_t; @@ -3838,7 +3938,7 @@ typedef enum _ze_event_pool_flag_t ZE_EVENT_POOL_FLAG_KERNEL_MAPPED_TIMESTAMP = ZE_BIT(3), ///< Indicates all events in pool will contain kernel timestamps ///< synchronized to host time domain; cannot be combined with ///< ::ZE_EVENT_POOL_FLAG_KERNEL_TIMESTAMP - ZE_EVENT_POOL_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_EVENT_POOL_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_EVENT_POOL_FLAG_* ENUMs } ze_event_pool_flag_t; @@ -3934,7 +4034,7 @@ typedef enum _ze_event_scope_flag_t ///< device access and peer device access ZE_EVENT_SCOPE_FLAG_HOST = ZE_BIT(2), ///< cache hierarchies are flushed or invalidated sufficient for device and ///< host access - ZE_EVENT_SCOPE_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_EVENT_SCOPE_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_EVENT_SCOPE_FLAG_* ENUMs } ze_event_scope_flag_t; @@ -4608,7 +4708,7 @@ 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 + ZE_FENCE_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_FENCE_FLAG_* ENUMs } ze_fence_flag_t; @@ -4788,7 +4888,7 @@ typedef enum _ze_image_flag_t { ZE_IMAGE_FLAG_KERNEL_WRITE = ZE_BIT(0), ///< kernels will write contents ZE_IMAGE_FLAG_BIAS_UNCACHED = ZE_BIT(1), ///< device should not cache contents - ZE_IMAGE_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_IMAGE_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_IMAGE_FLAG_* ENUMs } ze_image_flag_t; @@ -4802,7 +4902,7 @@ typedef enum _ze_image_type_t ZE_IMAGE_TYPE_2DARRAY = 3, ///< 2D array ZE_IMAGE_TYPE_3D = 4, ///< 3D ZE_IMAGE_TYPE_BUFFER = 5, ///< Buffer - ZE_IMAGE_TYPE_FORCE_UINT32 = 0x7fffffff + ZE_IMAGE_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_IMAGE_TYPE_* ENUMs } ze_image_type_t; @@ -4856,7 +4956,7 @@ typedef enum _ze_image_format_layout_t ZE_IMAGE_FORMAT_LAYOUT_8_8_8 = 43, ///< 3-component 8-bit layout ZE_IMAGE_FORMAT_LAYOUT_16_16_16 = 44, ///< 3-component 16-bit layout ZE_IMAGE_FORMAT_LAYOUT_32_32_32 = 45, ///< 3-component 32-bit layout - ZE_IMAGE_FORMAT_LAYOUT_FORCE_UINT32 = 0x7fffffff + ZE_IMAGE_FORMAT_LAYOUT_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_IMAGE_FORMAT_LAYOUT_* ENUMs } ze_image_format_layout_t; @@ -4869,7 +4969,7 @@ typedef enum _ze_image_format_type_t ZE_IMAGE_FORMAT_TYPE_UNORM = 2, ///< Unsigned normalized integer ZE_IMAGE_FORMAT_TYPE_SNORM = 3, ///< Signed normalized integer ZE_IMAGE_FORMAT_TYPE_FLOAT = 4, ///< Float - ZE_IMAGE_FORMAT_TYPE_FORCE_UINT32 = 0x7fffffff + ZE_IMAGE_FORMAT_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_IMAGE_FORMAT_TYPE_* ENUMs } ze_image_format_type_t; @@ -4884,7 +4984,7 @@ typedef enum _ze_image_format_swizzle_t ZE_IMAGE_FORMAT_SWIZZLE_0 = 4, ///< Zero ZE_IMAGE_FORMAT_SWIZZLE_1 = 5, ///< One ZE_IMAGE_FORMAT_SWIZZLE_X = 6, ///< Don't care - ZE_IMAGE_FORMAT_SWIZZLE_FORCE_UINT32 = 0x7fffffff + ZE_IMAGE_FORMAT_SWIZZLE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_IMAGE_FORMAT_SWIZZLE_* ENUMs } ze_image_format_swizzle_t; @@ -4949,7 +5049,7 @@ typedef enum _ze_image_sampler_filter_flag_t { ZE_IMAGE_SAMPLER_FILTER_FLAG_POINT = ZE_BIT(0), ///< device supports point filtering ZE_IMAGE_SAMPLER_FILTER_FLAG_LINEAR = ZE_BIT(1), ///< device supports linear filtering - ZE_IMAGE_SAMPLER_FILTER_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_IMAGE_SAMPLER_FILTER_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_IMAGE_SAMPLER_FILTER_FLAG_* ENUMs } ze_image_sampler_filter_flag_t; @@ -5071,7 +5171,7 @@ typedef enum _ze_device_mem_alloc_flag_t ZE_DEVICE_MEM_ALLOC_FLAG_BIAS_CACHED = ZE_BIT(0), ///< device should cache allocation ZE_DEVICE_MEM_ALLOC_FLAG_BIAS_UNCACHED = ZE_BIT(1), ///< device should not cache allocation (UC) ZE_DEVICE_MEM_ALLOC_FLAG_BIAS_INITIAL_PLACEMENT = ZE_BIT(2), ///< optimize shared allocation for first access on the device - ZE_DEVICE_MEM_ALLOC_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_DEVICE_MEM_ALLOC_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_DEVICE_MEM_ALLOC_FLAG_* ENUMs } ze_device_mem_alloc_flag_t; @@ -5099,7 +5199,7 @@ typedef enum _ze_host_mem_alloc_flag_t ZE_HOST_MEM_ALLOC_FLAG_BIAS_UNCACHED = ZE_BIT(1), ///< host should not cache allocation (UC) ZE_HOST_MEM_ALLOC_FLAG_BIAS_WRITE_COMBINED = ZE_BIT(2), ///< host memory should be allocated write-combined (WC) ZE_HOST_MEM_ALLOC_FLAG_BIAS_INITIAL_PLACEMENT = ZE_BIT(3), ///< optimize shared allocation for first access on the host - ZE_HOST_MEM_ALLOC_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_HOST_MEM_ALLOC_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_HOST_MEM_ALLOC_FLAG_* ENUMs } ze_host_mem_alloc_flag_t; @@ -5264,8 +5364,11 @@ zeMemAllocHost( /// @details /// - The application must ensure the device is not currently referencing /// the memory before it is freed -/// - The implementation of this function may immediately free all Host and -/// Device allocations associated with this memory +/// - 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. @@ -5294,7 +5397,7 @@ typedef enum _ze_memory_type_t ZE_MEMORY_TYPE_HOST = 1, ///< the memory pointed to is a host allocation ZE_MEMORY_TYPE_DEVICE = 2, ///< the memory pointed to is a device allocation ZE_MEMORY_TYPE_SHARED = 3, ///< the memory pointed to is a shared ownership allocation - ZE_MEMORY_TYPE_FORCE_UINT32 = 0x7fffffff + ZE_MEMORY_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_MEMORY_TYPE_* ENUMs } ze_memory_type_t; @@ -5486,7 +5589,7 @@ typedef enum _ze_ipc_memory_flag_t { ZE_IPC_MEMORY_FLAG_BIAS_CACHED = ZE_BIT(0), ///< device should cache allocation ZE_IPC_MEMORY_FLAG_BIAS_UNCACHED = ZE_BIT(1), ///< device should not cache allocation (UC) - ZE_IPC_MEMORY_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_IPC_MEMORY_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_IPC_MEMORY_FLAG_* ENUMs } ze_ipc_memory_flag_t; @@ -5687,7 +5790,7 @@ typedef enum _ze_memory_atomic_attr_exp_flag_t ZE_MEMORY_ATOMIC_ATTR_EXP_FLAG_SYSTEM_ATOMICS = ZE_BIT(6), ///< Concurrent atomics on the pointer from both host and device are ///< allowed. Requires ::ZE_MEMORY_ACCESS_CAP_FLAG_CONCURRENT_ATOMIC ///< returned by ::zeDeviceGetMemoryAccessProperties. - ZE_MEMORY_ATOMIC_ATTR_EXP_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_MEMORY_ATOMIC_ATTR_EXP_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_MEMORY_ATOMIC_ATTR_EXP_FLAG_* ENUMs } ze_memory_atomic_attr_exp_flag_t; @@ -5701,7 +5804,7 @@ typedef enum _ze_memory_atomic_attr_exp_flag_t /// 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_INVALID_ARGUMENT is returned. +/// ::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 @@ -5780,7 +5883,7 @@ typedef enum _ze_module_format_t { ZE_MODULE_FORMAT_IL_SPIRV = 0, ///< Format is SPIRV IL format ZE_MODULE_FORMAT_NATIVE = 1, ///< Format is device native format - ZE_MODULE_FORMAT_FORCE_UINT32 = 0x7fffffff + ZE_MODULE_FORMAT_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_MODULE_FORMAT_* ENUMs } ze_module_format_t; @@ -6105,7 +6208,7 @@ typedef enum _ze_module_property_flag_t { ZE_MODULE_PROPERTY_FLAG_IMPORTS = ZE_BIT(0), ///< Module has imports (i.e. imported global variables and/or kernels). ///< See ::zeModuleDynamicLink. - ZE_MODULE_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_MODULE_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_MODULE_PROPERTY_FLAG_* ENUMs } ze_module_property_flag_t; @@ -6151,7 +6254,7 @@ typedef enum _ze_kernel_flag_t ZE_KERNEL_FLAG_FORCE_RESIDENCY = ZE_BIT(0), ///< force all device allocations to be resident during execution ZE_KERNEL_FLAG_EXPLICIT_RESIDENCY = ZE_BIT(1), ///< application is responsible for all residency of device allocations. ///< driver may disable implicit residency management. - ZE_KERNEL_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_KERNEL_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_KERNEL_FLAG_* ENUMs } ze_kernel_flag_t; @@ -6379,7 +6482,7 @@ typedef enum _ze_kernel_indirect_access_flag_t ZE_KERNEL_INDIRECT_ACCESS_FLAG_HOST = ZE_BIT(0), ///< Indicates that the kernel accesses host allocations indirectly. ZE_KERNEL_INDIRECT_ACCESS_FLAG_DEVICE = ZE_BIT(1), ///< Indicates that the kernel accesses device allocations indirectly. ZE_KERNEL_INDIRECT_ACCESS_FLAG_SHARED = ZE_BIT(2), ///< Indicates that the kernel accesses shared allocations indirectly. - ZE_KERNEL_INDIRECT_ACCESS_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_KERNEL_INDIRECT_ACCESS_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_KERNEL_INDIRECT_ACCESS_FLAG_* ENUMs } ze_kernel_indirect_access_flag_t; @@ -6461,10 +6564,14 @@ zeKernelGetSourceAttributes( 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. + ///< 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. ); /////////////////////////////////////////////////////////////////////////////// @@ -6474,7 +6581,7 @@ typedef enum _ze_cache_config_flag_t { ZE_CACHE_CONFIG_FLAG_LARGE_SLM = ZE_BIT(0), ///< Large SLM size ZE_CACHE_CONFIG_FLAG_LARGE_DATA = ZE_BIT(1), ///< Large General Data size - ZE_CACHE_CONFIG_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_CACHE_CONFIG_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_CACHE_CONFIG_FLAG_* ENUMs } ze_cache_config_flag_t; @@ -6833,7 +6940,7 @@ typedef enum _ze_module_program_exp_version_t { ZE_MODULE_PROGRAM_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZE_MODULE_PROGRAM_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_MODULE_PROGRAM_EXP_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_MODULE_PROGRAM_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_MODULE_PROGRAM_EXP_VERSION_* ENUMs } ze_module_program_exp_version_t; @@ -6886,7 +6993,7 @@ typedef enum _ze_raytracing_ext_version_t { ZE_RAYTRACING_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZE_RAYTRACING_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_RAYTRACING_EXT_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_RAYTRACING_EXT_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_RAYTRACING_EXT_VERSION_* ENUMs } ze_raytracing_ext_version_t; @@ -6896,7 +7003,7 @@ typedef uint32_t ze_device_raytracing_ext_flags_t; typedef enum _ze_device_raytracing_ext_flag_t { ZE_DEVICE_RAYTRACING_EXT_FLAG_RAYQUERY = ZE_BIT(0), ///< Supports rayquery - ZE_DEVICE_RAYTRACING_EXT_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_DEVICE_RAYTRACING_EXT_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_DEVICE_RAYTRACING_EXT_FLAG_* ENUMs } ze_device_raytracing_ext_flag_t; @@ -6922,7 +7029,7 @@ typedef uint32_t ze_raytracing_mem_alloc_ext_flags_t; typedef enum _ze_raytracing_mem_alloc_ext_flag_t { ZE_RAYTRACING_MEM_ALLOC_EXT_FLAG_TBD = ZE_BIT(0), ///< reserved for future use - ZE_RAYTRACING_MEM_ALLOC_EXT_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_RAYTRACING_MEM_ALLOC_EXT_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_RAYTRACING_MEM_ALLOC_EXT_FLAG_* ENUMs } ze_raytracing_mem_alloc_ext_flag_t; @@ -7084,7 +7191,7 @@ typedef enum _ze_sampler_address_mode_t ///< 0.0f, 0.0f, 0.0f) if image format swizzle contains alpha, otherwise ///< (0.0f, 0.0f, 0.0f, 1.0f). ZE_SAMPLER_ADDRESS_MODE_MIRROR = 4, ///< Out-of-bounds coordinates are mirrored starting from edge. - ZE_SAMPLER_ADDRESS_MODE_FORCE_UINT32 = 0x7fffffff + ZE_SAMPLER_ADDRESS_MODE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_SAMPLER_ADDRESS_MODE_* ENUMs } ze_sampler_address_mode_t; @@ -7094,7 +7201,7 @@ typedef enum _ze_sampler_filter_mode_t { ZE_SAMPLER_FILTER_MODE_NEAREST = 0, ///< No coordinate modifications for out of bounds image access. ZE_SAMPLER_FILTER_MODE_LINEAR = 1, ///< Out-of-bounds coordinates are wrapped back around. - ZE_SAMPLER_FILTER_MODE_FORCE_UINT32 = 0x7fffffff + ZE_SAMPLER_FILTER_MODE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_SAMPLER_FILTER_MODE_* ENUMs } ze_sampler_filter_mode_t; @@ -7184,7 +7291,7 @@ typedef enum _ze_memory_access_attribute_t ZE_MEMORY_ACCESS_ATTRIBUTE_NONE = 0, ///< Indicates the memory page is inaccessible. ZE_MEMORY_ACCESS_ATTRIBUTE_READWRITE = 1, ///< Indicates the memory page supports read write access. ZE_MEMORY_ACCESS_ATTRIBUTE_READONLY = 2, ///< Indicates the memory page supports read-only access. - ZE_MEMORY_ACCESS_ATTRIBUTE_FORCE_UINT32 = 0x7fffffff + ZE_MEMORY_ACCESS_ATTRIBUTE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_MEMORY_ACCESS_ATTRIBUTE_* ENUMs } ze_memory_access_attribute_t; @@ -7292,7 +7399,7 @@ typedef enum _ze_physical_mem_flag_t { ZE_PHYSICAL_MEM_FLAG_ALLOCATE_ON_DEVICE = ZE_BIT(0), ///< [default] allocate physical device memory. ZE_PHYSICAL_MEM_FLAG_ALLOCATE_ON_HOST = ZE_BIT(1), ///< Allocate physical host memory instead. - ZE_PHYSICAL_MEM_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_PHYSICAL_MEM_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_PHYSICAL_MEM_FLAG_* ENUMs } ze_physical_mem_flag_t; @@ -7541,7 +7648,7 @@ typedef enum _ze_float_atomics_ext_version_t { ZE_FLOAT_ATOMICS_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZE_FLOAT_ATOMICS_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_FLOAT_ATOMICS_EXT_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_FLOAT_ATOMICS_EXT_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_FLOAT_ATOMICS_EXT_VERSION_* ENUMs } ze_float_atomics_ext_version_t; @@ -7556,7 +7663,7 @@ typedef enum _ze_device_fp_atomic_ext_flag_t ZE_DEVICE_FP_ATOMIC_EXT_FLAG_LOCAL_LOAD_STORE = ZE_BIT(16), ///< Supports atomic load, store, and exchange ZE_DEVICE_FP_ATOMIC_EXT_FLAG_LOCAL_ADD = ZE_BIT(17), ///< Supports atomic add and subtract ZE_DEVICE_FP_ATOMIC_EXT_FLAG_LOCAL_MIN_MAX = ZE_BIT(18), ///< Supports atomic min and max - ZE_DEVICE_FP_ATOMIC_EXT_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_DEVICE_FP_ATOMIC_EXT_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_DEVICE_FP_ATOMIC_EXT_FLAG_* ENUMs } ze_device_fp_atomic_ext_flag_t; @@ -7599,7 +7706,7 @@ typedef enum _ze_global_offset_exp_version_t { ZE_GLOBAL_OFFSET_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZE_GLOBAL_OFFSET_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_GLOBAL_OFFSET_EXP_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_GLOBAL_OFFSET_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_GLOBAL_OFFSET_EXP_VERSION_* ENUMs } ze_global_offset_exp_version_t; @@ -7648,7 +7755,7 @@ 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_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_RELAXED_ALLOCATION_LIMITS_EXP_VERSION_FORCE_UINT32 = 0x7fffffff + 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; @@ -7659,7 +7766,7 @@ 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_FORCE_UINT32 = 0x7fffffff + 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; @@ -7701,7 +7808,7 @@ typedef enum _ze_kernel_get_binary_exp_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 + ZE_KERNEL_GET_BINARY_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_KERNEL_GET_BINARY_EXP_VERSION_* ENUMs } ze_kernel_get_binary_exp_version_t; @@ -7752,7 +7859,7 @@ 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_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_DRIVER_DDI_HANDLES_EXT_VERSION_FORCE_UINT32 = 0x7fffffff + 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; @@ -7762,7 +7869,7 @@ typedef uint32_t ze_driver_ddi_handle_ext_flags_t; typedef enum _ze_driver_ddi_handle_ext_flag_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 + ZE_DRIVER_DDI_HANDLE_EXT_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_DRIVER_DDI_HANDLE_EXT_FLAG_* ENUMs } ze_driver_ddi_handle_ext_flag_t; @@ -7800,7 +7907,7 @@ 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 + ZE_EXTERNAL_SEMAPHORE_EXT_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_EXTERNAL_SEMAPHORE_EXT_VERSION_* ENUMs } ze_external_semaphore_ext_version_t; @@ -7822,7 +7929,7 @@ typedef enum _ze_external_semaphore_ext_flag_t 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 + ZE_EXTERNAL_SEMAPHORE_EXT_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_EXTERNAL_SEMAPHORE_EXT_FLAG_* ENUMs } ze_external_semaphore_ext_flag_t; @@ -8032,229 +8139,1289 @@ zeCommandListAppendWaitExternalSemaphoreExt( #if !defined(__GNUC__) #pragma endregion #endif -// Intel 'oneAPI' Level-Zero Extension APIs for Cache Reservation +// Intel 'oneAPI' Level-Zero Extension APIs for CacheLine Size #if !defined(__GNUC__) -#pragma region cacheReservation +#pragma region CacheLineSize #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 - -} ze_cache_reservation_ext_version_t; +#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 Cache Reservation Region -typedef enum _ze_cache_ext_region_t +/// @brief CacheLine Size Extension Version(s) +typedef enum _ze_device_cache_line_size_ext_version_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 + 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_cache_ext_region_t; +} ze_device_cache_line_size_ext_version_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief CacheReservation structure +/// @brief CacheLine Size queried using ::zeDeviceGetCacheProperties /// /// @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 ::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 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_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 - ); + size_t cacheLineSize; ///< [out] The cache line size in bytes. -/////////////////////////////////////////////////////////////////////////////// -/// @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_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_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 - ); +} ze_device_cache_line_size_ext_t; #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. #if !defined(__GNUC__) -#pragma region eventquerytimestamps +#pragma region RTAS #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_EXT_NAME +/// @brief Ray Tracing Acceleration Structure Extension Name +#define ZE_RTAS_EXT_NAME "ZE_extension_rtas" +#endif // ZE_RTAS_EXT_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_ext_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 + 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_event_query_timestamps_exp_version_t; +} ze_rtas_builder_ext_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_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 -/// - The application may call this function from simultaneous threads. -/// - The implementation of this function must be thread-safe. -/// - The implementation must support -/// ::ZE_experimental_event_query_timestamps. -/// - 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_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_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; -#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 +/// @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 Image Memory Properties Extension Version(s) -typedef enum _ze_image_memory_properties_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_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 + 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_image_memory_properties_exp_version_t; +} ze_rtas_parallel_operation_ext_flag_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Image memory properties -typedef struct _ze_image_memory_properties_exp_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_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_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_image_memory_properties_exp_t; +} ze_rtas_builder_geometry_ext_flag_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Query image memory properties. +/// @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 -/// - The application may call this function from simultaneous threads. -/// - The implementation of this function must be thread-safe. -/// - The implementation must support -/// ::ZE_experimental_image_memory_properties extension. +/// - 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 /// -/// @remarks +/// @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_extension_rtas 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_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_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_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_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_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_NULL_HANDLE +/// + `nullptr == hDriver` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `::ZE_RTAS_FORMAT_EXT_MAX < rtasFormatA` +/// + `::ZE_RTAS_FORMAT_EXT_MAX < rtasFormatB` +/// - ::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_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_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_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 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_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 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_extension_rtas 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_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 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. +/// +/// @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_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 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_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 Destroys a ray tracing acceleration structure builder parallel +/// operation object +/// +/// @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. +/// +/// @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_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 + ); + +#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 Device Vector Sizes Query Extension Version(s) +typedef enum _ze_device_vector_sizes_ext_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_device_vector_sizes_ext_version_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 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_device_vector_width_properties_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @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_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 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_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_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_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_experimental_event_query_timestamps. +/// - 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_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 +/////////////////////////////////////////////////////////////////////////////// +#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 +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. +/// - The implementation must support +/// ::ZE_experimental_image_memory_properties extension. +/// +/// @remarks /// _Analogues_ /// - None /// @@ -8293,7 +9460,7 @@ typedef enum _ze_image_view_ext_version_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 + ZE_IMAGE_VIEW_EXT_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_IMAGE_VIEW_EXT_VERSION_* ENUMs } ze_image_view_ext_version_t; @@ -8355,7 +9522,7 @@ typedef enum _ze_image_view_exp_version_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 + ZE_IMAGE_VIEW_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_IMAGE_VIEW_EXP_VERSION_* ENUMs } ze_image_view_exp_version_t; @@ -8427,7 +9594,7 @@ 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 + ZE_IMAGE_VIEW_PLANAR_EXT_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_IMAGE_VIEW_PLANAR_EXT_VERSION_* ENUMs } ze_image_view_planar_ext_version_t; @@ -8454,7 +9621,7 @@ typedef enum _ze_image_view_planar_exp_version_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 + ZE_IMAGE_VIEW_PLANAR_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_IMAGE_VIEW_PLANAR_EXP_VERSION_* ENUMs } ze_image_view_planar_exp_version_t; @@ -8465,7 +9632,8 @@ typedef struct _ze_image_view_planar_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) + uint32_t planeIndex; ///< [DEPRECATED] no longer supported, use + ///< ::ze_image_view_planar_ext_desc_t instead } ze_image_view_planar_exp_desc_t; @@ -8488,7 +9656,7 @@ typedef enum _ze_scheduling_hints_exp_version_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 + ZE_SCHEDULING_HINTS_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_SCHEDULING_HINTS_EXP_VERSION_* ENUMs } ze_scheduling_hints_exp_version_t; @@ -8500,7 +9668,7 @@ typedef enum _ze_scheduling_hint_exp_flag_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 + ZE_SCHEDULING_HINT_EXP_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_SCHEDULING_HINT_EXP_FLAG_* ENUMs } ze_scheduling_hint_exp_flag_t; @@ -8587,7 +9755,7 @@ typedef enum _ze_linkonce_odr_ext_version_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 + ZE_LINKONCE_ODR_EXT_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_LINKONCE_ODR_EXT_VERSION_* ENUMs } ze_linkonce_odr_ext_version_t; @@ -8610,7 +9778,7 @@ typedef enum _ze_power_saving_hint_exp_version_t { ZE_POWER_SAVING_HINT_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZE_POWER_SAVING_HINT_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_POWER_SAVING_HINT_EXP_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_POWER_SAVING_HINT_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_POWER_SAVING_HINT_EXP_VERSION_* ENUMs } ze_power_saving_hint_exp_version_t; @@ -8622,7 +9790,7 @@ typedef enum _ze_power_saving_hint_type_t ///< 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 + ZE_POWER_SAVING_HINT_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_POWER_SAVING_HINT_TYPE_* ENUMs } ze_power_saving_hint_type_t; @@ -8657,7 +9825,7 @@ typedef enum _ze_subgroup_ext_version_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 + ZE_SUBGROUP_EXT_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_SUBGROUP_EXT_VERSION_* ENUMs } ze_subgroup_ext_version_t; @@ -8680,7 +9848,7 @@ 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 + ZE_EU_COUNT_EXT_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_EU_COUNT_EXT_VERSION_* ENUMs } ze_eu_count_ext_version_t; @@ -8719,7 +9887,7 @@ typedef enum _ze_pci_properties_ext_version_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 + ZE_PCI_PROPERTIES_EXT_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_PCI_PROPERTIES_EXT_VERSION_* ENUMs } ze_pci_properties_ext_version_t; @@ -8812,7 +9980,7 @@ 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 + ZE_SRGB_EXT_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_SRGB_EXT_VERSION_* ENUMs } ze_srgb_ext_version_t; @@ -8851,7 +10019,7 @@ 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 + ZE_IMAGE_COPY_EXT_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_IMAGE_COPY_EXT_VERSION_* ENUMs } ze_image_copy_ext_version_t; @@ -9002,7 +10170,7 @@ 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 + 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; @@ -9061,7 +10229,7 @@ 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 + ZE_LINKAGE_INSPECTION_EXT_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_LINKAGE_INSPECTION_EXT_VERSION_* ENUMs } ze_linkage_inspection_ext_version_t; @@ -9073,7 +10241,7 @@ 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 + ZE_LINKAGE_INSPECTION_EXT_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_LINKAGE_INSPECTION_EXT_FLAG_* ENUMs } ze_linkage_inspection_ext_flag_t; @@ -9144,7 +10312,7 @@ 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 + 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; @@ -9155,7 +10323,7 @@ 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 + 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; @@ -9199,7 +10367,7 @@ 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 + 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; @@ -9208,9 +10376,16 @@ typedef enum _ze_memory_free_policies_ext_version_t 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 freeing - ZE_DRIVER_MEMORY_FREE_POLICY_EXT_FLAG_DEFER_FREE = ZE_BIT(1), ///< schedules the memory to be freed but does not free immediately - ZE_DRIVER_MEMORY_FREE_POLICY_EXT_FLAG_FORCE_UINT32 = 0x7fffffff + 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; @@ -9246,11 +10421,13 @@ typedef struct _ze_memory_free_ext_desc_t } ze_memory_free_ext_desc_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Frees allocated host memory, device memory, or shared memory using the -/// specified free policy. +/// @brief Frees allocated host memory, device memory, or shared memory on the +/// context using the specified free policy. /// /// @details -/// - The memory free policy is specified by the memory free descriptor. +/// - 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. @@ -9349,7 +10526,7 @@ typedef enum _ze_device_luid_ext_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 + ZE_DEVICE_LUID_EXT_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_DEVICE_LUID_EXT_VERSION_* ENUMs } ze_device_luid_ext_version_t; @@ -9421,7 +10598,7 @@ typedef enum _ze_fabric_vertex_exp_type_t 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 + ZE_FABRIC_VERTEX_EXP_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_FABRIC_VERTEX_EXP_TYPE_* ENUMs } ze_fabric_vertex_exp_type_t; @@ -9434,7 +10611,7 @@ typedef enum _ze_fabric_edge_exp_duplexity_t ///< 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 + ZE_FABRIC_EDGE_EXP_DUPLEXITY_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_FABRIC_EDGE_EXP_DUPLEXITY_* ENUMs } ze_fabric_edge_exp_duplexity_t; @@ -9736,7 +10913,7 @@ 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 + 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; @@ -9766,7 +10943,7 @@ typedef enum _ze_device_memory_ext_type_t 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_FORCE_UINT32 = 0x7fffffff + ZE_DEVICE_MEMORY_EXT_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_DEVICE_MEMORY_EXT_TYPE_* ENUMs } ze_device_memory_ext_type_t; @@ -9810,7 +10987,7 @@ 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 + ZE_BFLOAT16_CONVERSIONS_EXT_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_BFLOAT16_CONVERSIONS_EXT_VERSION_* ENUMs } ze_bfloat16_conversions_ext_version_t; @@ -9833,7 +11010,7 @@ 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 + ZE_DEVICE_IP_VERSION_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_DEVICE_IP_VERSION_VERSION_* ENUMs } ze_device_ip_version_version_t; @@ -9873,7 +11050,7 @@ 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 + 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; @@ -9918,7 +11095,7 @@ typedef enum _ze_sub_allocations_exp_version_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 + ZE_SUB_ALLOCATIONS_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_SUB_ALLOCATIONS_EXP_VERSION_* ENUMs } ze_sub_allocations_exp_version_t; @@ -9972,7 +11149,7 @@ 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 + 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; @@ -9983,7 +11160,7 @@ 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 + 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; @@ -10112,7 +11289,7 @@ 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 + ZE_RTAS_BUILDER_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_RTAS_BUILDER_EXP_VERSION_* ENUMs } ze_rtas_builder_exp_version_t; @@ -10122,7 +11299,7 @@ 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 + ZE_RTAS_DEVICE_EXP_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_RTAS_DEVICE_EXP_FLAG_* ENUMs } ze_rtas_device_exp_flag_t; @@ -10135,7 +11312,8 @@ typedef enum _ze_rtas_device_exp_flag_t typedef enum _ze_rtas_format_exp_t { ZE_RTAS_FORMAT_EXP_INVALID = 0, ///< Invalid acceleration structure format - ZE_RTAS_FORMAT_EXP_FORCE_UINT32 = 0x7fffffff + 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 } ze_rtas_format_exp_t; @@ -10145,7 +11323,7 @@ typedef uint32_t ze_rtas_builder_exp_flags_t; typedef enum _ze_rtas_builder_exp_flag_t { ZE_RTAS_BUILDER_EXP_FLAG_RESERVED = ZE_BIT(0), ///< Reserved for future use - ZE_RTAS_BUILDER_EXP_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_RTAS_BUILDER_EXP_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_RTAS_BUILDER_EXP_FLAG_* ENUMs } ze_rtas_builder_exp_flag_t; @@ -10155,7 +11333,7 @@ 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 + ZE_RTAS_PARALLEL_OPERATION_EXP_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_RTAS_PARALLEL_OPERATION_EXP_FLAG_* ENUMs } ze_rtas_parallel_operation_exp_flag_t; @@ -10165,7 +11343,7 @@ 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 + 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; @@ -10185,7 +11363,7 @@ typedef enum _ze_rtas_builder_instance_exp_flag_t ///< 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 + ZE_RTAS_BUILDER_INSTANCE_EXP_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_RTAS_BUILDER_INSTANCE_EXP_FLAG_* ENUMs } ze_rtas_builder_instance_exp_flag_t; @@ -10211,7 +11389,7 @@ 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 + 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; @@ -10234,7 +11412,7 @@ 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 + 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; @@ -10246,7 +11424,7 @@ typedef enum _ze_rtas_builder_geometry_type_exp_t 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 + ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_* ENUMs } ze_rtas_builder_geometry_type_exp_t; @@ -10275,7 +11453,7 @@ typedef enum _ze_rtas_builder_input_data_format_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 + 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; @@ -10724,7 +11902,7 @@ zeRTASBuilderCreateExp( /// + `nullptr == pBuildOpDescriptor` /// + `nullptr == pProperties` /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `::ZE_RTAS_FORMAT_EXP_INVALID < pBuildOpDescriptor->rtasFormat` +/// + `::ZE_RTAS_FORMAT_EXP_MAX < pBuildOpDescriptor->rtasFormat` /// + `::ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_HIGH < pBuildOpDescriptor->buildQuality` /// + `0x3 < pBuildOpDescriptor->buildFlags` ZE_APIEXPORT ze_result_t ZE_APICALL @@ -10750,8 +11928,8 @@ zeRTASBuilderGetBuildPropertiesExp( /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hDriver` /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `::ZE_RTAS_FORMAT_EXP_INVALID < rtasFormatA` -/// + `::ZE_RTAS_FORMAT_EXP_INVALID < rtasFormatB` +/// + `::ZE_RTAS_FORMAT_EXP_MAX < rtasFormatA` +/// + `::ZE_RTAS_FORMAT_EXP_MAX < rtasFormatB` /// - ::ZE_RESULT_SUCCESS /// + An acceleration structure built with `rtasFormatA` is compatible with devices that report `rtasFormatB`. /// - ::ZE_RESULT_EXP_ERROR_OPERANDS_INCOMPATIBLE @@ -10826,7 +12004,7 @@ zeDriverRTASFormatCompatibilityCheckExp( /// + `nullptr == pScratchBuffer` /// + `nullptr == pRtasBuffer` /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `::ZE_RTAS_FORMAT_EXP_INVALID < pBuildOpDescriptor->rtasFormat` +/// + `::ZE_RTAS_FORMAT_EXP_MAX < pBuildOpDescriptor->rtasFormat` /// + `::ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_HIGH < pBuildOpDescriptor->buildQuality` /// + `0x3 < pBuildOpDescriptor->buildFlags` /// - ::ZE_RESULT_EXP_RTAS_BUILD_DEFERRED @@ -10995,7 +12173,7 @@ 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 + 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; @@ -11006,7 +12184,7 @@ 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 + 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; @@ -11045,7 +12223,7 @@ 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 + ZE_BINDLESS_IMAGE_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_BINDLESS_IMAGE_EXP_VERSION_* ENUMs } ze_bindless_image_exp_version_t; @@ -11059,7 +12237,7 @@ typedef enum _ze_image_bindless_exp_flag_t 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 + ZE_IMAGE_BINDLESS_EXP_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_IMAGE_BINDLESS_EXP_FLAG_* ENUMs } ze_image_bindless_exp_flag_t; @@ -11188,7 +12366,7 @@ 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 + 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; @@ -11245,7 +12423,7 @@ 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 + 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; @@ -11307,7 +12485,7 @@ 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 + 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; @@ -11324,7 +12502,7 @@ typedef enum _ze_mutable_command_exp_flag_t 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 + ZE_MUTABLE_COMMAND_EXP_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_MUTABLE_COMMAND_EXP_FLAG_* ENUMs } ze_mutable_command_exp_flag_t; @@ -11349,7 +12527,7 @@ 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 + 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; diff --git a/include/ze_ddi.h b/include/ze_ddi.h index 9f99592b..86f43368 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.12-r1.12.15 + * @version v1.13-r1.13.1 * */ #ifndef _ZE_DDI_H @@ -19,6 +19,88 @@ extern "C" { #endif +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeRTASBuilderCreateExt +typedef ze_result_t (ZE_APICALL *ze_pfnRTASBuilderCreateExt_t)( + ze_driver_handle_t, + const ze_rtas_builder_ext_desc_t*, + ze_rtas_builder_ext_handle_t* + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeRTASBuilderGetBuildPropertiesExt +typedef ze_result_t (ZE_APICALL *ze_pfnRTASBuilderGetBuildPropertiesExt_t)( + ze_rtas_builder_ext_handle_t, + const ze_rtas_builder_build_op_ext_desc_t*, + ze_rtas_builder_ext_properties_t* + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeRTASBuilderBuildExt +typedef ze_result_t (ZE_APICALL *ze_pfnRTASBuilderBuildExt_t)( + ze_rtas_builder_ext_handle_t, + const ze_rtas_builder_build_op_ext_desc_t*, + void*, + size_t, + void*, + size_t, + ze_rtas_parallel_operation_ext_handle_t, + void*, + ze_rtas_aabb_ext_t*, + size_t* + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeRTASBuilderCommandListAppendCopyExt +typedef ze_result_t (ZE_APICALL *ze_pfnRTASBuilderCommandListAppendCopyExt_t)( + ze_command_list_handle_t, + void*, + const void*, + size_t, + ze_event_handle_t, + uint32_t, + ze_event_handle_t* + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeRTASBuilderDestroyExt +typedef ze_result_t (ZE_APICALL *ze_pfnRTASBuilderDestroyExt_t)( + ze_rtas_builder_ext_handle_t + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Table of RTASBuilder functions pointers +typedef struct _ze_rtas_builder_dditable_t +{ + ze_pfnRTASBuilderCreateExt_t pfnCreateExt; + ze_pfnRTASBuilderGetBuildPropertiesExt_t pfnGetBuildPropertiesExt; + ze_pfnRTASBuilderBuildExt_t pfnBuildExt; + ze_pfnRTASBuilderCommandListAppendCopyExt_t pfnCommandListAppendCopyExt; + ze_pfnRTASBuilderDestroyExt_t pfnDestroyExt; +} ze_rtas_builder_dditable_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Exported function for filling application's RTASBuilder 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 +zeGetRTASBuilderProcAddrTable( + ze_api_version_t version, ///< [in] API version requested + ze_rtas_builder_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeGetRTASBuilderProcAddrTable +typedef ze_result_t (ZE_APICALL *ze_pfnGetRTASBuilderProcAddrTable_t)( + ze_api_version_t, + ze_rtas_builder_dditable_t* + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Function-pointer for zeRTASBuilderCreateExp typedef ze_result_t (ZE_APICALL *ze_pfnRTASBuilderCreateExp_t)( @@ -88,6 +170,64 @@ typedef ze_result_t (ZE_APICALL *ze_pfnGetRTASBuilderExpProcAddrTable_t)( ze_rtas_builder_exp_dditable_t* ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeRTASParallelOperationCreateExt +typedef ze_result_t (ZE_APICALL *ze_pfnRTASParallelOperationCreateExt_t)( + ze_driver_handle_t, + ze_rtas_parallel_operation_ext_handle_t* + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeRTASParallelOperationGetPropertiesExt +typedef ze_result_t (ZE_APICALL *ze_pfnRTASParallelOperationGetPropertiesExt_t)( + ze_rtas_parallel_operation_ext_handle_t, + ze_rtas_parallel_operation_ext_properties_t* + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeRTASParallelOperationJoinExt +typedef ze_result_t (ZE_APICALL *ze_pfnRTASParallelOperationJoinExt_t)( + ze_rtas_parallel_operation_ext_handle_t + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeRTASParallelOperationDestroyExt +typedef ze_result_t (ZE_APICALL *ze_pfnRTASParallelOperationDestroyExt_t)( + ze_rtas_parallel_operation_ext_handle_t + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Table of RTASParallelOperation functions pointers +typedef struct _ze_rtas_parallel_operation_dditable_t +{ + ze_pfnRTASParallelOperationCreateExt_t pfnCreateExt; + ze_pfnRTASParallelOperationGetPropertiesExt_t pfnGetPropertiesExt; + ze_pfnRTASParallelOperationJoinExt_t pfnJoinExt; + ze_pfnRTASParallelOperationDestroyExt_t pfnDestroyExt; +} ze_rtas_parallel_operation_dditable_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Exported function for filling application's RTASParallelOperation 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 +zeGetRTASParallelOperationProcAddrTable( + ze_api_version_t version, ///< [in] API version requested + ze_rtas_parallel_operation_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeGetRTASParallelOperationProcAddrTable +typedef ze_result_t (ZE_APICALL *ze_pfnGetRTASParallelOperationProcAddrTable_t)( + ze_api_version_t, + ze_rtas_parallel_operation_dditable_t* + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Function-pointer for zeRTASParallelOperationCreateExp typedef ze_result_t (ZE_APICALL *ze_pfnRTASParallelOperationCreateExp_t)( @@ -241,6 +381,14 @@ typedef ze_result_t (ZE_APICALL *ze_pfnDriverGetLastErrorDescription_t)( const char** ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeDriverRTASFormatCompatibilityCheckExt +typedef ze_result_t (ZE_APICALL *ze_pfnDriverRTASFormatCompatibilityCheckExt_t)( + ze_driver_handle_t, + ze_rtas_format_ext_t, + ze_rtas_format_ext_t + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Table of Driver functions pointers typedef struct _ze_driver_dditable_t @@ -252,6 +400,7 @@ typedef struct _ze_driver_dditable_t ze_pfnDriverGetExtensionProperties_t pfnGetExtensionProperties; ze_pfnDriverGetExtensionFunctionAddress_t pfnGetExtensionFunctionAddress; ze_pfnDriverGetLastErrorDescription_t pfnGetLastErrorDescription; + ze_pfnDriverRTASFormatCompatibilityCheckExt_t pfnRTASFormatCompatibilityCheckExt; } ze_driver_dditable_t; /////////////////////////////////////////////////////////////////////////////// @@ -470,6 +619,14 @@ typedef ze_result_t (ZE_APICALL *ze_pfnDeviceReleaseExternalSemaphoreExt_t)( ze_external_semaphore_ext_handle_t ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeDeviceGetVectorWidthPropertiesExt +typedef ze_result_t (ZE_APICALL *ze_pfnDeviceGetVectorWidthPropertiesExt_t)( + ze_device_handle_t, + uint32_t*, + ze_device_vector_width_properties_ext_t* + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Table of Device functions pointers typedef struct _ze_device_dditable_t @@ -495,6 +652,7 @@ typedef struct _ze_device_dditable_t ze_pfnDeviceGetRootDevice_t pfnGetRootDevice; ze_pfnDeviceImportExternalSemaphoreExt_t pfnImportExternalSemaphoreExt; ze_pfnDeviceReleaseExternalSemaphoreExt_t pfnReleaseExternalSemaphoreExt; + ze_pfnDeviceGetVectorWidthPropertiesExt_t pfnGetVectorWidthPropertiesExt; } ze_device_dditable_t; /////////////////////////////////////////////////////////////////////////////// @@ -2588,7 +2746,9 @@ typedef ze_result_t (ZE_APICALL *ze_pfnGetFabricEdgeExpProcAddrTable_t)( /// @brief Container for all DDI tables typedef struct _ze_dditable_t { + ze_rtas_builder_dditable_t RTASBuilder; ze_rtas_builder_exp_dditable_t RTASBuilderExp; + ze_rtas_parallel_operation_dditable_t RTASParallelOperation; ze_rtas_parallel_operation_exp_dditable_t RTASParallelOperationExp; ze_global_dditable_t Global; ze_driver_dditable_t Driver; @@ -2622,7 +2782,9 @@ typedef struct _ze_dditable_driver_t { ze_api_version_t version; uint8_t isValidFlag; + ze_rtas_builder_dditable_t * RTASBuilder; ze_rtas_builder_exp_dditable_t * RTASBuilderExp; + ze_rtas_parallel_operation_dditable_t * RTASParallelOperation; ze_rtas_parallel_operation_exp_dditable_t * RTASParallelOperationExp; ze_global_dditable_t * Global; ze_driver_dditable_t * Driver; diff --git a/include/ze_ddi_common.h b/include/ze_ddi_common.h index 7831c57f..ca6eb50a 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.12-r1.12.15 + * @version v1.13-r1.13.1 * */ #ifndef _ZE_DDI_COMMON_H diff --git a/include/zes.py b/include/zes.py index 2b005b07..b9a9ca21 100644 --- a/include/zes.py +++ b/include/zes.py @@ -4,7 +4,7 @@ SPDX-License-Identifier: MIT @file zes.py - @version v1.12-r1.12.15 + @version v1.13-r1.13.1 """ import platform @@ -169,6 +169,7 @@ class zes_structure_type_v(IntEnum): VF_UTIL_MEM_EXP2 = 0x00020009 ## ::zes_vf_util_mem_exp2_t VF_UTIL_ENGINE_EXP2 = 0x00020010 ## ::zes_vf_util_engine_exp2_t VF_EXP2_CAPABILITIES = 0x00020011 ## ::zes_vf_exp2_capabilities_t + DEVICE_ECC_DEFAULT_PROPERTIES_EXT = 0x00020012 ## ::zes_device_ecc_default_properties_ext_t class zes_structure_type_t(c_int): def __str__(self): @@ -2147,6 +2148,32 @@ 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 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 62705642..82f706e0 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.12-r1.12.15 + * @version v1.13-r1.13.1 * */ #ifndef _ZES_API_H @@ -162,7 +162,8 @@ typedef enum _zes_structure_type_t ZES_STRUCTURE_TYPE_VF_UTIL_MEM_EXP2 = 0x00020009, ///< ::zes_vf_util_mem_exp2_t ZES_STRUCTURE_TYPE_VF_UTIL_ENGINE_EXP2 = 0x00020010, ///< ::zes_vf_util_engine_exp2_t ZES_STRUCTURE_TYPE_VF_EXP2_CAPABILITIES = 0x00020011, ///< ::zes_vf_exp2_capabilities_t - ZES_STRUCTURE_TYPE_FORCE_UINT32 = 0x7fffffff + ZES_STRUCTURE_TYPE_DEVICE_ECC_DEFAULT_PROPERTIES_EXT = 0x00020012, ///< ::zes_device_ecc_default_properties_ext_t + ZES_STRUCTURE_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_STRUCTURE_TYPE_* ENUMs } zes_structure_type_t; @@ -508,6 +509,10 @@ 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_power_limit_ext_desc_t typedef struct _zes_power_limit_ext_desc_t zes_power_limit_ext_desc_t; @@ -582,7 +587,7 @@ typedef uint32_t zes_init_flags_t; typedef enum _zes_init_flag_t { ZES_INIT_FLAG_PLACEHOLDER = ZE_BIT(0), ///< placeholder for future use - ZES_INIT_FLAG_FORCE_UINT32 = 0x7fffffff + ZES_INIT_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_INIT_FLAG_* ENUMs } zes_init_flag_t; @@ -793,7 +798,7 @@ typedef enum _zes_engine_type_flag_t ZES_ENGINE_TYPE_FLAG_MEDIA = ZE_BIT(3), ///< Engines that process media workloads. ZES_ENGINE_TYPE_FLAG_DMA = ZE_BIT(4), ///< Engines that copy blocks of data. ZES_ENGINE_TYPE_FLAG_RENDER = ZE_BIT(5), ///< Engines that can process both 3D content and compute kernels. - ZES_ENGINE_TYPE_FLAG_FORCE_UINT32 = 0x7fffffff + ZES_ENGINE_TYPE_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_ENGINE_TYPE_FLAG_* ENUMs } zes_engine_type_flag_t; @@ -804,7 +809,7 @@ typedef enum _zes_repair_status_t ZES_REPAIR_STATUS_UNSUPPORTED = 0, ///< The device does not support in-field repairs. ZES_REPAIR_STATUS_NOT_PERFORMED = 1, ///< The device has never been repaired. ZES_REPAIR_STATUS_PERFORMED = 2, ///< The device has been repaired. - ZES_REPAIR_STATUS_FORCE_UINT32 = 0x7fffffff + ZES_REPAIR_STATUS_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_REPAIR_STATUS_* ENUMs } zes_repair_status_t; @@ -816,7 +821,7 @@ typedef enum _zes_reset_reason_flag_t ZES_RESET_REASON_FLAG_WEDGED = ZE_BIT(0), ///< The device needs to be reset because one or more parts of the hardware ///< is wedged ZES_RESET_REASON_FLAG_REPAIR = ZE_BIT(1), ///< The device needs to be reset in order to complete in-field repairs - ZES_RESET_REASON_FLAG_FORCE_UINT32 = 0x7fffffff + ZES_RESET_REASON_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_RESET_REASON_FLAG_* ENUMs } zes_reset_reason_flag_t; @@ -827,7 +832,7 @@ typedef enum _zes_reset_type_t ZES_RESET_TYPE_WARM = 0, ///< Apply warm reset ZES_RESET_TYPE_COLD = 1, ///< Apply cold reset ZES_RESET_TYPE_FLR = 2, ///< Apply FLR reset - ZES_RESET_TYPE_FORCE_UINT32 = 0x7fffffff + ZES_RESET_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_RESET_TYPE_* ENUMs } zes_reset_type_t; @@ -874,7 +879,7 @@ typedef enum _zes_device_type_t ZES_DEVICE_TYPE_FPGA = 3, ///< Field Programmable Gate Array ZES_DEVICE_TYPE_MCA = 4, ///< Memory Copy Accelerator ZES_DEVICE_TYPE_VPU = 5, ///< Vision Processing Unit - ZES_DEVICE_TYPE_FORCE_UINT32 = 0x7fffffff + ZES_DEVICE_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_DEVICE_TYPE_* ENUMs } zes_device_type_t; @@ -887,7 +892,7 @@ typedef enum _zes_device_property_flag_t ZES_DEVICE_PROPERTY_FLAG_SUBDEVICE = ZE_BIT(1), ///< Device handle used for query represents a sub-device. ZES_DEVICE_PROPERTY_FLAG_ECC = ZE_BIT(2), ///< Device supports error correction memory access. ZES_DEVICE_PROPERTY_FLAG_ONDEMANDPAGING = ZE_BIT(3), ///< Device supports on-demand page-faulting. - ZES_DEVICE_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff + ZES_DEVICE_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_DEVICE_PROPERTY_FLAG_* ENUMs } zes_device_property_flag_t; @@ -1171,7 +1176,7 @@ typedef enum _zes_pci_link_status_t ZES_PCI_LINK_STATUS_QUALITY_ISSUES = 2, ///< The link is up but has quality and/or bandwidth degradation ZES_PCI_LINK_STATUS_STABILITY_ISSUES = 3, ///< The link has stability issues and preventing workloads making forward ///< progress - ZES_PCI_LINK_STATUS_FORCE_UINT32 = 0x7fffffff + ZES_PCI_LINK_STATUS_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_PCI_LINK_STATUS_* ENUMs } zes_pci_link_status_t; @@ -1182,7 +1187,7 @@ typedef enum _zes_pci_link_qual_issue_flag_t { ZES_PCI_LINK_QUAL_ISSUE_FLAG_REPLAYS = ZE_BIT(0), ///< A significant number of replays are occurring ZES_PCI_LINK_QUAL_ISSUE_FLAG_SPEED = ZE_BIT(1), ///< There is a degradation in the maximum bandwidth of the link - ZES_PCI_LINK_QUAL_ISSUE_FLAG_FORCE_UINT32 = 0x7fffffff + ZES_PCI_LINK_QUAL_ISSUE_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_PCI_LINK_QUAL_ISSUE_FLAG_* ENUMs } zes_pci_link_qual_issue_flag_t; @@ -1192,7 +1197,7 @@ typedef uint32_t zes_pci_link_stab_issue_flags_t; typedef enum _zes_pci_link_stab_issue_flag_t { ZES_PCI_LINK_STAB_ISSUE_FLAG_RETRAINING = ZE_BIT(0), ///< Link retraining has occurred to deal with quality issues - ZES_PCI_LINK_STAB_ISSUE_FLAG_FORCE_UINT32 = 0x7fffffff + ZES_PCI_LINK_STAB_ISSUE_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_PCI_LINK_STAB_ISSUE_FLAG_* ENUMs } zes_pci_link_stab_issue_flag_t; @@ -1225,7 +1230,7 @@ typedef enum _zes_pci_bar_type_t ZES_PCI_BAR_TYPE_MMIO = 0, ///< MMIO registers ZES_PCI_BAR_TYPE_ROM = 1, ///< ROM aperture ZES_PCI_BAR_TYPE_MEM = 2, ///< Device memory - ZES_PCI_BAR_TYPE_FORCE_UINT32 = 0x7fffffff + ZES_PCI_BAR_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_PCI_BAR_TYPE_* ENUMs } zes_pci_bar_type_t; @@ -1418,7 +1423,7 @@ typedef enum _zes_overclock_domain_t ZES_OVERCLOCK_DOMAIN_GPU_MEDIA = 64, ///< Overclocking a GPU with media assets on its own PLL/VR. ZES_OVERCLOCK_DOMAIN_VRAM = 128, ///< Overclocking device local memory. ZES_OVERCLOCK_DOMAIN_ADM = 256, ///< Overclocking LLC/L4 cache. - ZES_OVERCLOCK_DOMAIN_FORCE_UINT32 = 0x7fffffff + ZES_OVERCLOCK_DOMAIN_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_OVERCLOCK_DOMAIN_* ENUMs } zes_overclock_domain_t; @@ -1441,7 +1446,7 @@ typedef enum _zes_overclock_control_t ZES_OVERCLOCK_CONTROL_TEMP_LIMIT = 512, ///< This control changes the value of TjMax. ZES_OVERCLOCK_CONTROL_ITD_DISABLE = 1024, ///< This control permits disabling the adaptive voltage feature ITD ZES_OVERCLOCK_CONTROL_ACM_DISABLE = 2048, ///< This control permits disabling the adaptive voltage feature ACM. - ZES_OVERCLOCK_CONTROL_FORCE_UINT32 = 0x7fffffff + ZES_OVERCLOCK_CONTROL_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_OVERCLOCK_CONTROL_* ENUMs } zes_overclock_control_t; @@ -1455,7 +1460,7 @@ typedef enum _zes_overclock_mode_t ZES_OVERCLOCK_MODE_MODE_UNAVAILABLE = 4, ///< Overclocking is unavailable at this time since the system is running ///< on battery. ZES_OVERCLOCK_MODE_MODE_DISABLED = 5, ///< Overclock mode is disabled. - ZES_OVERCLOCK_MODE_FORCE_UINT32 = 0x7fffffff + ZES_OVERCLOCK_MODE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_OVERCLOCK_MODE_* ENUMs } zes_overclock_mode_t; @@ -1468,7 +1473,7 @@ typedef enum _zes_control_state_t ZES_CONTROL_STATE_STATE_ACTIVE = 2, ///< The overclock control has been set and it is active. ZES_CONTROL_STATE_STATE_DISABLED = 3, ///< The overclock control value has been disabled due to the current power ///< configuration (typically when running on DC). - ZES_CONTROL_STATE_FORCE_UINT32 = 0x7fffffff + ZES_CONTROL_STATE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_CONTROL_STATE_* ENUMs } zes_control_state_t; @@ -1481,7 +1486,7 @@ typedef enum _zes_pending_action_t ZES_PENDING_ACTION_PENDING_COLD_RESET = 2, ///< The requested change requires a device cold reset (hotplug, system ///< boot). ZES_PENDING_ACTION_PENDING_WARM_RESET = 3, ///< The requested change requires a device warm reset (PCIe FLR). - ZES_PENDING_ACTION_FORCE_UINT32 = 0x7fffffff + ZES_PENDING_ACTION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_PENDING_ACTION_* ENUMs } zes_pending_action_t; @@ -1496,7 +1501,7 @@ typedef enum _zes_vf_program_type_t ///< the frequency of those points cannot be changed ZES_VF_PROGRAM_TYPE_VF_VOLT_FIXED = 2, ///< Can only program the frequency for the V-F points that is reads back - ///< the voltage of each point cannot be changed. - ZES_VF_PROGRAM_TYPE_FORCE_UINT32 = 0x7fffffff + ZES_VF_PROGRAM_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_VF_PROGRAM_TYPE_* ENUMs } zes_vf_program_type_t; @@ -1506,7 +1511,7 @@ typedef enum _zes_vf_type_t { ZES_VF_TYPE_VOLT = 0, ///< VF Voltage point ZES_VF_TYPE_FREQ = 1, ///< VF Frequency point - ZES_VF_TYPE_FORCE_UINT32 = 0x7fffffff + ZES_VF_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_VF_TYPE_* ENUMs } zes_vf_type_t; @@ -1517,7 +1522,7 @@ typedef enum _zes_vf_array_type_t ZES_VF_ARRAY_TYPE_USER_VF_ARRAY = 0, ///< User V-F array ZES_VF_ARRAY_TYPE_DEFAULT_VF_ARRAY = 1, ///< Default V-F array ZES_VF_ARRAY_TYPE_LIVE_VF_ARRAY = 2, ///< Live V-F array - ZES_VF_ARRAY_TYPE_FORCE_UINT32 = 0x7fffffff + ZES_VF_ARRAY_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_VF_ARRAY_TYPE_* ENUMs } zes_vf_array_type_t; @@ -2031,7 +2036,7 @@ typedef enum _zes_diag_result_t ZES_DIAG_RESULT_FAIL_CANT_REPAIR = 2, ///< Diagnostic had problems setting up repairs ZES_DIAG_RESULT_REBOOT_FOR_REPAIR = 3, ///< Diagnostics found errors, setup for repair and reboot is required to ///< complete the process - ZES_DIAG_RESULT_FORCE_UINT32 = 0x7fffffff + ZES_DIAG_RESULT_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_DIAG_RESULT_* ENUMs } zes_diag_result_t; @@ -2217,7 +2222,7 @@ typedef enum _zes_device_ecc_state_t ZES_DEVICE_ECC_STATE_UNAVAILABLE = 0, ///< None ZES_DEVICE_ECC_STATE_ENABLED = 1, ///< ECC enabled. ZES_DEVICE_ECC_STATE_DISABLED = 2, ///< ECC disabled. - ZES_DEVICE_ECC_STATE_FORCE_UINT32 = 0x7fffffff + ZES_DEVICE_ECC_STATE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_DEVICE_ECC_STATE_* ENUMs } zes_device_ecc_state_t; @@ -2229,7 +2234,7 @@ typedef enum _zes_device_action_t ZES_DEVICE_ACTION_WARM_CARD_RESET = 1, ///< Warm reset of the card. ZES_DEVICE_ACTION_COLD_CARD_RESET = 2, ///< Cold reset of the card. ZES_DEVICE_ACTION_COLD_SYSTEM_REBOOT = 3, ///< Cold reboot of the system. - ZES_DEVICE_ACTION_FORCE_UINT32 = 0x7fffffff + ZES_DEVICE_ACTION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_DEVICE_ACTION_* ENUMs } zes_device_action_t; @@ -2406,7 +2411,7 @@ typedef enum _zes_engine_group_t ///< engines so activity of such an engine may not be indicative of the ///< underlying resource utilization - use ::ZES_ENGINE_GROUP_MEDIA_ALL for ///< that. - ZES_ENGINE_GROUP_FORCE_UINT32 = 0x7fffffff + ZES_ENGINE_GROUP_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_ENGINE_GROUP_* ENUMs } zes_engine_group_t; @@ -2574,7 +2579,7 @@ typedef enum _zes_event_type_flag_t ZES_EVENT_TYPE_FLAG_DEVICE_RESET_REQUIRED = ZE_BIT(14), ///< Event is triggered when the device needs to be reset (use ///< ::zesDeviceGetState() to determine the reasons for the reset). ZES_EVENT_TYPE_FLAG_SURVIVABILITY_MODE_DETECTED = ZE_BIT(15), ///< Event is triggered when graphics driver encounter an error condition. - ZES_EVENT_TYPE_FLAG_FORCE_UINT32 = 0x7fffffff + ZES_EVENT_TYPE_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_EVENT_TYPE_FLAG_* ENUMs } zes_event_type_flag_t; @@ -2721,7 +2726,7 @@ typedef enum _zes_fabric_port_status_t ZES_FABRIC_PORT_STATUS_FAILED = 3, ///< Port connection instabilities are preventing workloads making forward ///< progress ZES_FABRIC_PORT_STATUS_DISABLED = 4, ///< The port is configured down - ZES_FABRIC_PORT_STATUS_FORCE_UINT32 = 0x7fffffff + ZES_FABRIC_PORT_STATUS_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_FABRIC_PORT_STATUS_* ENUMs } zes_fabric_port_status_t; @@ -2732,7 +2737,7 @@ typedef enum _zes_fabric_port_qual_issue_flag_t { ZES_FABRIC_PORT_QUAL_ISSUE_FLAG_LINK_ERRORS = ZE_BIT(0), ///< Excessive link errors are occurring ZES_FABRIC_PORT_QUAL_ISSUE_FLAG_SPEED = ZE_BIT(1), ///< There is a degradation in the bitrate and/or width of the link - ZES_FABRIC_PORT_QUAL_ISSUE_FLAG_FORCE_UINT32 = 0x7fffffff + ZES_FABRIC_PORT_QUAL_ISSUE_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_FABRIC_PORT_QUAL_ISSUE_FLAG_* ENUMs } zes_fabric_port_qual_issue_flag_t; @@ -2752,7 +2757,7 @@ typedef enum _zes_fabric_port_failure_flag_t ///< period of time. Driver will allow port to continue to train, but will ///< not enable the port for use until the port has been disabled and ///< subsequently re-enabled using ::zesFabricPortSetConfig(). - ZES_FABRIC_PORT_FAILURE_FLAG_FORCE_UINT32 = 0x7fffffff + ZES_FABRIC_PORT_FAILURE_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_FABRIC_PORT_FAILURE_FLAG_* ENUMs } zes_fabric_port_failure_flag_t; @@ -3137,7 +3142,7 @@ typedef enum _zes_fan_speed_mode_t ZES_FAN_SPEED_MODE_FIXED = 1, ///< The fan speed is currently set to a fixed value ZES_FAN_SPEED_MODE_TABLE = 2, ///< The fan speed is currently controlled dynamically by hardware based on ///< a temp/speed table - ZES_FAN_SPEED_MODE_FORCE_UINT32 = 0x7fffffff + ZES_FAN_SPEED_MODE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_FAN_SPEED_MODE_* ENUMs } zes_fan_speed_mode_t; @@ -3147,7 +3152,7 @@ typedef enum _zes_fan_speed_units_t { ZES_FAN_SPEED_UNITS_RPM = 0, ///< The fan speed is in units of revolutions per minute (rpm) ZES_FAN_SPEED_UNITS_PERCENT = 1, ///< The fan speed is a percentage of the maximum speed of the fan - ZES_FAN_SPEED_UNITS_FORCE_UINT32 = 0x7fffffff + ZES_FAN_SPEED_UNITS_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_FAN_SPEED_UNITS_* ENUMs } zes_fan_speed_units_t; @@ -3594,7 +3599,7 @@ typedef enum _zes_freq_domain_t ZES_FREQ_DOMAIN_GPU = 0, ///< GPU Core Domain. ZES_FREQ_DOMAIN_MEMORY = 1, ///< Local Memory Domain. ZES_FREQ_DOMAIN_MEDIA = 2, ///< GPU Media Domain. - ZES_FREQ_DOMAIN_FORCE_UINT32 = 0x7fffffff + ZES_FREQ_DOMAIN_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_FREQ_DOMAIN_* ENUMs } zes_freq_domain_t; @@ -3668,7 +3673,7 @@ typedef enum _zes_freq_throttle_reason_flag_t ZES_FREQ_THROTTLE_REASON_FLAG_SW_RANGE = ZE_BIT(5), ///< frequency throttled due to software supplied frequency range ZES_FREQ_THROTTLE_REASON_FLAG_HW_RANGE = ZE_BIT(6), ///< frequency throttled due to a sub block that has a lower frequency ///< range when it receives clocks - ZES_FREQ_THROTTLE_REASON_FLAG_FORCE_UINT32 = 0x7fffffff + ZES_FREQ_THROTTLE_REASON_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_FREQ_THROTTLE_REASON_FLAG_* ENUMs } zes_freq_throttle_reason_flag_t; @@ -3740,7 +3745,7 @@ typedef enum _zes_oc_mode_t ///< specified overclock values. This mode disables OVERRIDE and ///< INTERPOLATIVE modes. This mode can damage the part, most of the ///< protections are disabled on this mode. - ZES_OC_MODE_FORCE_UINT32 = 0x7fffffff + ZES_OC_MODE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_OC_MODE_* ENUMs } zes_oc_mode_t; @@ -4532,7 +4537,7 @@ typedef enum _zes_mem_type_t ZES_MEM_TYPE_GDDR6 = 17, ///< GDDR6 memory ZES_MEM_TYPE_GDDR6X = 18, ///< GDDR6X memory ZES_MEM_TYPE_GDDR7 = 19, ///< GDDR7 memory - ZES_MEM_TYPE_FORCE_UINT32 = 0x7fffffff + ZES_MEM_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_MEM_TYPE_* ENUMs } zes_mem_type_t; @@ -4542,7 +4547,7 @@ typedef enum _zes_mem_loc_t { ZES_MEM_LOC_SYSTEM = 0, ///< System memory ZES_MEM_LOC_DEVICE = 1, ///< On board local device memory - ZES_MEM_LOC_FORCE_UINT32 = 0x7fffffff + ZES_MEM_LOC_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_MEM_LOC_* ENUMs } zes_mem_loc_t; @@ -4557,7 +4562,7 @@ typedef enum _zes_mem_health_t ZES_MEM_HEALTH_CRITICAL = 3, ///< Operating with reduced memory to cover banks with too many ///< uncorrectable errors. ZES_MEM_HEALTH_REPLACE = 4, ///< Device should be replaced due to excessive uncorrectable errors. - ZES_MEM_HEALTH_FORCE_UINT32 = 0x7fffffff + ZES_MEM_HEALTH_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_MEM_HEALTH_* ENUMs } zes_mem_health_t; @@ -4895,7 +4900,7 @@ typedef enum _zes_power_domain_t ZES_POWER_DOMAIN_STACK = 3, ///< The PUnit power domain is a stack-level power domain. ZES_POWER_DOMAIN_MEMORY = 4, ///< The PUnit power domain is a memory-level power domain. ZES_POWER_DOMAIN_GPU = 5, ///< The PUnit power domain is a GPU-level power domain. - ZES_POWER_DOMAIN_FORCE_UINT32 = 0x7fffffff + ZES_POWER_DOMAIN_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_POWER_DOMAIN_* ENUMs } zes_power_domain_t; @@ -4915,7 +4920,7 @@ typedef enum _zes_power_level_t ZES_POWER_LEVEL_INSTANTANEOUS = 4, ///< The PUnit predicts effective power draw using the current device ///< configuration (frequency, voltage, etc...) & throttles proactively to ///< stay within the specified limit. - ZES_POWER_LEVEL_FORCE_UINT32 = 0x7fffffff + ZES_POWER_LEVEL_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_POWER_LEVEL_* ENUMs } zes_power_level_t; @@ -4927,7 +4932,7 @@ typedef enum _zes_power_source_t ///< battery powered. ZES_POWER_SOURCE_MAINS = 1, ///< Limit active only when the device is mains powered. ZES_POWER_SOURCE_BATTERY = 2, ///< Limit active only when the device is battery powered. - ZES_POWER_SOURCE_FORCE_UINT32 = 0x7fffffff + ZES_POWER_SOURCE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_POWER_SOURCE_* ENUMs } zes_power_source_t; @@ -4938,7 +4943,7 @@ typedef enum _zes_limit_unit_t ZES_LIMIT_UNIT_UNKNOWN = 0, ///< The PUnit power monitoring unit cannot be determined. ZES_LIMIT_UNIT_CURRENT = 1, ///< The limit is specified in milliamperes of current drawn. ZES_LIMIT_UNIT_POWER = 2, ///< The limit is specified in milliwatts of power generated. - ZES_LIMIT_UNIT_FORCE_UINT32 = 0x7fffffff + ZES_LIMIT_UNIT_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_LIMIT_UNIT_* ENUMs } zes_limit_unit_t; @@ -5305,7 +5310,7 @@ typedef enum _zes_psu_voltage_status_t ZES_PSU_VOLTAGE_STATUS_NORMAL = 1, ///< No unusual voltages have been detected ZES_PSU_VOLTAGE_STATUS_OVER = 2, ///< Over-voltage has occurred ZES_PSU_VOLTAGE_STATUS_UNDER = 3, ///< Under-voltage has occurred - ZES_PSU_VOLTAGE_STATUS_FORCE_UINT32 = 0x7fffffff + ZES_PSU_VOLTAGE_STATUS_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_PSU_VOLTAGE_STATUS_* ENUMs } zes_psu_voltage_status_t; @@ -5434,7 +5439,7 @@ typedef enum _zes_ras_error_type_t { ZES_RAS_ERROR_TYPE_CORRECTABLE = 0, ///< Errors were corrected by hardware ZES_RAS_ERROR_TYPE_UNCORRECTABLE = 1, ///< Error were not corrected - ZES_RAS_ERROR_TYPE_FORCE_UINT32 = 0x7fffffff + ZES_RAS_ERROR_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_RAS_ERROR_TYPE_* ENUMs } zes_ras_error_type_t; @@ -5453,7 +5458,7 @@ typedef enum _zes_ras_error_cat_t ZES_RAS_ERROR_CAT_CACHE_ERRORS = 5, ///< The number of errors that have occurred in caches (L1/L3/register ///< file/shared local memory/sampler) ZES_RAS_ERROR_CAT_DISPLAY_ERRORS = 6, ///< The number of errors that have occurred in the display - ZES_RAS_ERROR_CAT_FORCE_UINT32 = 0x7fffffff + ZES_RAS_ERROR_CAT_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_RAS_ERROR_CAT_* ENUMs } zes_ras_error_cat_t; @@ -5708,7 +5713,7 @@ typedef enum _zes_sched_mode_t ///< contexts must wait until the running context completes with no further ///< submitted work. ZES_SCHED_MODE_COMPUTE_UNIT_DEBUG = 3, ///< [DEPRECATED] No longer supported. - ZES_SCHED_MODE_FORCE_UINT32 = 0x7fffffff + ZES_SCHED_MODE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_SCHED_MODE_* ENUMs } zes_sched_mode_t; @@ -6060,7 +6065,7 @@ zesSchedulerSetComputeUnitDebugMode( typedef enum _zes_standby_type_t { ZES_STANDBY_TYPE_GLOBAL = 0, ///< Control the overall standby policy of the device/sub-device - ZES_STANDBY_TYPE_FORCE_UINT32 = 0x7fffffff + ZES_STANDBY_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_STANDBY_TYPE_* ENUMs } zes_standby_type_t; @@ -6085,7 +6090,7 @@ typedef enum _zes_standby_promo_mode_t ZES_STANDBY_PROMO_MODE_DEFAULT = 0, ///< Best compromise between performance and energy savings. ZES_STANDBY_PROMO_MODE_NEVER = 1, ///< The device/component will never shutdown. This can improve performance ///< but uses more energy. - ZES_STANDBY_PROMO_MODE_FORCE_UINT32 = 0x7fffffff + ZES_STANDBY_PROMO_MODE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_STANDBY_PROMO_MODE_* ENUMs } zes_standby_promo_mode_t; @@ -6213,7 +6218,7 @@ typedef enum _zes_temp_sensors_t ZES_TEMP_SENSORS_GPU_BOARD = 6, ///< The maximum temperature across all sensors in the GPU Board ZES_TEMP_SENSORS_GPU_BOARD_MIN = 7, ///< The minimum temperature across all sensors in the GPU Board ZES_TEMP_SENSORS_VOLTAGE_REGULATOR = 8, ///< The maximum temperature across all sensors in the Voltage Regulator - ZES_TEMP_SENSORS_FORCE_UINT32 = 0x7fffffff + ZES_TEMP_SENSORS_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_TEMP_SENSORS_* ENUMs } zes_temp_sensors_t; @@ -6425,6 +6430,41 @@ 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 @@ -6444,7 +6484,7 @@ typedef enum _zes_power_limits_ext_version_t { ZES_POWER_LIMITS_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZES_POWER_LIMITS_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZES_POWER_LIMITS_EXT_VERSION_FORCE_UINT32 = 0x7fffffff + ZES_POWER_LIMITS_EXT_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_POWER_LIMITS_EXT_VERSION_* ENUMs } zes_power_limits_ext_version_t; @@ -6584,7 +6624,7 @@ typedef enum _zes_engine_activity_ext_version_t { ZES_ENGINE_ACTIVITY_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZES_ENGINE_ACTIVITY_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZES_ENGINE_ACTIVITY_EXT_VERSION_FORCE_UINT32 = 0x7fffffff + ZES_ENGINE_ACTIVITY_EXT_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_ENGINE_ACTIVITY_EXT_VERSION_* ENUMs } zes_engine_activity_ext_version_t; @@ -6668,7 +6708,7 @@ typedef enum _zes_ras_state_exp_version_t { ZES_RAS_STATE_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZES_RAS_STATE_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZES_RAS_STATE_EXP_VERSION_FORCE_UINT32 = 0x7fffffff + ZES_RAS_STATE_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_RAS_STATE_EXP_VERSION_* ENUMs } zes_ras_state_exp_version_t; @@ -6690,7 +6730,7 @@ typedef enum _zes_ras_error_category_exp_t ZES_RAS_ERROR_CATEGORY_EXP_MEMORY_ERRORS = 7, ///< The number of errors that have occurred in Memory ZES_RAS_ERROR_CATEGORY_EXP_SCALE_ERRORS = 8, ///< The number of errors that have occurred in Scale Fabric ZES_RAS_ERROR_CATEGORY_EXP_L3FABRIC_ERRORS = 9, ///< The number of errors that have occurred in L3 Fabric - ZES_RAS_ERROR_CATEGORY_EXP_FORCE_UINT32 = 0x7fffffff + ZES_RAS_ERROR_CATEGORY_EXP_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_RAS_ERROR_CATEGORY_EXP_* ENUMs } zes_ras_error_category_exp_t; @@ -6786,7 +6826,7 @@ typedef enum _zes_mem_page_offline_state_exp_version_t { ZES_MEM_PAGE_OFFLINE_STATE_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZES_MEM_PAGE_OFFLINE_STATE_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZES_MEM_PAGE_OFFLINE_STATE_EXP_VERSION_FORCE_UINT32 = 0x7fffffff + ZES_MEM_PAGE_OFFLINE_STATE_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_MEM_PAGE_OFFLINE_STATE_EXP_VERSION_* ENUMs } zes_mem_page_offline_state_exp_version_t; @@ -6826,7 +6866,7 @@ typedef enum _zes_mem_bandwidth_counter_bits_exp_version_t { ZES_MEM_BANDWIDTH_COUNTER_BITS_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZES_MEM_BANDWIDTH_COUNTER_BITS_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZES_MEM_BANDWIDTH_COUNTER_BITS_EXP_VERSION_FORCE_UINT32 = 0x7fffffff + ZES_MEM_BANDWIDTH_COUNTER_BITS_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_MEM_BANDWIDTH_COUNTER_BITS_EXP_VERSION_* ENUMs } zes_mem_bandwidth_counter_bits_exp_version_t; @@ -6868,7 +6908,7 @@ typedef enum _zes_power_domain_properties_exp_version_t { ZES_POWER_DOMAIN_PROPERTIES_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZES_POWER_DOMAIN_PROPERTIES_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZES_POWER_DOMAIN_PROPERTIES_EXP_VERSION_FORCE_UINT32 = 0x7fffffff + ZES_POWER_DOMAIN_PROPERTIES_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_POWER_DOMAIN_PROPERTIES_EXP_VERSION_* ENUMs } zes_power_domain_properties_exp_version_t; @@ -6908,7 +6948,7 @@ typedef enum _zes_firmware_security_exp_version_t { ZES_FIRMWARE_SECURITY_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZES_FIRMWARE_SECURITY_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZES_FIRMWARE_SECURITY_EXP_VERSION_FORCE_UINT32 = 0x7fffffff + ZES_FIRMWARE_SECURITY_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_FIRMWARE_SECURITY_EXP_VERSION_* ENUMs } zes_firmware_security_exp_version_t; @@ -6979,7 +7019,7 @@ typedef enum _zes_sysman_device_mapping_exp_version_t { ZES_SYSMAN_DEVICE_MAPPING_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZES_SYSMAN_DEVICE_MAPPING_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ),///< latest known version - ZES_SYSMAN_DEVICE_MAPPING_EXP_VERSION_FORCE_UINT32 = 0x7fffffff + ZES_SYSMAN_DEVICE_MAPPING_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_SYSMAN_DEVICE_MAPPING_EXP_VERSION_* ENUMs } zes_sysman_device_mapping_exp_version_t; @@ -7077,7 +7117,7 @@ typedef enum _zes_vf_management_exp_version_t ZES_VF_MANAGEMENT_EXP_VERSION_1_1 = ZE_MAKE_VERSION( 1, 1 ), ///< version 1.1 (deprecated) ZES_VF_MANAGEMENT_EXP_VERSION_1_2 = ZE_MAKE_VERSION( 1, 2 ), ///< version 1.2 ZES_VF_MANAGEMENT_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 2 ), ///< latest known version - ZES_VF_MANAGEMENT_EXP_VERSION_FORCE_UINT32 = 0x7fffffff + ZES_VF_MANAGEMENT_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_VF_MANAGEMENT_EXP_VERSION_* ENUMs } zes_vf_management_exp_version_t; @@ -7088,7 +7128,7 @@ typedef enum _zes_vf_info_mem_type_exp_flag_t { ZES_VF_INFO_MEM_TYPE_EXP_FLAG_MEM_TYPE_SYSTEM = ZE_BIT(0), ///< System memory ZES_VF_INFO_MEM_TYPE_EXP_FLAG_MEM_TYPE_DEVICE = ZE_BIT(1), ///< Device local memory - ZES_VF_INFO_MEM_TYPE_EXP_FLAG_FORCE_UINT32 = 0x7fffffff + ZES_VF_INFO_MEM_TYPE_EXP_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_VF_INFO_MEM_TYPE_EXP_FLAG_* ENUMs } zes_vf_info_mem_type_exp_flag_t; @@ -7101,7 +7141,7 @@ typedef enum _zes_vf_info_util_exp_flag_t ZES_VF_INFO_UTIL_EXP_FLAG_INFO_MEM_CPU = ZE_BIT(1), ///< System memory utilization associated with virtual function ZES_VF_INFO_UTIL_EXP_FLAG_INFO_MEM_GPU = ZE_BIT(2), ///< Device memory utilization associated with virtual function ZES_VF_INFO_UTIL_EXP_FLAG_INFO_ENGINE = ZE_BIT(3), ///< Engine utilization associated with virtual function - ZES_VF_INFO_UTIL_EXP_FLAG_FORCE_UINT32 = 0x7fffffff + ZES_VF_INFO_UTIL_EXP_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_VF_INFO_UTIL_EXP_FLAG_* ENUMs } zes_vf_info_util_exp_flag_t; diff --git a/include/zes_ddi.h b/include/zes_ddi.h index 3e2965ad..24b53356 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.12-r1.12.15 + * @version v1.13-r1.13.1 * */ #ifndef _ZES_DDI_H diff --git a/include/zet.py b/include/zet.py index 90d891b0..a6201bc1 100644 --- a/include/zet.py +++ b/include/zet.py @@ -4,7 +4,7 @@ SPDX-License-Identifier: MIT @file zet.py - @version v1.12-r1.12.15 + @version v1.13-r1.13.1 """ import platform @@ -676,6 +676,7 @@ class zet_metric_group_type_exp_flags_v(IntEnum): ## 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): @@ -707,6 +708,47 @@ class zet_export_dma_buf_exp_properties_t(Structure): ("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" @@ -1118,13 +1160,29 @@ class _zet_device_dditable_t(Structure): else: _zetDeviceCreateMetricGroupsFromMetricsExp_t = CFUNCTYPE( ze_result_t, zet_device_handle_t, c_ulong, *, *, *, *, POINTER(zet_metric_group_handle_t) ) +############################################################################### +## @brief Function-pointer for zetDeviceEnableMetricsExp +if __use_win_types: + _zetDeviceEnableMetricsExp_t = WINFUNCTYPE( ze_result_t, zet_device_handle_t ) +else: + _zetDeviceEnableMetricsExp_t = CFUNCTYPE( ze_result_t, zet_device_handle_t ) + +############################################################################### +## @brief Function-pointer for zetDeviceDisableMetricsExp +if __use_win_types: + _zetDeviceDisableMetricsExp_t = WINFUNCTYPE( ze_result_t, zet_device_handle_t ) +else: + _zetDeviceDisableMetricsExp_t = CFUNCTYPE( ze_result_t, zet_device_handle_t ) + ############################################################################### ## @brief Table of DeviceExp functions pointers class _zet_device_exp_dditable_t(Structure): _fields_ = [ ("pfnGetConcurrentMetricGroupsExp", c_void_p), ## _zetDeviceGetConcurrentMetricGroupsExp_t - ("pfnCreateMetricGroupsFromMetricsExp", c_void_p) ## _zetDeviceCreateMetricGroupsFromMetricsExp_t + ("pfnCreateMetricGroupsFromMetricsExp", c_void_p), ## _zetDeviceCreateMetricGroupsFromMetricsExp_t + ("pfnEnableMetricsExp", c_void_p), ## _zetDeviceEnableMetricsExp_t + ("pfnDisableMetricsExp", c_void_p) ## _zetDeviceDisableMetricsExp_t ] ############################################################################### @@ -1181,6 +1239,21 @@ class _zet_command_list_dditable_t(Structure): ("pfnAppendMetricMemoryBarrier", c_void_p) ## _zetCommandListAppendMetricMemoryBarrier_t ] +############################################################################### +## @brief Function-pointer for zetCommandListAppendMarkerExp +if __use_win_types: + _zetCommandListAppendMarkerExp_t = WINFUNCTYPE( ze_result_t, zet_command_list_handle_t, zet_metric_group_handle_t, c_ulong ) +else: + _zetCommandListAppendMarkerExp_t = CFUNCTYPE( ze_result_t, zet_command_list_handle_t, zet_metric_group_handle_t, c_ulong ) + + +############################################################################### +## @brief Table of CommandListExp functions pointers +class _zet_command_list_exp_dditable_t(Structure): + _fields_ = [ + ("pfnAppendMarkerExp", c_void_p) ## _zetCommandListAppendMarkerExp_t + ] + ############################################################################### ## @brief Function-pointer for zetModuleGetDebugInfo if __use_win_types: @@ -1628,6 +1701,7 @@ class _zet_dditable_t(Structure): ("DeviceExp", _zet_device_exp_dditable_t), ("Context", _zet_context_dditable_t), ("CommandList", _zet_command_list_dditable_t), + ("CommandListExp", _zet_command_list_exp_dditable_t), ("Module", _zet_module_dditable_t), ("Kernel", _zet_kernel_dditable_t), ("Metric", _zet_metric_dditable_t), @@ -1714,6 +1788,8 @@ def __init__(self, version : ze_api_version_t): # attach function interface to function address self.zetDeviceGetConcurrentMetricGroupsExp = _zetDeviceGetConcurrentMetricGroupsExp_t(self.__dditable.DeviceExp.pfnGetConcurrentMetricGroupsExp) self.zetDeviceCreateMetricGroupsFromMetricsExp = _zetDeviceCreateMetricGroupsFromMetricsExp_t(self.__dditable.DeviceExp.pfnCreateMetricGroupsFromMetricsExp) + self.zetDeviceEnableMetricsExp = _zetDeviceEnableMetricsExp_t(self.__dditable.DeviceExp.pfnEnableMetricsExp) + self.zetDeviceDisableMetricsExp = _zetDeviceDisableMetricsExp_t(self.__dditable.DeviceExp.pfnDisableMetricsExp) # call driver to get function pointers _Context = _zet_context_dditable_t() @@ -1738,6 +1814,16 @@ def __init__(self, version : ze_api_version_t): self.zetCommandListAppendMetricQueryEnd = _zetCommandListAppendMetricQueryEnd_t(self.__dditable.CommandList.pfnAppendMetricQueryEnd) self.zetCommandListAppendMetricMemoryBarrier = _zetCommandListAppendMetricMemoryBarrier_t(self.__dditable.CommandList.pfnAppendMetricMemoryBarrier) + # call driver to get function pointers + _CommandListExp = _zet_command_list_exp_dditable_t() + r = ze_result_v(self.__dll.zetGetCommandListExpProcAddrTable(version, byref(_CommandListExp))) + if r != ze_result_v.SUCCESS: + raise Exception(r) + self.__dditable.CommandListExp = _CommandListExp + + # attach function interface to function address + self.zetCommandListAppendMarkerExp = _zetCommandListAppendMarkerExp_t(self.__dditable.CommandListExp.pfnAppendMarkerExp) + # call driver to get function pointers _Module = _zet_module_dditable_t() r = ze_result_v(self.__dll.zetGetModuleProcAddrTable(version, byref(_Module))) diff --git a/include/zet_api.h b/include/zet_api.h index c8906ad7..13b8ea01 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.12-r1.12.15 + * @version v1.13-r1.13.1 * */ #ifndef _ZET_API_H @@ -102,7 +102,7 @@ typedef enum _zet_structure_type_t ZET_STRUCTURE_TYPE_METRIC_GROUP_TYPE_EXP = 0x00010006, ///< ::zet_metric_group_type_exp_t ZET_STRUCTURE_TYPE_EXPORT_DMA_EXP_PROPERTIES = 0x00010007, ///< ::zet_export_dma_buf_exp_properties_t ZET_STRUCTURE_TYPE_METRIC_TRACER_EXP_DESC = 0x00010008, ///< ::zet_metric_tracer_exp_desc_t - ZET_STRUCTURE_TYPE_FORCE_UINT32 = 0x7fffffff + ZET_STRUCTURE_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_STRUCTURE_TYPE_* ENUMs } zet_structure_type_t; @@ -138,7 +138,7 @@ typedef enum _zet_value_type_t ZET_VALUE_TYPE_STRING = 5, ///< C string ZET_VALUE_TYPE_UINT8 = 6, ///< 8-bit unsigned-integer ZET_VALUE_TYPE_UINT16 = 7, ///< 16-bit unsigned-integer - ZET_VALUE_TYPE_FORCE_UINT32 = 0x7fffffff + ZET_VALUE_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_VALUE_TYPE_* ENUMs } zet_value_type_t; @@ -269,6 +269,10 @@ 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; @@ -335,7 +339,7 @@ typedef struct _zet_metric_programmable_param_value_exp_t zet_metric_programmabl typedef enum _zet_module_debug_info_format_t { ZET_MODULE_DEBUG_INFO_FORMAT_ELF_DWARF = 0, ///< Format is ELF/DWARF - ZET_MODULE_DEBUG_INFO_FORMAT_FORCE_UINT32 = 0x7fffffff + ZET_MODULE_DEBUG_INFO_FORMAT_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_MODULE_DEBUG_INFO_FORMAT_* ENUMs } zet_module_debug_info_format_t; @@ -383,7 +387,7 @@ typedef uint32_t zet_device_debug_property_flags_t; typedef enum _zet_device_debug_property_flag_t { ZET_DEVICE_DEBUG_PROPERTY_FLAG_ATTACH = ZE_BIT(0), ///< the device supports attaching for debug - ZET_DEVICE_DEBUG_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff + ZET_DEVICE_DEBUG_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_DEVICE_DEBUG_PROPERTY_FLAG_* ENUMs } zet_device_debug_property_flag_t; @@ -480,7 +484,7 @@ typedef enum _zet_debug_event_flag_t { ZET_DEBUG_EVENT_FLAG_NEED_ACK = ZE_BIT(0), ///< The event needs to be acknowledged by calling ///< ::zetDebugAcknowledgeEvent. - ZET_DEBUG_EVENT_FLAG_FORCE_UINT32 = 0x7fffffff + ZET_DEBUG_EVENT_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_DEBUG_EVENT_FLAG_* ENUMs } zet_debug_event_flag_t; @@ -497,7 +501,7 @@ typedef enum _zet_debug_event_type_t ZET_DEBUG_EVENT_TYPE_THREAD_STOPPED = 6, ///< The thread stopped due to a device exception ZET_DEBUG_EVENT_TYPE_THREAD_UNAVAILABLE = 7, ///< The thread is not available to be stopped ZET_DEBUG_EVENT_TYPE_PAGE_FAULT = 8, ///< A page request could not be completed on the device - ZET_DEBUG_EVENT_TYPE_FORCE_UINT32 = 0x7fffffff + ZET_DEBUG_EVENT_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_DEBUG_EVENT_TYPE_* ENUMs } zet_debug_event_type_t; @@ -507,7 +511,7 @@ typedef enum _zet_debug_detach_reason_t { ZET_DEBUG_DETACH_REASON_INVALID = 0, ///< The detach reason is not valid ZET_DEBUG_DETACH_REASON_HOST_EXIT = 1, ///< The host process exited - ZET_DEBUG_DETACH_REASON_FORCE_UINT32 = 0x7fffffff + ZET_DEBUG_DETACH_REASON_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_DEBUG_DETACH_REASON_* ENUMs } zet_debug_detach_reason_t; @@ -547,7 +551,7 @@ typedef enum _zet_debug_page_fault_reason_t ZET_DEBUG_PAGE_FAULT_REASON_INVALID = 0, ///< The page fault reason is not valid ZET_DEBUG_PAGE_FAULT_REASON_MAPPING_ERROR = 1, ///< The address is not mapped ZET_DEBUG_PAGE_FAULT_REASON_PERMISSION_ERROR = 2, ///< Invalid access permissions - ZET_DEBUG_PAGE_FAULT_REASON_FORCE_UINT32 = 0x7fffffff + ZET_DEBUG_PAGE_FAULT_REASON_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_DEBUG_PAGE_FAULT_REASON_* ENUMs } zet_debug_page_fault_reason_t; @@ -676,7 +680,7 @@ typedef enum _zet_debug_memory_space_type_t ZET_DEBUG_MEMORY_SPACE_TYPE_DEFAULT = 0, ///< default memory space (attribute may be omitted) ZET_DEBUG_MEMORY_SPACE_TYPE_SLM = 1, ///< shared local memory space (GPU-only) ZET_DEBUG_MEMORY_SPACE_TYPE_ELF = 2, ///< ELF file memory space - ZET_DEBUG_MEMORY_SPACE_TYPE_FORCE_UINT32 = 0x7fffffff + ZET_DEBUG_MEMORY_SPACE_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_DEBUG_MEMORY_SPACE_TYPE_* ENUMs } zet_debug_memory_space_type_t; @@ -763,7 +767,7 @@ typedef enum _zet_debug_regset_flag_t { ZET_DEBUG_REGSET_FLAG_READABLE = ZE_BIT(0), ///< register set is readable ZET_DEBUG_REGSET_FLAG_WRITEABLE = ZE_BIT(1), ///< register set is writeable - ZET_DEBUG_REGSET_FLAG_FORCE_UINT32 = 0x7fffffff + ZET_DEBUG_REGSET_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_DEBUG_REGSET_FLAG_* ENUMs } zet_debug_regset_flag_t; @@ -868,8 +872,8 @@ zetDebugReadRegisters( ///< than the `count` member of ::zet_debug_regset_properties_t for the ///< type uint32_t count, ///< [in] the number of registers to read; start+count must be less than or - ///< equal to the `count` member of ::zet_debug_register_group_properties_t - ///< for the type + ///< equal to the `count` member of ::zet_debug_regset_properties_t for the + ///< type void* pRegisterValues ///< [in,out][optional][range(0, count)] buffer of register values ); @@ -895,8 +899,8 @@ zetDebugWriteRegisters( ///< than the `count` member of ::zet_debug_regset_properties_t for the ///< type uint32_t count, ///< [in] the number of registers to write; start+count must be less than - ///< or equal to the `count` member of - ///< ::zet_debug_register_group_properties_t for the type + ///< or equal to the `count` member of ::zet_debug_regset_properties_t for + ///< the type void* pRegisterValues ///< [in,out][optional][range(0, count)] buffer of register values ); @@ -957,7 +961,7 @@ typedef enum _zet_metric_group_sampling_type_flag_t ZET_METRIC_GROUP_SAMPLING_TYPE_FLAG_EVENT_BASED = ZE_BIT(0), ///< Event based sampling ZET_METRIC_GROUP_SAMPLING_TYPE_FLAG_TIME_BASED = ZE_BIT(1), ///< Time based sampling ZET_METRIC_GROUP_SAMPLING_TYPE_FLAG_EXP_TRACER_BASED = ZE_BIT(2), ///< Experimental Tracer based sampling - ZET_METRIC_GROUP_SAMPLING_TYPE_FLAG_FORCE_UINT32 = 0x7fffffff + ZET_METRIC_GROUP_SAMPLING_TYPE_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_METRIC_GROUP_SAMPLING_TYPE_FLAG_* ENUMs } zet_metric_group_sampling_type_flag_t; @@ -1022,7 +1026,7 @@ typedef enum _zet_metric_type_t ZET_METRIC_TYPE_IP_EXP = 0x7ffffffe, ///< Metric type: instruction pointer. Deprecated, use ///< ::ZET_METRIC_TYPE_IP. ZET_METRIC_TYPE_IP = 0x7ffffffe, ///< Metric type: instruction pointer - ZET_METRIC_TYPE_FORCE_UINT32 = 0x7fffffff + ZET_METRIC_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_METRIC_TYPE_* ENUMs } zet_metric_type_t; @@ -1032,7 +1036,7 @@ typedef enum _zet_metric_group_calculation_type_t { ZET_METRIC_GROUP_CALCULATION_TYPE_METRIC_VALUES = 0, ///< Calculated metric values from raw data. ZET_METRIC_GROUP_CALCULATION_TYPE_MAX_METRIC_VALUES = 1, ///< Maximum metric values. - ZET_METRIC_GROUP_CALCULATION_TYPE_FORCE_UINT32 = 0x7fffffff + ZET_METRIC_GROUP_CALCULATION_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_METRIC_GROUP_CALCULATION_TYPE_* ENUMs } zet_metric_group_calculation_type_t; @@ -1348,7 +1352,7 @@ typedef enum _zet_metric_query_pool_type_t { ZET_METRIC_QUERY_POOL_TYPE_PERFORMANCE = 0, ///< Performance metric query pool. ZET_METRIC_QUERY_POOL_TYPE_EXECUTION = 1, ///< Skips workload execution between begin/end calls. - ZET_METRIC_QUERY_POOL_TYPE_FORCE_UINT32 = 0x7fffffff + ZET_METRIC_QUERY_POOL_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_METRIC_QUERY_POOL_TYPE_* ENUMs } zet_metric_query_pool_type_t; @@ -1626,7 +1630,7 @@ typedef enum _zet_profile_flag_t ZET_PROFILE_FLAG_REGISTER_REALLOCATION = ZE_BIT(0), ///< request the compiler attempt to minimize register usage as much as ///< possible to allow for instrumentation ZET_PROFILE_FLAG_FREE_REGISTER_INFO = ZE_BIT(1), ///< request the compiler generate free register info - ZET_PROFILE_FLAG_FORCE_UINT32 = 0x7fffffff + ZET_PROFILE_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_PROFILE_FLAG_* ENUMs } zet_profile_flag_t; @@ -1648,7 +1652,7 @@ typedef struct _zet_profile_properties_t typedef enum _zet_profile_token_type_t { ZET_PROFILE_TOKEN_TYPE_FREE_REGISTER = 0, ///< GRF info - ZET_PROFILE_TOKEN_TYPE_FORCE_UINT32 = 0x7fffffff + ZET_PROFILE_TOKEN_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_PROFILE_TOKEN_TYPE_* ENUMs } zet_profile_token_type_t; @@ -1721,7 +1725,7 @@ typedef enum _zet_api_tracing_exp_version_t { ZET_API_TRACING_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZET_API_TRACING_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZET_API_TRACING_EXP_VERSION_FORCE_UINT32 = 0x7fffffff + ZET_API_TRACING_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_API_TRACING_EXP_VERSION_* ENUMs } zet_api_tracing_exp_version_t; @@ -1890,7 +1894,7 @@ typedef enum _zet_concurrent_metric_groups_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 + ZET_CONCURRENT_METRIC_GROUPS_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_CONCURRENT_METRIC_GROUPS_EXP_VERSION_* ENUMs } zet_concurrent_metric_groups_exp_version_t; @@ -1942,7 +1946,7 @@ typedef enum _zet_metric_tracer_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 + ZET_METRIC_TRACER_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_METRIC_TRACER_EXP_VERSION_* ENUMs } zet_metric_tracer_exp_version_t; @@ -2293,7 +2297,8 @@ typedef enum _zet_metric_group_type_exp_flag_t ///< 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_FORCE_UINT32 = 0x7fffffff + 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; @@ -2324,6 +2329,145 @@ typedef struct _zet_export_dma_buf_exp_properties_t } 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 Append a Marker based on the Metric source of the Metric Group, to a +/// Command List. +/// +/// @details +/// - This function appends a Marker based on the Metric source of the +/// Metric Group, to Command List. +/// +/// @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_NULL_HANDLE +/// + `nullptr == hCommandList` +/// + `nullptr == hMetricGroup` +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 + ); + +#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 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 +/// - 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 +/// - ::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_NULL_HANDLE +/// + `nullptr == hDevice` +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. + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Disable Metrics collection during runtime, if it was already enabled. +/// +/// @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. +/// +/// @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_NULL_HANDLE +/// + `nullptr == hDevice` +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 + ); + #if !defined(__GNUC__) #pragma endregion #endif @@ -2343,7 +2487,7 @@ 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 + 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; @@ -2421,7 +2565,7 @@ 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 + 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; @@ -2490,7 +2634,7 @@ 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 + 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; @@ -2628,7 +2772,7 @@ 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 + ZET_METRIC_PROGRAMMABLE_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_METRIC_PROGRAMMABLE_EXP_VERSION_* ENUMs } zet_metric_programmable_exp_version_t; @@ -2723,7 +2867,7 @@ typedef enum _zet_metric_programmable_param_type_exp_t 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 + 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; @@ -2740,7 +2884,7 @@ typedef enum _zet_value_info_type_exp_t 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 + ZET_VALUE_INFO_TYPE_EXP_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_VALUE_INFO_TYPE_EXP_* ENUMs } zet_value_info_type_exp_t; @@ -3216,6 +3360,8 @@ zetMetricGroupCloseExp( /// - 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 diff --git a/include/zet_ddi.h b/include/zet_ddi.h index 504106d4..bf7f56c0 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.12-r1.12.15 + * @version v1.13-r1.13.1 * */ #ifndef _ZET_DDI_H @@ -281,12 +281,26 @@ typedef ze_result_t (ZE_APICALL *zet_pfnDeviceCreateMetricGroupsFromMetricsExp_t zet_metric_group_handle_t* ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zetDeviceEnableMetricsExp +typedef ze_result_t (ZE_APICALL *zet_pfnDeviceEnableMetricsExp_t)( + zet_device_handle_t + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zetDeviceDisableMetricsExp +typedef ze_result_t (ZE_APICALL *zet_pfnDeviceDisableMetricsExp_t)( + zet_device_handle_t + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Table of DeviceExp functions pointers typedef struct _zet_device_exp_dditable_t { zet_pfnDeviceGetConcurrentMetricGroupsExp_t pfnGetConcurrentMetricGroupsExp; zet_pfnDeviceCreateMetricGroupsFromMetricsExp_t pfnCreateMetricGroupsFromMetricsExp; + zet_pfnDeviceEnableMetricsExp_t pfnEnableMetricsExp; + zet_pfnDeviceDisableMetricsExp_t pfnDisableMetricsExp; } zet_device_exp_dditable_t; /////////////////////////////////////////////////////////////////////////////// @@ -412,6 +426,43 @@ typedef ze_result_t (ZE_APICALL *zet_pfnGetCommandListProcAddrTable_t)( zet_command_list_dditable_t* ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zetCommandListAppendMarkerExp +typedef ze_result_t (ZE_APICALL *zet_pfnCommandListAppendMarkerExp_t)( + zet_command_list_handle_t, + zet_metric_group_handle_t, + uint32_t + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Table of CommandListExp functions pointers +typedef struct _zet_command_list_exp_dditable_t +{ + zet_pfnCommandListAppendMarkerExp_t pfnAppendMarkerExp; +} zet_command_list_exp_dditable_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Exported function for filling application's CommandListExp 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 +zetGetCommandListExpProcAddrTable( + ze_api_version_t version, ///< [in] API version requested + zet_command_list_exp_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zetGetCommandListExpProcAddrTable +typedef ze_result_t (ZE_APICALL *zet_pfnGetCommandListExpProcAddrTable_t)( + ze_api_version_t, + zet_command_list_exp_dditable_t* + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Function-pointer for zetModuleGetDebugInfo typedef ze_result_t (ZE_APICALL *zet_pfnModuleGetDebugInfo_t)( @@ -1154,6 +1205,7 @@ typedef struct _zet_dditable_t zet_device_exp_dditable_t DeviceExp; zet_context_dditable_t Context; zet_command_list_dditable_t CommandList; + zet_command_list_exp_dditable_t CommandListExp; zet_module_dditable_t Module; zet_kernel_dditable_t Kernel; zet_metric_dditable_t Metric; @@ -1178,6 +1230,7 @@ typedef struct _zet_dditable_driver_t zet_device_exp_dditable_t * DeviceExp; zet_context_dditable_t * Context; zet_command_list_dditable_t * CommandList; + zet_command_list_exp_dditable_t * CommandListExp; zet_module_dditable_t * Module; zet_kernel_dditable_t * Kernel; zet_metric_dditable_t * Metric; diff --git a/source/drivers/null/ze_nullddi.cpp b/source/drivers/null/ze_nullddi.cpp index b3740a94..e23aa7d1 100644 --- a/source/drivers/null/ze_nullddi.cpp +++ b/source/drivers/null/ze_nullddi.cpp @@ -3322,10 +3322,14 @@ namespace driver 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. + ///< 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. ) { ze_result_t result = ZE_RESULT_SUCCESS; @@ -4108,6 +4112,304 @@ namespace driver return result; } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASBuilderCreateExt + __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 + ) + { + 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 ) + { + result = pfnCreateExt( hDriver, pDescriptor, phBuilder ); + } + else + { + // generic implementation + *phBuilder = reinterpret_cast( context.get() ); + + } + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASBuilderGetBuildPropertiesExt + __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 + ) + { + 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 ) + { + result = pfnGetBuildPropertiesExt( hBuilder, pBuildOpDescriptor, pProperties ); + } + else + { + // generic implementation + } + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @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 + ) + { + 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 ) + { + result = pfnRTASFormatCompatibilityCheckExt( hDriver, rtasFormatA, rtasFormatB ); + } + else + { + // generic implementation + } + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASBuilderBuildExt + __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 + ) + { + 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 ) + { + result = pfnBuildExt( hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes ); + } + else + { + // generic implementation + } + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASBuilderCommandListAppendCopyExt + __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 + ) + { + 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 ) + { + result = pfnCommandListAppendCopyExt( hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents ); + } + else + { + // generic implementation + } + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASBuilderDestroyExt + __zedlllocal ze_result_t ZE_APICALL + 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 pfnDestroyExt = context.zeDdiTable.RTASBuilder.pfnDestroyExt; + if( nullptr != pfnDestroyExt ) + { + result = pfnDestroyExt( hBuilder ); + } + else + { + // generic implementation + + } + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @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 + ) + { + 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 ) + { + result = pfnCreateExt( hDriver, phParallelOperation ); + } + else + { + // generic implementation + *phParallelOperation = reinterpret_cast( context.get() ); + + } + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @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 + ) + { + 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 ) + { + result = pfnGetPropertiesExt( hParallelOperation, pProperties ); + } + else + { + // generic implementation + } + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASParallelOperationJoinExt + __zedlllocal ze_result_t ZE_APICALL + 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 pfnJoinExt = context.zeDdiTable.RTASParallelOperation.pfnJoinExt; + if( nullptr != pfnJoinExt ) + { + result = pfnJoinExt( hParallelOperation ); + } + else + { + // generic implementation + } + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASParallelOperationDestroyExt + __zedlllocal ze_result_t ZE_APICALL + 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 pfnDestroyExt = context.zeDdiTable.RTASParallelOperation.pfnDestroyExt; + if( nullptr != pfnDestroyExt ) + { + result = pfnDestroyExt( hParallelOperation ); + } + else + { + // generic implementation + + } + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeDeviceGetVectorWidthPropertiesExt + __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. + ) + { + 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 ) + { + result = pfnGetVectorWidthPropertiesExt( hDevice, pCount, pVectorWidthProperties ); + } + else + { + // generic implementation + } + + return result; + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zeDeviceReserveCacheExt __zedlllocal ze_result_t ZE_APICALL @@ -5294,6 +5596,41 @@ zeGetGlobalProcAddrTable( return result; } +/////////////////////////////////////////////////////////////////////////////// +/// @brief Exported function for filling application's RTASBuilder 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 +zeGetRTASBuilderProcAddrTable( + ze_api_version_t version, ///< [in] API version requested + ze_rtas_builder_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers + ) +{ + if( nullptr == pDdiTable ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + if( driver::context.version < version ) + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + + ze_result_t result = ZE_RESULT_SUCCESS; + + pDdiTable->pfnCreateExt = driver::zeRTASBuilderCreateExt; + + pDdiTable->pfnGetBuildPropertiesExt = driver::zeRTASBuilderGetBuildPropertiesExt; + + pDdiTable->pfnBuildExt = driver::zeRTASBuilderBuildExt; + + pDdiTable->pfnCommandListAppendCopyExt = driver::zeRTASBuilderCommandListAppendCopyExt; + + pDdiTable->pfnDestroyExt = driver::zeRTASBuilderDestroyExt; + + return result; +} + /////////////////////////////////////////////////////////////////////////////// /// @brief Exported function for filling application's RTASBuilderExp table /// with current process' addresses @@ -5327,6 +5664,39 @@ zeGetRTASBuilderExpProcAddrTable( return result; } +/////////////////////////////////////////////////////////////////////////////// +/// @brief Exported function for filling application's RTASParallelOperation 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 +zeGetRTASParallelOperationProcAddrTable( + ze_api_version_t version, ///< [in] API version requested + ze_rtas_parallel_operation_dditable_t* pDdiTable///< [in,out] pointer to table of DDI function pointers + ) +{ + if( nullptr == pDdiTable ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + if( driver::context.version < version ) + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + + ze_result_t result = ZE_RESULT_SUCCESS; + + pDdiTable->pfnCreateExt = driver::zeRTASParallelOperationCreateExt; + + pDdiTable->pfnGetPropertiesExt = driver::zeRTASParallelOperationGetPropertiesExt; + + pDdiTable->pfnJoinExt = driver::zeRTASParallelOperationJoinExt; + + pDdiTable->pfnDestroyExt = driver::zeRTASParallelOperationDestroyExt; + + return result; +} + /////////////////////////////////////////////////////////////////////////////// /// @brief Exported function for filling application's RTASParallelOperationExp table /// with current process' addresses @@ -5394,6 +5764,8 @@ zeGetDriverProcAddrTable( pDdiTable->pfnGetExtensionFunctionAddress = driver::zeDriverGetExtensionFunctionAddress; + pDdiTable->pfnRTASFormatCompatibilityCheckExt = driver::zeDriverRTASFormatCompatibilityCheckExt; + pDdiTable->pfnGetLastErrorDescription = driver::zeDriverGetLastErrorDescription; return result; @@ -5482,6 +5854,8 @@ zeGetDeviceProcAddrTable( pDdiTable->pfnReleaseExternalSemaphoreExt = driver::zeDeviceReleaseExternalSemaphoreExt; + pDdiTable->pfnGetVectorWidthPropertiesExt = driver::zeDeviceGetVectorWidthPropertiesExt; + pDdiTable->pfnReserveCacheExt = driver::zeDeviceReserveCacheExt; pDdiTable->pfnSetCacheAdviceExt = driver::zeDeviceSetCacheAdviceExt; diff --git a/source/drivers/null/zet_nullddi.cpp b/source/drivers/null/zet_nullddi.cpp index fd01dbf9..2b79a154 100644 --- a/source/drivers/null/zet_nullddi.cpp +++ b/source/drivers/null/zet_nullddi.cpp @@ -348,8 +348,8 @@ namespace driver ///< than the `count` member of ::zet_debug_regset_properties_t for the ///< type uint32_t count, ///< [in] the number of registers to read; start+count must be less than or - ///< equal to the `count` member of ::zet_debug_register_group_properties_t - ///< for the type + ///< equal to the `count` member of ::zet_debug_regset_properties_t for the + ///< type void* pRegisterValues ///< [in,out][optional][range(0, count)] buffer of register values ) { @@ -380,8 +380,8 @@ namespace driver ///< than the `count` member of ::zet_debug_regset_properties_t for the ///< type uint32_t count, ///< [in] the number of registers to write; start+count must be less than - ///< or equal to the `count` member of - ///< ::zet_debug_register_group_properties_t for the type + ///< or equal to the `count` member of ::zet_debug_regset_properties_t for + ///< the type void* pRegisterValues ///< [in,out][optional][range(0, count)] buffer of register values ) { @@ -1401,6 +1401,79 @@ namespace driver return result; } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetCommandListAppendMarkerExp + __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 + ) + { + 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 ) + { + result = pfnAppendMarkerExp( hCommandList, hMetricGroup, value ); + } + else + { + // generic implementation + } + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetDeviceEnableMetricsExp + __zedlllocal ze_result_t ZE_APICALL + 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 pfnEnableMetricsExp = context.zetDdiTable.DeviceExp.pfnEnableMetricsExp; + if( nullptr != pfnEnableMetricsExp ) + { + result = pfnEnableMetricsExp( hDevice ); + } + else + { + // generic implementation + } + + 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; + + // 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 ) + { + result = pfnDisableMetricsExp( hDevice ); + } + else + { + // generic implementation + } + + return result; + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zetMetricGroupCalculateMultipleMetricValuesExp __zedlllocal ze_result_t ZE_APICALL @@ -2116,6 +2189,10 @@ zetGetDeviceExpProcAddrTable( pDdiTable->pfnCreateMetricGroupsFromMetricsExp = driver::zetDeviceCreateMetricGroupsFromMetricsExp; + pDdiTable->pfnEnableMetricsExp = driver::zetDeviceEnableMetricsExp; + + pDdiTable->pfnDisableMetricsExp = driver::zetDeviceDisableMetricsExp; + return result; } @@ -2179,6 +2256,33 @@ zetGetCommandListProcAddrTable( return result; } +/////////////////////////////////////////////////////////////////////////////// +/// @brief Exported function for filling application's CommandListExp 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 +zetGetCommandListExpProcAddrTable( + ze_api_version_t version, ///< [in] API version requested + zet_command_list_exp_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers + ) +{ + if( nullptr == pDdiTable ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + if( driver::context.version < version ) + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + + ze_result_t result = ZE_RESULT_SUCCESS; + + pDdiTable->pfnAppendMarkerExp = driver::zetCommandListAppendMarkerExp; + + return result; +} + /////////////////////////////////////////////////////////////////////////////// /// @brief Exported function for filling application's Kernel table /// with current process' addresses diff --git a/source/layers/tracing/ze_tracing_cb_structs.h b/source/layers/tracing/ze_tracing_cb_structs.h index 5e6f6e74..c1c53b2d 100644 --- a/source/layers/tracing/ze_tracing_cb_structs.h +++ b/source/layers/tracing/ze_tracing_cb_structs.h @@ -30,6 +30,11 @@ typedef struct _zel_global_callbacks_t /// @brief Table of RTASBuilder callback functions pointers typedef struct _zel_rtas_builder_callbacks_t { + ze_pfnRTASBuilderCreateExtCb_t pfnCreateExtCb; + ze_pfnRTASBuilderGetBuildPropertiesExtCb_t pfnGetBuildPropertiesExtCb; + ze_pfnRTASBuilderBuildExtCb_t pfnBuildExtCb; + ze_pfnRTASBuilderCommandListAppendCopyExtCb_t pfnCommandListAppendCopyExtCb; + ze_pfnRTASBuilderDestroyExtCb_t pfnDestroyExtCb; ze_pfnRTASBuilderCreateExpCb_t pfnCreateExpCb; ze_pfnRTASBuilderGetBuildPropertiesExpCb_t pfnGetBuildPropertiesExpCb; ze_pfnRTASBuilderBuildExpCb_t pfnBuildExpCb; @@ -40,6 +45,10 @@ typedef struct _zel_rtas_builder_callbacks_t /// @brief Table of RTASParallelOperation callback functions pointers typedef struct _zel_rtas_parallel_operation_callbacks_t { + ze_pfnRTASParallelOperationCreateExtCb_t pfnCreateExtCb; + ze_pfnRTASParallelOperationGetPropertiesExtCb_t pfnGetPropertiesExtCb; + ze_pfnRTASParallelOperationJoinExtCb_t pfnJoinExtCb; + ze_pfnRTASParallelOperationDestroyExtCb_t pfnDestroyExtCb; ze_pfnRTASParallelOperationCreateExpCb_t pfnCreateExpCb; ze_pfnRTASParallelOperationGetPropertiesExpCb_t pfnGetPropertiesExpCb; ze_pfnRTASParallelOperationJoinExpCb_t pfnJoinExpCb; @@ -56,6 +65,7 @@ typedef struct _zel_driver_callbacks_t ze_pfnDriverGetIpcPropertiesCb_t pfnGetIpcPropertiesCb; ze_pfnDriverGetExtensionPropertiesCb_t pfnGetExtensionPropertiesCb; ze_pfnDriverGetExtensionFunctionAddressCb_t pfnGetExtensionFunctionAddressCb; + ze_pfnDriverRTASFormatCompatibilityCheckExtCb_t pfnRTASFormatCompatibilityCheckExtCb; ze_pfnDriverGetLastErrorDescriptionCb_t pfnGetLastErrorDescriptionCb; ze_pfnDriverRTASFormatCompatibilityCheckExpCb_t pfnRTASFormatCompatibilityCheckExpCb; } zel_driver_callbacks_t; @@ -81,6 +91,7 @@ typedef struct _zel_device_callbacks_t ze_pfnDeviceGetGlobalTimestampsCb_t pfnGetGlobalTimestampsCb; ze_pfnDeviceImportExternalSemaphoreExtCb_t pfnImportExternalSemaphoreExtCb; ze_pfnDeviceReleaseExternalSemaphoreExtCb_t pfnReleaseExternalSemaphoreExtCb; + ze_pfnDeviceGetVectorWidthPropertiesExtCb_t pfnGetVectorWidthPropertiesExtCb; ze_pfnDeviceReserveCacheExtCb_t pfnReserveCacheExtCb; ze_pfnDeviceSetCacheAdviceExtCb_t pfnSetCacheAdviceExtCb; ze_pfnDevicePciGetPropertiesExtCb_t pfnPciGetPropertiesExtCb; diff --git a/source/layers/tracing/ze_tracing_register_cb.cpp b/source/layers/tracing/ze_tracing_register_cb.cpp index bf2379a0..79d8a7e6 100644 --- a/source/layers/tracing/ze_tracing_register_cb.cpp +++ b/source/layers/tracing/ze_tracing_register_cb.cpp @@ -2435,6 +2435,182 @@ zelTracerCommandListAppendWaitExternalSemaphoreExtRegisterCallback( } +ZE_DLLEXPORT ze_result_t ZE_APICALL +zelTracerRTASBuilderCreateExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnRTASBuilderCreateExtCb_t pfnCreateExtCb + ) { + + ze_result_t result; + auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getProEpilogues(callback_type, result); + if (result == ZE_RESULT_SUCCESS) + cbs.RTASBuilder.pfnCreateExtCb = pfnCreateExtCb; + + return result; +} + + +ZE_DLLEXPORT ze_result_t ZE_APICALL +zelTracerRTASBuilderGetBuildPropertiesExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnRTASBuilderGetBuildPropertiesExtCb_t pfnGetBuildPropertiesExtCb + ) { + + ze_result_t result; + auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getProEpilogues(callback_type, result); + if (result == ZE_RESULT_SUCCESS) + cbs.RTASBuilder.pfnGetBuildPropertiesExtCb = pfnGetBuildPropertiesExtCb; + + return result; +} + + +ZE_DLLEXPORT ze_result_t ZE_APICALL +zelTracerDriverRTASFormatCompatibilityCheckExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnDriverRTASFormatCompatibilityCheckExtCb_t pfnRTASFormatCompatibilityCheckExtCb + ) { + + ze_result_t result; + auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getProEpilogues(callback_type, result); + if (result == ZE_RESULT_SUCCESS) + cbs.Driver.pfnRTASFormatCompatibilityCheckExtCb = pfnRTASFormatCompatibilityCheckExtCb; + + return result; +} + + +ZE_DLLEXPORT ze_result_t ZE_APICALL +zelTracerRTASBuilderBuildExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnRTASBuilderBuildExtCb_t pfnBuildExtCb + ) { + + ze_result_t result; + auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getProEpilogues(callback_type, result); + if (result == ZE_RESULT_SUCCESS) + cbs.RTASBuilder.pfnBuildExtCb = pfnBuildExtCb; + + return result; +} + + +ZE_DLLEXPORT ze_result_t ZE_APICALL +zelTracerRTASBuilderCommandListAppendCopyExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnRTASBuilderCommandListAppendCopyExtCb_t pfnCommandListAppendCopyExtCb + ) { + + ze_result_t result; + auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getProEpilogues(callback_type, result); + if (result == ZE_RESULT_SUCCESS) + cbs.RTASBuilder.pfnCommandListAppendCopyExtCb = pfnCommandListAppendCopyExtCb; + + return result; +} + + +ZE_DLLEXPORT ze_result_t ZE_APICALL +zelTracerRTASBuilderDestroyExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnRTASBuilderDestroyExtCb_t pfnDestroyExtCb + ) { + + ze_result_t result; + auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getProEpilogues(callback_type, result); + if (result == ZE_RESULT_SUCCESS) + cbs.RTASBuilder.pfnDestroyExtCb = pfnDestroyExtCb; + + return result; +} + + +ZE_DLLEXPORT ze_result_t ZE_APICALL +zelTracerRTASParallelOperationCreateExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnRTASParallelOperationCreateExtCb_t pfnCreateExtCb + ) { + + ze_result_t result; + auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getProEpilogues(callback_type, result); + if (result == ZE_RESULT_SUCCESS) + cbs.RTASParallelOperation.pfnCreateExtCb = pfnCreateExtCb; + + return result; +} + + +ZE_DLLEXPORT ze_result_t ZE_APICALL +zelTracerRTASParallelOperationGetPropertiesExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnRTASParallelOperationGetPropertiesExtCb_t pfnGetPropertiesExtCb + ) { + + ze_result_t result; + auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getProEpilogues(callback_type, result); + if (result == ZE_RESULT_SUCCESS) + cbs.RTASParallelOperation.pfnGetPropertiesExtCb = pfnGetPropertiesExtCb; + + return result; +} + + +ZE_DLLEXPORT ze_result_t ZE_APICALL +zelTracerRTASParallelOperationJoinExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnRTASParallelOperationJoinExtCb_t pfnJoinExtCb + ) { + + ze_result_t result; + auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getProEpilogues(callback_type, result); + if (result == ZE_RESULT_SUCCESS) + cbs.RTASParallelOperation.pfnJoinExtCb = pfnJoinExtCb; + + return result; +} + + +ZE_DLLEXPORT ze_result_t ZE_APICALL +zelTracerRTASParallelOperationDestroyExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnRTASParallelOperationDestroyExtCb_t pfnDestroyExtCb + ) { + + ze_result_t result; + auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getProEpilogues(callback_type, result); + if (result == ZE_RESULT_SUCCESS) + cbs.RTASParallelOperation.pfnDestroyExtCb = pfnDestroyExtCb; + + return result; +} + + +ZE_DLLEXPORT ze_result_t ZE_APICALL +zelTracerDeviceGetVectorWidthPropertiesExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnDeviceGetVectorWidthPropertiesExtCb_t pfnGetVectorWidthPropertiesExtCb + ) { + + ze_result_t result; + auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getProEpilogues(callback_type, result); + if (result == ZE_RESULT_SUCCESS) + cbs.Device.pfnGetVectorWidthPropertiesExtCb = pfnGetVectorWidthPropertiesExtCb; + + return result; +} + + ZE_DLLEXPORT ze_result_t ZE_APICALL zelTracerDeviceReserveCacheExtRegisterCallback( zel_tracer_handle_t hTracer, diff --git a/source/layers/tracing/ze_trcddi.cpp b/source/layers/tracing/ze_trcddi.cpp index 53447bc0..3f8e2cac 100644 --- a/source/layers/tracing/ze_trcddi.cpp +++ b/source/layers/tracing/ze_trcddi.cpp @@ -4830,10 +4830,14 @@ namespace tracing_layer 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. + ///< 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. ) { auto pfnGetSourceAttributes = context.zeDdiTable.Kernel.pfnGetSourceAttributes; @@ -6041,6 +6045,447 @@ namespace tracing_layer *tracerParams.pphWaitEvents); } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASBuilderCreateExt + __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 + ) + { + auto pfnCreateExt = context.zeDdiTable.RTASBuilder.pfnCreateExt; + + if( nullptr == pfnCreateExt) + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.RTASBuilder.pfnCreateExt, hDriver, pDescriptor, phBuilder); + + // capture parameters + ze_rtas_builder_create_ext_params_t tracerParams = { + &hDriver, + &pDescriptor, + &phBuilder + }; + + tracing_layer::APITracerCallbackDataImp apiCallbackData; + + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnRTASBuilderCreateExtCb_t, RTASBuilder, pfnCreateExtCb); + + + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.RTASBuilder.pfnCreateExt, + &tracerParams, + apiCallbackData.apiOrdinal, + apiCallbackData.prologCallbacks, + apiCallbackData.epilogCallbacks, + *tracerParams.phDriver, + *tracerParams.ppDescriptor, + *tracerParams.pphBuilder); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASBuilderGetBuildPropertiesExt + __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 + ) + { + auto pfnGetBuildPropertiesExt = context.zeDdiTable.RTASBuilder.pfnGetBuildPropertiesExt; + + if( nullptr == pfnGetBuildPropertiesExt) + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.RTASBuilder.pfnGetBuildPropertiesExt, hBuilder, pBuildOpDescriptor, pProperties); + + // capture parameters + ze_rtas_builder_get_build_properties_ext_params_t tracerParams = { + &hBuilder, + &pBuildOpDescriptor, + &pProperties + }; + + tracing_layer::APITracerCallbackDataImp apiCallbackData; + + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnRTASBuilderGetBuildPropertiesExtCb_t, RTASBuilder, pfnGetBuildPropertiesExtCb); + + + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.RTASBuilder.pfnGetBuildPropertiesExt, + &tracerParams, + apiCallbackData.apiOrdinal, + apiCallbackData.prologCallbacks, + apiCallbackData.epilogCallbacks, + *tracerParams.phBuilder, + *tracerParams.ppBuildOpDescriptor, + *tracerParams.ppProperties); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @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 + ) + { + auto pfnRTASFormatCompatibilityCheckExt = context.zeDdiTable.Driver.pfnRTASFormatCompatibilityCheckExt; + + if( nullptr == pfnRTASFormatCompatibilityCheckExt) + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.Driver.pfnRTASFormatCompatibilityCheckExt, hDriver, rtasFormatA, rtasFormatB); + + // capture parameters + ze_driver_rtas_format_compatibility_check_ext_params_t tracerParams = { + &hDriver, + &rtasFormatA, + &rtasFormatB + }; + + tracing_layer::APITracerCallbackDataImp apiCallbackData; + + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnDriverRTASFormatCompatibilityCheckExtCb_t, Driver, pfnRTASFormatCompatibilityCheckExtCb); + + + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.Driver.pfnRTASFormatCompatibilityCheckExt, + &tracerParams, + apiCallbackData.apiOrdinal, + apiCallbackData.prologCallbacks, + apiCallbackData.epilogCallbacks, + *tracerParams.phDriver, + *tracerParams.prtasFormatA, + *tracerParams.prtasFormatB); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASBuilderBuildExt + __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 + ) + { + auto pfnBuildExt = context.zeDdiTable.RTASBuilder.pfnBuildExt; + + if( nullptr == pfnBuildExt) + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.RTASBuilder.pfnBuildExt, hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes); + + // capture parameters + ze_rtas_builder_build_ext_params_t tracerParams = { + &hBuilder, + &pBuildOpDescriptor, + &pScratchBuffer, + &scratchBufferSizeBytes, + &pRtasBuffer, + &rtasBufferSizeBytes, + &hParallelOperation, + &pBuildUserPtr, + &pBounds, + &pRtasBufferSizeBytes + }; + + tracing_layer::APITracerCallbackDataImp apiCallbackData; + + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnRTASBuilderBuildExtCb_t, RTASBuilder, pfnBuildExtCb); + + + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.RTASBuilder.pfnBuildExt, + &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); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASBuilderCommandListAppendCopyExt + __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 + ) + { + auto pfnCommandListAppendCopyExt = context.zeDdiTable.RTASBuilder.pfnCommandListAppendCopyExt; + + if( nullptr == pfnCommandListAppendCopyExt) + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.RTASBuilder.pfnCommandListAppendCopyExt, hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents); + + // capture parameters + ze_rtas_builder_command_list_append_copy_ext_params_t tracerParams = { + &hCommandList, + &dstptr, + &srcptr, + &size, + &hSignalEvent, + &numWaitEvents, + &phWaitEvents + }; + + tracing_layer::APITracerCallbackDataImp apiCallbackData; + + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnRTASBuilderCommandListAppendCopyExtCb_t, RTASBuilder, pfnCommandListAppendCopyExtCb); + + + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.RTASBuilder.pfnCommandListAppendCopyExt, + &tracerParams, + apiCallbackData.apiOrdinal, + apiCallbackData.prologCallbacks, + apiCallbackData.epilogCallbacks, + *tracerParams.phCommandList, + *tracerParams.pdstptr, + *tracerParams.psrcptr, + *tracerParams.psize, + *tracerParams.phSignalEvent, + *tracerParams.pnumWaitEvents, + *tracerParams.pphWaitEvents); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASBuilderDestroyExt + __zedlllocal ze_result_t ZE_APICALL + zeRTASBuilderDestroyExt( + ze_rtas_builder_ext_handle_t hBuilder ///< [in][release] handle of builder object to destroy + ) + { + auto pfnDestroyExt = context.zeDdiTable.RTASBuilder.pfnDestroyExt; + + if( nullptr == pfnDestroyExt) + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.RTASBuilder.pfnDestroyExt, hBuilder); + + // capture parameters + ze_rtas_builder_destroy_ext_params_t tracerParams = { + &hBuilder + }; + + tracing_layer::APITracerCallbackDataImp apiCallbackData; + + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnRTASBuilderDestroyExtCb_t, RTASBuilder, pfnDestroyExtCb); + + + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.RTASBuilder.pfnDestroyExt, + &tracerParams, + apiCallbackData.apiOrdinal, + apiCallbackData.prologCallbacks, + apiCallbackData.epilogCallbacks, + *tracerParams.phBuilder); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @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 + ) + { + auto pfnCreateExt = context.zeDdiTable.RTASParallelOperation.pfnCreateExt; + + if( nullptr == pfnCreateExt) + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.RTASParallelOperation.pfnCreateExt, hDriver, phParallelOperation); + + // capture parameters + ze_rtas_parallel_operation_create_ext_params_t tracerParams = { + &hDriver, + &phParallelOperation + }; + + 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 pfnGetPropertiesExt = context.zeDdiTable.RTASParallelOperation.pfnGetPropertiesExt; + + if( nullptr == pfnGetPropertiesExt) + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.RTASParallelOperation.pfnGetPropertiesExt, hParallelOperation, pProperties); + + // capture parameters + ze_rtas_parallel_operation_get_properties_ext_params_t tracerParams = { + &hParallelOperation, + &pProperties + }; + + tracing_layer::APITracerCallbackDataImp apiCallbackData; + + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnRTASParallelOperationGetPropertiesExtCb_t, RTASParallelOperation, pfnGetPropertiesExtCb); + + + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.RTASParallelOperation.pfnGetPropertiesExt, + &tracerParams, + apiCallbackData.apiOrdinal, + apiCallbackData.prologCallbacks, + apiCallbackData.epilogCallbacks, + *tracerParams.phParallelOperation, + *tracerParams.ppProperties); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASParallelOperationJoinExt + __zedlllocal ze_result_t ZE_APICALL + zeRTASParallelOperationJoinExt( + ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in] handle of parallel operation object + ) + { + auto pfnJoinExt = context.zeDdiTable.RTASParallelOperation.pfnJoinExt; + + if( nullptr == pfnJoinExt) + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.RTASParallelOperation.pfnJoinExt, hParallelOperation); + + // capture parameters + ze_rtas_parallel_operation_join_ext_params_t tracerParams = { + &hParallelOperation + }; + + tracing_layer::APITracerCallbackDataImp apiCallbackData; + + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnRTASParallelOperationJoinExtCb_t, RTASParallelOperation, pfnJoinExtCb); + + + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.RTASParallelOperation.pfnJoinExt, + &tracerParams, + apiCallbackData.apiOrdinal, + apiCallbackData.prologCallbacks, + apiCallbackData.epilogCallbacks, + *tracerParams.phParallelOperation); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASParallelOperationDestroyExt + __zedlllocal ze_result_t ZE_APICALL + zeRTASParallelOperationDestroyExt( + ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in][release] handle of parallel operation object to destroy + ) + { + auto pfnDestroyExt = context.zeDdiTable.RTASParallelOperation.pfnDestroyExt; + + if( nullptr == pfnDestroyExt) + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.RTASParallelOperation.pfnDestroyExt, hParallelOperation); + + // capture parameters + ze_rtas_parallel_operation_destroy_ext_params_t tracerParams = { + &hParallelOperation + }; + + tracing_layer::APITracerCallbackDataImp apiCallbackData; + + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnRTASParallelOperationDestroyExtCb_t, RTASParallelOperation, pfnDestroyExtCb); + + + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.RTASParallelOperation.pfnDestroyExt, + &tracerParams, + apiCallbackData.apiOrdinal, + apiCallbackData.prologCallbacks, + apiCallbackData.epilogCallbacks, + *tracerParams.phParallelOperation); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeDeviceGetVectorWidthPropertiesExt + __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. + ) + { + auto pfnGetVectorWidthPropertiesExt = context.zeDdiTable.Device.pfnGetVectorWidthPropertiesExt; + + if( nullptr == pfnGetVectorWidthPropertiesExt) + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.Device.pfnGetVectorWidthPropertiesExt, hDevice, pCount, pVectorWidthProperties); + + // capture parameters + ze_device_get_vector_width_properties_ext_params_t tracerParams = { + &hDevice, + &pCount, + &pVectorWidthProperties + }; + + tracing_layer::APITracerCallbackDataImp apiCallbackData; + + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnDeviceGetVectorWidthPropertiesExtCb_t, Device, pfnGetVectorWidthPropertiesExtCb); + + + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.Device.pfnGetVectorWidthPropertiesExt, + &tracerParams, + apiCallbackData.apiOrdinal, + apiCallbackData.prologCallbacks, + apiCallbackData.epilogCallbacks, + *tracerParams.phDevice, + *tracerParams.ppCount, + *tracerParams.ppVectorWidthProperties); + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zeDeviceReserveCacheExt __zedlllocal ze_result_t ZE_APICALL @@ -7767,6 +8212,53 @@ zeGetGlobalProcAddrTable( return result; } +/////////////////////////////////////////////////////////////////////////////// +/// @brief Exported function for filling application's RTASBuilder 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 +zeGetRTASBuilderProcAddrTable( + ze_api_version_t version, ///< [in] API version requested + ze_rtas_builder_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers + ) +{ + auto& dditable = tracing_layer::context.zeDdiTable.RTASBuilder; + + 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_13) { + dditable.pfnCreateExt = pDdiTable->pfnCreateExt; + pDdiTable->pfnCreateExt = tracing_layer::zeRTASBuilderCreateExt; + } + if (version >= ZE_API_VERSION_1_13) { + dditable.pfnGetBuildPropertiesExt = pDdiTable->pfnGetBuildPropertiesExt; + pDdiTable->pfnGetBuildPropertiesExt = tracing_layer::zeRTASBuilderGetBuildPropertiesExt; + } + if (version >= ZE_API_VERSION_1_13) { + dditable.pfnBuildExt = pDdiTable->pfnBuildExt; + pDdiTable->pfnBuildExt = tracing_layer::zeRTASBuilderBuildExt; + } + if (version >= ZE_API_VERSION_1_13) { + dditable.pfnCommandListAppendCopyExt = pDdiTable->pfnCommandListAppendCopyExt; + pDdiTable->pfnCommandListAppendCopyExt = tracing_layer::zeRTASBuilderCommandListAppendCopyExt; + } + if (version >= ZE_API_VERSION_1_13) { + dditable.pfnDestroyExt = pDdiTable->pfnDestroyExt; + pDdiTable->pfnDestroyExt = tracing_layer::zeRTASBuilderDestroyExt; + } + return result; +} + /////////////////////////////////////////////////////////////////////////////// /// @brief Exported function for filling application's RTASBuilderExp table /// with current process' addresses @@ -7810,6 +8302,49 @@ zeGetRTASBuilderExpProcAddrTable( return result; } +/////////////////////////////////////////////////////////////////////////////// +/// @brief Exported function for filling application's RTASParallelOperation 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 +zeGetRTASParallelOperationProcAddrTable( + ze_api_version_t version, ///< [in] API version requested + ze_rtas_parallel_operation_dditable_t* pDdiTable///< [in,out] pointer to table of DDI function pointers + ) +{ + auto& dditable = tracing_layer::context.zeDdiTable.RTASParallelOperation; + + 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_13) { + dditable.pfnCreateExt = pDdiTable->pfnCreateExt; + pDdiTable->pfnCreateExt = tracing_layer::zeRTASParallelOperationCreateExt; + } + if (version >= ZE_API_VERSION_1_13) { + dditable.pfnGetPropertiesExt = pDdiTable->pfnGetPropertiesExt; + pDdiTable->pfnGetPropertiesExt = tracing_layer::zeRTASParallelOperationGetPropertiesExt; + } + if (version >= ZE_API_VERSION_1_13) { + dditable.pfnJoinExt = pDdiTable->pfnJoinExt; + pDdiTable->pfnJoinExt = tracing_layer::zeRTASParallelOperationJoinExt; + } + if (version >= ZE_API_VERSION_1_13) { + dditable.pfnDestroyExt = pDdiTable->pfnDestroyExt; + pDdiTable->pfnDestroyExt = tracing_layer::zeRTASParallelOperationDestroyExt; + } + return result; +} + /////////////////////////////////////////////////////////////////////////////// /// @brief Exported function for filling application's RTASParallelOperationExp table /// with current process' addresses @@ -7901,6 +8436,10 @@ zeGetDriverProcAddrTable( dditable.pfnGetExtensionFunctionAddress = pDdiTable->pfnGetExtensionFunctionAddress; pDdiTable->pfnGetExtensionFunctionAddress = tracing_layer::zeDriverGetExtensionFunctionAddress; } + if (version >= ZE_API_VERSION_1_13) { + dditable.pfnRTASFormatCompatibilityCheckExt = pDdiTable->pfnRTASFormatCompatibilityCheckExt; + pDdiTable->pfnRTASFormatCompatibilityCheckExt = tracing_layer::zeDriverRTASFormatCompatibilityCheckExt; + } if (version >= ZE_API_VERSION_1_6) { dditable.pfnGetLastErrorDescription = pDdiTable->pfnGetLastErrorDescription; pDdiTable->pfnGetLastErrorDescription = tracing_layer::zeDriverGetLastErrorDescription; @@ -8031,6 +8570,10 @@ zeGetDeviceProcAddrTable( dditable.pfnReleaseExternalSemaphoreExt = pDdiTable->pfnReleaseExternalSemaphoreExt; pDdiTable->pfnReleaseExternalSemaphoreExt = tracing_layer::zeDeviceReleaseExternalSemaphoreExt; } + if (version >= ZE_API_VERSION_1_13) { + dditable.pfnGetVectorWidthPropertiesExt = pDdiTable->pfnGetVectorWidthPropertiesExt; + pDdiTable->pfnGetVectorWidthPropertiesExt = tracing_layer::zeDeviceGetVectorWidthPropertiesExt; + } if (version >= ZE_API_VERSION_1_2) { dditable.pfnReserveCacheExt = pDdiTable->pfnReserveCacheExt; pDdiTable->pfnReserveCacheExt = tracing_layer::zeDeviceReserveCacheExt; diff --git a/source/layers/validation/checkers/parameter_validation/extension_validation.inl b/source/layers/validation/checkers/parameter_validation/extension_validation.inl index c7de1238..951617a8 100644 --- a/source/layers/validation/checkers/parameter_validation/extension_validation.inl +++ b/source/layers/validation/checkers/parameter_validation/extension_validation.inl @@ -146,7 +146,7 @@ inline ze_result_t ParameterValidation::validateExtensions(const ze_device_cache } std::vector baseTypes = {ZE_STRUCTURE_TYPE_DEVICE_CACHE_PROPERTIES}; - std::vector types = {ZE_STRUCTURE_TYPE_CACHE_RESERVATION_EXT_DESC}; + std::vector types = {ZE_STRUCTURE_TYPE_CACHE_RESERVATION_EXT_DESC,ZE_STRUCTURE_TYPE_DEVICE_CACHELINE_SIZE_EXT}; return validateStructureTypes(descriptor, baseTypes, types); } 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 d51c6b3f..44687fd9 100644 --- a/source/layers/validation/checkers/parameter_validation/ze_parameter_validation.cpp +++ b/source/layers/validation/checkers/parameter_validation/ze_parameter_validation.cpp @@ -2497,10 +2497,14 @@ namespace validation_layer 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. + ///< 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. ) { if( nullptr == hKernel ) @@ -3171,6 +3175,248 @@ namespace validation_layer } + 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 + ) + { + if( nullptr == hDriver ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + if( nullptr == pDescriptor ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + if( nullptr == phBuilder ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + if( ZE_RTAS_BUILDER_EXT_VERSION_CURRENT < pDescriptor->builderVersion ) + return ZE_RESULT_ERROR_INVALID_ENUMERATION; + + return ParameterValidation::validateExtensions(pDescriptor); + } + + + 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 + ) + { + if( nullptr == hBuilder ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + if( nullptr == pBuildOpDescriptor ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + if( nullptr == pProperties ) + 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; + + auto retVal = ZE_RESULT_SUCCESS; + retVal = ParameterValidation::validateExtensions(pBuildOpDescriptor); + if(retVal) + return retVal; + retVal = ParameterValidation::validateExtensions(pProperties); + return retVal; + } + + + 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 + ) + { + if( nullptr == hDriver ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + if( ZE_RTAS_FORMAT_EXT_MAX < rtasFormatA ) + return ZE_RESULT_ERROR_INVALID_ENUMERATION; + + if( ZE_RTAS_FORMAT_EXT_MAX < rtasFormatB ) + return ZE_RESULT_ERROR_INVALID_ENUMERATION; + + return ZE_RESULT_SUCCESS; + } + + + 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 + ) + { + if( nullptr == hBuilder ) + 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 ) + 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); + } + + + ze_result_t + 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::zeDeviceReserveCacheExtPrologue( ze_device_handle_t hDevice, ///< [in] handle of the device object @@ -3723,7 +3969,7 @@ namespace validation_layer if( nullptr == pProperties ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if( ZE_RTAS_FORMAT_EXP_INVALID < pBuildOpDescriptor->rtasFormat ) + if( ZE_RTAS_FORMAT_EXP_MAX < pBuildOpDescriptor->rtasFormat ) return ZE_RESULT_ERROR_INVALID_ENUMERATION; if( ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_HIGH < pBuildOpDescriptor->buildQuality ) @@ -3751,10 +3997,10 @@ namespace validation_layer if( nullptr == hDriver ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - if( ZE_RTAS_FORMAT_EXP_INVALID < rtasFormatA ) + if( ZE_RTAS_FORMAT_EXP_MAX < rtasFormatA ) return ZE_RESULT_ERROR_INVALID_ENUMERATION; - if( ZE_RTAS_FORMAT_EXP_INVALID < rtasFormatB ) + if( ZE_RTAS_FORMAT_EXP_MAX < rtasFormatB ) return ZE_RESULT_ERROR_INVALID_ENUMERATION; return ZE_RESULT_SUCCESS; @@ -3790,7 +4036,7 @@ namespace validation_layer if( nullptr == pRtasBuffer ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if( ZE_RTAS_FORMAT_EXP_INVALID < pBuildOpDescriptor->rtasFormat ) + if( ZE_RTAS_FORMAT_EXP_MAX < pBuildOpDescriptor->rtasFormat ) return ZE_RESULT_ERROR_INVALID_ENUMERATION; if( ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_HIGH < pBuildOpDescriptor->buildQuality ) 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 a22a25ff..eb6a4069 100644 --- a/source/layers/validation/checkers/parameter_validation/ze_parameter_validation.h +++ b/source/layers/validation/checkers/parameter_validation/ze_parameter_validation.h @@ -171,6 +171,17 @@ namespace validation_layer 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 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; 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 2f5468d1..c8a3bda3 100644 --- a/source/layers/validation/checkers/parameter_validation/zet_parameter_validation.cpp +++ b/source/layers/validation/checkers/parameter_validation/zet_parameter_validation.cpp @@ -259,8 +259,8 @@ namespace validation_layer ///< than the `count` member of ::zet_debug_regset_properties_t for the ///< type uint32_t count, ///< [in] the number of registers to read; start+count must be less than or - ///< equal to the `count` member of ::zet_debug_register_group_properties_t - ///< for the type + ///< equal to the `count` member of ::zet_debug_regset_properties_t for the + ///< type void* pRegisterValues ///< [in,out][optional][range(0, count)] buffer of register values ) { @@ -280,8 +280,8 @@ namespace validation_layer ///< than the `count` member of ::zet_debug_regset_properties_t for the ///< type uint32_t count, ///< [in] the number of registers to write; start+count must be less than - ///< or equal to the `count` member of - ///< ::zet_debug_register_group_properties_t for the type + ///< or equal to the `count` member of ::zet_debug_regset_properties_t for + ///< the type void* pRegisterValues ///< [in,out][optional][range(0, count)] buffer of register values ) { @@ -1014,6 +1014,49 @@ namespace validation_layer } + 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 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 4a2d24bc..eb141301 100644 --- a/source/layers/validation/checkers/parameter_validation/zet_parameter_validation.h +++ b/source/layers/validation/checkers/parameter_validation/zet_parameter_validation.h @@ -69,6 +69,9 @@ namespace validation_layer 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; diff --git a/source/layers/validation/common/ze_entry_points.h b/source/layers/validation/common/ze_entry_points.h index c96c1ec5..971500c9 100644 --- a/source/layers/validation/common/ze_entry_points.h +++ b/source/layers/validation/common/ze_entry_points.h @@ -319,6 +319,28 @@ class ZEValidationEntryPoints { 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 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;} diff --git a/source/layers/validation/common/zet_entry_points.h b/source/layers/validation/common/zet_entry_points.h index e5c541af..d52be228 100644 --- a/source/layers/validation/common/zet_entry_points.h +++ b/source/layers/validation/common/zet_entry_points.h @@ -115,6 +115,12 @@ class ZETValidationEntryPoints { 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;} 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 b892b6c0..fe36fcb3 100644 --- a/source/layers/validation/handle_lifetime_tracking/ze_handle_lifetime.cpp +++ b/source/layers/validation/handle_lifetime_tracking/ze_handle_lifetime.cpp @@ -2032,10 +2032,14 @@ namespace validation_layer 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. + ///< 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. ) { @@ -2606,6 +2610,180 @@ namespace validation_layer 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 + ) + { + + if ( !context.handleLifetime->isHandleValid( hDriver )){ + 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 + ) + { + + if ( !context.handleLifetime->isHandleValid( hBuilder )){ + 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 + ) + { + + if ( !context.handleLifetime->isHandleValid( hDriver )){ + 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 + ) + { + + if ( !context.handleLifetime->isHandleValid( hBuilder )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + if (hParallelOperation && !context.handleLifetime->isHandleValid( hParallelOperation )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + return ZE_RESULT_SUCCESS; + } + ze_result_t + 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( 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::zeRTASBuilderDestroyExtPrologue( + ze_rtas_builder_ext_handle_t hBuilder ///< [in][release] handle of builder object to destroy + ) + { + + if ( !context.handleLifetime->isHandleValid( hBuilder )){ + 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 + ) + { + + if ( !context.handleLifetime->isHandleValid( hDriver )){ + 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 + ) + { + + if ( !context.handleLifetime->isHandleValid( hParallelOperation )){ + 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 + ) + { + + if ( !context.handleLifetime->isHandleValid( hParallelOperation )){ + 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::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 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 5b598b0d..66bf76cc 100644 --- a/source/layers/validation/handle_lifetime_tracking/ze_handle_lifetime.h +++ b/source/layers/validation/handle_lifetime_tracking/ze_handle_lifetime.h @@ -167,6 +167,17 @@ namespace validation_layer 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 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; 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 bf4b9837..d9c92c00 100644 --- a/source/layers/validation/handle_lifetime_tracking/zet_handle_lifetime.cpp +++ b/source/layers/validation/handle_lifetime_tracking/zet_handle_lifetime.cpp @@ -201,8 +201,8 @@ namespace validation_layer ///< than the `count` member of ::zet_debug_regset_properties_t for the ///< type uint32_t count, ///< [in] the number of registers to read; start+count must be less than or - ///< equal to the `count` member of ::zet_debug_register_group_properties_t - ///< for the type + ///< equal to the `count` member of ::zet_debug_regset_properties_t for the + ///< type void* pRegisterValues ///< [in,out][optional][range(0, count)] buffer of register values ) { @@ -221,8 +221,8 @@ namespace validation_layer ///< than the `count` member of ::zet_debug_regset_properties_t for the ///< type uint32_t count, ///< [in] the number of registers to write; start+count must be less than - ///< or equal to the `count` member of - ///< ::zet_debug_register_group_properties_t for the type + ///< or equal to the `count` member of ::zet_debug_regset_properties_t for + ///< the type void* pRegisterValues ///< [in,out][optional][range(0, count)] buffer of register values ) { @@ -869,6 +869,49 @@ namespace validation_layer 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 + ) + { + + 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 )){ + 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. + ) + { + + if ( !context.handleLifetime->isHandleValid( hDevice )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + 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 + ) + { + + if ( !context.handleLifetime->isHandleValid( hDevice )){ + 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 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 bb3b6ea3..8729e8dc 100644 --- a/source/layers/validation/handle_lifetime_tracking/zet_handle_lifetime.h +++ b/source/layers/validation/handle_lifetime_tracking/zet_handle_lifetime.h @@ -68,6 +68,9 @@ namespace validation_layer 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; diff --git a/source/layers/validation/ze_valddi.cpp b/source/layers/validation/ze_valddi.cpp index 6a36d69e..45baa430 100644 --- a/source/layers/validation/ze_valddi.cpp +++ b/source/layers/validation/ze_valddi.cpp @@ -5589,10 +5589,14 @@ namespace validation_layer 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. + ///< 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("zeKernelGetSourceAttributes(hKernel, pSize, pString)"); @@ -6911,6 +6915,514 @@ namespace validation_layer return logAndPropagateResult("zeCommandListAppendWaitExternalSemaphoreExt", driver_result); } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASBuilderCreateExt + __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 + ) + { + context.logger->log_trace("zeRTASBuilderCreateExt(hDriver, pDescriptor, phBuilder)"); + + auto pfnCreateExt = context.zeDdiTable.RTASBuilder.pfnCreateExt; + + if( nullptr == pfnCreateExt ) + return logAndPropagateResult("zeRTASBuilderCreateExt", ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); + + 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); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zeHandleLifetime.zeRTASBuilderCreateExtPrologue( hDriver, pDescriptor, phBuilder ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult("zeRTASBuilderCreateExt", result); + } + + auto driver_result = pfnCreateExt( hDriver, pDescriptor, phBuilder ); + + 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); + } + + + if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ + + if (phBuilder){ + context.handleLifetime->addHandle( *phBuilder ); + context.handleLifetime->addDependent( hDriver, *phBuilder ); + + } + } + return logAndPropagateResult("zeRTASBuilderCreateExt", driver_result); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASBuilderGetBuildPropertiesExt + __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 + ) + { + context.logger->log_trace("zeRTASBuilderGetBuildPropertiesExt(hBuilder, pBuildOpDescriptor, pProperties)"); + + auto pfnGetBuildPropertiesExt = context.zeDdiTable.RTASBuilder.pfnGetBuildPropertiesExt; + + if( nullptr == pfnGetBuildPropertiesExt ) + return logAndPropagateResult("zeRTASBuilderGetBuildPropertiesExt", ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); + + 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); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zeHandleLifetime.zeRTASBuilderGetBuildPropertiesExtPrologue( hBuilder, pBuildOpDescriptor, pProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult("zeRTASBuilderGetBuildPropertiesExt", result); + } + + auto driver_result = pfnGetBuildPropertiesExt( hBuilder, pBuildOpDescriptor, pProperties ); + + 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); + } + + return logAndPropagateResult("zeRTASBuilderGetBuildPropertiesExt", driver_result); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @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("zeDriverRTASFormatCompatibilityCheckExt(hDriver, rtasFormatA, rtasFormatB)"); + + auto pfnRTASFormatCompatibilityCheckExt = context.zeDdiTable.Driver.pfnRTASFormatCompatibilityCheckExt; + + if( nullptr == pfnRTASFormatCompatibilityCheckExt ) + return logAndPropagateResult("zeDriverRTASFormatCompatibilityCheckExt", ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); + + 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); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zeHandleLifetime.zeDriverRTASFormatCompatibilityCheckExtPrologue( hDriver, rtasFormatA, rtasFormatB ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult("zeDriverRTASFormatCompatibilityCheckExt", result); + } + + auto driver_result = pfnRTASFormatCompatibilityCheckExt( hDriver, rtasFormatA, rtasFormatB ); + + 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); + } + + return logAndPropagateResult("zeDriverRTASFormatCompatibilityCheckExt", driver_result); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASBuilderBuildExt + __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 + ) + { + context.logger->log_trace("zeRTASBuilderBuildExt(hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes)"); + + auto pfnBuildExt = context.zeDdiTable.RTASBuilder.pfnBuildExt; + + if( nullptr == pfnBuildExt ) + return logAndPropagateResult("zeRTASBuilderBuildExt", ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); + + 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); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + 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); + } + + 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->zeRTASBuilderBuildExtEpilogue( hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult("zeRTASBuilderBuildExt", result); + } + + return logAndPropagateResult("zeRTASBuilderBuildExt", driver_result); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASBuilderCommandListAppendCopyExt + __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 + ) + { + context.logger->log_trace("zeRTASBuilderCommandListAppendCopyExt(hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEventsLocal)"); + + auto pfnCommandListAppendCopyExt = context.zeDdiTable.RTASBuilder.pfnCommandListAppendCopyExt; + + if( nullptr == pfnCommandListAppendCopyExt ) + return logAndPropagateResult("zeRTASBuilderCommandListAppendCopyExt", ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); + + 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); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + 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); + } + + 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); + } + + return logAndPropagateResult("zeRTASBuilderCommandListAppendCopyExt", driver_result); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASBuilderDestroyExt + __zedlllocal ze_result_t ZE_APICALL + zeRTASBuilderDestroyExt( + ze_rtas_builder_ext_handle_t hBuilder ///< [in][release] handle of builder object to destroy + ) + { + context.logger->log_trace("zeRTASBuilderDestroyExt(hBuilder)"); + + auto pfnDestroyExt = context.zeDdiTable.RTASBuilder.pfnDestroyExt; + + if( nullptr == pfnDestroyExt ) + return logAndPropagateResult("zeRTASBuilderDestroyExt", ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); + + 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); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zeHandleLifetime.zeRTASBuilderDestroyExtPrologue( hBuilder ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult("zeRTASBuilderDestroyExt", result); + } + + auto driver_result = pfnDestroyExt( hBuilder ); + + 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); + } + + return logAndPropagateResult("zeRTASBuilderDestroyExt", driver_result); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @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 + ) + { + context.logger->log_trace("zeRTASParallelOperationCreateExt(hDriver, phParallelOperation)"); + + auto pfnCreateExt = context.zeDdiTable.RTASParallelOperation.pfnCreateExt; + + if( nullptr == pfnCreateExt ) + return logAndPropagateResult("zeRTASParallelOperationCreateExt", ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); + + 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); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zeHandleLifetime.zeRTASParallelOperationCreateExtPrologue( hDriver, phParallelOperation ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult("zeRTASParallelOperationCreateExt", result); + } + + auto driver_result = pfnCreateExt( hDriver, phParallelOperation ); + + 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); + } + + + if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ + + if (phParallelOperation){ + context.handleLifetime->addHandle( *phParallelOperation ); + context.handleLifetime->addDependent( hDriver, *phParallelOperation ); + + } + } + return logAndPropagateResult("zeRTASParallelOperationCreateExt", driver_result); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @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("zeRTASParallelOperationGetPropertiesExt(hParallelOperation, pProperties)"); + + auto pfnGetPropertiesExt = context.zeDdiTable.RTASParallelOperation.pfnGetPropertiesExt; + + if( nullptr == pfnGetPropertiesExt ) + return logAndPropagateResult("zeRTASParallelOperationGetPropertiesExt", ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); + + 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); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zeHandleLifetime.zeRTASParallelOperationGetPropertiesExtPrologue( hParallelOperation, pProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult("zeRTASParallelOperationGetPropertiesExt", result); + } + + auto driver_result = pfnGetPropertiesExt( hParallelOperation, pProperties ); + + 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); + } + + return logAndPropagateResult("zeRTASParallelOperationGetPropertiesExt", driver_result); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASParallelOperationJoinExt + __zedlllocal ze_result_t ZE_APICALL + zeRTASParallelOperationJoinExt( + ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in] handle of parallel operation object + ) + { + context.logger->log_trace("zeRTASParallelOperationJoinExt(hParallelOperation)"); + + auto pfnJoinExt = context.zeDdiTable.RTASParallelOperation.pfnJoinExt; + + if( nullptr == pfnJoinExt ) + return logAndPropagateResult("zeRTASParallelOperationJoinExt", ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); + + 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); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zeHandleLifetime.zeRTASParallelOperationJoinExtPrologue( hParallelOperation ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult("zeRTASParallelOperationJoinExt", result); + } + + auto driver_result = pfnJoinExt( hParallelOperation ); + + 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); + } + + return logAndPropagateResult("zeRTASParallelOperationJoinExt", driver_result); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASParallelOperationDestroyExt + __zedlllocal ze_result_t ZE_APICALL + zeRTASParallelOperationDestroyExt( + ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in][release] handle of parallel operation object to destroy + ) + { + context.logger->log_trace("zeRTASParallelOperationDestroyExt(hParallelOperation)"); + + auto pfnDestroyExt = context.zeDdiTable.RTASParallelOperation.pfnDestroyExt; + + if( nullptr == pfnDestroyExt ) + return logAndPropagateResult("zeRTASParallelOperationDestroyExt", ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); + + 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); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zeHandleLifetime.zeRTASParallelOperationDestroyExtPrologue( hParallelOperation ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult("zeRTASParallelOperationDestroyExt", result); + } + + auto driver_result = pfnDestroyExt( hParallelOperation ); + + 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); + } + + return logAndPropagateResult("zeRTASParallelOperationDestroyExt", driver_result); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeDeviceGetVectorWidthPropertiesExt + __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. + ) + { + context.logger->log_trace("zeDeviceGetVectorWidthPropertiesExt(hDevice, pCount, pVectorWidthProperties)"); + + auto pfnGetVectorWidthPropertiesExt = context.zeDdiTable.Device.pfnGetVectorWidthPropertiesExt; + + if( nullptr == pfnGetVectorWidthPropertiesExt ) + return logAndPropagateResult("zeDeviceGetVectorWidthPropertiesExt", ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); + + 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); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zeHandleLifetime.zeDeviceGetVectorWidthPropertiesExtPrologue( hDevice, pCount, pVectorWidthProperties ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult("zeDeviceGetVectorWidthPropertiesExt", result); + } + + auto driver_result = pfnGetVectorWidthPropertiesExt( hDevice, pCount, pVectorWidthProperties ); + + 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); + } + + return logAndPropagateResult("zeDeviceGetVectorWidthPropertiesExt", driver_result); + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zeDeviceReserveCacheExt __zedlllocal ze_result_t ZE_APICALL @@ -8941,6 +9453,53 @@ zeGetGlobalProcAddrTable( return result; } +/////////////////////////////////////////////////////////////////////////////// +/// @brief Exported function for filling application's RTASBuilder 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 +zeGetRTASBuilderProcAddrTable( + ze_api_version_t version, ///< [in] API version requested + ze_rtas_builder_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers + ) +{ + auto& dditable = validation_layer::context.zeDdiTable.RTASBuilder; + + 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_13) { + dditable.pfnCreateExt = pDdiTable->pfnCreateExt; + pDdiTable->pfnCreateExt = validation_layer::zeRTASBuilderCreateExt; + } + if (version >= ZE_API_VERSION_1_13) { + dditable.pfnGetBuildPropertiesExt = pDdiTable->pfnGetBuildPropertiesExt; + pDdiTable->pfnGetBuildPropertiesExt = validation_layer::zeRTASBuilderGetBuildPropertiesExt; + } + if (version >= ZE_API_VERSION_1_13) { + dditable.pfnBuildExt = pDdiTable->pfnBuildExt; + pDdiTable->pfnBuildExt = validation_layer::zeRTASBuilderBuildExt; + } + if (version >= ZE_API_VERSION_1_13) { + dditable.pfnCommandListAppendCopyExt = pDdiTable->pfnCommandListAppendCopyExt; + pDdiTable->pfnCommandListAppendCopyExt = validation_layer::zeRTASBuilderCommandListAppendCopyExt; + } + if (version >= ZE_API_VERSION_1_13) { + dditable.pfnDestroyExt = pDdiTable->pfnDestroyExt; + pDdiTable->pfnDestroyExt = validation_layer::zeRTASBuilderDestroyExt; + } + return result; +} + /////////////////////////////////////////////////////////////////////////////// /// @brief Exported function for filling application's RTASBuilderExp table /// with current process' addresses @@ -8984,6 +9543,49 @@ zeGetRTASBuilderExpProcAddrTable( return result; } +/////////////////////////////////////////////////////////////////////////////// +/// @brief Exported function for filling application's RTASParallelOperation 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 +zeGetRTASParallelOperationProcAddrTable( + ze_api_version_t version, ///< [in] API version requested + ze_rtas_parallel_operation_dditable_t* pDdiTable///< [in,out] pointer to table of DDI function pointers + ) +{ + auto& dditable = validation_layer::context.zeDdiTable.RTASParallelOperation; + + 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_13) { + dditable.pfnCreateExt = pDdiTable->pfnCreateExt; + pDdiTable->pfnCreateExt = validation_layer::zeRTASParallelOperationCreateExt; + } + if (version >= ZE_API_VERSION_1_13) { + dditable.pfnGetPropertiesExt = pDdiTable->pfnGetPropertiesExt; + pDdiTable->pfnGetPropertiesExt = validation_layer::zeRTASParallelOperationGetPropertiesExt; + } + if (version >= ZE_API_VERSION_1_13) { + dditable.pfnJoinExt = pDdiTable->pfnJoinExt; + pDdiTable->pfnJoinExt = validation_layer::zeRTASParallelOperationJoinExt; + } + if (version >= ZE_API_VERSION_1_13) { + dditable.pfnDestroyExt = pDdiTable->pfnDestroyExt; + pDdiTable->pfnDestroyExt = validation_layer::zeRTASParallelOperationDestroyExt; + } + return result; +} + /////////////////////////////////////////////////////////////////////////////// /// @brief Exported function for filling application's RTASParallelOperationExp table /// with current process' addresses @@ -9075,6 +9677,10 @@ zeGetDriverProcAddrTable( dditable.pfnGetExtensionFunctionAddress = pDdiTable->pfnGetExtensionFunctionAddress; pDdiTable->pfnGetExtensionFunctionAddress = validation_layer::zeDriverGetExtensionFunctionAddress; } + if (version >= ZE_API_VERSION_1_13) { + dditable.pfnRTASFormatCompatibilityCheckExt = pDdiTable->pfnRTASFormatCompatibilityCheckExt; + pDdiTable->pfnRTASFormatCompatibilityCheckExt = validation_layer::zeDriverRTASFormatCompatibilityCheckExt; + } if (version >= ZE_API_VERSION_1_6) { dditable.pfnGetLastErrorDescription = pDdiTable->pfnGetLastErrorDescription; pDdiTable->pfnGetLastErrorDescription = validation_layer::zeDriverGetLastErrorDescription; @@ -9205,6 +9811,10 @@ zeGetDeviceProcAddrTable( dditable.pfnReleaseExternalSemaphoreExt = pDdiTable->pfnReleaseExternalSemaphoreExt; pDdiTable->pfnReleaseExternalSemaphoreExt = validation_layer::zeDeviceReleaseExternalSemaphoreExt; } + if (version >= ZE_API_VERSION_1_13) { + dditable.pfnGetVectorWidthPropertiesExt = pDdiTable->pfnGetVectorWidthPropertiesExt; + pDdiTable->pfnGetVectorWidthPropertiesExt = validation_layer::zeDeviceGetVectorWidthPropertiesExt; + } if (version >= ZE_API_VERSION_1_2) { dditable.pfnReserveCacheExt = pDdiTable->pfnReserveCacheExt; pDdiTable->pfnReserveCacheExt = validation_layer::zeDeviceReserveCacheExt; diff --git a/source/layers/validation/zet_valddi.cpp b/source/layers/validation/zet_valddi.cpp index 510b578f..84a284bc 100644 --- a/source/layers/validation/zet_valddi.cpp +++ b/source/layers/validation/zet_valddi.cpp @@ -569,8 +569,8 @@ namespace validation_layer ///< than the `count` member of ::zet_debug_regset_properties_t for the ///< type uint32_t count, ///< [in] the number of registers to read; start+count must be less than or - ///< equal to the `count` member of ::zet_debug_register_group_properties_t - ///< for the type + ///< equal to the `count` member of ::zet_debug_regset_properties_t for the + ///< type void* pRegisterValues ///< [in,out][optional][range(0, count)] buffer of register values ) { @@ -619,8 +619,8 @@ namespace validation_layer ///< than the `count` member of ::zet_debug_regset_properties_t for the ///< type uint32_t count, ///< [in] the number of registers to write; start+count must be less than - ///< or equal to the `count` member of - ///< ::zet_debug_register_group_properties_t for the type + ///< or equal to the `count` member of ::zet_debug_regset_properties_t for + ///< the type void* pRegisterValues ///< [in,out][optional][range(0, count)] buffer of register values ) { @@ -2342,6 +2342,133 @@ namespace validation_layer return logAndPropagateResult("zetMetricTracerDecodeExp", driver_result); } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetCommandListAppendMarkerExp + __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 + ) + { + context.logger->log_trace("zetCommandListAppendMarkerExp(hCommandList, hMetricGroup, value)"); + + auto pfnAppendMarkerExp = context.zetDdiTable.CommandListExp.pfnAppendMarkerExp; + + if( nullptr == pfnAppendMarkerExp ) + return logAndPropagateResult("zetCommandListAppendMarkerExp", ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); + + 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); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zetHandleLifetime.zetCommandListAppendMarkerExpPrologue( hCommandList, hMetricGroup, value ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult("zetCommandListAppendMarkerExp", result); + } + + auto driver_result = pfnAppendMarkerExp( hCommandList, hMetricGroup, value ); + + 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); + } + + return logAndPropagateResult("zetCommandListAppendMarkerExp", driver_result); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetDeviceEnableMetricsExp + __zedlllocal ze_result_t ZE_APICALL + zetDeviceEnableMetricsExp( + zet_device_handle_t hDevice ///< [in] handle of the device where metrics collection has to be enabled. + ) + { + context.logger->log_trace("zetDeviceEnableMetricsExp(hDevice)"); + + auto pfnEnableMetricsExp = context.zetDdiTable.DeviceExp.pfnEnableMetricsExp; + + if( nullptr == pfnEnableMetricsExp ) + return logAndPropagateResult("zetDeviceEnableMetricsExp", ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); + + 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); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zetHandleLifetime.zetDeviceEnableMetricsExpPrologue( hDevice ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult("zetDeviceEnableMetricsExp", result); + } + + auto driver_result = pfnEnableMetricsExp( hDevice ); + + 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); + } + + return logAndPropagateResult("zetDeviceEnableMetricsExp", driver_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 + ) + { + context.logger->log_trace("zetDeviceDisableMetricsExp(hDevice)"); + + auto pfnDisableMetricsExp = context.zetDdiTable.DeviceExp.pfnDisableMetricsExp; + + if( nullptr == pfnDisableMetricsExp ) + return logAndPropagateResult("zetDeviceDisableMetricsExp", ZE_RESULT_ERROR_UNSUPPORTED_FEATURE); + + 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); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zetHandleLifetime.zetDeviceDisableMetricsExpPrologue( hDevice ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult("zetDeviceDisableMetricsExp", result); + } + + auto driver_result = pfnDisableMetricsExp( hDevice ); + + 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); + } + + return logAndPropagateResult("zetDeviceDisableMetricsExp", driver_result); + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zetMetricGroupCalculateMultipleMetricValuesExp __zedlllocal ze_result_t ZE_APICALL @@ -3460,6 +3587,14 @@ zetGetDeviceExpProcAddrTable( dditable.pfnCreateMetricGroupsFromMetricsExp = pDdiTable->pfnCreateMetricGroupsFromMetricsExp; pDdiTable->pfnCreateMetricGroupsFromMetricsExp = validation_layer::zetDeviceCreateMetricGroupsFromMetricsExp; } + if (version >= ZE_API_VERSION_1_13) { + dditable.pfnEnableMetricsExp = pDdiTable->pfnEnableMetricsExp; + pDdiTable->pfnEnableMetricsExp = validation_layer::zetDeviceEnableMetricsExp; + } + if (version >= ZE_API_VERSION_1_13) { + dditable.pfnDisableMetricsExp = pDdiTable->pfnDisableMetricsExp; + pDdiTable->pfnDisableMetricsExp = validation_layer::zetDeviceDisableMetricsExp; + } return result; } @@ -3537,6 +3672,37 @@ zetGetCommandListProcAddrTable( return result; } +/////////////////////////////////////////////////////////////////////////////// +/// @brief Exported function for filling application's CommandListExp 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 +zetGetCommandListExpProcAddrTable( + ze_api_version_t version, ///< [in] API version requested + zet_command_list_exp_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers + ) +{ + auto& dditable = validation_layer::context.zetDdiTable.CommandListExp; + + 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_13) { + dditable.pfnAppendMarkerExp = pDdiTable->pfnAppendMarkerExp; + pDdiTable->pfnAppendMarkerExp = validation_layer::zetCommandListAppendMarkerExp; + } + return result; +} + /////////////////////////////////////////////////////////////////////////////// /// @brief Exported function for filling application's Kernel table /// with current process' addresses diff --git a/source/lib/ze_libapi.cpp b/source/lib/ze_libapi.cpp index c2aaf622..d6a2f55f 100644 --- a/source/lib/ze_libapi.cpp +++ b/source/lib/ze_libapi.cpp @@ -6234,8 +6234,11 @@ zeMemAllocHost( /// @details /// - The application must ensure the device is not currently referencing /// the memory before it is freed -/// - The implementation of this function may immediately free all Host and -/// Device allocations associated with this memory +/// - 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. @@ -6794,7 +6797,7 @@ zeMemCloseIpcHandle( /// 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_INVALID_ARGUMENT is returned. +/// ::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 @@ -8089,10 +8092,14 @@ zeKernelGetSourceAttributes( 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. + ///< 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 DYNAMIC_LOAD_LOADER @@ -9987,15 +9994,12 @@ zeCommandListAppendWaitExternalSemaphoreExt( } /////////////////////////////////////////////////////////////////////////////// -/// @brief Reserve Cache on Device +/// @brief Creates a ray tracing acceleration structure builder object /// /// @details -/// - The application may call this function but may not be successful as -/// some other application may have reserve prior -/// -/// @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_extension_rtas extension. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -10004,15 +10008,17 @@ zeCommandListAppendWaitExternalSemaphoreExt( /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hDevice` +/// + `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_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 +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 DYNAMIC_LOAD_LOADER @@ -10020,40 +10026,40 @@ 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_pfnRTASBuilderCreateExt_t pfnCreateExt = [&result] { + auto pfnCreateExt = ze_lib::context->zeDdiTable.load()->RTASBuilder.pfnCreateExt; + if( nullptr == pfnCreateExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnReserveCacheExt; + return pfnCreateExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnReserveCacheExt( hDevice, cacheLevel, cacheReservationSize ); + return pfnCreateExt( hDriver, pDescriptor, phBuilder ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnReserveCacheExt = ze_lib::context->zeDdiTable.load()->Device.pfnReserveCacheExt; - if( nullptr == pfnReserveCacheExt ) { + 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 pfnReserveCacheExt( hDevice, cacheLevel, cacheReservationSize ); + return pfnCreateExt( hDriver, pDescriptor, phBuilder ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Assign VA section to use reserved section +/// @brief Retrieves ray tracing acceleration structure builder properties /// /// @details -/// - The application may call this function to assign VA to particular -/// reservartion region +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -10062,17 +10068,19 @@ zeDeviceReserveCacheExt( /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hDevice` +/// + `nullptr == hBuilder` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == ptr` +/// + `nullptr == pBuildOpDescriptor` +/// + `nullptr == pProperties` /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `::ZE_CACHE_EXT_REGION_NON_RESERVED < cacheRegion` +/// + `::ZE_RTAS_FORMAT_EXT_MAX < pBuildOpDescriptor->rtasFormat` +/// + `::ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXT_HIGH < pBuildOpDescriptor->buildQuality` +/// + `0x3 < pBuildOpDescriptor->buildFlags` 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 +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 DYNAMIC_LOAD_LOADER @@ -10080,52 +10088,40 @@ 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_pfnRTASBuilderGetBuildPropertiesExt_t pfnGetBuildPropertiesExt = [&result] { + auto pfnGetBuildPropertiesExt = ze_lib::context->zeDdiTable.load()->RTASBuilder.pfnGetBuildPropertiesExt; + if( nullptr == pfnGetBuildPropertiesExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnSetCacheAdviceExt; + return pfnGetBuildPropertiesExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnSetCacheAdviceExt( hDevice, ptr, regionSize, cacheRegion ); + return pfnGetBuildPropertiesExt( hBuilder, pBuildOpDescriptor, pProperties ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnSetCacheAdviceExt = ze_lib::context->zeDdiTable.load()->Device.pfnSetCacheAdviceExt; - if( nullptr == pfnSetCacheAdviceExt ) { + 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 pfnSetCacheAdviceExt( hDevice, ptr, regionSize, cacheRegion ); + return pfnGetBuildPropertiesExt( hBuilder, pBuildOpDescriptor, pProperties ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Query event timestamps for a device or sub-device. +/// @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. -/// - The implementation must support -/// ::ZE_experimental_event_query_timestamps. -/// - 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 @@ -10134,22 +10130,19 @@ zeDeviceSetCacheAdviceExt( /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hEvent` -/// + `nullptr == hDevice` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pCount` +/// + `nullptr == hDriver` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `::ZE_RTAS_FORMAT_EXT_MAX < rtasFormatA` +/// + `::ZE_RTAS_FORMAT_EXT_MAX < rtasFormatB` +/// - ::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 -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. +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 DYNAMIC_LOAD_LOADER @@ -10157,46 +10150,83 @@ 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_pfnDriverRTASFormatCompatibilityCheckExt_t pfnRTASFormatCompatibilityCheckExt = [&result] { + auto pfnRTASFormatCompatibilityCheckExt = ze_lib::context->zeDdiTable.load()->Driver.pfnRTASFormatCompatibilityCheckExt; + if( nullptr == pfnRTASFormatCompatibilityCheckExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnQueryTimestampsExp; + return pfnRTASFormatCompatibilityCheckExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnQueryTimestampsExp( hEvent, hDevice, pCount, pTimestamps ); + return pfnRTASFormatCompatibilityCheckExt( hDriver, rtasFormatA, rtasFormatB ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnQueryTimestampsExp = ze_lib::context->zeDdiTable.load()->EventExp.pfnQueryTimestampsExp; - if( nullptr == pfnQueryTimestampsExp ) { + 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 pfnQueryTimestampsExp( hEvent, hDevice, pCount, pTimestamps ); + return pfnRTASFormatCompatibilityCheckExt( hDriver, rtasFormatA, rtasFormatB ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Query image memory properties. +/// @brief Build ray tracing acceleration structure /// /// @details -/// - The application may call this function from simultaneous threads. -/// - The implementation of this function must be thread-safe. -/// - The implementation must support -/// ::ZE_experimental_image_memory_properties extension. -/// -/// @remarks -/// _Analogues_ -/// - None +/// - 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 @@ -10205,13 +10235,36 @@ zeEventQueryTimestampsExp( /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hImage` +/// + `nullptr == hBuilder` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pMemoryProperties` +/// + `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_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 -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. +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 DYNAMIC_LOAD_LOADER @@ -10219,53 +10272,55 @@ 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_pfnRTASBuilderBuildExt_t pfnBuildExt = [&result] { + auto pfnBuildExt = ze_lib::context->zeDdiTable.load()->RTASBuilder.pfnBuildExt; + if( nullptr == pfnBuildExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnGetMemoryPropertiesExp; + return pfnBuildExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnGetMemoryPropertiesExp( hImage, pMemoryProperties ); + return pfnBuildExt( hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnGetMemoryPropertiesExp = ze_lib::context->zeDdiTable.load()->ImageExp.pfnGetMemoryPropertiesExp; - if( nullptr == pfnGetMemoryPropertiesExp ) { + 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 pfnGetMemoryPropertiesExp( hImage, pMemoryProperties ); + return pfnBuildExt( hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Create image view on the context. +/// @brief Copies a ray tracing acceleration structure (RTAS) from host to device +/// memory. /// /// @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_extension_image_view 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 +/// - 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 @@ -10274,23 +10329,26 @@ zeImageGetMemoryPropertiesExp( /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY /// - ::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_IMAGE_FORMAT +/// + `nullptr == dstptr` +/// + `nullptr == srcptr` +/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT +/// - ::ZE_RESULT_ERROR_INVALID_SIZE +/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` 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 +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 DYNAMIC_LOAD_LOADER @@ -10298,49 +10356,749 @@ 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_pfnRTASBuilderCommandListAppendCopyExt_t pfnCommandListAppendCopyExt = [&result] { + auto pfnCommandListAppendCopyExt = ze_lib::context->zeDdiTable.load()->RTASBuilder.pfnCommandListAppendCopyExt; + if( nullptr == pfnCommandListAppendCopyExt ) { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - return pfnViewCreateExt; + return pfnCommandListAppendCopyExt; }(); if (result != ZE_RESULT_SUCCESS) { return result; } - return pfnViewCreateExt( hContext, hDevice, desc, hImage, phImageView ); + return pfnCommandListAppendCopyExt( hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents ); #else if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - auto pfnViewCreateExt = ze_lib::context->zeDdiTable.load()->Image.pfnViewCreateExt; - if( nullptr == pfnViewCreateExt ) { + 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 pfnViewCreateExt( hContext, hDevice, desc, hImage, phImageView ); + return pfnCommandListAppendCopyExt( hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents ); #endif } /////////////////////////////////////////////////////////////////////////////// -/// @brief Create image view on the context. +/// @brief Destroys a ray tracing acceleration structure builder object /// /// @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 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 implementation must support ::ZE_experimental_image_view -/// 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. +/// +/// @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_NULL_HANDLE +/// + `nullptr == hBuilder` +/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE +ze_result_t ZE_APICALL +zeRTASBuilderDestroyExt( + ze_rtas_builder_ext_handle_t hBuilder ///< [in][release] handle of builder object to destroy + ) +{ + #ifdef DYNAMIC_LOAD_LOADER + ze_result_t result = ZE_RESULT_SUCCESS; + 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 ) { + result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnDestroyExt; + }(); + if (result != ZE_RESULT_SUCCESS) { + return result; + } + return pfnDestroyExt( hBuilder ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + 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 pfnDestroyExt( hBuilder ); + #endif +} + +/////////////////////////////////////////////////////////////////////////////// +/// @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_extension_rtas 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_NULL_HANDLE +/// + `nullptr == hDriver` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == phParallelOperation` +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 + ) +{ + #ifdef DYNAMIC_LOAD_LOADER + ze_result_t result = ZE_RESULT_SUCCESS; + 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 ) { + result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnCreateExt; + }(); + if (result != ZE_RESULT_SUCCESS) { + return result; + } + return pfnCreateExt( hDriver, phParallelOperation ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + 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 pfnCreateExt( hDriver, phParallelOperation ); + #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. +/// +/// @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_NULL_HANDLE +/// + `nullptr == hParallelOperation` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pProperties` +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 + ) +{ + #ifdef DYNAMIC_LOAD_LOADER + ze_result_t result = ZE_RESULT_SUCCESS; + 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 ) { + result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnGetPropertiesExt; + }(); + if (result != ZE_RESULT_SUCCESS) { + return result; + } + return pfnGetPropertiesExt( hParallelOperation, pProperties ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + 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 pfnGetPropertiesExt( hParallelOperation, pProperties ); + #endif +} + +/////////////////////////////////////////////////////////////////////////////// +/// @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_NULL_HANDLE +/// + `nullptr == hParallelOperation` +ze_result_t ZE_APICALL +zeRTASParallelOperationJoinExt( + ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in] handle of parallel operation object + ) +{ + #ifdef DYNAMIC_LOAD_LOADER + ze_result_t result = ZE_RESULT_SUCCESS; + 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 ) { + result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnJoinExt; + }(); + if (result != ZE_RESULT_SUCCESS) { + return result; + } + return pfnJoinExt( hParallelOperation ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + 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 pfnJoinExt( hParallelOperation ); + #endif +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Destroys a ray tracing acceleration structure builder parallel +/// operation object +/// +/// @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. +/// +/// @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_NULL_HANDLE +/// + `nullptr == hParallelOperation` +ze_result_t ZE_APICALL +zeRTASParallelOperationDestroyExt( + ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in][release] handle of parallel operation object to destroy + ) +{ + #ifdef DYNAMIC_LOAD_LOADER + ze_result_t result = ZE_RESULT_SUCCESS; + 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 ) { + result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnDestroyExt; + }(); + if (result != ZE_RESULT_SUCCESS) { + return result; + } + return pfnDestroyExt( hParallelOperation ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + 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 pfnDestroyExt( hParallelOperation ); + #endif +} + +/////////////////////////////////////////////////////////////////////////////// +/// @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_NULL_HANDLE +/// + `nullptr == hDevice` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pCount` +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. + ) +{ + #ifdef DYNAMIC_LOAD_LOADER + ze_result_t result = ZE_RESULT_SUCCESS; + 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 ) { + result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnGetVectorWidthPropertiesExt; + }(); + if (result != ZE_RESULT_SUCCESS) { + return result; + } + return pfnGetVectorWidthPropertiesExt( hDevice, pCount, pVectorWidthProperties ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + 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 pfnGetVectorWidthPropertiesExt( hDevice, pCount, pVectorWidthProperties ); + #endif +} + +/////////////////////////////////////////////////////////////////////////////// +/// @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_NULL_HANDLE +/// + `nullptr == hDevice` +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 + ) +{ + #ifdef DYNAMIC_LOAD_LOADER + ze_result_t result = ZE_RESULT_SUCCESS; + 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 ) { + result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnReserveCacheExt; + }(); + if (result != ZE_RESULT_SUCCESS) { + return result; + } + return pfnReserveCacheExt( hDevice, cacheLevel, cacheReservationSize ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + 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 pfnReserveCacheExt( hDevice, cacheLevel, cacheReservationSize ); + #endif +} + +/////////////////////////////////////////////////////////////////////////////// +/// @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_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_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 + ) +{ + #ifdef DYNAMIC_LOAD_LOADER + ze_result_t result = ZE_RESULT_SUCCESS; + 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 ) { + result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnSetCacheAdviceExt; + }(); + if (result != ZE_RESULT_SUCCESS) { + return result; + } + return pfnSetCacheAdviceExt( hDevice, ptr, regionSize, cacheRegion ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + 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 pfnSetCacheAdviceExt( hDevice, ptr, regionSize, cacheRegion ); + #endif +} + +/////////////////////////////////////////////////////////////////////////////// +/// @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_experimental_event_query_timestamps. +/// - 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_NULL_HANDLE +/// + `nullptr == hEvent` +/// + `nullptr == hDevice` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pCount` +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. + ) +{ + #ifdef DYNAMIC_LOAD_LOADER + ze_result_t result = ZE_RESULT_SUCCESS; + 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 ) { + result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnQueryTimestampsExp; + }(); + if (result != ZE_RESULT_SUCCESS) { + return result; + } + return pfnQueryTimestampsExp( hEvent, hDevice, pCount, pTimestamps ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + 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 pfnQueryTimestampsExp( hEvent, hDevice, pCount, pTimestamps ); + #endif +} + +/////////////////////////////////////////////////////////////////////////////// +/// @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_experimental_image_memory_properties 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_NULL_HANDLE +/// + `nullptr == hImage` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pMemoryProperties` +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. + ) +{ + #ifdef DYNAMIC_LOAD_LOADER + ze_result_t result = ZE_RESULT_SUCCESS; + 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 ) { + result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnGetMemoryPropertiesExp; + }(); + if (result != ZE_RESULT_SUCCESS) { + return result; + } + return pfnGetMemoryPropertiesExp( hImage, pMemoryProperties ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + 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 pfnGetMemoryPropertiesExp( hImage, pMemoryProperties ); + #endif +} + +/////////////////////////////////////////////////////////////////////////////// +/// @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_extension_image_view 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_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_IMAGE_FORMAT +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 + ) +{ + #ifdef DYNAMIC_LOAD_LOADER + ze_result_t result = ZE_RESULT_SUCCESS; + 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 ) { + result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnViewCreateExt; + }(); + if (result != ZE_RESULT_SUCCESS) { + return result; + } + return pfnViewCreateExt( hContext, hDevice, desc, hImage, phImageView ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + 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 pfnViewCreateExt( hContext, hDevice, desc, hImage, phImageView ); + #endif +} + +/////////////////////////////////////////////////////////////////////////////// +/// @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_experimental_image_view +/// 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. @@ -10851,11 +11609,13 @@ zeModuleInspectLinkageExt( } /////////////////////////////////////////////////////////////////////////////// -/// @brief Frees allocated host memory, device memory, or shared memory using the -/// specified free policy. +/// @brief Frees allocated host memory, device memory, or shared memory on the +/// context using the specified free policy. /// /// @details -/// - The memory free policy is specified by the memory free descriptor. +/// - 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. @@ -11576,7 +12336,7 @@ zeRTASBuilderCreateExp( /// + `nullptr == pBuildOpDescriptor` /// + `nullptr == pProperties` /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `::ZE_RTAS_FORMAT_EXP_INVALID < pBuildOpDescriptor->rtasFormat` +/// + `::ZE_RTAS_FORMAT_EXP_MAX < pBuildOpDescriptor->rtasFormat` /// + `::ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_HIGH < pBuildOpDescriptor->buildQuality` /// + `0x3 < pBuildOpDescriptor->buildFlags` ze_result_t ZE_APICALL @@ -11635,8 +12395,8 @@ zeRTASBuilderGetBuildPropertiesExp( /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hDriver` /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `::ZE_RTAS_FORMAT_EXP_INVALID < rtasFormatA` -/// + `::ZE_RTAS_FORMAT_EXP_INVALID < rtasFormatB` +/// + `::ZE_RTAS_FORMAT_EXP_MAX < rtasFormatA` +/// + `::ZE_RTAS_FORMAT_EXP_MAX < rtasFormatB` /// - ::ZE_RESULT_SUCCESS /// + An acceleration structure built with `rtasFormatA` is compatible with devices that report `rtasFormatB`. /// - ::ZE_RESULT_EXP_ERROR_OPERANDS_INCOMPATIBLE @@ -11744,7 +12504,7 @@ zeDriverRTASFormatCompatibilityCheckExp( /// + `nullptr == pScratchBuffer` /// + `nullptr == pRtasBuffer` /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `::ZE_RTAS_FORMAT_EXP_INVALID < pBuildOpDescriptor->rtasFormat` +/// + `::ZE_RTAS_FORMAT_EXP_MAX < pBuildOpDescriptor->rtasFormat` /// + `::ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_HIGH < pBuildOpDescriptor->buildQuality` /// + `0x3 < pBuildOpDescriptor->buildFlags` /// - ::ZE_RESULT_EXP_RTAS_BUILD_DEFERRED diff --git a/source/lib/ze_libddi.cpp b/source/lib/ze_libddi.cpp index ee61632e..2549ad93 100644 --- a/source/lib/ze_libddi.cpp +++ b/source/lib/ze_libddi.cpp @@ -32,6 +32,24 @@ namespace ze_lib GET_FUNCTION_PTR(loader, "zeInitDrivers") ); } + if( ZE_RESULT_SUCCESS == result ) + { + // Optional + auto getTable = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeGetRTASBuilderProcAddrTable") ); + getTableWithCheck(getTable, version, &initialzeDdiTable.RTASBuilder ); + initialzeDdiTable.RTASBuilder.pfnCreateExt = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeRTASBuilderCreateExt") ); + initialzeDdiTable.RTASBuilder.pfnGetBuildPropertiesExt = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeRTASBuilderGetBuildPropertiesExt") ); + initialzeDdiTable.RTASBuilder.pfnBuildExt = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeRTASBuilderBuildExt") ); + initialzeDdiTable.RTASBuilder.pfnCommandListAppendCopyExt = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeRTASBuilderCommandListAppendCopyExt") ); + initialzeDdiTable.RTASBuilder.pfnDestroyExt = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeRTASBuilderDestroyExt") ); + } + if( ZE_RESULT_SUCCESS == result ) { // Optional @@ -48,6 +66,22 @@ namespace ze_lib GET_FUNCTION_PTR(loader, "zeRTASBuilderDestroyExp") ); } + if( ZE_RESULT_SUCCESS == result ) + { + // Optional + auto getTable = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeGetRTASParallelOperationProcAddrTable") ); + getTableWithCheck(getTable, version, &initialzeDdiTable.RTASParallelOperation ); + initialzeDdiTable.RTASParallelOperation.pfnCreateExt = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeRTASParallelOperationCreateExt") ); + initialzeDdiTable.RTASParallelOperation.pfnGetPropertiesExt = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeRTASParallelOperationGetPropertiesExt") ); + initialzeDdiTable.RTASParallelOperation.pfnJoinExt = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeRTASParallelOperationJoinExt") ); + initialzeDdiTable.RTASParallelOperation.pfnDestroyExt = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeRTASParallelOperationDestroyExt") ); + } + if( ZE_RESULT_SUCCESS == result ) { // Optional @@ -81,6 +115,8 @@ namespace ze_lib GET_FUNCTION_PTR(loader, "zeDriverGetExtensionProperties") ); initialzeDdiTable.Driver.pfnGetExtensionFunctionAddress = reinterpret_cast( GET_FUNCTION_PTR(loader, "zeDriverGetExtensionFunctionAddress") ); + initialzeDdiTable.Driver.pfnRTASFormatCompatibilityCheckExt = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeDriverRTASFormatCompatibilityCheckExt") ); initialzeDdiTable.Driver.pfnGetLastErrorDescription = reinterpret_cast( GET_FUNCTION_PTR(loader, "zeDriverGetLastErrorDescription") ); } @@ -134,6 +170,8 @@ namespace ze_lib GET_FUNCTION_PTR(loader, "zeDeviceImportExternalSemaphoreExt") ); initialzeDdiTable.Device.pfnReleaseExternalSemaphoreExt = reinterpret_cast( GET_FUNCTION_PTR(loader, "zeDeviceReleaseExternalSemaphoreExt") ); + initialzeDdiTable.Device.pfnGetVectorWidthPropertiesExt = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeDeviceGetVectorWidthPropertiesExt") ); initialzeDdiTable.Device.pfnReserveCacheExt = reinterpret_cast( GET_FUNCTION_PTR(loader, "zeDeviceReserveCacheExt") ); initialzeDdiTable.Device.pfnSetCacheAdviceExt = reinterpret_cast( @@ -624,12 +662,24 @@ namespace ze_lib result = zeGetGlobalProcAddrTable( version, &initialzeDdiTable.Global ); } + if( ZE_RESULT_SUCCESS == result ) + { + // Optional + zeGetRTASBuilderProcAddrTable( version, &initialzeDdiTable.RTASBuilder ); + } + if( ZE_RESULT_SUCCESS == result ) { // Optional zeGetRTASBuilderExpProcAddrTable( version, &initialzeDdiTable.RTASBuilderExp ); } + if( ZE_RESULT_SUCCESS == result ) + { + // Optional + zeGetRTASParallelOperationProcAddrTable( version, &initialzeDdiTable.RTASParallelOperation ); + } + 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 df0192d8..a42b7412 100644 --- a/source/lib/ze_tracing_register_cb_libapi.cpp +++ b/source/lib/ze_tracing_register_cb_libapi.cpp @@ -3793,6 +3793,281 @@ zelTracerCommandListAppendWaitExternalSemaphoreExtRegisterCallback( } +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerRTASBuilderCreateExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnRTASBuilderCreateExtCb_t pfnCreateExtCb + ) { + + 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_pfnRTASBuilderCreateExtCb_t pfnCreateExtCb + ); + + auto func = reinterpret_cast( + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerRTASBuilderCreateExtRegisterCallback") ); + + if(func) + return func(hTracer, callback_type, pfnCreateExtCb); + + return ZE_RESULT_ERROR_UNINITIALIZED; +} + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerRTASBuilderGetBuildPropertiesExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnRTASBuilderGetBuildPropertiesExtCb_t pfnGetBuildPropertiesExtCb + ) { + + 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_pfnRTASBuilderGetBuildPropertiesExtCb_t pfnGetBuildPropertiesExtCb + ); + + auto func = reinterpret_cast( + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerRTASBuilderGetBuildPropertiesExtRegisterCallback") ); + + if(func) + return func(hTracer, callback_type, pfnGetBuildPropertiesExtCb); + + return ZE_RESULT_ERROR_UNINITIALIZED; +} + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerDriverRTASFormatCompatibilityCheckExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnDriverRTASFormatCompatibilityCheckExtCb_t pfnRTASFormatCompatibilityCheckExtCb + ) { + + 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_pfnDriverRTASFormatCompatibilityCheckExtCb_t pfnRTASFormatCompatibilityCheckExtCb + ); + + auto func = reinterpret_cast( + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerDriverRTASFormatCompatibilityCheckExtRegisterCallback") ); + + if(func) + return func(hTracer, callback_type, pfnRTASFormatCompatibilityCheckExtCb); + + return ZE_RESULT_ERROR_UNINITIALIZED; +} + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerRTASBuilderBuildExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnRTASBuilderBuildExtCb_t pfnBuildExtCb + ) { + + 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_pfnRTASBuilderBuildExtCb_t pfnBuildExtCb + ); + + auto func = reinterpret_cast( + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerRTASBuilderBuildExtRegisterCallback") ); + + if(func) + return func(hTracer, callback_type, pfnBuildExtCb); + + return ZE_RESULT_ERROR_UNINITIALIZED; +} + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerRTASBuilderCommandListAppendCopyExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnRTASBuilderCommandListAppendCopyExtCb_t pfnCommandListAppendCopyExtCb + ) { + + 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_pfnRTASBuilderCommandListAppendCopyExtCb_t pfnCommandListAppendCopyExtCb + ); + + auto func = reinterpret_cast( + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerRTASBuilderCommandListAppendCopyExtRegisterCallback") ); + + if(func) + return func(hTracer, callback_type, pfnCommandListAppendCopyExtCb); + + return ZE_RESULT_ERROR_UNINITIALIZED; +} + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerRTASBuilderDestroyExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnRTASBuilderDestroyExtCb_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_pfnRTASBuilderDestroyExtCb_t pfnDestroyExtCb + ); + + auto func = reinterpret_cast( + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerRTASBuilderDestroyExtRegisterCallback") ); + + if(func) + return func(hTracer, callback_type, pfnDestroyExtCb); + + return ZE_RESULT_ERROR_UNINITIALIZED; +} + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerRTASParallelOperationCreateExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnRTASParallelOperationCreateExtCb_t pfnCreateExtCb + ) { + + 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_pfnRTASParallelOperationCreateExtCb_t pfnCreateExtCb + ); + + auto func = reinterpret_cast( + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerRTASParallelOperationCreateExtRegisterCallback") ); + + if(func) + return func(hTracer, callback_type, pfnCreateExtCb); + + return ZE_RESULT_ERROR_UNINITIALIZED; +} + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerRTASParallelOperationGetPropertiesExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnRTASParallelOperationGetPropertiesExtCb_t pfnGetPropertiesExtCb + ) { + + 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_pfnRTASParallelOperationGetPropertiesExtCb_t pfnGetPropertiesExtCb + ); + + auto func = reinterpret_cast( + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerRTASParallelOperationGetPropertiesExtRegisterCallback") ); + + if(func) + return func(hTracer, callback_type, pfnGetPropertiesExtCb); + + return ZE_RESULT_ERROR_UNINITIALIZED; +} + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerRTASParallelOperationJoinExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnRTASParallelOperationJoinExtCb_t pfnJoinExtCb + ) { + + 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_pfnRTASParallelOperationJoinExtCb_t pfnJoinExtCb + ); + + auto func = reinterpret_cast( + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerRTASParallelOperationJoinExtRegisterCallback") ); + + if(func) + return func(hTracer, callback_type, pfnJoinExtCb); + + return ZE_RESULT_ERROR_UNINITIALIZED; +} + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerRTASParallelOperationDestroyExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnRTASParallelOperationDestroyExtCb_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_pfnRTASParallelOperationDestroyExtCb_t pfnDestroyExtCb + ); + + auto func = reinterpret_cast( + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerRTASParallelOperationDestroyExtRegisterCallback") ); + + if(func) + return func(hTracer, callback_type, pfnDestroyExtCb); + + return ZE_RESULT_ERROR_UNINITIALIZED; +} + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerDeviceGetVectorWidthPropertiesExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnDeviceGetVectorWidthPropertiesExtCb_t pfnGetVectorWidthPropertiesExtCb + ) { + + 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_pfnDeviceGetVectorWidthPropertiesExtCb_t pfnGetVectorWidthPropertiesExtCb + ); + + auto func = reinterpret_cast( + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerDeviceGetVectorWidthPropertiesExtRegisterCallback") ); + + if(func) + return func(hTracer, callback_type, pfnGetVectorWidthPropertiesExtCb); + + return ZE_RESULT_ERROR_UNINITIALIZED; +} + + ZE_APIEXPORT ze_result_t ZE_APICALL zelTracerDeviceReserveCacheExtRegisterCallback( zel_tracer_handle_t hTracer, diff --git a/source/lib/zet_libapi.cpp b/source/lib/zet_libapi.cpp index 719f8c25..fb8377b2 100644 --- a/source/lib/zet_libapi.cpp +++ b/source/lib/zet_libapi.cpp @@ -738,8 +738,8 @@ zetDebugReadRegisters( ///< than the `count` member of ::zet_debug_regset_properties_t for the ///< type uint32_t count, ///< [in] the number of registers to read; start+count must be less than or - ///< equal to the `count` member of ::zet_debug_register_group_properties_t - ///< for the type + ///< equal to the `count` member of ::zet_debug_regset_properties_t for the + ///< type void* pRegisterValues ///< [in,out][optional][range(0, count)] buffer of register values ) { @@ -798,8 +798,8 @@ zetDebugWriteRegisters( ///< than the `count` member of ::zet_debug_regset_properties_t for the ///< type uint32_t count, ///< [in] the number of registers to write; start+count must be less than - ///< or equal to the `count` member of - ///< ::zet_debug_register_group_properties_t for the type + ///< or equal to the `count` member of ::zet_debug_regset_properties_t for + ///< the type void* pRegisterValues ///< [in,out][optional][range(0, count)] buffer of register values ) { @@ -3016,6 +3016,186 @@ zetMetricTracerDecodeExp( #endif } +/////////////////////////////////////////////////////////////////////////////// +/// @brief Append a Marker based on the Metric source of the Metric Group, to a +/// Command List. +/// +/// @details +/// - This function appends a Marker based on the Metric source of the +/// Metric Group, to Command List. +/// +/// @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_NULL_HANDLE +/// + `nullptr == hCommandList` +/// + `nullptr == hMetricGroup` +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 + ) +{ + #ifdef DYNAMIC_LOAD_LOADER + ze_result_t result = ZE_RESULT_SUCCESS; + 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 ) { + result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnAppendMarkerExp; + }(); + if (result != ZE_RESULT_SUCCESS) { + return result; + } + return pfnAppendMarkerExp( hCommandList, hMetricGroup, value ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + 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 pfnAppendMarkerExp( hCommandList, hMetricGroup, value ); + #endif +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Enable Metrics collection during runtime. +/// +/// @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. +/// +/// @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_NULL_HANDLE +/// + `nullptr == hDevice` +ze_result_t ZE_APICALL +zetDeviceEnableMetricsExp( + zet_device_handle_t hDevice ///< [in] handle of the device where metrics collection has to be enabled. + ) +{ + #ifdef DYNAMIC_LOAD_LOADER + ze_result_t result = ZE_RESULT_SUCCESS; + 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 ) { + result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnEnableMetricsExp; + }(); + if (result != ZE_RESULT_SUCCESS) { + return result; + } + return pfnEnableMetricsExp( hDevice ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + 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 pfnEnableMetricsExp( hDevice ); + #endif +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Disable Metrics collection during runtime, if it was already enabled. +/// +/// @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. +/// +/// @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_NULL_HANDLE +/// + `nullptr == hDevice` +ze_result_t ZE_APICALL +zetDeviceDisableMetricsExp( + zet_device_handle_t hDevice ///< [in] handle of the device where metrics collection has to be disabled + ) +{ + #ifdef DYNAMIC_LOAD_LOADER + ze_result_t result = ZE_RESULT_SUCCESS; + 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 ) { + result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnDisableMetricsExp; + }(); + if (result != ZE_RESULT_SUCCESS) { + return result; + } + return pfnDisableMetricsExp( hDevice ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + 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 pfnDisableMetricsExp( hDevice ); + #endif +} + /////////////////////////////////////////////////////////////////////////////// /// @brief Calculate one or more sets of metric values from raw data. /// diff --git a/source/lib/zet_libddi.cpp b/source/lib/zet_libddi.cpp index 91ec9e6c..af6143c5 100644 --- a/source/lib/zet_libddi.cpp +++ b/source/lib/zet_libddi.cpp @@ -90,6 +90,10 @@ namespace ze_lib GET_FUNCTION_PTR(loader, "zetDeviceGetConcurrentMetricGroupsExp") ); initialzetDdiTable.DeviceExp.pfnCreateMetricGroupsFromMetricsExp = reinterpret_cast( GET_FUNCTION_PTR(loader, "zetDeviceCreateMetricGroupsFromMetricsExp") ); + initialzetDdiTable.DeviceExp.pfnEnableMetricsExp = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zetDeviceEnableMetricsExp") ); + initialzetDdiTable.DeviceExp.pfnDisableMetricsExp = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zetDeviceDisableMetricsExp") ); } if( ZE_RESULT_SUCCESS == result ) @@ -116,6 +120,16 @@ namespace ze_lib GET_FUNCTION_PTR(loader, "zetCommandListAppendMetricMemoryBarrier") ); } + if( ZE_RESULT_SUCCESS == result ) + { + // Optional + auto getTable = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zetGetCommandListExpProcAddrTable") ); + getTableWithCheck(getTable, version, &initialzetDdiTable.CommandListExp ); + initialzetDdiTable.CommandListExp.pfnAppendMarkerExp = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zetCommandListAppendMarkerExp") ); + } + if( ZE_RESULT_SUCCESS == result ) { auto getTable = reinterpret_cast( @@ -331,6 +345,12 @@ namespace ze_lib result = zetGetCommandListProcAddrTable( version, &initialzetDdiTable.CommandList ); } + if( ZE_RESULT_SUCCESS == result ) + { + // Optional + zetGetCommandListExpProcAddrTable( version, &initialzetDdiTable.CommandListExp ); + } + if( ZE_RESULT_SUCCESS == result ) { result = zetGetKernelProcAddrTable( version, &initialzetDdiTable.Kernel ); diff --git a/source/loader/ze_ldrddi.cpp b/source/loader/ze_ldrddi.cpp index 9890e2db..ad443e83 100644 --- a/source/loader/ze_ldrddi.cpp +++ b/source/loader/ze_ldrddi.cpp @@ -4074,10 +4074,14 @@ namespace loader 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. + ///< 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. ) { ze_result_t result = ZE_RESULT_SUCCESS; @@ -5060,6 +5064,361 @@ namespace loader return result; } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASBuilderCreateExt + __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 + ) + { + 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 ) + return ZE_RESULT_ERROR_UNINITIALIZED; + + // convert loader handle to driver handle + hDriver = reinterpret_cast( hDriver )->handle; + + // forward to device-driver + result = pfnCreateExt( hDriver, pDescriptor, phBuilder ); + + if( ZE_RESULT_SUCCESS != result ) + return result; + + try + { + // convert driver handle to loader handle + *phBuilder = reinterpret_cast( + context->ze_rtas_builder_ext_factory.getInstance( *phBuilder, dditable ) ); + } + catch( std::bad_alloc& ) + { + result = ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY; + } + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASBuilderGetBuildPropertiesExt + __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 + ) + { + 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 ) + return ZE_RESULT_ERROR_UNINITIALIZED; + + // convert loader handle to driver handle + hBuilder = reinterpret_cast( hBuilder )->handle; + + // forward to device-driver + result = pfnGetBuildPropertiesExt( hBuilder, pBuildOpDescriptor, pProperties ); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @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 + ) + { + 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 ) + return ZE_RESULT_ERROR_UNINITIALIZED; + + // convert loader handle to driver handle + hDriver = reinterpret_cast( hDriver )->handle; + + // forward to device-driver + result = pfnRTASFormatCompatibilityCheckExt( hDriver, rtasFormatA, rtasFormatB ); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASBuilderBuildExt + __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 + ) + { + 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 ) + 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; + + // forward to device-driver + result = pfnBuildExt( hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes ); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASBuilderCommandListAppendCopyExt + __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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract driver's function pointer table + 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 + 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 = pfnCommandListAppendCopyExt( hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEventsLocal ); + delete []phWaitEventsLocal; + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASBuilderDestroyExt + __zedlllocal ze_result_t ZE_APICALL + 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( hBuilder )->dditable; + auto pfnDestroyExt = dditable->ze.RTASBuilder.pfnDestroyExt; + if( nullptr == pfnDestroyExt ) + return ZE_RESULT_ERROR_UNINITIALIZED; + + // convert loader handle to driver handle + hBuilder = reinterpret_cast( hBuilder )->handle; + + // forward to device-driver + result = pfnDestroyExt( hBuilder ); + + if( ZE_RESULT_SUCCESS != result ) + return result; + + // release loader handle + context->ze_rtas_builder_ext_factory.release( hBuilder ); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @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 + ) + { + 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 ) + return ZE_RESULT_ERROR_UNINITIALIZED; + + // convert loader handle to driver handle + hDriver = reinterpret_cast( hDriver )->handle; + + // forward to device-driver + result = pfnCreateExt( hDriver, phParallelOperation ); + + if( ZE_RESULT_SUCCESS != result ) + return result; + + try + { + // convert driver handle to loader handle + *phParallelOperation = reinterpret_cast( + context->ze_rtas_parallel_operation_ext_factory.getInstance( *phParallelOperation, dditable ) ); + } + catch( std::bad_alloc& ) + { + result = ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY; + } + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @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 + ) + { + 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 ) + return ZE_RESULT_ERROR_UNINITIALIZED; + + // convert loader handle to driver handle + hParallelOperation = reinterpret_cast( hParallelOperation )->handle; + + // forward to device-driver + result = pfnGetPropertiesExt( hParallelOperation, pProperties ); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASParallelOperationJoinExt + __zedlllocal ze_result_t ZE_APICALL + 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( hParallelOperation )->dditable; + auto pfnJoinExt = dditable->ze.RTASParallelOperation.pfnJoinExt; + if( nullptr == pfnJoinExt ) + return ZE_RESULT_ERROR_UNINITIALIZED; + + // convert loader handle to driver handle + hParallelOperation = reinterpret_cast( hParallelOperation )->handle; + + // forward to device-driver + result = pfnJoinExt( hParallelOperation ); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASParallelOperationDestroyExt + __zedlllocal ze_result_t ZE_APICALL + 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( hParallelOperation )->dditable; + auto pfnDestroyExt = dditable->ze.RTASParallelOperation.pfnDestroyExt; + if( nullptr == pfnDestroyExt ) + return ZE_RESULT_ERROR_UNINITIALIZED; + + // convert loader handle to driver handle + hParallelOperation = reinterpret_cast( hParallelOperation )->handle; + + // forward to device-driver + 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 zeDeviceGetVectorWidthPropertiesExt + __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. + ) + { + 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 ) + return ZE_RESULT_ERROR_UNINITIALIZED; + + // convert loader handle to driver handle + hDevice = reinterpret_cast( hDevice )->handle; + + // forward to device-driver + result = pfnGetVectorWidthPropertiesExt( hDevice, pCount, pVectorWidthProperties ); + + return result; + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zeDeviceReserveCacheExt __zedlllocal ze_result_t ZE_APICALL @@ -6612,6 +6971,112 @@ zeGetGlobalProcAddrTable( return result; } +/////////////////////////////////////////////////////////////////////////////// +/// @brief Exported function for filling application's RTASBuilder 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 +zeGetRTASBuilderProcAddrTable( + ze_api_version_t version, ///< [in] API version requested + ze_rtas_builder_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; + + ze_result_t result = ZE_RESULT_SUCCESS; + + bool atLeastOneDriverValid = false; + // Load the device-driver DDI tables + for( auto& drv : loader::context->zeDrivers ) + { + if(drv.initStatus != ZE_RESULT_SUCCESS) + continue; + auto getTable = reinterpret_cast( + GET_FUNCTION_PTR( drv.handle, "zeGetRTASBuilderProcAddrTable") ); + if(!getTable) + continue; + auto getTableResult = getTable( version, &drv.dditable.ze.RTASBuilder); + if(getTableResult == ZE_RESULT_SUCCESS) + atLeastOneDriverValid = true; + else + drv.initStatus = getTableResult; + } + + if(!atLeastOneDriverValid) + result = ZE_RESULT_ERROR_UNINITIALIZED; + else + result = ZE_RESULT_SUCCESS; + + if( ZE_RESULT_SUCCESS == result ) + { + if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) + { + // return pointers to loader's DDIs + if (version >= ZE_API_VERSION_1_13) { + pDdiTable->pfnCreateExt = loader::zeRTASBuilderCreateExt; + } + if (version >= ZE_API_VERSION_1_13) { + pDdiTable->pfnGetBuildPropertiesExt = loader::zeRTASBuilderGetBuildPropertiesExt; + } + if (version >= ZE_API_VERSION_1_13) { + pDdiTable->pfnBuildExt = loader::zeRTASBuilderBuildExt; + } + if (version >= ZE_API_VERSION_1_13) { + pDdiTable->pfnCommandListAppendCopyExt = loader::zeRTASBuilderCommandListAppendCopyExt; + } + if (version >= ZE_API_VERSION_1_13) { + pDdiTable->pfnDestroyExt = loader::zeRTASBuilderDestroyExt; + } + } + else + { + // return pointers directly to driver's DDIs + *pDdiTable = loader::context->zeDrivers.front().dditable.ze.RTASBuilder; + } + } + + // 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, "zeGetRTASBuilderProcAddrTable") ); + 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, "zeGetRTASBuilderProcAddrTable") ); + if(!getTable) + return ZE_RESULT_ERROR_UNINITIALIZED; + ze_rtas_builder_dditable_t dditable; + memcpy(&dditable, pDdiTable, sizeof(ze_rtas_builder_dditable_t)); + result = getTable( version, &dditable ); + loader::context->tracing_dditable.ze.RTASBuilder = dditable; + if ( loader::context->tracingLayerEnabled ) { + result = getTable( version, pDdiTable ); + } + } + + return result; +} + /////////////////////////////////////////////////////////////////////////////// /// @brief Exported function for filling application's RTASBuilderExp table /// with current process' addresses @@ -6706,6 +7171,109 @@ zeGetRTASBuilderExpProcAddrTable( return result; } +/////////////////////////////////////////////////////////////////////////////// +/// @brief Exported function for filling application's RTASParallelOperation 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 +zeGetRTASParallelOperationProcAddrTable( + ze_api_version_t version, ///< [in] API version requested + ze_rtas_parallel_operation_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; + + ze_result_t result = ZE_RESULT_SUCCESS; + + bool atLeastOneDriverValid = false; + // Load the device-driver DDI tables + for( auto& drv : loader::context->zeDrivers ) + { + if(drv.initStatus != ZE_RESULT_SUCCESS) + continue; + auto getTable = reinterpret_cast( + GET_FUNCTION_PTR( drv.handle, "zeGetRTASParallelOperationProcAddrTable") ); + if(!getTable) + continue; + auto getTableResult = getTable( version, &drv.dditable.ze.RTASParallelOperation); + if(getTableResult == ZE_RESULT_SUCCESS) + atLeastOneDriverValid = true; + else + drv.initStatus = getTableResult; + } + + if(!atLeastOneDriverValid) + result = ZE_RESULT_ERROR_UNINITIALIZED; + else + result = ZE_RESULT_SUCCESS; + + if( ZE_RESULT_SUCCESS == result ) + { + if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) + { + // return pointers to loader's DDIs + if (version >= ZE_API_VERSION_1_13) { + pDdiTable->pfnCreateExt = loader::zeRTASParallelOperationCreateExt; + } + if (version >= ZE_API_VERSION_1_13) { + pDdiTable->pfnGetPropertiesExt = loader::zeRTASParallelOperationGetPropertiesExt; + } + if (version >= ZE_API_VERSION_1_13) { + pDdiTable->pfnJoinExt = loader::zeRTASParallelOperationJoinExt; + } + if (version >= ZE_API_VERSION_1_13) { + pDdiTable->pfnDestroyExt = loader::zeRTASParallelOperationDestroyExt; + } + } + else + { + // return pointers directly to driver's DDIs + *pDdiTable = loader::context->zeDrivers.front().dditable.ze.RTASParallelOperation; + } + } + + // 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, "zeGetRTASParallelOperationProcAddrTable") ); + 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, "zeGetRTASParallelOperationProcAddrTable") ); + if(!getTable) + return ZE_RESULT_ERROR_UNINITIALIZED; + ze_rtas_parallel_operation_dditable_t dditable; + memcpy(&dditable, pDdiTable, sizeof(ze_rtas_parallel_operation_dditable_t)); + result = getTable( version, &dditable ); + loader::context->tracing_dditable.ze.RTASParallelOperation = dditable; + if ( loader::context->tracingLayerEnabled ) { + result = getTable( version, pDdiTable ); + } + } + + return result; +} + /////////////////////////////////////////////////////////////////////////////// /// @brief Exported function for filling application's RTASParallelOperationExp table /// with current process' addresses @@ -6872,6 +7440,9 @@ zeGetDriverProcAddrTable( if (version >= ZE_API_VERSION_1_1) { pDdiTable->pfnGetExtensionFunctionAddress = loader::zeDriverGetExtensionFunctionAddress; } + if (version >= ZE_API_VERSION_1_13) { + pDdiTable->pfnRTASFormatCompatibilityCheckExt = loader::zeDriverRTASFormatCompatibilityCheckExt; + } if (version >= ZE_API_VERSION_1_6) { pDdiTable->pfnGetLastErrorDescription = loader::zeDriverGetLastErrorDescription; } @@ -7102,6 +7673,9 @@ zeGetDeviceProcAddrTable( if (version >= ZE_API_VERSION_1_12) { pDdiTable->pfnReleaseExternalSemaphoreExt = loader::zeDeviceReleaseExternalSemaphoreExt; } + if (version >= ZE_API_VERSION_1_13) { + pDdiTable->pfnGetVectorWidthPropertiesExt = loader::zeDeviceGetVectorWidthPropertiesExt; + } if (version >= ZE_API_VERSION_1_2) { pDdiTable->pfnReserveCacheExt = loader::zeDeviceReserveCacheExt; } diff --git a/source/loader/ze_ldrddi.h b/source/loader/ze_ldrddi.h index 2643d540..609bb853 100644 --- a/source/loader/ze_ldrddi.h +++ b/source/loader/ze_ldrddi.h @@ -63,6 +63,12 @@ namespace loader 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 >; + using ze_rtas_builder_ext_object_t = object_t < ze_rtas_builder_ext_handle_t >; + using ze_rtas_builder_ext_factory_t = singleton_factory_t < ze_rtas_builder_ext_object_t, ze_rtas_builder_ext_handle_t >; + + 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_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 >; diff --git a/source/loader/ze_loader_internal.h b/source/loader/ze_loader_internal.h index 295a33a2..e391523b 100644 --- a/source/loader/ze_loader_internal.h +++ b/source/loader/ze_loader_internal.h @@ -84,7 +84,9 @@ namespace loader ze_module_factory_t ze_module_factory; ze_physical_mem_factory_t ze_physical_mem_factory; ze_rtas_builder_exp_factory_t ze_rtas_builder_exp_factory; + ze_rtas_builder_ext_factory_t ze_rtas_builder_ext_factory; ze_rtas_parallel_operation_exp_factory_t ze_rtas_parallel_operation_exp_factory; + ze_rtas_parallel_operation_ext_factory_t ze_rtas_parallel_operation_ext_factory; ze_sampler_factory_t ze_sampler_factory; zes_device_factory_t zes_device_factory; zes_diag_factory_t zes_diag_factory; diff --git a/source/loader/zet_ldrddi.cpp b/source/loader/zet_ldrddi.cpp index 572ae41b..f0f99072 100644 --- a/source/loader/zet_ldrddi.cpp +++ b/source/loader/zet_ldrddi.cpp @@ -376,8 +376,8 @@ namespace loader ///< than the `count` member of ::zet_debug_regset_properties_t for the ///< type uint32_t count, ///< [in] the number of registers to read; start+count must be less than or - ///< equal to the `count` member of ::zet_debug_register_group_properties_t - ///< for the type + ///< equal to the `count` member of ::zet_debug_regset_properties_t for the + ///< type void* pRegisterValues ///< [in,out][optional][range(0, count)] buffer of register values ) { @@ -409,8 +409,8 @@ namespace loader ///< than the `count` member of ::zet_debug_regset_properties_t for the ///< type uint32_t count, ///< [in] the number of registers to write; start+count must be less than - ///< or equal to the `count` member of - ///< ::zet_debug_register_group_properties_t for the type + ///< or equal to the `count` member of ::zet_debug_regset_properties_t for + ///< the type void* pRegisterValues ///< [in,out][optional][range(0, count)] buffer of register values ) { @@ -1654,6 +1654,85 @@ namespace loader return result; } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetCommandListAppendMarkerExp + __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 + ) + { + 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 ) + return ZE_RESULT_ERROR_UNINITIALIZED; + + // convert loader handle to driver handle + hCommandList = reinterpret_cast( hCommandList )->handle; + + // convert loader handle to driver handle + hMetricGroup = reinterpret_cast( hMetricGroup )->handle; + + // forward to device-driver + result = pfnAppendMarkerExp( hCommandList, hMetricGroup, value ); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetDeviceEnableMetricsExp + __zedlllocal ze_result_t ZE_APICALL + 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( hDevice )->dditable; + auto pfnEnableMetricsExp = dditable->zet.DeviceExp.pfnEnableMetricsExp; + if( nullptr == pfnEnableMetricsExp ) + 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; + + // convert loader handle to driver handle + hDevice = reinterpret_cast( hDevice )->handle; + + // forward to device-driver + result = pfnDisableMetricsExp( hDevice ); + + return result; + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zetMetricGroupCalculateMultipleMetricValuesExp __zedlllocal ze_result_t ZE_APICALL @@ -2664,6 +2743,12 @@ zetGetDeviceExpProcAddrTable( if (version >= ZE_API_VERSION_1_10) { pDdiTable->pfnCreateMetricGroupsFromMetricsExp = loader::zetDeviceCreateMetricGroupsFromMetricsExp; } + if (version >= ZE_API_VERSION_1_13) { + pDdiTable->pfnEnableMetricsExp = loader::zetDeviceEnableMetricsExp; + } + if (version >= ZE_API_VERSION_1_13) { + pDdiTable->pfnDisableMetricsExp = loader::zetDeviceDisableMetricsExp; + } } else { @@ -2850,6 +2935,75 @@ zetGetCommandListProcAddrTable( return result; } +/////////////////////////////////////////////////////////////////////////////// +/// @brief Exported function for filling application's CommandListExp 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 +zetGetCommandListExpProcAddrTable( + ze_api_version_t version, ///< [in] API version requested + zet_command_list_exp_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; + + ze_result_t result = ZE_RESULT_SUCCESS; + + // Load the device-driver DDI tables + for( auto& drv : loader::context->zeDrivers ) + { + if(drv.initStatus != ZE_RESULT_SUCCESS) + continue; + auto getTable = reinterpret_cast( + GET_FUNCTION_PTR( drv.handle, "zetGetCommandListExpProcAddrTable") ); + if(!getTable) + continue; + result = getTable( version, &drv.dditable.zet.CommandListExp); + } + + + if( ZE_RESULT_SUCCESS == result ) + { + if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) + { + // return pointers to loader's DDIs + if (version >= ZE_API_VERSION_1_13) { + pDdiTable->pfnAppendMarkerExp = loader::zetCommandListAppendMarkerExp; + } + } + else + { + // return pointers directly to driver's DDIs + *pDdiTable = loader::context->zeDrivers.front().dditable.zet.CommandListExp; + } + } + + // 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, "zetGetCommandListExpProcAddrTable") ); + if(!getTable) + return ZE_RESULT_ERROR_UNINITIALIZED; + result = getTable( version, pDdiTable ); + } + + return result; +} + /////////////////////////////////////////////////////////////////////////////// /// @brief Exported function for filling application's Kernel table /// with current process' addresses From bf5a36f4e080ee9b64ad639c1b7eff6462b09793 Mon Sep 17 00:00:00 2001 From: "Neil R. Spruit" Date: Wed, 14 May 2025 15:32:46 -0700 Subject: [PATCH 09/28] Fix zesInit to init the correct requested api version (#332) Signed-off-by: Neil R. Spruit --- scripts/templates/ldrddi.cpp.mako | 5 +- scripts/templates/ze_loader_internal.h.mako | 1 + source/loader/ze_ldrddi.cpp | 95 ++++++++++++--------- source/loader/ze_loader.cpp | 2 +- source/loader/ze_loader_internal.h | 1 + source/loader/zes_ldrddi.cpp | 95 ++++++++++++--------- source/loader/zet_ldrddi.cpp | 60 +++++++------ 7 files changed, 156 insertions(+), 103 deletions(-) diff --git a/scripts/templates/ldrddi.cpp.mako b/scripts/templates/ldrddi.cpp.mako index 72e5c2ed..975ea7c7 100644 --- a/scripts/templates/ldrddi.cpp.mako +++ b/scripts/templates/ldrddi.cpp.mako @@ -410,9 +410,10 @@ ${tbl['export']['name']}( %endif %if tbl['experimental'] is False: #//Experimental Tables may not be implemented in driver auto getTableResult = getTable( version, &drv.dditable.${n}.${tbl['name']}); - if(getTableResult == ZE_RESULT_SUCCESS) + if(getTableResult == ZE_RESULT_SUCCESS) { atLeastOneDriverValid = true; - else + loader::context->configured_version = version; + } else drv.initStatus = getTableResult; %if namespace != "zes": %if tbl['name'] == "Global": diff --git a/scripts/templates/ze_loader_internal.h.mako b/scripts/templates/ze_loader_internal.h.mako index 9937b814..d249eb80 100644 --- a/scripts/templates/ze_loader_internal.h.mako +++ b/scripts/templates/ze_loader_internal.h.mako @@ -93,6 +93,7 @@ namespace loader std::unordered_map image_handle_map; std::unordered_map sampler_handle_map; ze_api_version_t version = ZE_API_VERSION_CURRENT; + ze_api_version_t configured_version = ZE_API_VERSION_CURRENT; driver_vector_t allDrivers; driver_vector_t zeDrivers; diff --git a/source/loader/ze_ldrddi.cpp b/source/loader/ze_ldrddi.cpp index ad443e83..f424c7c4 100644 --- a/source/loader/ze_ldrddi.cpp +++ b/source/loader/ze_ldrddi.cpp @@ -6909,9 +6909,10 @@ zeGetGlobalProcAddrTable( if(!getTable) continue; auto getTableResult = getTable( version, &drv.dditable.ze.Global); - if(getTableResult == ZE_RESULT_SUCCESS) + if(getTableResult == ZE_RESULT_SUCCESS) { atLeastOneDriverValid = true; - else + loader::context->configured_version = version; + } else drv.initStatus = getTableResult; if (drv.dditable.ze.Global.pfnInitDrivers) { loader::context->initDriversSupport = true; @@ -7009,9 +7010,10 @@ zeGetRTASBuilderProcAddrTable( if(!getTable) continue; auto getTableResult = getTable( version, &drv.dditable.ze.RTASBuilder); - if(getTableResult == ZE_RESULT_SUCCESS) + if(getTableResult == ZE_RESULT_SUCCESS) { atLeastOneDriverValid = true; - else + loader::context->configured_version = version; + } else drv.initStatus = getTableResult; } @@ -7209,9 +7211,10 @@ zeGetRTASParallelOperationProcAddrTable( if(!getTable) continue; auto getTableResult = getTable( version, &drv.dditable.ze.RTASParallelOperation); - if(getTableResult == ZE_RESULT_SUCCESS) + if(getTableResult == ZE_RESULT_SUCCESS) { atLeastOneDriverValid = true; - else + loader::context->configured_version = version; + } else drv.initStatus = getTableResult; } @@ -7406,9 +7409,10 @@ zeGetDriverProcAddrTable( if(!getTable) continue; auto getTableResult = getTable( version, &drv.dditable.ze.Driver); - if(getTableResult == ZE_RESULT_SUCCESS) + if(getTableResult == ZE_RESULT_SUCCESS) { atLeastOneDriverValid = true; - else + loader::context->configured_version = version; + } else drv.initStatus = getTableResult; } @@ -7606,9 +7610,10 @@ zeGetDeviceProcAddrTable( if(!getTable) continue; auto getTableResult = getTable( version, &drv.dditable.ze.Device); - if(getTableResult == ZE_RESULT_SUCCESS) + if(getTableResult == ZE_RESULT_SUCCESS) { atLeastOneDriverValid = true; - else + loader::context->configured_version = version; + } else drv.initStatus = getTableResult; } @@ -7848,9 +7853,10 @@ zeGetContextProcAddrTable( if(!getTable) continue; auto getTableResult = getTable( version, &drv.dditable.ze.Context); - if(getTableResult == ZE_RESULT_SUCCESS) + if(getTableResult == ZE_RESULT_SUCCESS) { atLeastOneDriverValid = true; - else + loader::context->configured_version = version; + } else drv.initStatus = getTableResult; } @@ -7966,9 +7972,10 @@ zeGetCommandQueueProcAddrTable( if(!getTable) continue; auto getTableResult = getTable( version, &drv.dditable.ze.CommandQueue); - if(getTableResult == ZE_RESULT_SUCCESS) + if(getTableResult == ZE_RESULT_SUCCESS) { atLeastOneDriverValid = true; - else + loader::context->configured_version = version; + } else drv.initStatus = getTableResult; } @@ -8075,9 +8082,10 @@ zeGetCommandListProcAddrTable( if(!getTable) continue; auto getTableResult = getTable( version, &drv.dditable.ze.CommandList); - if(getTableResult == ZE_RESULT_SUCCESS) + if(getTableResult == ZE_RESULT_SUCCESS) { atLeastOneDriverValid = true; - else + loader::context->configured_version = version; + } else drv.initStatus = getTableResult; } @@ -8380,9 +8388,10 @@ zeGetEventProcAddrTable( if(!getTable) continue; auto getTableResult = getTable( version, &drv.dditable.ze.Event); - if(getTableResult == ZE_RESULT_SUCCESS) + if(getTableResult == ZE_RESULT_SUCCESS) { atLeastOneDriverValid = true; - else + loader::context->configured_version = version; + } else drv.initStatus = getTableResult; } @@ -8589,9 +8598,10 @@ zeGetEventPoolProcAddrTable( if(!getTable) continue; auto getTableResult = getTable( version, &drv.dditable.ze.EventPool); - if(getTableResult == ZE_RESULT_SUCCESS) + if(getTableResult == ZE_RESULT_SUCCESS) { atLeastOneDriverValid = true; - else + loader::context->configured_version = version; + } else drv.initStatus = getTableResult; } @@ -8704,9 +8714,10 @@ zeGetFenceProcAddrTable( if(!getTable) continue; auto getTableResult = getTable( version, &drv.dditable.ze.Fence); - if(getTableResult == ZE_RESULT_SUCCESS) + if(getTableResult == ZE_RESULT_SUCCESS) { atLeastOneDriverValid = true; - else + loader::context->configured_version = version; + } else drv.initStatus = getTableResult; } @@ -8810,9 +8821,10 @@ zeGetImageProcAddrTable( if(!getTable) continue; auto getTableResult = getTable( version, &drv.dditable.ze.Image); - if(getTableResult == ZE_RESULT_SUCCESS) + if(getTableResult == ZE_RESULT_SUCCESS) { atLeastOneDriverValid = true; - else + loader::context->configured_version = version; + } else drv.initStatus = getTableResult; } @@ -9007,9 +9019,10 @@ zeGetKernelProcAddrTable( if(!getTable) continue; auto getTableResult = getTable( version, &drv.dditable.ze.Kernel); - if(getTableResult == ZE_RESULT_SUCCESS) + if(getTableResult == ZE_RESULT_SUCCESS) { atLeastOneDriverValid = true; - else + loader::context->configured_version = version; + } else drv.initStatus = getTableResult; } @@ -9225,9 +9238,10 @@ zeGetMemProcAddrTable( if(!getTable) continue; auto getTableResult = getTable( version, &drv.dditable.ze.Mem); - if(getTableResult == ZE_RESULT_SUCCESS) + if(getTableResult == ZE_RESULT_SUCCESS) { atLeastOneDriverValid = true; - else + loader::context->configured_version = version; + } else drv.initStatus = getTableResult; } @@ -9446,9 +9460,10 @@ zeGetModuleProcAddrTable( if(!getTable) continue; auto getTableResult = getTable( version, &drv.dditable.ze.Module); - if(getTableResult == ZE_RESULT_SUCCESS) + if(getTableResult == ZE_RESULT_SUCCESS) { atLeastOneDriverValid = true; - else + loader::context->configured_version = version; + } else drv.initStatus = getTableResult; } @@ -9564,9 +9579,10 @@ zeGetModuleBuildLogProcAddrTable( if(!getTable) continue; auto getTableResult = getTable( version, &drv.dditable.ze.ModuleBuildLog); - if(getTableResult == ZE_RESULT_SUCCESS) + if(getTableResult == ZE_RESULT_SUCCESS) { atLeastOneDriverValid = true; - else + loader::context->configured_version = version; + } else drv.initStatus = getTableResult; } @@ -9661,9 +9677,10 @@ zeGetPhysicalMemProcAddrTable( if(!getTable) continue; auto getTableResult = getTable( version, &drv.dditable.ze.PhysicalMem); - if(getTableResult == ZE_RESULT_SUCCESS) + if(getTableResult == ZE_RESULT_SUCCESS) { atLeastOneDriverValid = true; - else + loader::context->configured_version = version; + } else drv.initStatus = getTableResult; } @@ -9758,9 +9775,10 @@ zeGetSamplerProcAddrTable( if(!getTable) continue; auto getTableResult = getTable( version, &drv.dditable.ze.Sampler); - if(getTableResult == ZE_RESULT_SUCCESS) + if(getTableResult == ZE_RESULT_SUCCESS) { atLeastOneDriverValid = true; - else + loader::context->configured_version = version; + } else drv.initStatus = getTableResult; } @@ -9855,9 +9873,10 @@ zeGetVirtualMemProcAddrTable( if(!getTable) continue; auto getTableResult = getTable( version, &drv.dditable.ze.VirtualMem); - if(getTableResult == ZE_RESULT_SUCCESS) + if(getTableResult == ZE_RESULT_SUCCESS) { atLeastOneDriverValid = true; - else + loader::context->configured_version = version; + } else drv.initStatus = getTableResult; } diff --git a/source/loader/ze_loader.cpp b/source/loader/ze_loader.cpp index 1cad8aba..fb05f7e6 100644 --- a/source/loader/ze_loader.cpp +++ b/source/loader/ze_loader.cpp @@ -372,7 +372,7 @@ namespace loader } zes_global_dditable_t global; - auto getTableResult = getTable(ZE_API_VERSION_CURRENT, &global); + auto getTableResult = getTable(this->configured_version, &global); if(getTableResult != ZE_RESULT_SUCCESS) { if (debugTraceEnabled) { std::string errorMessage = "init driver " + driver.name + " failed, zesGetGlobalProcAddrTable() failed with "; diff --git a/source/loader/ze_loader_internal.h b/source/loader/ze_loader_internal.h index e391523b..d3e42238 100644 --- a/source/loader/ze_loader_internal.h +++ b/source/loader/ze_loader_internal.h @@ -129,6 +129,7 @@ namespace loader std::unordered_map image_handle_map; std::unordered_map sampler_handle_map; ze_api_version_t version = ZE_API_VERSION_CURRENT; + ze_api_version_t configured_version = ZE_API_VERSION_CURRENT; driver_vector_t allDrivers; driver_vector_t zeDrivers; diff --git a/source/loader/zes_ldrddi.cpp b/source/loader/zes_ldrddi.cpp index de3a665a..db5649ed 100644 --- a/source/loader/zes_ldrddi.cpp +++ b/source/loader/zes_ldrddi.cpp @@ -4623,9 +4623,10 @@ zesGetGlobalProcAddrTable( continue; } auto getTableResult = getTable( version, &drv.dditable.zes.Global); - if(getTableResult == ZE_RESULT_SUCCESS) + if(getTableResult == ZE_RESULT_SUCCESS) { atLeastOneDriverValid = true; - else + loader::context->configured_version = version; + } else drv.initStatus = getTableResult; } @@ -4701,9 +4702,10 @@ zesGetDeviceProcAddrTable( if(!getTable) continue; auto getTableResult = getTable( version, &drv.dditable.zes.Device); - if(getTableResult == ZE_RESULT_SUCCESS) + if(getTableResult == ZE_RESULT_SUCCESS) { atLeastOneDriverValid = true; - else + loader::context->configured_version = version; + } else drv.initStatus = getTableResult; } @@ -4962,9 +4964,10 @@ zesGetDriverProcAddrTable( if(!getTable) continue; auto getTableResult = getTable( version, &drv.dditable.zes.Driver); - if(getTableResult == ZE_RESULT_SUCCESS) + if(getTableResult == ZE_RESULT_SUCCESS) { atLeastOneDriverValid = true; - else + loader::context->configured_version = version; + } else drv.initStatus = getTableResult; } @@ -5121,9 +5124,10 @@ zesGetDiagnosticsProcAddrTable( if(!getTable) continue; auto getTableResult = getTable( version, &drv.dditable.zes.Diagnostics); - if(getTableResult == ZE_RESULT_SUCCESS) + if(getTableResult == ZE_RESULT_SUCCESS) { atLeastOneDriverValid = true; - else + loader::context->configured_version = version; + } else drv.initStatus = getTableResult; } @@ -5205,9 +5209,10 @@ zesGetEngineProcAddrTable( if(!getTable) continue; auto getTableResult = getTable( version, &drv.dditable.zes.Engine); - if(getTableResult == ZE_RESULT_SUCCESS) + if(getTableResult == ZE_RESULT_SUCCESS) { atLeastOneDriverValid = true; - else + loader::context->configured_version = version; + } else drv.initStatus = getTableResult; } @@ -5289,9 +5294,10 @@ zesGetFabricPortProcAddrTable( if(!getTable) continue; auto getTableResult = getTable( version, &drv.dditable.zes.FabricPort); - if(getTableResult == ZE_RESULT_SUCCESS) + if(getTableResult == ZE_RESULT_SUCCESS) { atLeastOneDriverValid = true; - else + loader::context->configured_version = version; + } else drv.initStatus = getTableResult; } @@ -5388,9 +5394,10 @@ zesGetFanProcAddrTable( if(!getTable) continue; auto getTableResult = getTable( version, &drv.dditable.zes.Fan); - if(getTableResult == ZE_RESULT_SUCCESS) + if(getTableResult == ZE_RESULT_SUCCESS) { atLeastOneDriverValid = true; - else + loader::context->configured_version = version; + } else drv.initStatus = getTableResult; } @@ -5481,9 +5488,10 @@ zesGetFirmwareProcAddrTable( if(!getTable) continue; auto getTableResult = getTable( version, &drv.dditable.zes.Firmware); - if(getTableResult == ZE_RESULT_SUCCESS) + if(getTableResult == ZE_RESULT_SUCCESS) { atLeastOneDriverValid = true; - else + loader::context->configured_version = version; + } else drv.initStatus = getTableResult; } @@ -5640,9 +5648,10 @@ zesGetFrequencyProcAddrTable( if(!getTable) continue; auto getTableResult = getTable( version, &drv.dditable.zes.Frequency); - if(getTableResult == ZE_RESULT_SUCCESS) + if(getTableResult == ZE_RESULT_SUCCESS) { atLeastOneDriverValid = true; - else + loader::context->configured_version = version; + } else drv.initStatus = getTableResult; } @@ -5766,9 +5775,10 @@ zesGetLedProcAddrTable( if(!getTable) continue; auto getTableResult = getTable( version, &drv.dditable.zes.Led); - if(getTableResult == ZE_RESULT_SUCCESS) + if(getTableResult == ZE_RESULT_SUCCESS) { atLeastOneDriverValid = true; - else + loader::context->configured_version = version; + } else drv.initStatus = getTableResult; } @@ -5853,9 +5863,10 @@ zesGetMemoryProcAddrTable( if(!getTable) continue; auto getTableResult = getTable( version, &drv.dditable.zes.Memory); - if(getTableResult == ZE_RESULT_SUCCESS) + if(getTableResult == ZE_RESULT_SUCCESS) { atLeastOneDriverValid = true; - else + loader::context->configured_version = version; + } else drv.initStatus = getTableResult; } @@ -5941,9 +5952,10 @@ zesGetOverclockProcAddrTable( continue; } auto getTableResult = getTable( version, &drv.dditable.zes.Overclock); - if(getTableResult == ZE_RESULT_SUCCESS) + if(getTableResult == ZE_RESULT_SUCCESS) { atLeastOneDriverValid = true; - else + loader::context->configured_version = version; + } else drv.initStatus = getTableResult; } @@ -6043,9 +6055,10 @@ zesGetPerformanceFactorProcAddrTable( if(!getTable) continue; auto getTableResult = getTable( version, &drv.dditable.zes.PerformanceFactor); - if(getTableResult == ZE_RESULT_SUCCESS) + if(getTableResult == ZE_RESULT_SUCCESS) { atLeastOneDriverValid = true; - else + loader::context->configured_version = version; + } else drv.initStatus = getTableResult; } @@ -6127,9 +6140,10 @@ zesGetPowerProcAddrTable( if(!getTable) continue; auto getTableResult = getTable( version, &drv.dditable.zes.Power); - if(getTableResult == ZE_RESULT_SUCCESS) + if(getTableResult == ZE_RESULT_SUCCESS) { atLeastOneDriverValid = true; - else + loader::context->configured_version = version; + } else drv.initStatus = getTableResult; } @@ -6226,9 +6240,10 @@ zesGetPsuProcAddrTable( if(!getTable) continue; auto getTableResult = getTable( version, &drv.dditable.zes.Psu); - if(getTableResult == ZE_RESULT_SUCCESS) + if(getTableResult == ZE_RESULT_SUCCESS) { atLeastOneDriverValid = true; - else + loader::context->configured_version = version; + } else drv.initStatus = getTableResult; } @@ -6307,9 +6322,10 @@ zesGetRasProcAddrTable( if(!getTable) continue; auto getTableResult = getTable( version, &drv.dditable.zes.Ras); - if(getTableResult == ZE_RESULT_SUCCESS) + if(getTableResult == ZE_RESULT_SUCCESS) { atLeastOneDriverValid = true; - else + loader::context->configured_version = version; + } else drv.initStatus = getTableResult; } @@ -6466,9 +6482,10 @@ zesGetSchedulerProcAddrTable( if(!getTable) continue; auto getTableResult = getTable( version, &drv.dditable.zes.Scheduler); - if(getTableResult == ZE_RESULT_SUCCESS) + if(getTableResult == ZE_RESULT_SUCCESS) { atLeastOneDriverValid = true; - else + loader::context->configured_version = version; + } else drv.initStatus = getTableResult; } @@ -6565,9 +6582,10 @@ zesGetStandbyProcAddrTable( if(!getTable) continue; auto getTableResult = getTable( version, &drv.dditable.zes.Standby); - if(getTableResult == ZE_RESULT_SUCCESS) + if(getTableResult == ZE_RESULT_SUCCESS) { atLeastOneDriverValid = true; - else + loader::context->configured_version = version; + } else drv.initStatus = getTableResult; } @@ -6649,9 +6667,10 @@ zesGetTemperatureProcAddrTable( if(!getTable) continue; auto getTableResult = getTable( version, &drv.dditable.zes.Temperature); - if(getTableResult == ZE_RESULT_SUCCESS) + if(getTableResult == ZE_RESULT_SUCCESS) { atLeastOneDriverValid = true; - else + loader::context->configured_version = version; + } else drv.initStatus = getTableResult; } diff --git a/source/loader/zet_ldrddi.cpp b/source/loader/zet_ldrddi.cpp index f0f99072..3077950e 100644 --- a/source/loader/zet_ldrddi.cpp +++ b/source/loader/zet_ldrddi.cpp @@ -2652,9 +2652,10 @@ zetGetDeviceProcAddrTable( if(!getTable) continue; auto getTableResult = getTable( version, &drv.dditable.zet.Device); - if(getTableResult == ZE_RESULT_SUCCESS) + if(getTableResult == ZE_RESULT_SUCCESS) { atLeastOneDriverValid = true; - else + loader::context->configured_version = version; + } else drv.initStatus = getTableResult; } @@ -2808,9 +2809,10 @@ zetGetContextProcAddrTable( if(!getTable) continue; auto getTableResult = getTable( version, &drv.dditable.zet.Context); - if(getTableResult == ZE_RESULT_SUCCESS) + if(getTableResult == ZE_RESULT_SUCCESS) { atLeastOneDriverValid = true; - else + loader::context->configured_version = version; + } else drv.initStatus = getTableResult; } @@ -2886,9 +2888,10 @@ zetGetCommandListProcAddrTable( if(!getTable) continue; auto getTableResult = getTable( version, &drv.dditable.zet.CommandList); - if(getTableResult == ZE_RESULT_SUCCESS) + if(getTableResult == ZE_RESULT_SUCCESS) { atLeastOneDriverValid = true; - else + loader::context->configured_version = version; + } else drv.initStatus = getTableResult; } @@ -3042,9 +3045,10 @@ zetGetKernelProcAddrTable( if(!getTable) continue; auto getTableResult = getTable( version, &drv.dditable.zet.Kernel); - if(getTableResult == ZE_RESULT_SUCCESS) + if(getTableResult == ZE_RESULT_SUCCESS) { atLeastOneDriverValid = true; - else + loader::context->configured_version = version; + } else drv.initStatus = getTableResult; } @@ -3120,9 +3124,10 @@ zetGetModuleProcAddrTable( if(!getTable) continue; auto getTableResult = getTable( version, &drv.dditable.zet.Module); - if(getTableResult == ZE_RESULT_SUCCESS) + if(getTableResult == ZE_RESULT_SUCCESS) { atLeastOneDriverValid = true; - else + loader::context->configured_version = version; + } else drv.initStatus = getTableResult; } @@ -3198,9 +3203,10 @@ zetGetDebugProcAddrTable( if(!getTable) continue; auto getTableResult = getTable( version, &drv.dditable.zet.Debug); - if(getTableResult == ZE_RESULT_SUCCESS) + if(getTableResult == ZE_RESULT_SUCCESS) { atLeastOneDriverValid = true; - else + loader::context->configured_version = version; + } else drv.initStatus = getTableResult; } @@ -3309,9 +3315,10 @@ zetGetMetricProcAddrTable( if(!getTable) continue; auto getTableResult = getTable( version, &drv.dditable.zet.Metric); - if(getTableResult == ZE_RESULT_SUCCESS) + if(getTableResult == ZE_RESULT_SUCCESS) { atLeastOneDriverValid = true; - else + loader::context->configured_version = version; + } else drv.initStatus = getTableResult; } @@ -3465,9 +3472,10 @@ zetGetMetricGroupProcAddrTable( if(!getTable) continue; auto getTableResult = getTable( version, &drv.dditable.zet.MetricGroup); - if(getTableResult == ZE_RESULT_SUCCESS) + if(getTableResult == ZE_RESULT_SUCCESS) { atLeastOneDriverValid = true; - else + loader::context->configured_version = version; + } else drv.initStatus = getTableResult; } @@ -3642,9 +3650,10 @@ zetGetMetricQueryProcAddrTable( if(!getTable) continue; auto getTableResult = getTable( version, &drv.dditable.zet.MetricQuery); - if(getTableResult == ZE_RESULT_SUCCESS) + if(getTableResult == ZE_RESULT_SUCCESS) { atLeastOneDriverValid = true; - else + loader::context->configured_version = version; + } else drv.initStatus = getTableResult; } @@ -3729,9 +3738,10 @@ zetGetMetricQueryPoolProcAddrTable( if(!getTable) continue; auto getTableResult = getTable( version, &drv.dditable.zet.MetricQueryPool); - if(getTableResult == ZE_RESULT_SUCCESS) + if(getTableResult == ZE_RESULT_SUCCESS) { atLeastOneDriverValid = true; - else + loader::context->configured_version = version; + } else drv.initStatus = getTableResult; } @@ -3810,9 +3820,10 @@ zetGetMetricStreamerProcAddrTable( if(!getTable) continue; auto getTableResult = getTable( version, &drv.dditable.zet.MetricStreamer); - if(getTableResult == ZE_RESULT_SUCCESS) + if(getTableResult == ZE_RESULT_SUCCESS) { atLeastOneDriverValid = true; - else + loader::context->configured_version = version; + } else drv.initStatus = getTableResult; } @@ -3894,9 +3905,10 @@ zetGetTracerExpProcAddrTable( if(!getTable) continue; auto getTableResult = getTable( version, &drv.dditable.zet.TracerExp); - if(getTableResult == ZE_RESULT_SUCCESS) + if(getTableResult == ZE_RESULT_SUCCESS) { atLeastOneDriverValid = true; - else + loader::context->configured_version = version; + } else drv.initStatus = getTableResult; } From abc68a57e5d536a449a5e45f1aef85285fa70088 Mon Sep 17 00:00:00 2001 From: "Neil R. Spruit" Date: Thu, 15 May 2025 08:39:21 -0700 Subject: [PATCH 10/28] Fix sysman only init to disallow retrieval of loader context due to version compatibility (#334) - Given the static loader will no longer call the sysman apis directly, but thru the dynamic loader, split sysman drivers will be done by the dynamic loader and assignment in the static loader is not needed. - When the context read from the loader was newer than the context locally, the memory assignment was invalid causing issues. Signed-off-by: Neil R. Spruit --- source/lib/ze_lib.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/source/lib/ze_lib.cpp b/source/lib/ze_lib.cpp index 2046f5fa..a470efee 100644 --- a/source/lib/ze_lib.cpp +++ b/source/lib/ze_lib.cpp @@ -174,16 +174,12 @@ namespace ze_lib // Given zesInit, then zesDrivers needs to be used as the sysmanInstanceDrivers; bool loaderContextAccessAllowed = true; #ifdef DYNAMIC_LOAD_LOADER + loaderContextAccessAllowed = false; loader::context_t *loaderContext = nullptr; - if (loaderGetContext == nullptr) { - loaderContextAccessAllowed = false; - } else { - loaderContext = loaderGetContext(); - } #else loader::context_t *loaderContext = loader::context; #endif - if (sysmanOnly && loaderContextAccessAllowed) { + if (sysmanOnly && loaderContextAccessAllowed && loaderContext != nullptr) { loaderContext->sysmanInstanceDrivers = &loaderContext->zesDrivers; } From 1a14f0d692307cce9e7ca26a1b162cc98a00d4cc Mon Sep 17 00:00:00 2001 From: "Neil R. Spruit" Date: Thu, 15 May 2025 12:18:14 -0700 Subject: [PATCH 11/28] Fix version update and GUID update for 1.22.2 (#336) Signed-off-by: Neil R. Spruit --- CMakeLists.txt | 2 +- PRODUCT_GUID.txt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d3d8b34c..11d9c041 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.22.1) +project(level-zero VERSION 1.22.2) include(GNUInstallDirs) diff --git a/PRODUCT_GUID.txt b/PRODUCT_GUID.txt index a0ef1a6a..620632cd 100644 --- a/PRODUCT_GUID.txt +++ b/PRODUCT_GUID.txt @@ -1,2 +1,2 @@ -1.22.1 -7c020ce6-fe70-4b38-8227-997082444587 \ No newline at end of file +1.22.2 +3c13e883-2082-4dcb-811f-81b387aef3ac \ No newline at end of file From 35c037cdf4aa9a2e6df34b6f1ce1bdc86ac5422f Mon Sep 17 00:00:00 2001 From: "Neil R. Spruit" Date: Fri, 16 May 2025 13:08:22 -0700 Subject: [PATCH 12/28] Add ability to Register a TeardownCallback to notify release of L0 resources (#333) * Add ability to Register a TeardownCallback to notify release of L0 resources Signed-off-by: Neil R. Spruit --- include/loader/ze_loader.h | 35 +++++ source/lib/ze_lib.cpp | 258 +++++++++++++++++++++++-------------- source/lib/ze_lib.h | 11 ++ 3 files changed, 209 insertions(+), 95 deletions(-) diff --git a/include/loader/ze_loader.h b/include/loader/ze_loader.h index dec810e1..5b6261e2 100644 --- a/include/loader/ze_loader.h +++ b/include/loader/ze_loader.h @@ -94,6 +94,41 @@ zelEnableTracingLayer(); ZE_DLLEXPORT bool ZE_APICALL zelCheckIsLoaderInTearDown(); +typedef void (*zel_loader_teardown_callback_t)(); +typedef void (*zel_application_teardown_callback_t)(uint32_t index); + +/** + * @brief Registers a teardown callback to be invoked during loader teardown. + * + * This function allows the application to register a callback function that will be called + * when the loader is being torn down. The loader will also provide its own callback function + * and assign an index to the registered callback. + * + * The application_callback is required to be a function that takes no arguments and returns void. + * In addition, the application_callback should be thread-safe and not block to prevent deadlocking the + * loader teardown process. + * + * For example, the application_callback used by the static loader is: + * void staticLoaderTeardownCallback() { + * loaderTeardownCallbackReceived = true; + * } + * The application_callback should provide a simple notification to the application that the loader is being torn down. + * + * @param[in] application_callback Application's callback function to be called during loader teardown. + * @param[out] loader_callback Pointer to the loader's callback function. + * @param[out] index Index assigned to the registered callback. + * + * @return + * - ZE_RESULT_SUCCESS if the callback was successfully registered. + * - Appropriate error code otherwise. + */ +ZE_DLLEXPORT ze_result_t ZE_APICALL +zelRegisterTeardownCallback( + zel_loader_teardown_callback_t application_callback, // [in] Application's callback function to be called during loader teardown + zel_application_teardown_callback_t *loader_callback, // [out] Pointer to the loader's callback function + uint32_t *index // [out] Index assigned to the registered callback +); + /////////////////////////////////////////////////////////////////////////////// /// @brief Exported function for Disabling the Tracing Layer During Runtime. /// diff --git a/source/lib/ze_lib.cpp b/source/lib/ze_lib.cpp index a470efee..b4554d52 100644 --- a/source/lib/ze_lib.cpp +++ b/source/lib/ze_lib.cpp @@ -27,7 +27,37 @@ namespace ze_lib } } bool delayContextDestruction = false; + bool loaderTeardownCallbackReceived = false; + bool loaderTeardownRegistrationEnabled = false; + + /// @brief Callback function to handle loader teardown events. + /// + /// This function sets the `loaderTeardownCallbackReceived` flag to true, + /// indicating that a loader teardown callback has been received. + /// It is intended to be used as a static callback during the loader's + /// teardown process. + void staticLoaderTeardownCallback() { + loaderTeardownCallbackReceived = true; + } #endif + /** + * @brief Removes a teardown callback from the context's callback registry. + * + * This function checks if a teardown callback with the specified index exists + * in the context's teardownCallbacks map. If it exists, the callback is removed. + * + * @param index The unique identifier of the teardown callback to remove. + */ + void applicationTeardownCallback(uint32_t index) { + std::lock_guard lock(ze_lib::context->teardownCallbacksMutex); + if (ze_lib::context->teardownCallbacks.find(index) != ze_lib::context->teardownCallbacks.end()) { + if (ze_lib::context->debugTraceEnabled) { + std::string message = "applicationTeardownCallback received for index: " + std::to_string(index); + ze_lib::context->debug_trace_message(message, ""); + } + ze_lib::context->teardownCallbacks.erase(index); + } + } bool destruction = false; /////////////////////////////////////////////////////////////////////////////// @@ -40,9 +70,19 @@ namespace ze_lib __zedlllocal context_t::~context_t() { #ifdef DYNAMIC_LOAD_LOADER + if (loaderTeardownRegistrationEnabled && !loaderTeardownCallbackReceived) { + loaderTeardownCallback(loaderTeardownCallbackIndex); + } if (loader) { FREE_DRIVER_LIBRARY( loader ); } +#else + // Given the loader teardown, notify the registered callbacks that the loader is being torn down. + for (auto &callback : teardownCallbacks) { + callback.second(); + } + // Clear the teardown callbacks map once the callbacks have been executed. + teardownCallbacks.clear(); #endif ze_lib::destruction = true; }; @@ -339,9 +379,29 @@ namespace ze_lib isInitialized = true; } #ifdef DYNAMIC_LOAD_LOADER - if (!delayContextDestruction) { - std::atexit(context_at_exit_destructor); - } + std::call_once(ze_lib::context->initTeardownCallbacksOnce, [this]() { + if (!delayContextDestruction) { + std::atexit(context_at_exit_destructor); + } + // Get the function pointer for zelRegisterTeardownCallback from the dynamic loader + typedef ze_result_t (ZE_APICALL *zelRegisterTeardownCallback_t)( + zel_loader_teardown_callback_t, + zel_application_teardown_callback_t*, + uint32_t*); + auto pfnZelRegisterTeardownCallback = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zelRegisterTeardownCallback")); + if (pfnZelRegisterTeardownCallback != nullptr) { + auto register_teardown_result = pfnZelRegisterTeardownCallback(staticLoaderTeardownCallback, &loaderTeardownCallback, &loaderTeardownCallbackIndex); + if (register_teardown_result != ZE_RESULT_SUCCESS) { + std::string message = "ze_lib Context Init() zelRegisterTeardownCallback failed with "; + debug_trace_message(message, to_string(register_teardown_result)); + } else { + loaderTeardownRegistrationEnabled = true; + std::string message = "ze_lib Context Init() zelRegisterTeardownCallback completed for the static loader with"; + debug_trace_message(message, to_string(register_teardown_result)); + } + } + }); #endif return result; } @@ -393,6 +453,15 @@ zelSetDriverTeardown() { ze_result_t result = ZE_RESULT_SUCCESS; if (!ze_lib::destruction) { + if (ze_lib::context) { + // Given the driver teardown, notify the registered callbacks that the loader is being torn down. + for (auto &callback : ze_lib::context->teardownCallbacks) { + callback.second(); + } + // Clear the registered callbacks now that they have been called. + ze_lib::context->teardownCallbacks.clear(); + } + ze_lib::destruction = true; } return result; @@ -408,117 +477,116 @@ zelSetDelayLoaderContextTeardown() #endif } -#ifdef DYNAMIC_LOAD_LOADER -#define ZEL_STABILITY_CHECK_RESULT_SUCCESS 0 -#define ZEL_STABILITY_CHECK_RESULT_DRIVER_GET_NULL 1 -#define ZEL_STABILITY_CHECK_RESULT_DRIVER_GET_FAILED 2 -#define ZEL_STABILITY_CHECK_RESULT_EXCEPTION 3 - -/** - * @brief Performs a stability check for the Level Zero loader. - * - * This function checks the stability of the Level Zero loader by verifying - * the presence of the loader module, the validity of the `zeDriverGet` function - * pointer, and the ability to retrieve driver information. The result of the - * stability check is communicated through the provided promise. - * - * @param stabilityPromise A promise object used to communicate the result of - * the stability check. The promise is set with one of - * the following values: - * - ZEL_STABILITY_CHECK_RESULT_DRIVER_GET_NULL: The - * `zeDriverGet` function pointer is invalid. - * - ZEL_STABILITY_CHECK_RESULT_DRIVER_GET_FAILED: The - * loader failed to retrieve driver information. - * - ZEL_STABILITY_CHECK_RESULT_EXCEPTION: An - * exception occurred during the stability check. - * - ZEL_STABILITY_CHECK_RESULT_SUCCESS: The stability - * check was successful. - * - * @note If debug tracing is enabled, debug messages are logged for each failure - * scenario. - * @note If the Loader is completely torn down, this thread is expected to be killed - * due to invalid memory access and the stability check will determine a failure. - * - * @exception This function catches all exceptions internally and does not throw. - */ -void stabilityCheck(std::promise stabilityPromise) { - try { - if (!ze_lib::context->loaderDriverGet) { - if (ze_lib::context->debugTraceEnabled) { - std::string message = "LoaderDriverGet is a bad pointer. Exiting stability checker thread."; - ze_lib::context->debug_trace_message(message, ""); - } - stabilityPromise.set_value(ZEL_STABILITY_CHECK_RESULT_DRIVER_GET_NULL); - return; - } - - uint32_t driverCount = 0; - ze_result_t result = ZE_RESULT_ERROR_UNINITIALIZED; - result = ze_lib::context->loaderDriverGet(&driverCount, nullptr); - if (result != ZE_RESULT_SUCCESS || driverCount == 0) { - if (ze_lib::context->debugTraceEnabled) { - std::string message = "Loader stability check failed. Exiting stability checker thread."; - ze_lib::context->debug_trace_message(message, ""); - } - stabilityPromise.set_value(ZEL_STABILITY_CHECK_RESULT_DRIVER_GET_FAILED); - return; +/// @brief Registers a teardown callback function to be invoked during loader teardown. +/// +/// This function allows an application to register a callback that will be called when the loader is being torn down. +/// The loader provides a callback function pointer to the application, which the application should call to notify +/// the loader that it is tearing down. The loader will then remove the application's callback from its list of registered callbacks. +/// +/// @param[in] application_callback +/// The application's callback function to be called during loader teardown. Must not be nullptr. +/// @param[out] loader_callback +/// Pointer to the loader's callback function. The application should call this function to notify the loader of teardown. +/// @param[out] index +/// Pointer to a uint32_t that will receive the index assigned to the registered callback. +/// +/// @return +/// - ZE_RESULT_SUCCESS: The callback was successfully registered. +/// - ZE_RESULT_ERROR_INVALID_ARGUMENT: The application_callback parameter is nullptr. +/// - ZE_RESULT_ERROR_UNINITIALIZED: The loader context is not initialized. +ze_result_t ZE_APICALL +zelRegisterTeardownCallback( + zel_loader_teardown_callback_t application_callback, // [in] Application's callback function to be called during loader teardown + zel_application_teardown_callback_t *loader_callback, // [out] Pointer to the loader's callback function + uint32_t *index // [out] Index assigned to the registered callback +) { + ze_result_t result = ZE_RESULT_SUCCESS; + if (nullptr == application_callback) { + return ZE_RESULT_ERROR_INVALID_ARGUMENT; + } + if (!ze_lib::context) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + { + std::lock_guard lock(ze_lib::context->teardownCallbacksMutex); + // Assign the loader's callback function to the application callback such that the application can notify the loader + // that it is tearing down. The loader will then remove the application's callback from the list of callbacks. + *loader_callback = ze_lib::applicationTeardownCallback; + // Increment the teardown callback count and assign the index to the application callback. + ze_lib::context->teardownCallbacksCount.fetch_add(1); + *index = ze_lib::context->teardownCallbacksCount.load(); + ze_lib::context->teardownCallbacks.insert(std::pair(*index, application_callback)); + if (ze_lib::context->debugTraceEnabled) { + std::string message = "Registered teardown callback with index: " + std::to_string(*index); + ze_lib::context->debug_trace_message(message, ""); } - stabilityPromise.set_value(ZEL_STABILITY_CHECK_RESULT_SUCCESS); - return; - } catch (...) { - stabilityPromise.set_value(ZEL_STABILITY_CHECK_RESULT_EXCEPTION); - return; } + return result; } -#endif -/** - * @brief Checks if the loader is in the process of tearing down. - * - * This function determines whether the loader is in a teardown state by - * checking the destruction flag or the context pointer. If the loader is - * dynamically loaded thru the static loader code path, then it performs - * an additional stability check using a separate thread that could be killed. - * - * @return true if the loader is in teardown based on the stack variablrs - * or the stability check fails; false otherwise. - * - * @note If the macro DYNAMIC_LOAD_LOADER is defined, a stability checker - * thread is launched to perform additional checks. Any exceptions - * or errors during this process are logged if debug tracing is enabled. - */ +/// @brief Checks if the Level Zero loader is currently in the teardown state. +/// +/// This function determines whether the loader is in the process of being destroyed or is otherwise +/// unavailable for further API calls. It performs several checks, including: +/// - Whether the loader's destruction flag is set or the context is null. +/// - On Windows with dynamic loading, it checks for loader teardown notifications, +/// registration status, and the stability of the loader by attempting to call `loaderDriverGet`. +/// - If any of these checks indicate the loader is in teardown or unstable, the function returns true. +/// +/// @return true if the loader is in teardown or unstable; false otherwise. bool ZE_APICALL zelCheckIsLoaderInTearDown() { if (ze_lib::destruction || ze_lib::context == nullptr) { return true; } #if defined(DYNAMIC_LOAD_LOADER) && defined(_WIN32) - std::promise stabilityPromise; - std::future resultFuture = stabilityPromise.get_future(); - int result = -1; - try { - // Launch the stability checker thread - std::thread stabilityThread(stabilityCheck, std::move(stabilityPromise)); - result = resultFuture.get(); // Blocks until the result is available - stabilityThread.join(); - } catch (const std::exception& e) { - if (ze_lib::context->debugTraceEnabled) { - std::string message = "Exception caught in parent thread: " + std::string(e.what()); - ze_lib::context->debug_trace_message(message, ""); - } - } catch (...) { + static bool loaderIsStable = true; + if (!loaderIsStable) { if (ze_lib::context->debugTraceEnabled) { - std::string message = "Unknown exception caught in parent thread."; + std::string message = "Loader Teardown check failed before, exiting."; ze_lib::context->debug_trace_message(message, ""); } + return true; } - if (result != ZEL_STABILITY_CHECK_RESULT_SUCCESS) { + if (ze_lib::loaderTeardownCallbackReceived) { if (ze_lib::context->debugTraceEnabled) { - std::string message = "Loader stability check failed with result: " + std::to_string(result); + std::string message = "Loader Teardown Notification Received, loader in teardown state."; ze_lib::context->debug_trace_message(message, ""); } + loaderIsStable = false; return true; } + if (!ze_lib::loaderTeardownRegistrationEnabled) { + try { + if (!ze_lib::context->loaderDriverGet) { + if (ze_lib::context->debugTraceEnabled) { + std::string message = "LoaderDriverGet is a bad pointer. Exiting stability checker."; + ze_lib::context->debug_trace_message(message, ""); + } + loaderIsStable = false; + return true; + } + + uint32_t driverCount = 0; + ze_result_t result = ZE_RESULT_ERROR_UNINITIALIZED; + result = ze_lib::context->loaderDriverGet(&driverCount, nullptr); + if (result != ZE_RESULT_SUCCESS || driverCount == 0) { + if (ze_lib::context->debugTraceEnabled) { + std::string message = "Loader stability check failed. Exiting stability checker."; + ze_lib::context->debug_trace_message(message, ""); + } + loaderIsStable = false; + return true; + } + } catch (...) { + if (ze_lib::context->debugTraceEnabled) { + std::string message = "Loader stability check failed. Exception occurred."; + ze_lib::context->debug_trace_message(message, ""); + } + loaderIsStable = false; + return true; + } + } #endif return false; } diff --git a/source/lib/ze_lib.h b/source/lib/ze_lib.h index f4a2bad8..4e829f1f 100644 --- a/source/lib/ze_lib.h +++ b/source/lib/ze_lib.h @@ -17,6 +17,7 @@ #include "layers/zel_tracing_api.h" #include "layers/zel_tracing_ddi.h" #include "../utils/logging.h" +#include "loader/ze_loader.h" #include "ze_util.h" #include #include @@ -175,12 +176,22 @@ namespace ze_lib bool debugTraceEnabled = false; bool dynamicTracingSupported = true; ze_pfnDriverGet_t loaderDriverGet = nullptr; + std::atomic teardownCallbacksCount{0}; + std::map teardownCallbacks; + std::mutex teardownCallbacksMutex; + #ifdef DYNAMIC_LOAD_LOADER + std::once_flag initTeardownCallbacksOnce; + zel_application_teardown_callback_t loaderTeardownCallback = nullptr; + uint32_t loaderTeardownCallbackIndex = 0; + #endif }; extern bool destruction; extern context_t *context; #ifdef DYNAMIC_LOAD_LOADER extern bool delayContextDestruction; + extern bool loaderTeardownCallbackReceived; + extern bool loaderTeardownRegistrationEnabled; #endif } // namespace ze_lib From 79ce2b51cccfc6a2d868847c5a8f3abceb13de81 Mon Sep 17 00:00:00 2001 From: "Neil R. Spruit" Date: Fri, 23 May 2025 07:18:52 -0700 Subject: [PATCH 13/28] Fix GUID gen and update to v1.22.3 (#338) Signed-off-by: Neil R. Spruit --- CHANGELOG.md | 5 +++++ CMakeLists.txt | 36 ++++++++++++++++++++---------------- PRODUCT_GUID.txt | 4 ++-- 3 files changed, 27 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cf6f3697..302adb0f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Level zero loader changelog +## v1.22.3 +* Fix sysman-only initialization to block loader context retrieval when versions are incompatible +* Add ability to register a TeardownCallback to notify release of L0 resources +## v1.22.2 +* Fix zesInit to init the correct requested api version ## v1.22.1 * fix ddi compatibility to avoid assigning values which don't exist * Fix static loader to request current version as the latest APIs diff --git a/CMakeLists.txt b/CMakeLists.txt index 11d9c041..9a25973c 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.22.2) +project(level-zero VERSION 1.22.3) include(GNUInstallDirs) @@ -252,6 +252,11 @@ install(FILES ${LEVEL_ZERO_LOADER_API_HEADERS} COMPONENT ${SDK_COMPONENT_STRING} ) +if (MSVC) + set (PYTHON_EXECUTABLE "python") +else() + set (PYTHON_EXECUTABLE "python3") +endif() set(PRODUCT_GUID_FILE "${CMAKE_CURRENT_SOURCE_DIR}/PRODUCT_GUID.txt") if(EXISTS "${PRODUCT_GUID_FILE}") file(STRINGS "${PRODUCT_GUID_FILE}" SAVED_PRODUCT_GUID) @@ -259,23 +264,22 @@ if(EXISTS "${PRODUCT_GUID_FILE}") message(STATUS "Saved Product GUID: ${SAVED_PRODUCT_GUID_VERSION}") message(STATUS "project version: ${PROJECT_VERSION}") if(NOT SAVED_PRODUCT_GUID_VERSION STREQUAL "${PROJECT_VERSION}") - - execute_process( - COMMAND python ${CMAKE_CURRENT_SOURCE_DIR}/scripts/generate_wix_guid.py - OUTPUT_VARIABLE GENERATED_PRODUCT_GUID - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - file(WRITE "${PRODUCT_GUID_FILE}" "${PROJECT_VERSION}\n${GENERATED_PRODUCT_GUID}") - message(STATUS "Generated Product GUID: ${GENERATED_PRODUCT_GUID} for version ${PROJECT_VERSION}") - else() - string(REPLACE "\n" ";" GUID_CONTENTS "${SAVED_PRODUCT_GUID}") - list(GET GUID_CONTENTS 1 GENERATED_PRODUCT_GUID) + execute_process( + COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/scripts/generate_wix_guid.py + OUTPUT_VARIABLE GENERATED_PRODUCT_GUID + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + file(WRITE "${PRODUCT_GUID_FILE}" "${PROJECT_VERSION}\n${GENERATED_PRODUCT_GUID}") + message(STATUS "Generated Product GUID: ${GENERATED_PRODUCT_GUID} for version ${PROJECT_VERSION}") + else() + string(REPLACE "\n" ";" GUID_CONTENTS "${SAVED_PRODUCT_GUID}") + list(GET GUID_CONTENTS 1 GENERATED_PRODUCT_GUID) endif() else() execute_process( - COMMAND python ${CMAKE_CURRENT_SOURCE_DIR}/scripts/generate_wix_guid.py - OUTPUT_VARIABLE GENERATED_PRODUCT_GUID - OUTPUT_STRIP_TRAILING_WHITESPACE + COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/scripts/generate_wix_guid.py + OUTPUT_VARIABLE GENERATED_PRODUCT_GUID + OUTPUT_STRIP_TRAILING_WHITESPACE ) file(WRITE "${PRODUCT_GUID_FILE}" "${PROJECT_VERSION}\n${GENERATED_PRODUCT_GUID}") endif() @@ -385,4 +389,4 @@ if(CPACK_GENERATOR MATCHES "DEB") set(CPACK_ARCHIVE_COMPONENT_INSTALL ON) endif() -INCLUDE(CPack) +INCLUDE(CPack) \ No newline at end of file diff --git a/PRODUCT_GUID.txt b/PRODUCT_GUID.txt index 620632cd..b1c6a38c 100644 --- a/PRODUCT_GUID.txt +++ b/PRODUCT_GUID.txt @@ -1,2 +1,2 @@ -1.22.2 -3c13e883-2082-4dcb-811f-81b387aef3ac \ No newline at end of file +1.22.3 +b3491b8d-9942-47bf-be47-8741f9614566 \ No newline at end of file From de1e9f42641cf7513672c2f3a5c306034a4f7e96 Mon Sep 17 00:00:00 2001 From: "Neil R. Spruit" Date: Fri, 30 May 2025 15:08:31 -0700 Subject: [PATCH 14/28] Rename the static build define from DYNAMIC_LOAD_LOADER to L0_STATIC_LOADER_BUILD (#339) Signed-off-by: Neil R. Spruit --- scripts/templates/libapi.cpp.mako | 8 +- scripts/templates/libddi.cpp.mako | 4 +- source/CMakeLists.txt | 2 +- source/lib/linux/lib_init.cpp | 2 +- source/lib/windows/lib_init.cpp | 4 +- source/lib/ze_lib.cpp | 30 +- source/lib/ze_lib.h | 6 +- source/lib/ze_libapi.cpp | 406 +++++++++++++------------- source/lib/ze_libddi.cpp | 4 +- source/lib/zel_tracing_libddi.cpp | 2 +- source/lib/zes_libapi.cpp | 298 +++++++++---------- source/lib/zes_libddi.cpp | 4 +- source/lib/zet_libapi.cpp | 138 ++++----- source/lib/zet_libddi.cpp | 4 +- source/loader/linux/loader_init.cpp | 2 +- source/loader/windows/loader_init.cpp | 2 +- 16 files changed, 458 insertions(+), 458 deletions(-) diff --git a/scripts/templates/libapi.cpp.mako b/scripts/templates/libapi.cpp.mako index b19e69fb..c36c9618 100644 --- a/scripts/templates/libapi.cpp.mako +++ b/scripts/templates/libapi.cpp.mako @@ -56,7 +56,7 @@ ${th.make_func_name(n, tags, obj)}( { %if re.match("Init", obj['name']): %if re.match("zes", n): - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD if (!${x}_lib::context) { ${x}_lib::context = new ${x}_lib::context_t; } @@ -87,7 +87,7 @@ ${th.make_func_name(n, tags, obj)}( %else: %if re.match("InitDrivers", obj['name']): ${x}_result_t result = ${X}_RESULT_SUCCESS; - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD if (!${x}_lib::context) { ${x}_lib::context = new ${x}_lib::context_t; } @@ -124,7 +124,7 @@ ${th.make_func_name(n, tags, obj)}( return result; %else: static ${x}_result_t result = ${X}_RESULT_SUCCESS; - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD if (!${x}_lib::context) { ${x}_lib::context = new ${x}_lib::context_t; } @@ -160,7 +160,7 @@ ${th.make_func_name(n, tags, obj)}( } %endif %else: - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ${X}_RESULT_SUCCESS; if(ze_lib::destruction) { return ${X}_RESULT_ERROR_UNINITIALIZED; diff --git a/scripts/templates/libddi.cpp.mako b/scripts/templates/libddi.cpp.mako index a965c5e4..a4229f80 100644 --- a/scripts/templates/libddi.cpp.mako +++ b/scripts/templates/libddi.cpp.mako @@ -17,7 +17,7 @@ from templates import helper as th * */ #include "${x}_lib.h" -#ifndef DYNAMIC_LOAD_LOADER +#ifndef L0_STATIC_LOADER_BUILD #include "${n}_ddi.h" #endif @@ -25,7 +25,7 @@ namespace ${x}_lib { /////////////////////////////////////////////////////////////////////////////// -#ifdef DYNAMIC_LOAD_LOADER +#ifdef L0_STATIC_LOADER_BUILD __zedlllocal ${x}_result_t context_t::${n}DdiTableInit(ze_api_version_t version) { ${x}_result_t result = ${X}_RESULT_SUCCESS; diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 0ca11962..2ec4b8db 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -19,7 +19,7 @@ if (BUILD_STATIC) "" ${CMAKE_CURRENT_BINARY_DIR}/ZeLoaderVersion.rc ) - add_definitions(-DDYNAMIC_LOAD_LOADER="1") + add_definitions(-DL0_STATIC_LOADER_BUILD="1") else() message(STATUS "Building loader as dynamic library") add_library(${TARGET_LOADER_NAME} diff --git a/source/lib/linux/lib_init.cpp b/source/lib/linux/lib_init.cpp index 399736c7..97e4bde2 100644 --- a/source/lib/linux/lib_init.cpp +++ b/source/lib/linux/lib_init.cpp @@ -10,7 +10,7 @@ namespace ze_lib { -#ifndef DYNAMIC_LOAD_LOADER +#ifndef L0_STATIC_LOADER_BUILD void __attribute__((constructor)) createLibContext() { context = new context_t; } diff --git a/source/lib/windows/lib_init.cpp b/source/lib/windows/lib_init.cpp index db47b9a9..b76bace6 100644 --- a/source/lib/windows/lib_init.cpp +++ b/source/lib/windows/lib_init.cpp @@ -7,13 +7,13 @@ */ #include "../ze_lib.h" -#ifndef DYNAMIC_LOAD_LOADER +#ifndef L0_STATIC_LOADER_BUILD #include "../loader/ze_loader_internal.h" #endif namespace ze_lib { -#ifndef DYNAMIC_LOAD_LOADER +#ifndef L0_STATIC_LOADER_BUILD extern "C" BOOL APIENTRY DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { if (fdwReason == DLL_PROCESS_DETACH) { delete context; diff --git a/source/lib/ze_lib.cpp b/source/lib/ze_lib.cpp index b4554d52..f82080f0 100644 --- a/source/lib/ze_lib.cpp +++ b/source/lib/ze_lib.cpp @@ -18,7 +18,7 @@ namespace ze_lib { /////////////////////////////////////////////////////////////////////////////// context_t *context = nullptr; - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD void context_at_exit_destructor() { if (ze_lib::context) { @@ -69,7 +69,7 @@ namespace ze_lib /////////////////////////////////////////////////////////////////////////////// __zedlllocal context_t::~context_t() { -#ifdef DYNAMIC_LOAD_LOADER +#ifdef L0_STATIC_LOADER_BUILD if (loaderTeardownRegistrationEnabled && !loaderTeardownCallbackReceived) { loaderTeardownCallback(loaderTeardownCallbackIndex); } @@ -92,7 +92,7 @@ namespace ze_lib { ze_result_t result; ze_api_version_t version = ZE_API_VERSION_CURRENT; -#ifdef DYNAMIC_LOAD_LOADER +#ifdef L0_STATIC_LOADER_BUILD std::string loaderLibraryPath; auto loaderLibraryPathEnv = getenv_string("ZEL_LIBRARY_PATH"); if (!loaderLibraryPathEnv.empty()) { @@ -213,7 +213,7 @@ namespace ze_lib // Given zesInit, then zesDrivers needs to be used as the sysmanInstanceDrivers; bool loaderContextAccessAllowed = true; -#ifdef DYNAMIC_LOAD_LOADER +#ifdef L0_STATIC_LOADER_BUILD loaderContextAccessAllowed = false; loader::context_t *loaderContext = nullptr; #else @@ -264,7 +264,7 @@ namespace ze_lib // Init the stored ddi tables for the tracing layer if( ZE_RESULT_SUCCESS == result ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD if (loaderTracingLayerInit) { result = loaderTracingLayerInit(this->pTracingZeDdiTable); } @@ -280,7 +280,7 @@ namespace ze_lib // Check which drivers support the ze_driver_flag_t specified // No need to check if only initializing sysman bool requireDdiReinit = false; - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD if (zeInitDriversSupport) { typedef ze_result_t (ZE_APICALL *zelLoaderDriverCheck_t)(ze_init_flags_t flags, ze_init_driver_type_desc_t* desc, ze_global_dditable_t *globalInitStored, zes_global_dditable_t *sysmanGlobalInitStored, bool *requireDdiReinit, bool sysmanOnly); auto loaderDriverCheck = reinterpret_cast( @@ -341,7 +341,7 @@ namespace ze_lib if( ZE_RESULT_SUCCESS == result ) { -#ifdef DYNAMIC_LOAD_LOADER +#ifdef L0_STATIC_LOADER_BUILD // Init Dynamic Loader's Lib Context: auto initDriversLoader = reinterpret_cast( GET_FUNCTION_PTR(loader, "zeInitDrivers") ); @@ -378,7 +378,7 @@ namespace ze_lib #endif isInitialized = true; } - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD std::call_once(ze_lib::context->initTeardownCallbacksOnce, [this]() { if (!delayContextDestruction) { std::atexit(context_at_exit_destructor); @@ -416,7 +416,7 @@ zelLoaderGetVersions( size_t *num_elems, //Pointer to num versions to get. zel_component_version_t *versions) //Pointer to array of versions. If set to NULL, num_elems is returned { -#ifdef DYNAMIC_LOAD_LOADER +#ifdef L0_STATIC_LOADER_BUILD if(nullptr == ze_lib::context->loader) return ZE_RESULT_ERROR_UNINITIALIZED; typedef ze_result_t (ZE_APICALL *zelLoaderGetVersions_t)(size_t *num_elems, zel_component_version_t *versions); @@ -436,7 +436,7 @@ zelLoaderTranslateHandle( void **handleOut) { -#ifdef DYNAMIC_LOAD_LOADER +#ifdef L0_STATIC_LOADER_BUILD if(nullptr == ze_lib::context->loader) return ZE_RESULT_ERROR_UNINITIALIZED; typedef ze_result_t (ZE_APICALL *zelLoaderTranslateHandleInternal_t)(zel_handle_type_t handleType, void *handleIn, void **handleOut); @@ -470,7 +470,7 @@ zelSetDriverTeardown() void ZE_APICALL zelSetDelayLoaderContextTeardown() { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD if (!ze_lib::delayContextDestruction) { ze_lib::delayContextDestruction = true; } @@ -539,7 +539,7 @@ zelCheckIsLoaderInTearDown() { if (ze_lib::destruction || ze_lib::context == nullptr) { return true; } - #if defined(DYNAMIC_LOAD_LOADER) && defined(_WIN32) + #if defined(L0_STATIC_LOADER_BUILD) && defined(_WIN32) static bool loaderIsStable = true; if (!loaderIsStable) { if (ze_lib::context->debugTraceEnabled) { @@ -594,7 +594,7 @@ zelCheckIsLoaderInTearDown() { void ZE_APICALL zelLoaderContextTeardown() { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD if (ze_lib::delayContextDestruction && ze_lib::context) { delete ze_lib::context; ze_lib::context = nullptr; @@ -605,7 +605,7 @@ zelLoaderContextTeardown() ze_result_t ZE_APICALL zelEnableTracingLayer() { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD if(nullptr == ze_lib::context->loader) return ZE_RESULT_ERROR_UNINITIALIZED; typedef ze_result_t (ZE_APICALL *zelEnableTracingLayerInternal_t)(); @@ -626,7 +626,7 @@ zelEnableTracingLayer() ze_result_t ZE_APICALL zelDisableTracingLayer() { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD if(nullptr == ze_lib::context->loader) return ZE_RESULT_ERROR_UNINITIALIZED; typedef ze_result_t (ZE_APICALL *zelDisableTracingLayerInternal_t)(); diff --git a/source/lib/ze_lib.h b/source/lib/ze_lib.h index 4e829f1f..44d85bfc 100644 --- a/source/lib/ze_lib.h +++ b/source/lib/ze_lib.h @@ -31,7 +31,7 @@ namespace ze_lib class __zedlllocal context_t { public: -#ifdef DYNAMIC_LOAD_LOADER +#ifdef L0_STATIC_LOADER_BUILD HMODULE loader = nullptr; #endif @@ -179,7 +179,7 @@ namespace ze_lib std::atomic teardownCallbacksCount{0}; std::map teardownCallbacks; std::mutex teardownCallbacksMutex; - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD std::once_flag initTeardownCallbacksOnce; zel_application_teardown_callback_t loaderTeardownCallback = nullptr; uint32_t loaderTeardownCallbackIndex = 0; @@ -188,7 +188,7 @@ namespace ze_lib extern bool destruction; extern context_t *context; - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD extern bool delayContextDestruction; extern bool loaderTeardownCallbackReceived; extern bool loaderTeardownRegistrationEnabled; diff --git a/source/lib/ze_libapi.cpp b/source/lib/ze_libapi.cpp index d6a2f55f..a18b5064 100644 --- a/source/lib/ze_libapi.cpp +++ b/source/lib/ze_libapi.cpp @@ -46,7 +46,7 @@ zeInit( ) { static ze_result_t result = ZE_RESULT_SUCCESS; - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD if (!ze_lib::context) { ze_lib::context = new ze_lib::context_t; } @@ -120,7 +120,7 @@ zeDriverGet( ///< shall only retrieve that number of drivers. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -223,7 +223,7 @@ zeInitDrivers( ) { ze_result_t result = ZE_RESULT_SUCCESS; - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD if (!ze_lib::context) { ze_lib::context = new ze_lib::context_t; } @@ -283,7 +283,7 @@ zeDriverGetApiVersion( ze_api_version_t* version ///< [out] api version ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -343,7 +343,7 @@ zeDriverGetProperties( ze_driver_properties_t* pDriverProperties ///< [in,out] query result for driver properties ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -399,7 +399,7 @@ zeDriverGetIpcProperties( ze_driver_ipc_properties_t* pIpcProperties ///< [in,out] query result for IPC properties ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -468,7 +468,7 @@ zeDriverGetExtensionProperties( ///< then driver shall only retrieve that number of extension properties. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -527,7 +527,7 @@ zeDriverGetExtensionFunctionAddress( void** ppFunctionAddress ///< [out] pointer to function pointer ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -590,7 +590,7 @@ zeDriverGetLastErrorDescription( ///< cause of error. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -658,7 +658,7 @@ zeDeviceGet( ///< shall only retrieve that number of devices. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -722,7 +722,7 @@ zeDeviceGetRootDevice( ze_device_handle_t* phRootDevice ///< [in,out] parent root device. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -795,7 +795,7 @@ zeDeviceGetSubDevices( ///< shall only retrieve that number of sub-devices. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -855,7 +855,7 @@ zeDeviceGetProperties( ze_device_properties_t* pDeviceProperties ///< [in,out] query result for device properties ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -915,7 +915,7 @@ zeDeviceGetComputeProperties( ze_device_compute_properties_t* pComputeProperties ///< [in,out] query result for compute properties ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -971,7 +971,7 @@ zeDeviceGetModuleProperties( ze_device_module_properties_t* pModuleProperties///< [in,out] query result for module properties ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1047,7 +1047,7 @@ zeDeviceGetCommandQueueGroupProperties( ///< queue group properties. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1122,7 +1122,7 @@ zeDeviceGetMemoryProperties( ///< driver shall only retrieve that number of memory properties. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1182,7 +1182,7 @@ zeDeviceGetMemoryAccessProperties( ze_device_memory_access_properties_t* pMemAccessProperties ///< [in,out] query result for memory access properties ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1250,7 +1250,7 @@ zeDeviceGetCacheProperties( ///< driver shall only retrieve that number of cache properties. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1307,7 +1307,7 @@ zeDeviceGetImageProperties( ze_device_image_properties_t* pImageProperties ///< [in,out] query result for image properties ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1363,7 +1363,7 @@ zeDeviceGetExternalMemoryProperties( ze_device_external_memory_properties_t* pExternalMemoryProperties ///< [in,out] query result for external memory properties ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1422,7 +1422,7 @@ zeDeviceGetP2PProperties( ze_device_p2p_properties_t* pP2PProperties ///< [in,out] Peer-to-Peer properties between source and peer device ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1494,7 +1494,7 @@ zeDeviceCanAccessPeer( ze_bool_t* value ///< [out] returned access capability ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1554,7 +1554,7 @@ zeDeviceGetStatus( ze_device_handle_t hDevice ///< [in] handle of the device ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1617,7 +1617,7 @@ zeDeviceGetGlobalTimestamps( ///< Host's global timestamp value. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1679,7 +1679,7 @@ zeContextCreate( ze_context_handle_t* phContext ///< [out] pointer to handle of context object created ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1753,7 +1753,7 @@ zeContextCreateEx( ze_context_handle_t* phContext ///< [out] pointer to handle of context object created ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1812,7 +1812,7 @@ zeContextDestroy( ze_context_handle_t hContext ///< [in][release] handle of context object to destroy ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1870,7 +1870,7 @@ zeContextGetStatus( ze_context_handle_t hContext ///< [in] handle of context object ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1942,7 +1942,7 @@ zeCommandQueueCreate( ze_command_queue_handle_t* phCommandQueue ///< [out] pointer to handle of command queue object created ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2007,7 +2007,7 @@ zeCommandQueueDestroy( ze_command_queue_handle_t hCommandQueue ///< [in][release] handle of command queue object to destroy ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2089,7 +2089,7 @@ zeCommandQueueExecuteCommandLists( ze_fence_handle_t hFence ///< [in][optional] handle of the fence to signal on completion ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2151,7 +2151,7 @@ zeCommandQueueSynchronize( ///< value allowed by the accuracy of those dependencies. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2207,7 +2207,7 @@ zeCommandQueueGetOrdinal( uint32_t* pOrdinal ///< [out] command queue group ordinal ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2263,7 +2263,7 @@ zeCommandQueueGetIndex( uint32_t* pIndex ///< [out] command queue index within the group ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2330,7 +2330,7 @@ zeCommandListCreate( ze_command_list_handle_t* phCommandList ///< [out] pointer to handle of command list object created ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2405,7 +2405,7 @@ zeCommandListCreateImmediate( ze_command_list_handle_t* phCommandList ///< [out] pointer to handle of command list object created ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2464,7 +2464,7 @@ zeCommandListDestroy( ze_command_list_handle_t hCommandList ///< [in][release] handle of command list object to destroy ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2518,7 +2518,7 @@ zeCommandListClose( ze_command_list_handle_t hCommandList ///< [in] handle of command list object to close ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2575,7 +2575,7 @@ zeCommandListReset( ze_command_list_handle_t hCommandList ///< [in] handle of command list object to reset ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2652,7 +2652,7 @@ zeCommandListAppendWriteGlobalTimestamp( ///< on before executing query ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2723,7 +2723,7 @@ zeCommandListHostSynchronize( ///< value allowed by the accuracy of those dependencies. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2779,7 +2779,7 @@ zeCommandListGetDeviceHandle( ze_device_handle_t* phDevice ///< [out] handle of the device on which the command list was created ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2835,7 +2835,7 @@ zeCommandListGetContextHandle( ze_context_handle_t* phContext ///< [out] handle of the context on which the command list was created ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2892,7 +2892,7 @@ zeCommandListGetOrdinal( uint32_t* pOrdinal ///< [out] command queue group ordinal to which command list is submitted ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2954,7 +2954,7 @@ zeCommandListImmediateGetIndex( ///< command list is submitted ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3011,7 +3011,7 @@ zeCommandListIsImmediate( ///< command list (true) or not (false) ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3087,7 +3087,7 @@ zeCommandListAppendBarrier( ///< on before executing barrier ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3163,7 +3163,7 @@ zeCommandListAppendMemoryRangesBarrier( ///< on before executing barrier ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3224,7 +3224,7 @@ zeContextSystemBarrier( ze_device_handle_t hDevice ///< [in] handle of the device ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3308,7 +3308,7 @@ zeCommandListAppendMemoryCopy( ///< on before launching ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3396,7 +3396,7 @@ zeCommandListAppendMemoryFill( ///< on before launching ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3489,7 +3489,7 @@ zeCommandListAppendMemoryCopyRegion( ///< on before launching ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3569,7 +3569,7 @@ zeCommandListAppendMemoryCopyFromContext( ///< on before launching ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3645,7 +3645,7 @@ zeCommandListAppendImageCopy( ///< on before launching ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3723,7 +3723,7 @@ zeCommandListAppendImageCopyRegion( ///< on before launching ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3806,7 +3806,7 @@ zeCommandListAppendImageCopyToMemory( ///< on before launching ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3889,7 +3889,7 @@ zeCommandListAppendImageCopyFromMemory( ///< on before launching ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3968,7 +3968,7 @@ zeCommandListAppendMemoryPrefetch( size_t size ///< [in] size in bytes of the memory range to prefetch ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4047,7 +4047,7 @@ zeCommandListAppendMemAdvise( ze_memory_advice_t advice ///< [in] Memory advice for the memory range ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4118,7 +4118,7 @@ zeEventPoolCreate( ze_event_pool_handle_t* phEventPool ///< [out] pointer handle of event pool object created ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4179,7 +4179,7 @@ zeEventPoolDestroy( ze_event_pool_handle_t hEventPool ///< [in][release] handle of event pool object to destroy ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4250,7 +4250,7 @@ zeEventCreate( ze_event_handle_t* phEvent ///< [out] pointer to handle of event object created ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4314,7 +4314,7 @@ zeEventDestroy( ze_event_handle_t hEvent ///< [in][release] handle of event object to destroy ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4372,7 +4372,7 @@ zeEventPoolGetIpcHandle( ze_ipc_event_pool_handle_t* phIpc ///< [out] Returned IPC event handle ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4436,7 +4436,7 @@ zeEventPoolPutIpcHandle( ze_ipc_event_pool_handle_t hIpc ///< [in] IPC event pool handle ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4510,7 +4510,7 @@ zeEventPoolOpenIpcHandle( ze_event_pool_handle_t* phEventPool ///< [out] pointer handle of event pool object created ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4565,7 +4565,7 @@ zeEventPoolCloseIpcHandle( ze_event_pool_handle_t hEventPool ///< [in][release] handle of event pool object ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4636,7 +4636,7 @@ zeCommandListAppendSignalEvent( ze_event_handle_t hEvent ///< [in] handle of the event ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4700,7 +4700,7 @@ zeCommandListAppendWaitOnEvents( ///< continuing ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4763,7 +4763,7 @@ zeEventHostSignal( ze_event_handle_t hEvent ///< [in] handle of the event ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4830,7 +4830,7 @@ zeEventHostSynchronize( ///< value allowed by the accuracy of those dependencies. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4891,7 +4891,7 @@ zeEventQueryStatus( ze_event_handle_t hEvent ///< [in] handle of the event ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4957,7 +4957,7 @@ zeCommandListAppendEventReset( ze_event_handle_t hEvent ///< [in] handle of the event ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -5015,7 +5015,7 @@ zeEventHostReset( ze_event_handle_t hEvent ///< [in] handle of the event ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -5079,7 +5079,7 @@ zeEventQueryKernelTimestamp( ze_kernel_timestamp_result_t* dstptr ///< [in,out] pointer to memory for where timestamp result will be written. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -5164,7 +5164,7 @@ zeCommandListAppendQueryKernelTimestamps( ///< on before executing query ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -5220,7 +5220,7 @@ zeEventGetEventPool( ze_event_pool_handle_t* phEventPool ///< [out] handle of the event pool for the event ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -5278,7 +5278,7 @@ zeEventGetSignalScope( ///< triggered. May be 0 or a valid combination of ::ze_event_scope_flag_t. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -5336,7 +5336,7 @@ zeEventGetWaitScope( ///< May be 0 or a valid combination of ::ze_event_scope_flag_t. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -5392,7 +5392,7 @@ zeEventPoolGetContextHandle( ze_context_handle_t* phContext ///< [out] handle of the context on which the event pool was created ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -5449,7 +5449,7 @@ zeEventPoolGetFlags( ///< valid combination of ::ze_event_pool_flag_t ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -5517,7 +5517,7 @@ zeFenceCreate( ze_fence_handle_t* phFence ///< [out] pointer to handle of fence object created ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -5580,7 +5580,7 @@ zeFenceDestroy( ze_fence_handle_t hFence ///< [in][release] handle of fence object to destroy ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -5647,7 +5647,7 @@ zeFenceHostSynchronize( ///< value allowed by the accuracy of those dependencies. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -5707,7 +5707,7 @@ zeFenceQueryStatus( ze_fence_handle_t hFence ///< [in] handle of the fence ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -5764,7 +5764,7 @@ zeFenceReset( ze_fence_handle_t hFence ///< [in] handle of the fence ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -5825,7 +5825,7 @@ zeImageGetProperties( ze_image_properties_t* pImageProperties ///< [out] pointer to image properties ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -5895,7 +5895,7 @@ zeImageCreate( ze_image_handle_t* phImage ///< [out] pointer to handle of image object created ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -5954,7 +5954,7 @@ zeImageDestroy( ze_image_handle_t hImage ///< [in][release] handle of image object to destroy ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -6042,7 +6042,7 @@ zeMemAllocShared( void** pptr ///< [out] pointer to shared allocation ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -6118,7 +6118,7 @@ zeMemAllocDevice( void** pptr ///< [out] pointer to device allocation ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -6194,7 +6194,7 @@ zeMemAllocHost( void** pptr ///< [out] pointer to host allocation ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -6259,7 +6259,7 @@ zeMemFree( void* ptr ///< [in][release] pointer to memory to free ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -6322,7 +6322,7 @@ zeMemGetAllocProperties( ze_device_handle_t* phDevice ///< [out][optional] device associated with this allocation ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -6379,7 +6379,7 @@ zeMemGetAddressRange( size_t* pSize ///< [in,out][optional] size of the allocation ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -6442,7 +6442,7 @@ zeMemGetIpcHandle( ze_ipc_mem_handle_t* pIpcHandle ///< [out] Returned IPC memory handle ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -6503,7 +6503,7 @@ zeMemGetIpcHandleFromFileDescriptorExp( ze_ipc_mem_handle_t* pIpcHandle ///< [out] Returned IPC memory handle ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -6562,7 +6562,7 @@ zeMemGetFileDescriptorFromIpcHandleExp( uint64_t* pHandle ///< [out] Returned file descriptor ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -6625,7 +6625,7 @@ zeMemPutIpcHandle( ze_ipc_mem_handle_t handle ///< [in] IPC memory handle ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -6695,7 +6695,7 @@ zeMemOpenIpcHandle( void** pptr ///< [out] pointer to device allocation in this process ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -6754,7 +6754,7 @@ zeMemCloseIpcHandle( const void* ptr ///< [in][release] pointer to device allocation in this process ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -6833,7 +6833,7 @@ zeMemSetAtomicAccessAttributeExp( ///< Must be 0 (default) or a valid combination of ::ze_memory_atomic_attr_exp_flag_t. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -6896,7 +6896,7 @@ zeMemGetAtomicAccessAttributeExp( ze_memory_atomic_attr_exp_flags_t* pAttr ///< [out] Atomic access attributes for the specified range ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -6973,7 +6973,7 @@ zeModuleCreate( ze_module_build_log_handle_t* phBuildLog ///< [out][optional] pointer to handle of module's build log. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -7034,7 +7034,7 @@ zeModuleDestroy( ze_module_handle_t hModule ///< [in][release] handle of the module ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -7117,7 +7117,7 @@ zeModuleDynamicLink( ze_module_build_log_handle_t* phLinkLog ///< [out][optional] pointer to handle of dynamic link log. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -7176,7 +7176,7 @@ zeModuleBuildLogDestroy( ze_module_build_log_handle_t hModuleBuildLog ///< [in][release] handle of the module build log object. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -7235,7 +7235,7 @@ zeModuleBuildLogGetString( char* pBuildLog ///< [in,out][optional] pointer to null-terminated string of the log. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -7300,7 +7300,7 @@ zeModuleGetNativeBinary( uint8_t* pModuleNativeBinary ///< [in,out][optional] byte pointer to native binary ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -7363,7 +7363,7 @@ zeModuleGetGlobalPointer( void** pptr ///< [in,out][optional] device visible pointer ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -7426,7 +7426,7 @@ zeModuleGetKernelNames( ///< only retrieve that number of names. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -7482,7 +7482,7 @@ zeModuleGetProperties( ze_module_properties_t* pModuleProperties ///< [in,out] query result for module properties. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -7547,7 +7547,7 @@ zeKernelCreate( ze_kernel_handle_t* phKernel ///< [out] handle of the Function object ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -7606,7 +7606,7 @@ zeKernelDestroy( ze_kernel_handle_t hKernel ///< [in][release] handle of the kernel object ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -7670,7 +7670,7 @@ zeModuleGetFunctionPointer( void** pfnFunction ///< [out] pointer to function. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -7730,7 +7730,7 @@ zeKernelSetGroupSize( uint32_t groupSizeZ ///< [in] group size for Z dimension to use for this kernel ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -7797,7 +7797,7 @@ zeKernelSuggestGroupSize( uint32_t* groupSizeZ ///< [out] recommended size of group for Z dimension ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -7853,7 +7853,7 @@ zeKernelSuggestMaxCooperativeGroupCount( uint32_t* totalGroupCount ///< [out] recommended total group count. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -7915,7 +7915,7 @@ zeKernelSetArgumentValue( ///< null then argument value is considered null. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -7975,7 +7975,7 @@ zeKernelSetIndirectAccess( ze_kernel_indirect_access_flags_t flags ///< [in] kernel indirect access flags ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -8032,7 +8032,7 @@ zeKernelGetIndirectAccess( ze_kernel_indirect_access_flags_t* pFlags ///< [out] query result for kernel indirect access flags. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -8102,7 +8102,7 @@ zeKernelGetSourceAttributes( ///< create your own char *pString and then pass to this API with &pString. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -8163,7 +8163,7 @@ zeKernelSetCacheConfig( ///< must be 0 (default configuration) or a valid combination of ::ze_cache_config_flag_t. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -8219,7 +8219,7 @@ zeKernelGetProperties( ze_kernel_properties_t* pKernelProperties ///< [in,out] query result for kernel properties. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -8280,7 +8280,7 @@ zeKernelGetName( char* pName ///< [in,out][optional] char pointer to kernel name. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -8353,7 +8353,7 @@ zeCommandListAppendLaunchKernel( ///< on before launching ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -8430,7 +8430,7 @@ zeCommandListAppendLaunchCooperativeKernel( ///< on before launching ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -8509,7 +8509,7 @@ zeCommandListAppendLaunchKernelIndirect( ///< on before launching ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -8595,7 +8595,7 @@ zeCommandListAppendLaunchMultipleKernelsIndirect( ///< on before launching ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -8658,7 +8658,7 @@ zeContextMakeMemoryResident( size_t size ///< [in] size in bytes to make resident ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -8721,7 +8721,7 @@ zeContextEvictMemory( size_t size ///< [in] size in bytes to evict ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -8780,7 +8780,7 @@ zeContextMakeImageResident( ze_image_handle_t hImage ///< [in] handle of image to make resident ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -8841,7 +8841,7 @@ zeContextEvictImage( ze_image_handle_t hImage ///< [in] handle of image to make evict ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -8906,7 +8906,7 @@ zeSamplerCreate( ze_sampler_handle_t* phSampler ///< [out] handle of the sampler ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -8965,7 +8965,7 @@ zeSamplerDestroy( ze_sampler_handle_t hSampler ///< [in][release] handle of the sampler ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -9035,7 +9035,7 @@ zeVirtualMemReserve( void** pptr ///< [out] pointer to virtual reservation. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -9098,7 +9098,7 @@ zeVirtualMemFree( size_t size ///< [in] size in bytes to free; must be page aligned. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -9161,7 +9161,7 @@ zeVirtualMemQueryPageSize( ///< alignments. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -9232,7 +9232,7 @@ zePhysicalMemCreate( ze_physical_mem_handle_t* phPhysicalMemory ///< [out] pointer to handle of physical memory object created ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -9291,7 +9291,7 @@ zePhysicalMemDestroy( ze_physical_mem_handle_t hPhysicalMemory ///< [in][release] handle of physical memory object to destroy ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -9369,7 +9369,7 @@ zeVirtualMemMap( ///< range. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -9434,7 +9434,7 @@ zeVirtualMemUnmap( size_t size ///< [in] size in bytes to unmap; must be page aligned. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -9501,7 +9501,7 @@ zeVirtualMemSetAccessAttribute( ///< range. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -9571,7 +9571,7 @@ zeVirtualMemGetAccessAttribute( ///< that shares same access attribute. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -9630,7 +9630,7 @@ zeKernelSetGlobalOffsetExp( uint32_t offsetZ ///< [in] global offset for Z dimension to use for this kernel ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -9691,7 +9691,7 @@ zeKernelGetBinaryExp( uint8_t* pKernelBinary ///< [in,out] pointer to storage area for GEN ISA binary function. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -9753,7 +9753,7 @@ zeDeviceImportExternalSemaphoreExt( ze_external_semaphore_ext_handle_t* phSemaphore ///< [out] The handle of the external semaphore imported. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -9810,7 +9810,7 @@ zeDeviceReleaseExternalSemaphoreExt( ze_external_semaphore_ext_handle_t hSemaphore ///< [in] The handle of the external semaphore. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -9885,7 +9885,7 @@ zeCommandListAppendSignalExternalSemaphoreExt( ///< on before launching ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -9960,7 +9960,7 @@ zeCommandListAppendWaitExternalSemaphoreExt( ///< on before launching ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -10021,7 +10021,7 @@ zeRTASBuilderCreateExt( ze_rtas_builder_ext_handle_t* phBuilder ///< [out] handle of builder object ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -10083,7 +10083,7 @@ zeRTASBuilderGetBuildPropertiesExt( ze_rtas_builder_ext_properties_t* pProperties ///< [in,out] query result for builder properties ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -10145,7 +10145,7 @@ zeDriverRTASFormatCompatibilityCheckExt( ze_rtas_format_ext_t rtasFormatB ///< [in] operand B ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -10267,7 +10267,7 @@ zeRTASBuilderBuildExt( ///< bytes ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -10351,7 +10351,7 @@ zeRTASBuilderCommandListAppendCopyExt( ///< on before launching ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -10408,7 +10408,7 @@ zeRTASBuilderDestroyExt( ze_rtas_builder_ext_handle_t hBuilder ///< [in][release] handle of builder object to destroy ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -10466,7 +10466,7 @@ zeRTASParallelOperationCreateExt( ze_rtas_parallel_operation_ext_handle_t* phParallelOperation///< [out] handle of parallel operation object ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -10528,7 +10528,7 @@ zeRTASParallelOperationGetPropertiesExt( ze_rtas_parallel_operation_ext_properties_t* pProperties///< [in,out] query result for parallel operation properties ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -10581,7 +10581,7 @@ zeRTASParallelOperationJoinExt( ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in] handle of parallel operation object ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -10639,7 +10639,7 @@ zeRTASParallelOperationDestroyExt( ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in][release] handle of parallel operation object to destroy ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -10711,7 +10711,7 @@ zeDeviceGetVectorWidthPropertiesExt( ///< driver will return only the number requested. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -10773,7 +10773,7 @@ zeDeviceReserveCacheExt( ///< shall remove prior reservation ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -10833,7 +10833,7 @@ zeDeviceSetCacheAdviceExt( ze_cache_ext_region_t cacheRegion ///< [in] reservation region ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -10910,7 +10910,7 @@ zeEventQueryTimestampsExp( ///< shall only retrieve that number of timestamps. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -10972,7 +10972,7 @@ zeImageGetMemoryPropertiesExp( ze_image_memory_properties_exp_t* pMemoryProperties ///< [in,out] query result for image memory properties. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -11051,7 +11051,7 @@ zeImageViewCreateExt( ze_image_handle_t* phImageView ///< [out] pointer to handle of image object created for view ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -11133,7 +11133,7 @@ zeImageViewCreateExp( ze_image_handle_t* phImageView ///< [out] pointer to handle of image object created for view ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -11198,7 +11198,7 @@ zeKernelSchedulingHintExp( ze_scheduling_hint_exp_desc_t* pHint ///< [in] pointer to kernel scheduling hint descriptor ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -11258,7 +11258,7 @@ zeDevicePciGetPropertiesExt( ze_pci_ext_properties_t* pPciProperties ///< [in,out] returns the PCI properties of the device. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -11355,7 +11355,7 @@ zeCommandListAppendImageCopyToMemoryExt( ///< on before launching ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -11452,7 +11452,7 @@ zeCommandListAppendImageCopyFromMemoryExt( ///< on before launching ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -11509,7 +11509,7 @@ zeImageGetAllocPropertiesExt( ze_image_allocation_ext_properties_t* pImageAllocProperties ///< [in,out] query result for image allocation properties ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -11575,7 +11575,7 @@ zeModuleInspectLinkageExt( ///< contain separate lists of imports, un-resolvable imports, and exports. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -11640,7 +11640,7 @@ zeMemFreeExt( void* ptr ///< [in][release] pointer to memory to free ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -11706,7 +11706,7 @@ zeFabricVertexGetExp( ///< driver shall only retrieve that number of fabric vertices. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -11774,7 +11774,7 @@ zeFabricVertexGetSubVerticesExp( ///< driver shall only retrieve that number of sub-vertices. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -11830,7 +11830,7 @@ zeFabricVertexGetPropertiesExp( ze_fabric_vertex_exp_properties_t* pVertexProperties///< [in,out] query result for fabric vertex properties ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -11890,7 +11890,7 @@ zeFabricVertexGetDeviceExp( ze_device_handle_t* phDevice ///< [out] device handle corresponding to fabric vertex ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -11948,7 +11948,7 @@ zeDeviceGetFabricVertexExp( ze_fabric_vertex_handle_t* phVertex ///< [out] fabric vertex handle corresponding to device ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -12016,7 +12016,7 @@ zeFabricEdgeGetExp( ///< driver shall only retrieve that number of fabric edges. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -12076,7 +12076,7 @@ zeFabricEdgeGetVerticesExp( ze_fabric_vertex_handle_t* phVertexB ///< [out] fabric vertex connected to other end of the given fabric edge. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -12132,7 +12132,7 @@ zeFabricEdgeGetPropertiesExp( ze_fabric_edge_exp_properties_t* pEdgeProperties///< [in,out] query result for fabric edge properties ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -12222,7 +12222,7 @@ zeEventQueryKernelTimestampsExt( ///< available, the driver may only update the valid elements. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -12284,7 +12284,7 @@ zeRTASBuilderCreateExp( ze_rtas_builder_exp_handle_t* phBuilder ///< [out] handle of builder object ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -12346,7 +12346,7 @@ zeRTASBuilderGetBuildPropertiesExp( ze_rtas_builder_exp_properties_t* pProperties ///< [in,out] query result for builder properties ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -12408,7 +12408,7 @@ zeDriverRTASFormatCompatibilityCheckExp( ze_rtas_format_exp_t rtasFormatB ///< [in] operand B ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -12530,7 +12530,7 @@ zeRTASBuilderBuildExp( ///< bytes ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -12587,7 +12587,7 @@ zeRTASBuilderDestroyExp( ze_rtas_builder_exp_handle_t hBuilder ///< [in][release] handle of builder object to destroy ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -12646,7 +12646,7 @@ zeRTASParallelOperationCreateExp( ze_rtas_parallel_operation_exp_handle_t* phParallelOperation///< [out] handle of parallel operation object ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -12708,7 +12708,7 @@ zeRTASParallelOperationGetPropertiesExp( ze_rtas_parallel_operation_exp_properties_t* pProperties///< [in,out] query result for parallel operation properties ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -12761,7 +12761,7 @@ zeRTASParallelOperationJoinExp( ze_rtas_parallel_operation_exp_handle_t hParallelOperation ///< [in] handle of parallel operation object ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -12819,7 +12819,7 @@ zeRTASParallelOperationDestroyExp( ze_rtas_parallel_operation_exp_handle_t hParallelOperation ///< [in][release] handle of parallel operation object to destroy ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -12883,7 +12883,7 @@ zeMemGetPitchFor2dImage( size_t * rowPitch ///< [out] rowPitch ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -12942,7 +12942,7 @@ zeImageGetDeviceOffsetExp( uint64_t* pDeviceOffset ///< [out] bindless device offset for image ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -13009,7 +13009,7 @@ zeCommandListCreateCloneExp( ze_command_list_handle_t* phClonedCommandList ///< [out] pointer to handle of the cloned command list ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -13080,7 +13080,7 @@ zeCommandListImmediateAppendCommandListsExp( ///< of any appended command list(s) ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -13144,7 +13144,7 @@ zeCommandListGetNextCommandIdExp( uint64_t* pCommandId ///< [out] pointer to mutable command identifier to be written ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -13214,7 +13214,7 @@ zeCommandListGetNextCommandIdWithKernelsExp( uint64_t* pCommandId ///< [out] pointer to mutable command identifier to be written ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -13279,7 +13279,7 @@ zeCommandListUpdateMutableCommandsExp( ///< be chained via `pNext` member ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -13343,7 +13343,7 @@ zeCommandListUpdateMutableCommandSignalEventExp( ze_event_handle_t hSignalEvent ///< [in][optional] handle of the event to signal on completion ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -13416,7 +13416,7 @@ zeCommandListUpdateMutableCommandWaitEventsExp( ///< on before launching ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -13487,7 +13487,7 @@ zeCommandListUpdateMutableCommandKernelsExp( ///< identifier to switch to ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; diff --git a/source/lib/ze_libddi.cpp b/source/lib/ze_libddi.cpp index 2549ad93..502b2e61 100644 --- a/source/lib/ze_libddi.cpp +++ b/source/lib/ze_libddi.cpp @@ -8,7 +8,7 @@ * */ #include "ze_lib.h" -#ifndef DYNAMIC_LOAD_LOADER +#ifndef L0_STATIC_LOADER_BUILD #include "ze_ddi.h" #endif @@ -16,7 +16,7 @@ namespace ze_lib { /////////////////////////////////////////////////////////////////////////////// -#ifdef DYNAMIC_LOAD_LOADER +#ifdef L0_STATIC_LOADER_BUILD __zedlllocal ze_result_t context_t::zeDdiTableInit(ze_api_version_t version) { ze_result_t result = ZE_RESULT_SUCCESS; diff --git a/source/lib/zel_tracing_libddi.cpp b/source/lib/zel_tracing_libddi.cpp index f20b75bb..82f8817f 100644 --- a/source/lib/zel_tracing_libddi.cpp +++ b/source/lib/zel_tracing_libddi.cpp @@ -14,7 +14,7 @@ namespace ze_lib { /////////////////////////////////////////////////////////////////////////////// -#ifdef DYNAMIC_LOAD_LOADER +#ifdef L0_STATIC_LOADER_BUILD __zedlllocal ze_result_t context_t::zelTracingDdiTableInit(ze_api_version_t version) { ze_result_t result = ZE_RESULT_SUCCESS; diff --git a/source/lib/zes_libapi.cpp b/source/lib/zes_libapi.cpp index 11899ab1..5c0cb2e5 100644 --- a/source/lib/zes_libapi.cpp +++ b/source/lib/zes_libapi.cpp @@ -48,7 +48,7 @@ zesInit( ///< currently unused, must be 0 (default). ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD if (!ze_lib::context) { ze_lib::context = new ze_lib::context_t; } @@ -110,7 +110,7 @@ zesDriverGet( ///< loader shall only retrieve that number of sysman drivers. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -183,7 +183,7 @@ zesDriverGetExtensionProperties( ///< then driver shall only retrieve that number of extension properties. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -242,7 +242,7 @@ zesDriverGetExtensionFunctionAddress( void** ppFunctionAddress ///< [out] pointer to function pointer ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -311,7 +311,7 @@ zesDeviceGet( ///< driver shall only retrieve that number of sysman devices. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -367,7 +367,7 @@ zesDeviceGetProperties( zes_device_properties_t* pProperties ///< [in,out] Structure that will contain information about the device. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -424,7 +424,7 @@ zesDeviceGetState( zes_device_state_t* pState ///< [in,out] Structure that will contain information about the device. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -492,7 +492,7 @@ zesDeviceReset( ///< device will be forcibly killed. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -561,7 +561,7 @@ zesDeviceResetExt( zes_reset_properties_t* pProperties ///< [in] Device reset properties to apply ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -635,7 +635,7 @@ zesDeviceProcessesGetState( ///< number of processes. In this case, the return code will ::ZE_RESULT_ERROR_INVALID_SIZE. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -691,7 +691,7 @@ zesDevicePciGetProperties( zes_pci_properties_t* pProperties ///< [in,out] Will contain the PCI properties. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -747,7 +747,7 @@ zesDevicePciGetState( zes_pci_state_t* pState ///< [in,out] Will contain the PCI properties. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -811,7 +811,7 @@ zesDevicePciGetBars( ///< driver shall only retrieve information about that number of PCI bars. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -869,7 +869,7 @@ zesDevicePciGetStats( zes_pci_stats_t* pStats ///< [in,out] Will contain a snapshot of the latest stats. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -925,7 +925,7 @@ zesDeviceSetOverclockWaiver( zes_device_handle_t hDevice ///< [in] Sysman handle of the device. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -985,7 +985,7 @@ zesDeviceGetOverclockDomains( ///< doesn't support overclocking. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1049,7 +1049,7 @@ zesDeviceGetOverclockControls( ///< ::zes_overclock_control_t). ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1107,7 +1107,7 @@ zesDeviceResetOverclockSettings( ///< manufacturing state ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1174,7 +1174,7 @@ zesDeviceReadOverclockState( ze_bool_t* pPendingReset ///< [out] Pending reset 0 =manufacturing state, 1= shipped state).. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1240,7 +1240,7 @@ zesDeviceEnumOverclockDomains( ///< component handles. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1298,7 +1298,7 @@ zesOverclockGetDomainProperties( zes_overclock_properties_t* pDomainProperties ///< [in,out] The overclock properties for the specified domain. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1356,7 +1356,7 @@ zesOverclockGetDomainVFProperties( zes_vf_property_t* pVFProperties ///< [in,out] The VF min,max,step for a specified domain. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1417,7 +1417,7 @@ zesOverclockGetDomainControlProperties( zes_control_property_t* pControlProperties ///< [in,out] overclock control values. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1478,7 +1478,7 @@ zesOverclockGetControlCurrentValue( double* pValue ///< [in,out] Getting overclock control value for the specified control. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1540,7 +1540,7 @@ zesOverclockGetControlPendingValue( ///< format of the value depend on the control type. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1603,7 +1603,7 @@ zesOverclockSetControlUserValue( zes_pending_action_t* pPendingAction ///< [out] Pending overclock setting. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1666,7 +1666,7 @@ zesOverclockGetControlState( zes_pending_action_t* pPendingAction ///< [out] Pending overclock setting. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1732,7 +1732,7 @@ zesOverclockGetVFPointValues( ///< units from the custom V-F curve at the specified zero-based index ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1793,7 +1793,7 @@ zesOverclockSetVFPointValues( ///< custom V-F curve at the specified zero-based index ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1859,7 +1859,7 @@ zesDeviceEnumDiagnosticTestSuites( ///< component handles. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1916,7 +1916,7 @@ zesDiagnosticsGetProperties( ///< suite ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1984,7 +1984,7 @@ zesDiagnosticsGetTests( ///< driver shall only retrieve that number of tests. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2055,7 +2055,7 @@ zesDiagnosticsRunTests( zes_diag_result_t* pResult ///< [in,out] The result of the diagnostics ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2111,7 +2111,7 @@ zesDeviceEccAvailable( ze_bool_t* pAvailable ///< [out] ECC functionality is available (true)/unavailable (false). ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2167,7 +2167,7 @@ zesDeviceEccConfigurable( ze_bool_t* pConfigurable ///< [out] ECC can be enabled/disabled (true)/enabled/disabled (false). ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2223,7 +2223,7 @@ zesDeviceGetEccState( zes_device_ecc_properties_t* pState ///< [out] ECC state, pending state, and pending action for state change. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2287,7 +2287,7 @@ zesDeviceSetEccState( zes_device_ecc_properties_t* pState ///< [out] ECC state, pending state, and pending action for state change. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2353,7 +2353,7 @@ zesDeviceEnumEngineGroups( ///< component handles. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2409,7 +2409,7 @@ zesEngineGetProperties( zes_engine_properties_t* pProperties ///< [in,out] The properties for the specified engine group. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2468,7 +2468,7 @@ zesEngineGetActivity( ///< counters. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2524,7 +2524,7 @@ zesDeviceEventRegister( zes_event_type_flags_t events ///< [in] List of events to listen to. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2602,7 +2602,7 @@ zesDriverEventListen( ///< entry will be zero. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2680,7 +2680,7 @@ zesDriverEventListenEx( ///< entry will be zero. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2746,7 +2746,7 @@ zesDeviceEnumFabricPorts( ///< component handles. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2802,7 +2802,7 @@ zesFabricPortGetProperties( zes_fabric_port_properties_t* pProperties ///< [in,out] Will contain properties of the Fabric Port. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2859,7 +2859,7 @@ zesFabricPortGetLinkType( ///< port. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2915,7 +2915,7 @@ zesFabricPortGetConfig( zes_fabric_port_config_t* pConfig ///< [in,out] Will contain configuration of the Fabric Port. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2973,7 +2973,7 @@ zesFabricPortSetConfig( const zes_fabric_port_config_t* pConfig ///< [in] Contains new configuration of the Fabric Port. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3030,7 +3030,7 @@ zesFabricPortGetState( zes_fabric_port_state_t* pState ///< [in,out] Will contain the current state of the Fabric Port ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3088,7 +3088,7 @@ zesFabricPortGetThroughput( zes_fabric_port_throughput_t* pThroughput ///< [in,out] Will contain the Fabric port throughput counters. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3149,7 +3149,7 @@ zesFabricPortGetFabricErrorCounters( zes_fabric_port_error_counters_t* pErrors ///< [in,out] Will contain the Fabric port Error counters. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3210,7 +3210,7 @@ zesFabricPortGetMultiPortThroughput( ///< from multiple ports of type ::zes_fabric_port_throughput_t. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3276,7 +3276,7 @@ zesDeviceEnumFans( ///< component handles. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3332,7 +3332,7 @@ zesFanGetProperties( zes_fan_properties_t* pProperties ///< [in,out] Will contain the properties of the fan. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3389,7 +3389,7 @@ zesFanGetConfig( zes_fan_config_t* pConfig ///< [in,out] Will contain the current configuration of the fan. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3445,7 +3445,7 @@ zesFanSetDefaultMode( zes_fan_handle_t hFan ///< [in] Handle for the component. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3506,7 +3506,7 @@ zesFanSetFixedSpeedMode( const zes_fan_speed_t* speed ///< [in] The fixed fan speed setting ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3569,7 +3569,7 @@ zesFanSetSpeedTableMode( const zes_fan_speed_table_t* speedTable ///< [in] A table containing temperature/speed pairs. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3632,7 +3632,7 @@ zesFanGetState( ///< measured. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3698,7 +3698,7 @@ zesDeviceEnumFirmwares( ///< component handles. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3755,7 +3755,7 @@ zesFirmwareGetProperties( ///< firmware ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3818,7 +3818,7 @@ zesFirmwareFlash( uint32_t size ///< [in] Size of the flash image. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3874,7 +3874,7 @@ zesFirmwareGetFlashProgress( uint32_t* pCompletionPercent ///< [in,out] Pointer to the Completion Percentage of Firmware Update ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3934,7 +3934,7 @@ zesFirmwareGetConsoleLogs( char* pFirmwareLog ///< [in,out][optional] pointer to null-terminated string of the log. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4000,7 +4000,7 @@ zesDeviceEnumFrequencyDomains( ///< component handles. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4056,7 +4056,7 @@ zesFrequencyGetProperties( zes_freq_properties_t* pProperties ///< [in,out] The frequency properties for the specified domain. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4123,7 +4123,7 @@ zesFrequencyGetAvailableClocks( ///< then the driver shall only retrieve that number of frequencies. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4180,7 +4180,7 @@ zesFrequencyGetRange( ///< specified domain. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4242,7 +4242,7 @@ zesFrequencySetRange( ///< specified domain. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4299,7 +4299,7 @@ zesFrequencyGetState( zes_freq_state_t* pState ///< [in,out] Frequency state for the specified domain. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4356,7 +4356,7 @@ zesFrequencyGetThrottleTime( ///< specified domain. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4413,7 +4413,7 @@ zesFrequencyOcGetCapabilities( zes_oc_capabilities_t* pOcCapabilities ///< [in,out] Pointer to the capabilities structure. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4482,7 +4482,7 @@ zesFrequencyOcGetFrequencyTarget( ///< ::zes_oc_capabilities_t. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4549,7 +4549,7 @@ zesFrequencyOcSetFrequencyTarget( ///< ::zes_oc_capabilities_t. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4620,7 +4620,7 @@ zesFrequencyOcGetVoltageTarget( ///< `maxOcVoltageOffset` members of ::zes_oc_capabilities_t. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4688,7 +4688,7 @@ zesFrequencyOcSetVoltageTarget( ///< `maxOcVoltageOffset` members of ::zes_oc_capabilities_t. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4753,7 +4753,7 @@ zesFrequencyOcSetMode( zes_oc_mode_t CurrentOcMode ///< [in] Current Overclocking Mode ::zes_oc_mode_t. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4818,7 +4818,7 @@ zesFrequencyOcGetMode( zes_oc_mode_t* pCurrentOcMode ///< [out] Current Overclocking Mode ::zes_oc_mode_t. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4879,7 +4879,7 @@ zesFrequencyOcGetIccMax( ///< successful return. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4944,7 +4944,7 @@ zesFrequencyOcSetIccMax( double ocIccMax ///< [in] The new maximum current limit in Amperes. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -5004,7 +5004,7 @@ zesFrequencyOcGetTjMax( ///< on successful return. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -5069,7 +5069,7 @@ zesFrequencyOcSetTjMax( double ocTjMax ///< [in] The new maximum temperature limit in degrees Celsius. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -5135,7 +5135,7 @@ zesDeviceEnumLeds( ///< component handles. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -5191,7 +5191,7 @@ zesLedGetProperties( zes_led_properties_t* pProperties ///< [in,out] Will contain the properties of the LED. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -5247,7 +5247,7 @@ zesLedGetState( zes_led_state_t* pState ///< [in,out] Will contain the current state of the LED. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -5303,7 +5303,7 @@ zesLedSetState( ze_bool_t enable ///< [in] Set to TRUE to turn the LED on, FALSE to turn off. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -5363,7 +5363,7 @@ zesLedSetColor( const zes_led_color_t* pColor ///< [in] New color of the LED. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -5429,7 +5429,7 @@ zesDeviceEnumMemoryModules( ///< component handles. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -5485,7 +5485,7 @@ zesMemoryGetProperties( zes_mem_properties_t* pProperties ///< [in,out] Will contain memory properties. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -5541,7 +5541,7 @@ zesMemoryGetState( zes_mem_state_t* pState ///< [in,out] Will contain the current health and allocated memory. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -5600,7 +5600,7 @@ zesMemoryGetBandwidth( ///< to memory, as well as the current maximum bandwidth. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -5668,7 +5668,7 @@ zesDeviceEnumPerformanceFactorDomains( ///< component handles. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -5725,7 +5725,7 @@ zesPerformanceFactorGetProperties( ///< Factor domain. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -5782,7 +5782,7 @@ zesPerformanceFactorGetConfig( ///< hardware (may not be the same as the requested Performance Factor). ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -5841,7 +5841,7 @@ zesPerformanceFactorSetConfig( double factor ///< [in] The new Performance Factor. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -5907,7 +5907,7 @@ zesDeviceEnumPowerDomains( ///< component handles. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -5966,7 +5966,7 @@ zesDeviceGetCardPowerDomain( zes_pwr_handle_t* phPower ///< [in,out] power domain handle for the entire PCIe card. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -6022,7 +6022,7 @@ zesPowerGetProperties( zes_power_properties_t* pProperties ///< [in,out] Structure that will contain property data. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -6079,7 +6079,7 @@ zesPowerGetEnergyCounter( ///< timestamp when the last counter value was measured. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -6139,7 +6139,7 @@ zesPowerGetLimits( ///< power limits will not be returned. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -6203,7 +6203,7 @@ zesPowerSetLimits( ///< be made to the peak power limits. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -6264,7 +6264,7 @@ zesPowerGetEnergyThreshold( ///< enabled/energy threshold/process ID. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -6338,7 +6338,7 @@ zesPowerSetEnergyThreshold( double threshold ///< [in] The energy threshold to be set in joules. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -6404,7 +6404,7 @@ zesDeviceEnumPsus( ///< component handles. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -6460,7 +6460,7 @@ zesPsuGetProperties( zes_psu_properties_t* pProperties ///< [in,out] Will contain the properties of the power supply. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -6516,7 +6516,7 @@ zesPsuGetState( zes_psu_state_t* pState ///< [in,out] Will contain the current state of the power supply. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -6592,7 +6592,7 @@ zesDeviceEnumRasErrorSets( ///< component handles. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -6650,7 +6650,7 @@ zesRasGetProperties( zes_ras_properties_t* pProperties ///< [in,out] Structure describing RAS properties ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -6716,7 +6716,7 @@ zesRasGetConfig( ///< thresholds used to trigger events ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -6787,7 +6787,7 @@ zesRasSetConfig( const zes_ras_config_t* pConfig ///< [in] Change the RAS configuration - thresholds used to trigger events ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -6849,7 +6849,7 @@ zesRasGetState( zes_ras_state_t* pState ///< [in,out] Breakdown of where errors have occurred ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -6921,7 +6921,7 @@ zesDeviceEnumSchedulers( ///< component handles. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -6977,7 +6977,7 @@ zesSchedulerGetProperties( zes_sched_properties_t* pProperties ///< [in,out] Structure that will contain property data. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -7035,7 +7035,7 @@ zesSchedulerGetCurrentMode( zes_sched_mode_t* pMode ///< [in,out] Will contain the current scheduler mode. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -7095,7 +7095,7 @@ zesSchedulerGetTimeoutModeProperties( zes_sched_timeout_properties_t* pConfig ///< [in,out] Will contain the current parameters for this mode. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -7155,7 +7155,7 @@ zesSchedulerGetTimesliceModeProperties( zes_sched_timeslice_properties_t* pConfig ///< [in,out] Will contain the current parameters for this mode. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -7223,7 +7223,7 @@ zesSchedulerSetTimeoutMode( ///< apply the new scheduler mode. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -7290,7 +7290,7 @@ zesSchedulerSetTimesliceMode( ///< apply the new scheduler mode. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -7355,7 +7355,7 @@ zesSchedulerSetExclusiveMode( ///< apply the new scheduler mode. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -7422,7 +7422,7 @@ zesSchedulerSetComputeUnitDebugMode( ///< apply the new scheduler mode. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -7488,7 +7488,7 @@ zesDeviceEnumStandbyDomains( ///< component handles. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -7544,7 +7544,7 @@ zesStandbyGetProperties( zes_standby_properties_t* pProperties ///< [in,out] Will contain the standby hardware properties. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -7600,7 +7600,7 @@ zesStandbyGetMode( zes_standby_promo_mode_t* pMode ///< [in,out] Will contain the current standby mode. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -7658,7 +7658,7 @@ zesStandbySetMode( zes_standby_promo_mode_t mode ///< [in] New standby mode. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -7724,7 +7724,7 @@ zesDeviceEnumTemperatureSensors( ///< component handles. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -7780,7 +7780,7 @@ zesTemperatureGetProperties( zes_temp_properties_t* pProperties ///< [in,out] Will contain the temperature sensor properties. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -7842,7 +7842,7 @@ zesTemperatureGetConfig( zes_temp_config_t* pConfig ///< [in,out] Returns current configuration. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -7921,7 +7921,7 @@ zesTemperatureSetConfig( const zes_temp_config_t* pConfig ///< [in] New configuration. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -7978,7 +7978,7 @@ zesTemperatureGetState( ///< in degrees Celsius. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -8044,7 +8044,7 @@ zesPowerGetLimitsExt( ///< number of components. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -8113,7 +8113,7 @@ zesPowerSetLimitsExt( zes_power_limit_ext_desc_t* pSustained ///< [in][optional][range(0, *pCount)] Array of power limit descriptors. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -8184,7 +8184,7 @@ zesEngineGetActivityExt( ///< of VF engine stats. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -8250,7 +8250,7 @@ zesRasGetStateExp( ///< shall only retrieve that number of RAS states. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -8313,7 +8313,7 @@ zesRasClearStateExp( zes_ras_error_category_exp_t category ///< [in] category for which error counter is to be cleared. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -8374,7 +8374,7 @@ zesFirmwareGetSecurityVersionExp( ///< returned if this property cannot be determined. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -8427,7 +8427,7 @@ zesFirmwareSetSecurityVersionExp( zes_firmware_handle_t hFirmware ///< [in] Handle for the component. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -8491,7 +8491,7 @@ zesDeviceGetSubDevicePropertiesExp( ///< the driver shall only retrieve that number of sub device property structures. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -8554,7 +8554,7 @@ zesDriverGetDeviceByUuidExp( uint32_t* subdeviceId ///< [out] If onSubdevice is true, this gives the ID of the sub-device ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -8621,7 +8621,7 @@ zesDeviceEnumActiveVFExp( ///< component handles. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -8679,7 +8679,7 @@ zesVFManagementGetVFPropertiesExp( zes_vf_exp_properties_t* pProperties ///< [in,out] Will contain VF properties. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -8750,7 +8750,7 @@ zesVFManagementGetVFMemoryUtilizationExp( ///< memory stats. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -8821,7 +8821,7 @@ zesVFManagementGetVFEngineUtilizationExp( ///< engine stats. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -8881,7 +8881,7 @@ zesVFManagementSetVFTelemetryModeExp( ze_bool_t enable ///< [in] Enable utilization telemetry. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -8941,7 +8941,7 @@ zesVFManagementSetVFTelemetrySamplingIntervalExp( uint64_t samplingInterval ///< [in] Sampling interval value. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -9007,7 +9007,7 @@ zesDeviceEnumEnabledVFExp( ///< component handles. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -9065,7 +9065,7 @@ zesVFManagementGetVFCapabilitiesExp( zes_vf_exp_capabilities_t* pCapability ///< [in,out] Will contain VF capability. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -9133,7 +9133,7 @@ zesVFManagementGetVFMemoryUtilizationExp2( ///< memory stats. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -9201,7 +9201,7 @@ zesVFManagementGetVFEngineUtilizationExp2( ///< engine stats. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -9257,7 +9257,7 @@ zesVFManagementGetVFCapabilitiesExp2( zes_vf_exp2_capabilities_t* pCapability ///< [in,out] Will contain VF capability. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; diff --git a/source/lib/zes_libddi.cpp b/source/lib/zes_libddi.cpp index 05f2e0e4..f6e85b0b 100644 --- a/source/lib/zes_libddi.cpp +++ b/source/lib/zes_libddi.cpp @@ -8,7 +8,7 @@ * */ #include "ze_lib.h" -#ifndef DYNAMIC_LOAD_LOADER +#ifndef L0_STATIC_LOADER_BUILD #include "zes_ddi.h" #endif @@ -16,7 +16,7 @@ namespace ze_lib { /////////////////////////////////////////////////////////////////////////////// -#ifdef DYNAMIC_LOAD_LOADER +#ifdef L0_STATIC_LOADER_BUILD __zedlllocal ze_result_t context_t::zesDdiTableInit(ze_api_version_t version) { ze_result_t result = ZE_RESULT_SUCCESS; diff --git a/source/lib/zet_libapi.cpp b/source/lib/zet_libapi.cpp index fb8377b2..8f10a5d6 100644 --- a/source/lib/zet_libapi.cpp +++ b/source/lib/zet_libapi.cpp @@ -44,7 +44,7 @@ zetModuleGetDebugInfo( uint8_t* pDebugInfo ///< [in,out][optional] byte pointer to debug info ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -96,7 +96,7 @@ zetDeviceGetDebugProperties( zet_device_debug_properties_t* pDebugProperties ///< [in,out] query result for debug properties ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -160,7 +160,7 @@ zetDebugAttach( zet_debug_session_handle_t* phDebug ///< [out] debug session handle ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -209,7 +209,7 @@ zetDebugDetach( zet_debug_session_handle_t hDebug ///< [in][release] debug session handle ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -270,7 +270,7 @@ zetDebugReadEvent( zet_debug_event_t* event ///< [in,out] a pointer to a ::zet_debug_event_t. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -322,7 +322,7 @@ zetDebugAcknowledgeEvent( const zet_debug_event_t* event ///< [in] a pointer to a ::zet_debug_event_t. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -374,7 +374,7 @@ zetDebugInterrupt( ze_device_thread_t thread ///< [in] the thread to interrupt ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -426,7 +426,7 @@ zetDebugResume( ze_device_thread_t thread ///< [in] the thread to resume ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -491,7 +491,7 @@ zetDebugReadMemory( void* buffer ///< [in,out] a buffer to hold a copy of the memory ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -556,7 +556,7 @@ zetDebugWriteMemory( const void* buffer ///< [in] a buffer holding the pattern to write ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -617,7 +617,7 @@ zetDebugGetRegisterSetProperties( ///< then driver shall only retrieve that number of register set properties. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -683,7 +683,7 @@ zetDebugGetThreadRegisterSetProperties( ///< then driver shall only retrieve that number of register set properties. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -743,7 +743,7 @@ zetDebugReadRegisters( void* pRegisterValues ///< [in,out][optional][range(0, count)] buffer of register values ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -803,7 +803,7 @@ zetDebugWriteRegisters( void* pRegisterValues ///< [in,out][optional][range(0, count)] buffer of register values ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -866,7 +866,7 @@ zetMetricGroupGet( ///< driver shall only retrieve that number of metric groups. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -921,7 +921,7 @@ zetMetricGroupGetProperties( zet_metric_group_properties_t* pProperties ///< [in,out] metric group properties ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -990,7 +990,7 @@ zetMetricGroupCalculateMetricValues( ///< then driver shall only calculate that number of metric values. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1052,7 +1052,7 @@ zetMetricGet( ///< shall only retrieve that number of metrics. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1107,7 +1107,7 @@ zetMetricGetProperties( zet_metric_properties_t* pProperties ///< [in,out] metric properties ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1180,7 +1180,7 @@ zetContextActivateMetricGroups( ///< metric query and metric stream must use activated metric groups. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1250,7 +1250,7 @@ zetMetricStreamerOpen( zet_metric_streamer_handle_t* phMetricStreamer ///< [out] handle of metric streamer ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1312,7 +1312,7 @@ zetCommandListAppendMetricStreamerMarker( uint32_t value ///< [in] streamer marker value ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1365,7 +1365,7 @@ zetMetricStreamerClose( zet_metric_streamer_handle_t hMetricStreamer ///< [in][release] handle of the metric streamer ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1432,7 +1432,7 @@ zetMetricStreamerReadData( ///< reports in raw format ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1496,7 +1496,7 @@ zetMetricQueryPoolCreate( zet_metric_query_pool_handle_t* phMetricQueryPool ///< [out] handle of metric query pool ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1555,7 +1555,7 @@ zetMetricQueryPoolDestroy( zet_metric_query_pool_handle_t hMetricQueryPool ///< [in][release] handle of the metric query pool ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1612,7 +1612,7 @@ zetMetricQueryCreate( zet_metric_query_handle_t* phMetricQuery ///< [out] handle of metric query ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1669,7 +1669,7 @@ zetMetricQueryDestroy( zet_metric_query_handle_t hMetricQuery ///< [in][release] handle of metric query ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1724,7 +1724,7 @@ zetMetricQueryReset( zet_metric_query_handle_t hMetricQuery ///< [in] handle of metric query ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1785,7 +1785,7 @@ zetCommandListAppendMetricQueryBegin( zet_metric_query_handle_t hMetricQuery ///< [in] handle of the metric query ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1860,7 +1860,7 @@ zetCommandListAppendMetricQueryEnd( ze_event_handle_t* phWaitEvents ///< [in][mbz] must be nullptr ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1913,7 +1913,7 @@ zetCommandListAppendMetricMemoryBarrier( zet_command_list_handle_t hCommandList ///< [in] handle of the command list ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1976,7 +1976,7 @@ zetMetricQueryGetData( ///< reports in raw format ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2036,7 +2036,7 @@ zetKernelGetProfileInfo( zet_profile_properties_t* pProfileProperties ///< [out] pointer to profile properties ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2098,7 +2098,7 @@ zetTracerExpCreate( zet_tracer_exp_handle_t* phTracer ///< [out] pointer to handle of tracer object created ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2156,7 +2156,7 @@ zetTracerExpDestroy( zet_tracer_exp_handle_t hTracer ///< [in][release] handle of tracer object to destroy ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2217,7 +2217,7 @@ zetTracerExpSetPrologues( zet_core_callbacks_t* pCoreCbs ///< [in] pointer to table of 'core' callback function pointers ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2278,7 +2278,7 @@ zetTracerExpSetEpilogues( zet_core_callbacks_t* pCoreCbs ///< [in] pointer to table of 'core' callback function pointers ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2332,7 +2332,7 @@ zetTracerExpSetEnabled( ze_bool_t enable ///< [in] enable the tracer if true; disable if false ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2394,7 +2394,7 @@ zetDeviceGetConcurrentMetricGroupsExp( ///< replays necessary. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2472,7 +2472,7 @@ zetMetricTracerCreateExp( zet_metric_tracer_exp_handle_t* phMetricTracer ///< [out] handle of the metric tracer ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2525,7 +2525,7 @@ zetMetricTracerDestroyExp( zet_metric_tracer_exp_handle_t hMetricTracer ///< [in] handle of the metric tracer ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2586,7 +2586,7 @@ zetMetricTracerEnableExp( ///< when the tracer is active. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2648,7 +2648,7 @@ zetMetricTracerDisableExp( ///< has no more data to be retrieved. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2718,7 +2718,7 @@ zetMetricTracerReadDataExp( ///< data in raw format ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2770,7 +2770,7 @@ zetMetricDecoderCreateExp( zet_metric_decoder_exp_handle_t* phMetricDecoder///< [out] handle of the metric decoder object ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2819,7 +2819,7 @@ zetMetricDecoderDestroyExp( zet_metric_decoder_exp_handle_t phMetricDecoder ///< [in] handle of the metric decoder object ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2890,7 +2890,7 @@ zetMetricDecoderGetDecodableMetricsExp( ///< the hMetricDecoder handle provided. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2983,7 +2983,7 @@ zetMetricTracerDecodeExp( ///< decoded metric entries ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3042,7 +3042,7 @@ zetCommandListAppendMarkerExp( uint32_t value ///< [in] marker value ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3104,7 +3104,7 @@ zetDeviceEnableMetricsExp( zet_device_handle_t hDevice ///< [in] handle of the device where metrics collection has to be enabled. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3163,7 +3163,7 @@ zetDeviceDisableMetricsExp( zet_device_handle_t hDevice ///< [in] handle of the device where metrics collection has to be disabled ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3251,7 +3251,7 @@ zetMetricGroupCalculateMultipleMetricValuesExp( ///< then driver shall only calculate that number of metric values. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3312,7 +3312,7 @@ zetMetricGroupGetGlobalTimestampsExp( uint64_t* metricTimestamp ///< [out] Metric timestamp. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3381,7 +3381,7 @@ zetMetricGroupGetExportDataExp( uint8_t * pExportData ///< [in,out][optional][range(0, *pExportDataSize)] buffer of exported data. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3470,7 +3470,7 @@ zetMetricGroupCalculateMetricExportDataExp( ///< then driver shall only calculate that number of metric values. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3535,7 +3535,7 @@ zetMetricProgrammableGetExp( ///< then driver shall only retrieve that number of metric programmables. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3590,7 +3590,7 @@ zetMetricProgrammableGetPropertiesExp( zet_metric_programmable_exp_properties_t* pProperties ///< [in,out] properties of the metric programmable ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3654,7 +3654,7 @@ zetMetricProgrammableGetParamInfoExp( ///< then driver shall only retrieve that number of parameter info. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3720,7 +3720,7 @@ zetMetricProgrammableGetParamValueInfoExp( ///< then driver shall only retrieve that number of value info. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3802,7 +3802,7 @@ zetMetricCreateFromProgrammableExp2( ///< shall only retrieve that number of metric handles. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3877,7 +3877,7 @@ zetMetricCreateFromProgrammableExp( ///< shall only retrieve that number of metric handles. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3957,7 +3957,7 @@ zetDeviceCreateMetricGroupsFromMetricsExp( ///< Created Metric group handles. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4023,7 +4023,7 @@ zetMetricGroupCreateExp( zet_metric_group_handle_t* phMetricGroup ///< [in,out] Created Metric group handle ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4097,7 +4097,7 @@ zetMetricGroupAddMetricExp( ///< available, then driver shall only retrieve that length of error string. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4157,7 +4157,7 @@ zetMetricGroupRemoveMetricExp( zet_metric_handle_t hMetric ///< [in] Metric handle to be removed from the metric group. ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4226,7 +4226,7 @@ zetMetricGroupCloseExp( zet_metric_group_handle_t hMetricGroup ///< [in] Handle of the metric group ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4289,7 +4289,7 @@ zetMetricGroupDestroyExp( zet_metric_group_handle_t hMetricGroup ///< [in] Handle of the metric group to destroy ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4346,7 +4346,7 @@ zetMetricDestroyExp( zet_metric_handle_t hMetric ///< [in] Handle of the metric to destroy ) { - #ifdef DYNAMIC_LOAD_LOADER + #ifdef L0_STATIC_LOADER_BUILD ze_result_t result = ZE_RESULT_SUCCESS; if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; diff --git a/source/lib/zet_libddi.cpp b/source/lib/zet_libddi.cpp index af6143c5..2109d01d 100644 --- a/source/lib/zet_libddi.cpp +++ b/source/lib/zet_libddi.cpp @@ -8,7 +8,7 @@ * */ #include "ze_lib.h" -#ifndef DYNAMIC_LOAD_LOADER +#ifndef L0_STATIC_LOADER_BUILD #include "zet_ddi.h" #endif @@ -16,7 +16,7 @@ namespace ze_lib { /////////////////////////////////////////////////////////////////////////////// -#ifdef DYNAMIC_LOAD_LOADER +#ifdef L0_STATIC_LOADER_BUILD __zedlllocal ze_result_t context_t::zetDdiTableInit(ze_api_version_t version) { ze_result_t result = ZE_RESULT_SUCCESS; diff --git a/source/loader/linux/loader_init.cpp b/source/loader/linux/loader_init.cpp index aa9f57ba..67c6456d 100644 --- a/source/loader/linux/loader_init.cpp +++ b/source/loader/linux/loader_init.cpp @@ -10,7 +10,7 @@ namespace loader { -#ifndef DYNAMIC_LOAD_LOADER +#ifndef L0_STATIC_LOADER_BUILD void __attribute__((constructor)) createLoaderContext() { context = new context_t; } diff --git a/source/loader/windows/loader_init.cpp b/source/loader/windows/loader_init.cpp index 03baad8a..2d3bba32 100644 --- a/source/loader/windows/loader_init.cpp +++ b/source/loader/windows/loader_init.cpp @@ -10,7 +10,7 @@ namespace loader { -#ifdef DYNAMIC_LOAD_LOADER +#ifdef L0_STATIC_LOADER_BUILD extern "C" BOOL APIENTRY DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { if (fdwReason == DLL_PROCESS_DETACH) { delete context; From e3b6efdd91d67bb03024b266094afabd39e213bf Mon Sep 17 00:00:00 2001 From: "Neil R. Spruit" Date: Tue, 3 Jun 2025 18:11:59 -0700 Subject: [PATCH 15/28] Block all calls to get drivers until after init has completed to avoid race during sorting (#345) Signed-off-by: Neil R. Spruit --- CHANGELOG.md | 2 ++ CMakeLists.txt | 2 +- PRODUCT_GUID.txt | 4 +-- scripts/templates/ldrddi.cpp.mako | 37 +++++++++++---------- scripts/templates/ze_loader_internal.h.mako | 1 + source/loader/ze_ldrddi.cpp | 26 +++++++++------ source/loader/ze_loader_internal.h | 1 + source/loader/zes_ldrddi.cpp | 13 +++++--- 8 files changed, 51 insertions(+), 35 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 302adb0f..883e196e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Level zero loader changelog +## v1.22.4 +* Block all calls to get until after init has completed to avoid race during sorting. ## v1.22.3 * Fix sysman-only initialization to block loader context retrieval when versions are incompatible * Add ability to register a TeardownCallback to notify release of L0 resources diff --git a/CMakeLists.txt b/CMakeLists.txt index 9a25973c..35d051a6 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.22.3) +project(level-zero VERSION 1.22.4) include(GNUInstallDirs) diff --git a/PRODUCT_GUID.txt b/PRODUCT_GUID.txt index b1c6a38c..24be5899 100644 --- a/PRODUCT_GUID.txt +++ b/PRODUCT_GUID.txt @@ -1,2 +1,2 @@ -1.22.3 -b3491b8d-9942-47bf-be47-8741f9614566 \ No newline at end of file +1.22.4 +55e69860-8ae7-4f60-8ad9-728c1ed2a2e7 \ No newline at end of file diff --git a/scripts/templates/ldrddi.cpp.mako b/scripts/templates/ldrddi.cpp.mako index 975ea7c7..24f6ec1c 100644 --- a/scripts/templates/ldrddi.cpp.mako +++ b/scripts/templates/ldrddi.cpp.mako @@ -79,23 +79,26 @@ namespace loader %elif re.match(r"\w+DriverGet$", th.make_func_name(n, tags, obj)) or re.match(r"\w+InitDrivers$", th.make_func_name(n, tags, obj)): uint32_t total_driver_handle_count = 0; - if (!loader::context->sortingInProgress.exchange(true) && !loader::context->instrumentationEnabled) { - %if namespace != "zes": - %if not re.match(r"\w+InitDrivers$", th.make_func_name(n, tags, obj)): - std::call_once(loader::context->coreDriverSortOnce, []() { - loader::context->driverSorting(&loader::context->zeDrivers, nullptr, false); - }); - %else: - std::call_once(loader::context->coreDriverSortOnce, [desc]() { - loader::context->driverSorting(&loader::context->zeDrivers, desc, false); - }); - %endif - %else: - std::call_once(loader::context->sysmanDriverSortOnce, []() { - loader::context->driverSorting(loader::context->sysmanInstanceDrivers, nullptr, true); - }); - %endif - loader::context->sortingInProgress.store(false); + { + std::lock_guard lock(loader::context->sortMutex); + if (!loader::context->sortingInProgress.exchange(true) && !loader::context->instrumentationEnabled) { + %if namespace != "zes": + %if not re.match(r"\w+InitDrivers$", th.make_func_name(n, tags, obj)): + std::call_once(loader::context->coreDriverSortOnce, []() { + loader::context->driverSorting(&loader::context->zeDrivers, nullptr, false); + }); + %else: + std::call_once(loader::context->coreDriverSortOnce, [desc]() { + loader::context->driverSorting(&loader::context->zeDrivers, desc, false); + }); + %endif + %else: + std::call_once(loader::context->sysmanDriverSortOnce, []() { + loader::context->driverSorting(loader::context->sysmanInstanceDrivers, nullptr, true); + }); + %endif + loader::context->sortingInProgress.store(false); + } } %if namespace != "zes": diff --git a/scripts/templates/ze_loader_internal.h.mako b/scripts/templates/ze_loader_internal.h.mako index d249eb80..220aea50 100644 --- a/scripts/templates/ze_loader_internal.h.mako +++ b/scripts/templates/ze_loader_internal.h.mako @@ -122,6 +122,7 @@ namespace loader std::once_flag coreDriverSortOnce; std::once_flag sysmanDriverSortOnce; std::atomic sortingInProgress = {false}; + std::mutex sortMutex; bool instrumentationEnabled = false; dditable_t tracing_dditable = {}; std::shared_ptr zel_logger; diff --git a/source/loader/ze_ldrddi.cpp b/source/loader/ze_ldrddi.cpp index f424c7c4..88f30e4d 100644 --- a/source/loader/ze_ldrddi.cpp +++ b/source/loader/ze_ldrddi.cpp @@ -56,11 +56,14 @@ namespace loader uint32_t total_driver_handle_count = 0; - if (!loader::context->sortingInProgress.exchange(true) && !loader::context->instrumentationEnabled) { - std::call_once(loader::context->coreDriverSortOnce, []() { - loader::context->driverSorting(&loader::context->zeDrivers, nullptr, false); - }); - loader::context->sortingInProgress.store(false); + { + std::lock_guard lock(loader::context->sortMutex); + if (!loader::context->sortingInProgress.exchange(true) && !loader::context->instrumentationEnabled) { + std::call_once(loader::context->coreDriverSortOnce, []() { + loader::context->driverSorting(&loader::context->zeDrivers, nullptr, false); + }); + loader::context->sortingInProgress.store(false); + } } for( auto& drv : loader::context->zeDrivers ) @@ -139,11 +142,14 @@ namespace loader uint32_t total_driver_handle_count = 0; - if (!loader::context->sortingInProgress.exchange(true) && !loader::context->instrumentationEnabled) { - std::call_once(loader::context->coreDriverSortOnce, [desc]() { - loader::context->driverSorting(&loader::context->zeDrivers, desc, false); - }); - loader::context->sortingInProgress.store(false); + { + std::lock_guard lock(loader::context->sortMutex); + if (!loader::context->sortingInProgress.exchange(true) && !loader::context->instrumentationEnabled) { + std::call_once(loader::context->coreDriverSortOnce, [desc]() { + loader::context->driverSorting(&loader::context->zeDrivers, desc, false); + }); + loader::context->sortingInProgress.store(false); + } } for( auto& drv : loader::context->zeDrivers ) diff --git a/source/loader/ze_loader_internal.h b/source/loader/ze_loader_internal.h index d3e42238..94f123e9 100644 --- a/source/loader/ze_loader_internal.h +++ b/source/loader/ze_loader_internal.h @@ -158,6 +158,7 @@ namespace loader std::once_flag coreDriverSortOnce; std::once_flag sysmanDriverSortOnce; std::atomic sortingInProgress = {false}; + std::mutex sortMutex; bool instrumentationEnabled = false; dditable_t tracing_dditable = {}; std::shared_ptr zel_logger; diff --git a/source/loader/zes_ldrddi.cpp b/source/loader/zes_ldrddi.cpp index db5649ed..9e80fa9d 100644 --- a/source/loader/zes_ldrddi.cpp +++ b/source/loader/zes_ldrddi.cpp @@ -60,11 +60,14 @@ namespace loader uint32_t total_driver_handle_count = 0; - if (!loader::context->sortingInProgress.exchange(true) && !loader::context->instrumentationEnabled) { - std::call_once(loader::context->sysmanDriverSortOnce, []() { - loader::context->driverSorting(loader::context->sysmanInstanceDrivers, nullptr, true); - }); - loader::context->sortingInProgress.store(false); + { + std::lock_guard lock(loader::context->sortMutex); + if (!loader::context->sortingInProgress.exchange(true) && !loader::context->instrumentationEnabled) { + std::call_once(loader::context->sysmanDriverSortOnce, []() { + loader::context->driverSorting(loader::context->sysmanInstanceDrivers, nullptr, true); + }); + loader::context->sortingInProgress.store(false); + } } for( auto& drv : *loader::context->sysmanInstanceDrivers ) From ec7b3f28327ced73235dc4b65ecdfef1d4c9f2c5 Mon Sep 17 00:00:00 2001 From: "Neil R. Spruit" Date: Wed, 11 Jun 2025 07:56:46 -0700 Subject: [PATCH 16/28] Fix CI to run on release branches (#348) Signed-off-by: Neil R. Spruit --- .github/workflows/build-msi-package.yml | 4 ++-- .github/workflows/build-multi-static.yml | 4 ++-- .github/workflows/build-multi.yml | 4 ++-- .github/workflows/build-quick-static.yml | 4 ++-- .github/workflows/build-quick.yml | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-msi-package.yml b/.github/workflows/build-msi-package.yml index 66cb6cf7..5997c9c6 100644 --- a/.github/workflows/build-msi-package.yml +++ b/.github/workflows/build-msi-package.yml @@ -1,8 +1,8 @@ on: push: - branches: [ master ] + branches: [ master,release_branch* ] pull_request: - branches: [ master ] + branches: [ master,release_branch* ] workflow_dispatch: permissions: read-all diff --git a/.github/workflows/build-multi-static.yml b/.github/workflows/build-multi-static.yml index c510c5cd..6a95e140 100644 --- a/.github/workflows/build-multi-static.yml +++ b/.github/workflows/build-multi-static.yml @@ -1,8 +1,8 @@ on: push: - branches: [ master ] + branches: [ master,release_branch* ] pull_request: - branches: [ master ] + branches: [ master,release_branch* ] workflow_dispatch: permissions: read-all diff --git a/.github/workflows/build-multi.yml b/.github/workflows/build-multi.yml index 0921e8ad..e3bb075d 100644 --- a/.github/workflows/build-multi.yml +++ b/.github/workflows/build-multi.yml @@ -1,8 +1,8 @@ on: push: - branches: [ master ] + branches: [ master,release_branch* ] pull_request: - branches: [ master ] + branches: [ master,release_branch* ] workflow_dispatch: permissions: read-all diff --git a/.github/workflows/build-quick-static.yml b/.github/workflows/build-quick-static.yml index 24a99d96..85f0302b 100644 --- a/.github/workflows/build-quick-static.yml +++ b/.github/workflows/build-quick-static.yml @@ -1,8 +1,8 @@ on: push: - branches: [ master ] + branches: [ master,release_branch* ] pull_request: - branches: [ master ] + branches: [ master,release_branch* ] workflow_dispatch: permissions: read-all diff --git a/.github/workflows/build-quick.yml b/.github/workflows/build-quick.yml index 8ffeba83..fbdb2c02 100644 --- a/.github/workflows/build-quick.yml +++ b/.github/workflows/build-quick.yml @@ -1,8 +1,8 @@ on: push: - branches: [ master ] + branches: [ master,release_branch* ] pull_request: - branches: [ master ] + branches: [ master,release_branch* ] workflow_dispatch: permissions: read-all From 41da2f66672a755cedfdde8a2a44b6d5333e359f Mon Sep 17 00:00:00 2001 From: "Kozlowski, Marek" Date: Tue, 17 Jun 2025 15:39:06 +0200 Subject: [PATCH 17/28] Init certification checker (#340) Signed-off-by: Kozlowski, Marek --- scripts/generate_code.py | 3 +- .../templates/validation/certification.h.mako | 36 + source/layers/validation/README.md | 5 + .../checkers/certification/CMakeLists.txt | 12 + .../checkers/certification/README.md | 16 + .../generated/ze_certification.h | 1237 +++++++++++++++++ .../generated/zes_certification.h | 913 ++++++++++++ .../generated/zet_certification.h | 433 ++++++ .../zel_certification_checker.cpp | 64 + .../certification/zel_certification_checker.h | 40 + .../zel_global_certification_state.h | 25 + 11 files changed, 2783 insertions(+), 1 deletion(-) create mode 100644 scripts/templates/validation/certification.h.mako create mode 100644 source/layers/validation/checkers/certification/CMakeLists.txt create mode 100644 source/layers/validation/checkers/certification/README.md create mode 100644 source/layers/validation/checkers/certification/generated/ze_certification.h create mode 100644 source/layers/validation/checkers/certification/generated/zes_certification.h create mode 100644 source/layers/validation/checkers/certification/generated/zet_certification.h create mode 100644 source/layers/validation/checkers/certification/zel_certification_checker.cpp create mode 100644 source/layers/validation/checkers/certification/zel_certification_checker.h create mode 100644 source/layers/validation/checkers/certification/zel_global_certification_state.h diff --git a/scripts/generate_code.py b/scripts/generate_code.py index a17de577..6ef50434 100644 --- a/scripts/generate_code.py +++ b/scripts/generate_code.py @@ -163,7 +163,8 @@ def _mako_loader_cpp(path, namespace, tags, version, specs, meta): 'param.cpp.mako' : ('checkers/parameter_validation', 'parameter_validation.cpp'), 'param.h.mako' : ('checkers/parameter_validation', 'parameter_validation.h'), 'handle_lifetime.h.mako' : ('handle_lifetime_tracking', 'handle_lifetime.h'), - 'handle_lifetime.cpp.mako' : ('handle_lifetime_tracking', 'handle_lifetime.cpp') + 'handle_lifetime.cpp.mako' : ('handle_lifetime_tracking', 'handle_lifetime.cpp'), + 'certification.h.mako' : ('checkers/certification/generated', 'certification.h'), } def _mako_validation_layer_cpp(path, namespace, tags, version, specs, meta): diff --git a/scripts/templates/validation/certification.h.mako b/scripts/templates/validation/certification.h.mako new file mode 100644 index 00000000..838a0625 --- /dev/null +++ b/scripts/templates/validation/certification.h.mako @@ -0,0 +1,36 @@ +<%! +from templates import helper as th +%><% + n=namespace + N=n.upper() +%>/* + * ***THIS FILE IS GENERATED. *** + * + * Copyright (C) 2025 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + * @file ${name} + * + */ +#pragma once +#include "../zel_global_certification_state.h" +#include "${n}_entry_points.h" + +namespace validation_layer { +class ${N}certificationCheckerGenerated : public ${N}ValidationEntryPoints { +public: +%for obj in th.extract_objs(specs, r"function"): + virtual ze_result_t ${th.make_func_name(n, tags, obj)}Prologue( \ + %for line in th.make_param_lines(n, tags, obj, format=["type", "name", "delim"]): +${line} \ + %endfor +) override { + if (GlobalCertificationState::getInstance().certification_version < ${th.get_version(obj)}) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } +%endfor +}; +} // namespace validation_layer diff --git a/source/layers/validation/README.md b/source/layers/validation/README.md index 9cd53f40..b96e224e 100644 --- a/source/layers/validation/README.md +++ b/source/layers/validation/README.md @@ -21,6 +21,7 @@ By default, no validation modes will be enabled. The individual validation modes - `ZEL_ENABLE_EVENTS_CHECKER` - `ZEL_ENABLE_BASIC_LEAK_CHECKER` - `ZE_ENABLE_THREADING_VALIDATION` (Not yet Implemented) +- `ZEL_ENABLE_CERTIFICATION_CHECKER` ## Validation Modes @@ -83,6 +84,10 @@ Basic leak checker in the validation layer which tracks the Create and Destroy c Validates: - Objects are not concurrently reused in free-threaded API calls +### `ZEL_ENABLE_CERTIFICATION_CHECKER` + +When this mode is enabled, the certification checker validates API usage against the version supported by the driver or an explicitly specified version. +If an API is used that was introduced in a version higher than the supported version, the checker will return `ZE_RESULT_ERROR_UNSUPPORTED_VERSION`. ## Testing diff --git a/source/layers/validation/checkers/certification/CMakeLists.txt b/source/layers/validation/checkers/certification/CMakeLists.txt new file mode 100644 index 00000000..3a176d9e --- /dev/null +++ b/source/layers/validation/checkers/certification/CMakeLists.txt @@ -0,0 +1,12 @@ +# Copyright (C) 2025 Intel Corporation +# SPDX-License-Identifier: MIT + +target_sources(${TARGET_NAME} + PRIVATE + ${CMAKE_CURRENT_LIST_DIR}/zel_certification_checker.h + ${CMAKE_CURRENT_LIST_DIR}/zel_certification_checker.cpp + ${CMAKE_CURRENT_LIST_DIR}/zel_global_certification_state.h + ${CMAKE_CURRENT_LIST_DIR}/generated/ze_certification.h + ${CMAKE_CURRENT_LIST_DIR}/generated/zes_certification.h + ${CMAKE_CURRENT_LIST_DIR}/generated/zet_certification.h +) diff --git a/source/layers/validation/checkers/certification/README.md b/source/layers/validation/checkers/certification/README.md new file mode 100644 index 00000000..ed728e83 --- /dev/null +++ b/source/layers/validation/checkers/certification/README.md @@ -0,0 +1,16 @@ +# Certification Checker + +## Description +The Certification Checker is a validation layer component designed to ensure that API usage conforms to a specific version supported by the driver. +Its primary function is to restrict the use of APIs to those that are available in the version reported by the driver or a version explicitly specified by the user. +If an attempt is made to use an API introduced in a later version, the checker shall return `ZE_RESULT_ERROR_UNSUPPORTED_VERSION`. + +When enabled, the checker intercepts API calls and compares the version of each API used against the version supported by the driver. +There are two modes: +- **Default:** + The supported version is, by default, set to the loader's defined `ZE_API_VERSION_CURRENT`. + It is updated to the driver’s reported version once `zeDriverGetApiVersion` is first called. +- **Explicit:** + The version can be overridden by setting the `ZEL_CERTIFICATION_CHECKER_VERSION` environment variable to a value of `.`. Once set, the version returned by `zeDriverGetApiVersion` is ignored. + For example, to restrict API usage to version 1.6: + `export ZEL_CERTIFICATION_CHECKER_VERSION=1.6` \ No newline at end of file diff --git a/source/layers/validation/checkers/certification/generated/ze_certification.h b/source/layers/validation/checkers/certification/generated/ze_certification.h new file mode 100644 index 00000000..d09abf9f --- /dev/null +++ b/source/layers/validation/checkers/certification/generated/ze_certification.h @@ -0,0 +1,1237 @@ +/* + * ***THIS FILE IS GENERATED. *** + * + * Copyright (C) 2025 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + * @file ze_certification.h + * + */ +#pragma once +#include "../zel_global_certification_state.h" +#include "ze_entry_points.h" + +namespace validation_layer { +class ZEcertificationCheckerGenerated : public ZEValidationEntryPoints { +public: + virtual ze_result_t zeInitPrologue( ze_init_flags_t flags ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeDriverGetPrologue( uint32_t* pCount, ze_driver_handle_t* phDrivers ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeInitDriversPrologue( uint32_t* pCount, ze_driver_handle_t* phDrivers, ze_init_driver_type_desc_t* desc ) 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 zeDriverGetApiVersionPrologue( ze_driver_handle_t hDriver, ze_api_version_t* version ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeDriverGetPropertiesPrologue( ze_driver_handle_t hDriver, ze_driver_properties_t* pDriverProperties ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeDriverGetIpcPropertiesPrologue( ze_driver_handle_t hDriver, ze_driver_ipc_properties_t* pIpcProperties ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeDriverGetExtensionPropertiesPrologue( ze_driver_handle_t hDriver, uint32_t* pCount, ze_driver_extension_properties_t* pExtensionProperties ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeDriverGetExtensionFunctionAddressPrologue( ze_driver_handle_t hDriver, const char* name, void** ppFunctionAddress ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_1) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeDriverGetLastErrorDescriptionPrologue( ze_driver_handle_t hDriver, const char** ppString ) 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 zeDeviceGetPrologue( ze_driver_handle_t hDriver, uint32_t* pCount, ze_device_handle_t* phDevices ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeDeviceGetRootDevicePrologue( ze_device_handle_t hDevice, ze_device_handle_t* phRootDevice ) 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 zeDeviceGetSubDevicesPrologue( ze_device_handle_t hDevice, uint32_t* pCount, ze_device_handle_t* phSubdevices ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeDeviceGetPropertiesPrologue( ze_device_handle_t hDevice, ze_device_properties_t* pDeviceProperties ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeDeviceGetComputePropertiesPrologue( ze_device_handle_t hDevice, ze_device_compute_properties_t* pComputeProperties ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeDeviceGetModulePropertiesPrologue( ze_device_handle_t hDevice, ze_device_module_properties_t* pModuleProperties ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeDeviceGetCommandQueueGroupPropertiesPrologue( ze_device_handle_t hDevice, uint32_t* pCount, ze_command_queue_group_properties_t* pCommandQueueGroupProperties ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeDeviceGetMemoryPropertiesPrologue( ze_device_handle_t hDevice, uint32_t* pCount, ze_device_memory_properties_t* pMemProperties ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeDeviceGetMemoryAccessPropertiesPrologue( ze_device_handle_t hDevice, ze_device_memory_access_properties_t* pMemAccessProperties ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeDeviceGetCachePropertiesPrologue( ze_device_handle_t hDevice, uint32_t* pCount, ze_device_cache_properties_t* pCacheProperties ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeDeviceGetImagePropertiesPrologue( ze_device_handle_t hDevice, ze_device_image_properties_t* pImageProperties ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeDeviceGetExternalMemoryPropertiesPrologue( ze_device_handle_t hDevice, ze_device_external_memory_properties_t* pExternalMemoryProperties ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeDeviceGetP2PPropertiesPrologue( ze_device_handle_t hDevice, ze_device_handle_t hPeerDevice, ze_device_p2p_properties_t* pP2PProperties ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeDeviceCanAccessPeerPrologue( ze_device_handle_t hDevice, ze_device_handle_t hPeerDevice, ze_bool_t* value ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeDeviceGetStatusPrologue( ze_device_handle_t hDevice ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeDeviceGetGlobalTimestampsPrologue( ze_device_handle_t hDevice, uint64_t* hostTimestamp, uint64_t* deviceTimestamp ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_1) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeContextCreatePrologue( ze_driver_handle_t hDriver, const ze_context_desc_t* desc, ze_context_handle_t* phContext ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeContextCreateExPrologue( ze_driver_handle_t hDriver, const ze_context_desc_t* desc, uint32_t numDevices, ze_device_handle_t* phDevices, ze_context_handle_t* phContext ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_1) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeContextDestroyPrologue( ze_context_handle_t hContext ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeContextGetStatusPrologue( ze_context_handle_t hContext ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeCommandQueueCreatePrologue( ze_context_handle_t hContext, ze_device_handle_t hDevice, const ze_command_queue_desc_t* desc, ze_command_queue_handle_t* phCommandQueue ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeCommandQueueDestroyPrologue( ze_command_queue_handle_t hCommandQueue ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeCommandQueueExecuteCommandListsPrologue( ze_command_queue_handle_t hCommandQueue, uint32_t numCommandLists, ze_command_list_handle_t* phCommandLists, ze_fence_handle_t hFence ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeCommandQueueSynchronizePrologue( ze_command_queue_handle_t hCommandQueue, uint64_t timeout ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeCommandQueueGetOrdinalPrologue( ze_command_queue_handle_t hCommandQueue, uint32_t* pOrdinal ) 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 zeCommandQueueGetIndexPrologue( ze_command_queue_handle_t hCommandQueue, uint32_t* pIndex ) 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 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; + } + 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 ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeCommandListDestroyPrologue( ze_command_list_handle_t hCommandList ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeCommandListClosePrologue( ze_command_list_handle_t hCommandList ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeCommandListResetPrologue( ze_command_list_handle_t hCommandList ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeCommandListAppendWriteGlobalTimestampPrologue( ze_command_list_handle_t hCommandList, uint64_t* dstptr, 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; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeCommandListHostSynchronizePrologue( ze_command_list_handle_t hCommandList, uint64_t timeout ) 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 zeCommandListGetDeviceHandlePrologue( ze_command_list_handle_t hCommandList, ze_device_handle_t* phDevice ) 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 zeCommandListGetContextHandlePrologue( ze_command_list_handle_t hCommandList, ze_context_handle_t* phContext ) 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 zeCommandListGetOrdinalPrologue( ze_command_list_handle_t hCommandList, uint32_t* pOrdinal ) 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 zeCommandListImmediateGetIndexPrologue( ze_command_list_handle_t hCommandListImmediate, uint32_t* pIndex ) 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 zeCommandListIsImmediatePrologue( ze_command_list_handle_t hCommandList, ze_bool_t* pIsImmediate ) 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 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; + } + 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 ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeContextSystemBarrierPrologue( ze_context_handle_t hContext, ze_device_handle_t hDevice ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeCommandListAppendMemoryCopyPrologue( 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeCommandListAppendMemoryFillPrologue( ze_command_list_handle_t hCommandList, void* ptr, const void* pattern, size_t pattern_size, 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeCommandListAppendMemoryCopyRegionPrologue( ze_command_list_handle_t hCommandList, void* dstptr, const ze_copy_region_t* dstRegion, uint32_t dstPitch, uint32_t dstSlicePitch, const void* srcptr, const ze_copy_region_t* srcRegion, uint32_t srcPitch, 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeCommandListAppendMemoryCopyFromContextPrologue( ze_command_list_handle_t hCommandList, void* dstptr, ze_context_handle_t hContextSrc, 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeCommandListAppendImageCopyPrologue( ze_command_list_handle_t hCommandList, ze_image_handle_t hDstImage, ze_image_handle_t hSrcImage, 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; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeCommandListAppendImageCopyRegionPrologue( ze_command_list_handle_t hCommandList, ze_image_handle_t hDstImage, ze_image_handle_t hSrcImage, const ze_image_region_t* pDstRegion, const ze_image_region_t* pSrcRegion, 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; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeCommandListAppendImageCopyToMemoryPrologue( ze_command_list_handle_t hCommandList, void* dstptr, ze_image_handle_t hSrcImage, const ze_image_region_t* pSrcRegion, 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; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeCommandListAppendImageCopyFromMemoryPrologue( ze_command_list_handle_t hCommandList, ze_image_handle_t hDstImage, const void* srcptr, const ze_image_region_t* pDstRegion, 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; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeCommandListAppendMemoryPrefetchPrologue( ze_command_list_handle_t hCommandList, const void* ptr, size_t size ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeCommandListAppendMemAdvisePrologue( ze_command_list_handle_t hCommandList, ze_device_handle_t hDevice, const void* ptr, size_t size, ze_memory_advice_t advice ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeEventPoolCreatePrologue( ze_context_handle_t hContext, const ze_event_pool_desc_t* desc, uint32_t numDevices, ze_device_handle_t* phDevices, ze_event_pool_handle_t* phEventPool ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeEventPoolDestroyPrologue( ze_event_pool_handle_t hEventPool ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeEventCreatePrologue( ze_event_pool_handle_t hEventPool, const ze_event_desc_t* desc, ze_event_handle_t* phEvent ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeEventDestroyPrologue( ze_event_handle_t hEvent ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeEventPoolGetIpcHandlePrologue( ze_event_pool_handle_t hEventPool, ze_ipc_event_pool_handle_t* phIpc ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeEventPoolPutIpcHandlePrologue( ze_context_handle_t hContext, ze_ipc_event_pool_handle_t hIpc ) 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 zeEventPoolOpenIpcHandlePrologue( ze_context_handle_t hContext, ze_ipc_event_pool_handle_t hIpc, ze_event_pool_handle_t* phEventPool ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeEventPoolCloseIpcHandlePrologue( ze_event_pool_handle_t hEventPool ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeCommandListAppendSignalEventPrologue( ze_command_list_handle_t hCommandList, ze_event_handle_t hEvent ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeCommandListAppendWaitOnEventsPrologue( ze_command_list_handle_t hCommandList, uint32_t numEvents, ze_event_handle_t* phEvents ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeEventHostSignalPrologue( ze_event_handle_t hEvent ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeEventHostSynchronizePrologue( ze_event_handle_t hEvent, uint64_t timeout ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeEventQueryStatusPrologue( ze_event_handle_t hEvent ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeCommandListAppendEventResetPrologue( ze_command_list_handle_t hCommandList, ze_event_handle_t hEvent ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeEventHostResetPrologue( ze_event_handle_t hEvent ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeEventQueryKernelTimestampPrologue( ze_event_handle_t hEvent, ze_kernel_timestamp_result_t* dstptr ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeCommandListAppendQueryKernelTimestampsPrologue( ze_command_list_handle_t hCommandList, uint32_t numEvents, ze_event_handle_t* phEvents, void* dstptr, const size_t* pOffsets, 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; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeEventGetEventPoolPrologue( ze_event_handle_t hEvent, ze_event_pool_handle_t* phEventPool ) 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 zeEventGetSignalScopePrologue( ze_event_handle_t hEvent, ze_event_scope_flags_t* pSignalScope ) 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 zeEventGetWaitScopePrologue( ze_event_handle_t hEvent, ze_event_scope_flags_t* pWaitScope ) 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 zeEventPoolGetContextHandlePrologue( ze_event_pool_handle_t hEventPool, ze_context_handle_t* phContext ) 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 zeEventPoolGetFlagsPrologue( ze_event_pool_handle_t hEventPool, ze_event_pool_flags_t* pFlags ) 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 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; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeFenceDestroyPrologue( ze_fence_handle_t hFence ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeFenceHostSynchronizePrologue( ze_fence_handle_t hFence, uint64_t timeout ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeFenceQueryStatusPrologue( ze_fence_handle_t hFence ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeFenceResetPrologue( ze_fence_handle_t hFence ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeImageGetPropertiesPrologue( ze_device_handle_t hDevice, const ze_image_desc_t* desc, ze_image_properties_t* pImageProperties ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeImageCreatePrologue( ze_context_handle_t hContext, ze_device_handle_t hDevice, const ze_image_desc_t* desc, ze_image_handle_t* phImage ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeImageDestroyPrologue( ze_image_handle_t hImage ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeMemAllocSharedPrologue( ze_context_handle_t hContext, const ze_device_mem_alloc_desc_t* device_desc, const ze_host_mem_alloc_desc_t* host_desc, size_t size, size_t alignment, ze_device_handle_t hDevice, void** pptr ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeMemAllocDevicePrologue( ze_context_handle_t hContext, const ze_device_mem_alloc_desc_t* device_desc, size_t size, size_t alignment, ze_device_handle_t hDevice, void** pptr ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeMemAllocHostPrologue( ze_context_handle_t hContext, const ze_host_mem_alloc_desc_t* host_desc, size_t size, size_t alignment, void** pptr ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeMemFreePrologue( ze_context_handle_t hContext, void* ptr ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeMemGetAllocPropertiesPrologue( ze_context_handle_t hContext, const void* ptr, ze_memory_allocation_properties_t* pMemAllocProperties, ze_device_handle_t* phDevice ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeMemGetAddressRangePrologue( ze_context_handle_t hContext, const void* ptr, void** pBase, size_t* pSize ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeMemGetIpcHandlePrologue( ze_context_handle_t hContext, const void* ptr, ze_ipc_mem_handle_t* pIpcHandle ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeMemGetIpcHandleFromFileDescriptorExpPrologue( ze_context_handle_t hContext, uint64_t handle, ze_ipc_mem_handle_t* pIpcHandle ) 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 zeMemGetFileDescriptorFromIpcHandleExpPrologue( ze_context_handle_t hContext, ze_ipc_mem_handle_t ipcHandle, uint64_t* pHandle ) 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 zeMemPutIpcHandlePrologue( ze_context_handle_t hContext, ze_ipc_mem_handle_t handle ) 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 zeMemOpenIpcHandlePrologue( ze_context_handle_t hContext, ze_device_handle_t hDevice, ze_ipc_mem_handle_t handle, ze_ipc_memory_flags_t flags, void** pptr ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeMemCloseIpcHandlePrologue( ze_context_handle_t hContext, const void* ptr ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeMemSetAtomicAccessAttributeExpPrologue( ze_context_handle_t hContext, ze_device_handle_t hDevice, const void* ptr, size_t size, ze_memory_atomic_attr_exp_flags_t attr ) 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 zeMemGetAtomicAccessAttributeExpPrologue( ze_context_handle_t hContext, ze_device_handle_t hDevice, const void* ptr, size_t size, ze_memory_atomic_attr_exp_flags_t* pAttr ) 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 zeModuleCreatePrologue( ze_context_handle_t hContext, ze_device_handle_t hDevice, const ze_module_desc_t* desc, ze_module_handle_t* phModule, ze_module_build_log_handle_t* phBuildLog ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeModuleDestroyPrologue( ze_module_handle_t hModule ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeModuleDynamicLinkPrologue( uint32_t numModules, ze_module_handle_t* phModules, ze_module_build_log_handle_t* phLinkLog ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeModuleBuildLogDestroyPrologue( ze_module_build_log_handle_t hModuleBuildLog ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeModuleBuildLogGetStringPrologue( ze_module_build_log_handle_t hModuleBuildLog, size_t* pSize, char* pBuildLog ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeModuleGetNativeBinaryPrologue( ze_module_handle_t hModule, size_t* pSize, uint8_t* pModuleNativeBinary ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeModuleGetGlobalPointerPrologue( ze_module_handle_t hModule, const char* pGlobalName, size_t* pSize, void** pptr ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeModuleGetKernelNamesPrologue( ze_module_handle_t hModule, uint32_t* pCount, const char** pNames ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeModuleGetPropertiesPrologue( ze_module_handle_t hModule, ze_module_properties_t* pModuleProperties ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeKernelCreatePrologue( ze_module_handle_t hModule, const ze_kernel_desc_t* desc, ze_kernel_handle_t* phKernel ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeKernelDestroyPrologue( ze_kernel_handle_t hKernel ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeModuleGetFunctionPointerPrologue( ze_module_handle_t hModule, const char* pFunctionName, void** pfnFunction ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeKernelSetGroupSizePrologue( ze_kernel_handle_t hKernel, uint32_t groupSizeX, uint32_t groupSizeY, uint32_t groupSizeZ ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeKernelSuggestGroupSizePrologue( ze_kernel_handle_t hKernel, uint32_t globalSizeX, uint32_t globalSizeY, uint32_t globalSizeZ, uint32_t* groupSizeX, uint32_t* groupSizeY, uint32_t* groupSizeZ ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeKernelSuggestMaxCooperativeGroupCountPrologue( ze_kernel_handle_t hKernel, uint32_t* totalGroupCount ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeKernelSetArgumentValuePrologue( ze_kernel_handle_t hKernel, uint32_t argIndex, size_t argSize, const void* pArgValue ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeKernelSetIndirectAccessPrologue( ze_kernel_handle_t hKernel, ze_kernel_indirect_access_flags_t flags ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeKernelGetIndirectAccessPrologue( ze_kernel_handle_t hKernel, ze_kernel_indirect_access_flags_t* pFlags ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeKernelGetSourceAttributesPrologue( ze_kernel_handle_t hKernel, uint32_t* pSize, char** pString ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeKernelSetCacheConfigPrologue( ze_kernel_handle_t hKernel, ze_cache_config_flags_t flags ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeKernelGetPropertiesPrologue( ze_kernel_handle_t hKernel, ze_kernel_properties_t* pKernelProperties ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeKernelGetNamePrologue( ze_kernel_handle_t hKernel, size_t* pSize, char* pName ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeCommandListAppendLaunchKernelPrologue( ze_command_list_handle_t hCommandList, ze_kernel_handle_t hKernel, const ze_group_count_t* pLaunchFuncArgs, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeCommandListAppendLaunchCooperativeKernelPrologue( ze_command_list_handle_t hCommandList, ze_kernel_handle_t hKernel, const ze_group_count_t* pLaunchFuncArgs, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeCommandListAppendLaunchKernelIndirectPrologue( ze_command_list_handle_t hCommandList, ze_kernel_handle_t hKernel, const ze_group_count_t* pLaunchArgumentsBuffer, 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; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeCommandListAppendLaunchMultipleKernelsIndirectPrologue( ze_command_list_handle_t hCommandList, uint32_t numKernels, ze_kernel_handle_t* phKernels, const uint32_t* pCountBuffer, const ze_group_count_t* pLaunchArgumentsBuffer, 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; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeContextMakeMemoryResidentPrologue( ze_context_handle_t hContext, ze_device_handle_t hDevice, void* ptr, size_t size ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeContextEvictMemoryPrologue( ze_context_handle_t hContext, ze_device_handle_t hDevice, void* ptr, size_t size ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeContextMakeImageResidentPrologue( ze_context_handle_t hContext, ze_device_handle_t hDevice, ze_image_handle_t hImage ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeContextEvictImagePrologue( ze_context_handle_t hContext, ze_device_handle_t hDevice, ze_image_handle_t hImage ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeSamplerCreatePrologue( ze_context_handle_t hContext, ze_device_handle_t hDevice, const ze_sampler_desc_t* desc, ze_sampler_handle_t* phSampler ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeSamplerDestroyPrologue( ze_sampler_handle_t hSampler ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeVirtualMemReservePrologue( ze_context_handle_t hContext, const void* pStart, size_t size, void** pptr ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeVirtualMemFreePrologue( ze_context_handle_t hContext, const void* ptr, size_t size ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeVirtualMemQueryPageSizePrologue( ze_context_handle_t hContext, ze_device_handle_t hDevice, size_t size, size_t* pagesize ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zePhysicalMemCreatePrologue( ze_context_handle_t hContext, ze_device_handle_t hDevice, ze_physical_mem_desc_t* desc, ze_physical_mem_handle_t* phPhysicalMemory ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zePhysicalMemDestroyPrologue( ze_context_handle_t hContext, ze_physical_mem_handle_t hPhysicalMemory ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeVirtualMemMapPrologue( ze_context_handle_t hContext, const void* ptr, size_t size, ze_physical_mem_handle_t hPhysicalMemory, size_t offset, ze_memory_access_attribute_t access ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeVirtualMemUnmapPrologue( ze_context_handle_t hContext, const void* ptr, size_t size ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeVirtualMemSetAccessAttributePrologue( ze_context_handle_t hContext, const void* ptr, size_t size, ze_memory_access_attribute_t access ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeVirtualMemGetAccessAttributePrologue( ze_context_handle_t hContext, const void* ptr, size_t size, ze_memory_access_attribute_t* access, size_t* outSize ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeKernelSetGlobalOffsetExpPrologue( ze_kernel_handle_t hKernel, uint32_t offsetX, uint32_t offsetY, uint32_t offsetZ ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_1) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + 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) { + 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) { + 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) { + 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) { + 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) { + 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) { + 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) { + 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) { + 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) { + 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) { + 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) { + 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) { + 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) { + 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) { + 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) { + 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) { + 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; + } + 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) { + 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) { + 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) { + 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) { + 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) { + 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) { + 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) { + 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) { + 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) { + 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) { + 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) { + 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) { + 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) { + 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) { + 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) { + 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) { + 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) { + 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) { + 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) { + 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) { + 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) { + 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) { + 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) { + 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) { + 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) { + 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) { + 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) { + 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) { + 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) { + 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) { + 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) { + 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) { + 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) { + 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) { + 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) { + 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) { + 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) { + 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; + } + 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) { + 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) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } +}; +} // namespace validation_layer diff --git a/source/layers/validation/checkers/certification/generated/zes_certification.h b/source/layers/validation/checkers/certification/generated/zes_certification.h new file mode 100644 index 00000000..e2a64252 --- /dev/null +++ b/source/layers/validation/checkers/certification/generated/zes_certification.h @@ -0,0 +1,913 @@ +/* + * ***THIS FILE IS GENERATED. *** + * + * Copyright (C) 2025 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + * @file zes_certification.h + * + */ +#pragma once +#include "../zel_global_certification_state.h" +#include "zes_entry_points.h" + +namespace validation_layer { +class ZEScertificationCheckerGenerated : public ZESValidationEntryPoints { +public: + virtual ze_result_t zesInitPrologue( zes_init_flags_t flags ) 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 zesDriverGetPrologue( uint32_t* pCount, zes_driver_handle_t* phDrivers ) 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 zesDriverGetExtensionPropertiesPrologue( zes_driver_handle_t hDriver, uint32_t* pCount, zes_driver_extension_properties_t* pExtensionProperties ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_8) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesDriverGetExtensionFunctionAddressPrologue( zes_driver_handle_t hDriver, const char* name, void** ppFunctionAddress ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_8) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesDeviceGetPrologue( zes_driver_handle_t hDriver, uint32_t* pCount, zes_device_handle_t* phDevices ) 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 zesDeviceGetPropertiesPrologue( zes_device_handle_t hDevice, zes_device_properties_t* pProperties ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesDeviceGetStatePrologue( zes_device_handle_t hDevice, zes_device_state_t* pState ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesDeviceResetPrologue( zes_device_handle_t hDevice, ze_bool_t force ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesDeviceResetExtPrologue( zes_device_handle_t hDevice, zes_reset_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 zesDeviceProcessesGetStatePrologue( zes_device_handle_t hDevice, uint32_t* pCount, zes_process_state_t* pProcesses ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesDevicePciGetPropertiesPrologue( zes_device_handle_t hDevice, zes_pci_properties_t* pProperties ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesDevicePciGetStatePrologue( zes_device_handle_t hDevice, zes_pci_state_t* pState ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesDevicePciGetBarsPrologue( zes_device_handle_t hDevice, uint32_t* pCount, zes_pci_bar_properties_t* pProperties ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesDevicePciGetStatsPrologue( zes_device_handle_t hDevice, zes_pci_stats_t* pStats ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesDeviceSetOverclockWaiverPrologue( zes_device_handle_t hDevice ) 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 zesDeviceGetOverclockDomainsPrologue( zes_device_handle_t hDevice, uint32_t* pOverclockDomains ) 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 zesDeviceGetOverclockControlsPrologue( zes_device_handle_t hDevice, zes_overclock_domain_t domainType, uint32_t* pAvailableControls ) 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 zesDeviceResetOverclockSettingsPrologue( zes_device_handle_t hDevice, ze_bool_t onShippedState ) 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 zesDeviceReadOverclockStatePrologue( zes_device_handle_t hDevice, zes_overclock_mode_t* pOverclockMode, ze_bool_t* pWaiverSetting, ze_bool_t* pOverclockState, zes_pending_action_t* pPendingAction, ze_bool_t* pPendingReset ) 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 zesDeviceEnumOverclockDomainsPrologue( zes_device_handle_t hDevice, uint32_t* pCount, zes_overclock_handle_t* phDomainHandle ) 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 zesOverclockGetDomainPropertiesPrologue( zes_overclock_handle_t hDomainHandle, zes_overclock_properties_t* pDomainProperties ) 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 zesOverclockGetDomainVFPropertiesPrologue( zes_overclock_handle_t hDomainHandle, zes_vf_property_t* pVFProperties ) 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 zesOverclockGetDomainControlPropertiesPrologue( zes_overclock_handle_t hDomainHandle, zes_overclock_control_t DomainControl, zes_control_property_t* pControlProperties ) 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 zesOverclockGetControlCurrentValuePrologue( zes_overclock_handle_t hDomainHandle, zes_overclock_control_t DomainControl, double* pValue ) 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 zesOverclockGetControlPendingValuePrologue( zes_overclock_handle_t hDomainHandle, zes_overclock_control_t DomainControl, double* pValue ) 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 zesOverclockSetControlUserValuePrologue( zes_overclock_handle_t hDomainHandle, zes_overclock_control_t DomainControl, double pValue, zes_pending_action_t* pPendingAction ) 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 zesOverclockGetControlStatePrologue( zes_overclock_handle_t hDomainHandle, zes_overclock_control_t DomainControl, zes_control_state_t* pControlState, zes_pending_action_t* pPendingAction ) 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 zesOverclockGetVFPointValuesPrologue( zes_overclock_handle_t hDomainHandle, zes_vf_type_t VFType, zes_vf_array_type_t VFArrayType, uint32_t PointIndex, uint32_t* PointValue ) 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 zesOverclockSetVFPointValuesPrologue( zes_overclock_handle_t hDomainHandle, zes_vf_type_t VFType, uint32_t PointIndex, uint32_t PointValue ) 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 zesDeviceEnumDiagnosticTestSuitesPrologue( zes_device_handle_t hDevice, uint32_t* pCount, zes_diag_handle_t* phDiagnostics ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesDiagnosticsGetPropertiesPrologue( zes_diag_handle_t hDiagnostics, zes_diag_properties_t* pProperties ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesDiagnosticsGetTestsPrologue( zes_diag_handle_t hDiagnostics, uint32_t* pCount, zes_diag_test_t* pTests ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesDiagnosticsRunTestsPrologue( zes_diag_handle_t hDiagnostics, uint32_t startIndex, uint32_t endIndex, zes_diag_result_t* pResult ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesDeviceEccAvailablePrologue( zes_device_handle_t hDevice, ze_bool_t* pAvailable ) 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 zesDeviceEccConfigurablePrologue( zes_device_handle_t hDevice, ze_bool_t* pConfigurable ) 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 zesDeviceGetEccStatePrologue( zes_device_handle_t hDevice, zes_device_ecc_properties_t* pState ) 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 zesDeviceSetEccStatePrologue( zes_device_handle_t hDevice, const zes_device_ecc_desc_t* newState, zes_device_ecc_properties_t* pState ) 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 zesDeviceEnumEngineGroupsPrologue( zes_device_handle_t hDevice, uint32_t* pCount, zes_engine_handle_t* phEngine ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesEngineGetPropertiesPrologue( zes_engine_handle_t hEngine, zes_engine_properties_t* pProperties ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesEngineGetActivityPrologue( zes_engine_handle_t hEngine, zes_engine_stats_t* pStats ) 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 zesDeviceEventRegisterPrologue( zes_device_handle_t hDevice, zes_event_type_flags_t events ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesDriverEventListenPrologue( ze_driver_handle_t hDriver, uint32_t timeout, uint32_t count, zes_device_handle_t* phDevices, uint32_t* pNumDeviceEvents, zes_event_type_flags_t* pEvents ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesDriverEventListenExPrologue( ze_driver_handle_t hDriver, uint64_t timeout, uint32_t count, zes_device_handle_t* phDevices, uint32_t* pNumDeviceEvents, zes_event_type_flags_t* pEvents ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_1) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesDeviceEnumFabricPortsPrologue( zes_device_handle_t hDevice, uint32_t* pCount, zes_fabric_port_handle_t* phPort ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesFabricPortGetPropertiesPrologue( zes_fabric_port_handle_t hPort, zes_fabric_port_properties_t* pProperties ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesFabricPortGetLinkTypePrologue( zes_fabric_port_handle_t hPort, zes_fabric_link_type_t* pLinkType ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesFabricPortGetConfigPrologue( zes_fabric_port_handle_t hPort, zes_fabric_port_config_t* pConfig ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesFabricPortSetConfigPrologue( zes_fabric_port_handle_t hPort, const zes_fabric_port_config_t* pConfig ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesFabricPortGetStatePrologue( zes_fabric_port_handle_t hPort, zes_fabric_port_state_t* pState ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesFabricPortGetThroughputPrologue( zes_fabric_port_handle_t hPort, zes_fabric_port_throughput_t* pThroughput ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesFabricPortGetFabricErrorCountersPrologue( zes_fabric_port_handle_t hPort, zes_fabric_port_error_counters_t* pErrors ) 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 zesFabricPortGetMultiPortThroughputPrologue( zes_device_handle_t hDevice, uint32_t numPorts, zes_fabric_port_handle_t* phPort, zes_fabric_port_throughput_t** pThroughput ) 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 zesDeviceEnumFansPrologue( zes_device_handle_t hDevice, uint32_t* pCount, zes_fan_handle_t* phFan ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesFanGetPropertiesPrologue( zes_fan_handle_t hFan, zes_fan_properties_t* pProperties ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesFanGetConfigPrologue( zes_fan_handle_t hFan, zes_fan_config_t* pConfig ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesFanSetDefaultModePrologue( zes_fan_handle_t hFan ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesFanSetFixedSpeedModePrologue( zes_fan_handle_t hFan, const zes_fan_speed_t* speed ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesFanSetSpeedTableModePrologue( zes_fan_handle_t hFan, const zes_fan_speed_table_t* speedTable ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesFanGetStatePrologue( zes_fan_handle_t hFan, zes_fan_speed_units_t units, int32_t* pSpeed ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesDeviceEnumFirmwaresPrologue( zes_device_handle_t hDevice, uint32_t* pCount, zes_firmware_handle_t* phFirmware ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesFirmwareGetPropertiesPrologue( zes_firmware_handle_t hFirmware, zes_firmware_properties_t* pProperties ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesFirmwareFlashPrologue( zes_firmware_handle_t hFirmware, void* pImage, uint32_t size ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesFirmwareGetFlashProgressPrologue( zes_firmware_handle_t hFirmware, uint32_t* pCompletionPercent ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_8) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesFirmwareGetConsoleLogsPrologue( zes_firmware_handle_t hFirmware, size_t* pSize, char* pFirmwareLog ) 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 zesDeviceEnumFrequencyDomainsPrologue( zes_device_handle_t hDevice, uint32_t* pCount, zes_freq_handle_t* phFrequency ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesFrequencyGetPropertiesPrologue( zes_freq_handle_t hFrequency, zes_freq_properties_t* pProperties ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesFrequencyGetAvailableClocksPrologue( zes_freq_handle_t hFrequency, uint32_t* pCount, double* phFrequency ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesFrequencyGetRangePrologue( zes_freq_handle_t hFrequency, zes_freq_range_t* pLimits ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesFrequencySetRangePrologue( zes_freq_handle_t hFrequency, const zes_freq_range_t* pLimits ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesFrequencyGetStatePrologue( zes_freq_handle_t hFrequency, zes_freq_state_t* pState ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesFrequencyGetThrottleTimePrologue( zes_freq_handle_t hFrequency, zes_freq_throttle_time_t* pThrottleTime ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesFrequencyOcGetCapabilitiesPrologue( zes_freq_handle_t hFrequency, zes_oc_capabilities_t* pOcCapabilities ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesFrequencyOcGetFrequencyTargetPrologue( zes_freq_handle_t hFrequency, double* pCurrentOcFrequency ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesFrequencyOcSetFrequencyTargetPrologue( zes_freq_handle_t hFrequency, double CurrentOcFrequency ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesFrequencyOcGetVoltageTargetPrologue( zes_freq_handle_t hFrequency, double* pCurrentVoltageTarget, double* pCurrentVoltageOffset ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesFrequencyOcSetVoltageTargetPrologue( zes_freq_handle_t hFrequency, double CurrentVoltageTarget, double CurrentVoltageOffset ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesFrequencyOcSetModePrologue( zes_freq_handle_t hFrequency, zes_oc_mode_t CurrentOcMode ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesFrequencyOcGetModePrologue( zes_freq_handle_t hFrequency, zes_oc_mode_t* pCurrentOcMode ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesFrequencyOcGetIccMaxPrologue( zes_freq_handle_t hFrequency, double* pOcIccMax ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesFrequencyOcSetIccMaxPrologue( zes_freq_handle_t hFrequency, double ocIccMax ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesFrequencyOcGetTjMaxPrologue( zes_freq_handle_t hFrequency, double* pOcTjMax ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesFrequencyOcSetTjMaxPrologue( zes_freq_handle_t hFrequency, double ocTjMax ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesDeviceEnumLedsPrologue( zes_device_handle_t hDevice, uint32_t* pCount, zes_led_handle_t* phLed ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesLedGetPropertiesPrologue( zes_led_handle_t hLed, zes_led_properties_t* pProperties ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesLedGetStatePrologue( zes_led_handle_t hLed, zes_led_state_t* pState ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesLedSetStatePrologue( zes_led_handle_t hLed, ze_bool_t enable ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesLedSetColorPrologue( zes_led_handle_t hLed, const zes_led_color_t* pColor ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesDeviceEnumMemoryModulesPrologue( zes_device_handle_t hDevice, uint32_t* pCount, zes_mem_handle_t* phMemory ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesMemoryGetPropertiesPrologue( zes_mem_handle_t hMemory, zes_mem_properties_t* pProperties ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesMemoryGetStatePrologue( zes_mem_handle_t hMemory, zes_mem_state_t* pState ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesMemoryGetBandwidthPrologue( zes_mem_handle_t hMemory, zes_mem_bandwidth_t* pBandwidth ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesDeviceEnumPerformanceFactorDomainsPrologue( zes_device_handle_t hDevice, uint32_t* pCount, zes_perf_handle_t* phPerf ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesPerformanceFactorGetPropertiesPrologue( zes_perf_handle_t hPerf, zes_perf_properties_t* pProperties ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesPerformanceFactorGetConfigPrologue( zes_perf_handle_t hPerf, double* pFactor ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesPerformanceFactorSetConfigPrologue( zes_perf_handle_t hPerf, double factor ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesDeviceEnumPowerDomainsPrologue( zes_device_handle_t hDevice, uint32_t* pCount, zes_pwr_handle_t* phPower ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesDeviceGetCardPowerDomainPrologue( zes_device_handle_t hDevice, zes_pwr_handle_t* phPower ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesPowerGetPropertiesPrologue( zes_pwr_handle_t hPower, zes_power_properties_t* pProperties ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesPowerGetEnergyCounterPrologue( zes_pwr_handle_t hPower, zes_power_energy_counter_t* pEnergy ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesPowerGetLimitsPrologue( zes_pwr_handle_t hPower, zes_power_sustained_limit_t* pSustained, zes_power_burst_limit_t* pBurst, zes_power_peak_limit_t* pPeak ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesPowerSetLimitsPrologue( zes_pwr_handle_t hPower, const zes_power_sustained_limit_t* pSustained, const zes_power_burst_limit_t* pBurst, const zes_power_peak_limit_t* pPeak ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesPowerGetEnergyThresholdPrologue( zes_pwr_handle_t hPower, zes_energy_threshold_t* pThreshold ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesPowerSetEnergyThresholdPrologue( zes_pwr_handle_t hPower, double threshold ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesDeviceEnumPsusPrologue( zes_device_handle_t hDevice, uint32_t* pCount, zes_psu_handle_t* phPsu ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesPsuGetPropertiesPrologue( zes_psu_handle_t hPsu, zes_psu_properties_t* pProperties ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesPsuGetStatePrologue( zes_psu_handle_t hPsu, zes_psu_state_t* pState ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesDeviceEnumRasErrorSetsPrologue( zes_device_handle_t hDevice, uint32_t* pCount, zes_ras_handle_t* phRas ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesRasGetPropertiesPrologue( zes_ras_handle_t hRas, zes_ras_properties_t* pProperties ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesRasGetConfigPrologue( zes_ras_handle_t hRas, zes_ras_config_t* pConfig ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesRasSetConfigPrologue( zes_ras_handle_t hRas, const zes_ras_config_t* pConfig ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesRasGetStatePrologue( zes_ras_handle_t hRas, ze_bool_t clear, zes_ras_state_t* pState ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesDeviceEnumSchedulersPrologue( zes_device_handle_t hDevice, uint32_t* pCount, zes_sched_handle_t* phScheduler ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesSchedulerGetPropertiesPrologue( zes_sched_handle_t hScheduler, zes_sched_properties_t* pProperties ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesSchedulerGetCurrentModePrologue( zes_sched_handle_t hScheduler, zes_sched_mode_t* pMode ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesSchedulerGetTimeoutModePropertiesPrologue( zes_sched_handle_t hScheduler, ze_bool_t getDefaults, zes_sched_timeout_properties_t* pConfig ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesSchedulerGetTimesliceModePropertiesPrologue( zes_sched_handle_t hScheduler, ze_bool_t getDefaults, zes_sched_timeslice_properties_t* pConfig ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesSchedulerSetTimeoutModePrologue( zes_sched_handle_t hScheduler, zes_sched_timeout_properties_t* pProperties, ze_bool_t* pNeedReload ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesSchedulerSetTimesliceModePrologue( zes_sched_handle_t hScheduler, zes_sched_timeslice_properties_t* pProperties, ze_bool_t* pNeedReload ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesSchedulerSetExclusiveModePrologue( zes_sched_handle_t hScheduler, ze_bool_t* pNeedReload ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesSchedulerSetComputeUnitDebugModePrologue( zes_sched_handle_t hScheduler, ze_bool_t* pNeedReload ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesDeviceEnumStandbyDomainsPrologue( zes_device_handle_t hDevice, uint32_t* pCount, zes_standby_handle_t* phStandby ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesStandbyGetPropertiesPrologue( zes_standby_handle_t hStandby, zes_standby_properties_t* pProperties ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesStandbyGetModePrologue( zes_standby_handle_t hStandby, zes_standby_promo_mode_t* pMode ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesStandbySetModePrologue( zes_standby_handle_t hStandby, zes_standby_promo_mode_t mode ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesDeviceEnumTemperatureSensorsPrologue( zes_device_handle_t hDevice, uint32_t* pCount, zes_temp_handle_t* phTemperature ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesTemperatureGetPropertiesPrologue( zes_temp_handle_t hTemperature, zes_temp_properties_t* pProperties ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesTemperatureGetConfigPrologue( zes_temp_handle_t hTemperature, zes_temp_config_t* pConfig ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesTemperatureSetConfigPrologue( zes_temp_handle_t hTemperature, const zes_temp_config_t* pConfig ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesTemperatureGetStatePrologue( zes_temp_handle_t hTemperature, double* pTemperature ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t 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; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesPowerSetLimitsExtPrologue( 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; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesEngineGetActivityExtPrologue( zes_engine_handle_t hEngine, uint32_t* pCount, zes_engine_stats_t* pStats ) 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 zesRasGetStateExpPrologue( zes_ras_handle_t hRas, uint32_t* pCount, zes_ras_state_exp_t* pState ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesRasClearStateExpPrologue( zes_ras_handle_t hRas, zes_ras_error_category_exp_t category ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesFirmwareGetSecurityVersionExpPrologue( zes_firmware_handle_t hFirmware, char* pVersion ) 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 zesFirmwareSetSecurityVersionExpPrologue( zes_firmware_handle_t hFirmware ) 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 zesDeviceGetSubDevicePropertiesExpPrologue( zes_device_handle_t hDevice, uint32_t* pCount, zes_subdevice_exp_properties_t* pSubdeviceProps ) 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 zesDriverGetDeviceByUuidExpPrologue( zes_driver_handle_t hDriver, zes_uuid_t uuid, zes_device_handle_t* phDevice, ze_bool_t* onSubdevice, uint32_t* subdeviceId ) 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 zesDeviceEnumActiveVFExpPrologue( zes_device_handle_t hDevice, uint32_t* pCount, zes_vf_handle_t* phVFhandle ) 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 zesVFManagementGetVFPropertiesExpPrologue( zes_vf_handle_t hVFhandle, zes_vf_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 zesVFManagementGetVFMemoryUtilizationExpPrologue( zes_vf_handle_t hVFhandle, uint32_t* pCount, zes_vf_util_mem_exp_t* pMemUtil ) 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 zesVFManagementGetVFEngineUtilizationExpPrologue( zes_vf_handle_t hVFhandle, uint32_t* pCount, zes_vf_util_engine_exp_t* pEngineUtil ) 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 zesVFManagementSetVFTelemetryModeExpPrologue( zes_vf_handle_t hVFhandle, zes_vf_info_util_exp_flags_t flags, ze_bool_t enable ) 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 zesVFManagementSetVFTelemetrySamplingIntervalExpPrologue( zes_vf_handle_t hVFhandle, zes_vf_info_util_exp_flags_t flag, uint64_t samplingInterval ) 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 zesDeviceEnumEnabledVFExpPrologue( zes_device_handle_t hDevice, uint32_t* pCount, zes_vf_handle_t* phVFhandle ) 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 zesVFManagementGetVFCapabilitiesExpPrologue( zes_vf_handle_t hVFhandle, zes_vf_exp_capabilities_t* pCapability ) 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 zesVFManagementGetVFMemoryUtilizationExp2Prologue( zes_vf_handle_t hVFhandle, uint32_t* pCount, zes_vf_util_mem_exp2_t* pMemUtil ) 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 zesVFManagementGetVFEngineUtilizationExp2Prologue( zes_vf_handle_t hVFhandle, uint32_t* pCount, zes_vf_util_engine_exp2_t* pEngineUtil ) 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 zesVFManagementGetVFCapabilitiesExp2Prologue( zes_vf_handle_t hVFhandle, zes_vf_exp2_capabilities_t* pCapability ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_12) { + 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 new file mode 100644 index 00000000..80ed2f73 --- /dev/null +++ b/source/layers/validation/checkers/certification/generated/zet_certification.h @@ -0,0 +1,433 @@ +/* + * ***THIS FILE IS GENERATED. *** + * + * Copyright (C) 2025 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + * @file zet_certification.h + * + */ +#pragma once +#include "../zel_global_certification_state.h" +#include "zet_entry_points.h" + +namespace validation_layer { +class ZETcertificationCheckerGenerated : public ZETValidationEntryPoints { +public: + virtual ze_result_t zetModuleGetDebugInfoPrologue( zet_module_handle_t hModule, zet_module_debug_info_format_t format, size_t* pSize, uint8_t* pDebugInfo ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zetDeviceGetDebugPropertiesPrologue( zet_device_handle_t hDevice, zet_device_debug_properties_t* pDebugProperties ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zetDebugAttachPrologue( zet_device_handle_t hDevice, const zet_debug_config_t* config, zet_debug_session_handle_t* phDebug ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zetDebugDetachPrologue( zet_debug_session_handle_t hDebug ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zetDebugReadEventPrologue( zet_debug_session_handle_t hDebug, uint64_t timeout, zet_debug_event_t* event ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zetDebugAcknowledgeEventPrologue( zet_debug_session_handle_t hDebug, const zet_debug_event_t* event ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zetDebugInterruptPrologue( zet_debug_session_handle_t hDebug, ze_device_thread_t thread ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zetDebugResumePrologue( zet_debug_session_handle_t hDebug, ze_device_thread_t thread ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zetDebugReadMemoryPrologue( zet_debug_session_handle_t hDebug, ze_device_thread_t thread, const zet_debug_memory_space_desc_t* desc, size_t size, void* buffer ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zetDebugWriteMemoryPrologue( zet_debug_session_handle_t hDebug, ze_device_thread_t thread, const zet_debug_memory_space_desc_t* desc, size_t size, const void* buffer ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zetDebugGetRegisterSetPropertiesPrologue( zet_device_handle_t hDevice, uint32_t* pCount, zet_debug_regset_properties_t* pRegisterSetProperties ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zetDebugGetThreadRegisterSetPropertiesPrologue( zet_debug_session_handle_t hDebug, ze_device_thread_t thread, uint32_t* pCount, zet_debug_regset_properties_t* pRegisterSetProperties ) 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 zetDebugReadRegistersPrologue( zet_debug_session_handle_t hDebug, ze_device_thread_t thread, uint32_t type, uint32_t start, uint32_t count, void* pRegisterValues ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zetDebugWriteRegistersPrologue( zet_debug_session_handle_t hDebug, ze_device_thread_t thread, uint32_t type, uint32_t start, uint32_t count, void* pRegisterValues ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zetMetricGroupGetPrologue( zet_device_handle_t hDevice, uint32_t* pCount, zet_metric_group_handle_t* phMetricGroups ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zetMetricGroupGetPropertiesPrologue( zet_metric_group_handle_t hMetricGroup, zet_metric_group_properties_t* pProperties ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zetMetricGroupCalculateMetricValuesPrologue( zet_metric_group_handle_t hMetricGroup, zet_metric_group_calculation_type_t type, size_t rawDataSize, const uint8_t* pRawData, uint32_t* pMetricValueCount, zet_typed_value_t* pMetricValues ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zetMetricGetPrologue( zet_metric_group_handle_t hMetricGroup, uint32_t* pCount, zet_metric_handle_t* phMetrics ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zetMetricGetPropertiesPrologue( zet_metric_handle_t hMetric, zet_metric_properties_t* pProperties ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zetContextActivateMetricGroupsPrologue( zet_context_handle_t hContext, zet_device_handle_t hDevice, uint32_t count, zet_metric_group_handle_t* phMetricGroups ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zetMetricStreamerOpenPrologue( zet_context_handle_t hContext, zet_device_handle_t hDevice, zet_metric_group_handle_t hMetricGroup, zet_metric_streamer_desc_t* desc, ze_event_handle_t hNotificationEvent, zet_metric_streamer_handle_t* phMetricStreamer ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zetCommandListAppendMetricStreamerMarkerPrologue( zet_command_list_handle_t hCommandList, zet_metric_streamer_handle_t hMetricStreamer, uint32_t value ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zetMetricStreamerClosePrologue( zet_metric_streamer_handle_t hMetricStreamer ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zetMetricStreamerReadDataPrologue( zet_metric_streamer_handle_t hMetricStreamer, uint32_t maxReportCount, size_t* pRawDataSize, uint8_t* pRawData ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zetMetricQueryPoolCreatePrologue( zet_context_handle_t hContext, zet_device_handle_t hDevice, zet_metric_group_handle_t hMetricGroup, const zet_metric_query_pool_desc_t* desc, zet_metric_query_pool_handle_t* phMetricQueryPool ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zetMetricQueryPoolDestroyPrologue( zet_metric_query_pool_handle_t hMetricQueryPool ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zetMetricQueryCreatePrologue( zet_metric_query_pool_handle_t hMetricQueryPool, uint32_t index, zet_metric_query_handle_t* phMetricQuery ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zetMetricQueryDestroyPrologue( zet_metric_query_handle_t hMetricQuery ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zetMetricQueryResetPrologue( zet_metric_query_handle_t hMetricQuery ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zetCommandListAppendMetricQueryBeginPrologue( zet_command_list_handle_t hCommandList, zet_metric_query_handle_t hMetricQuery ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zetCommandListAppendMetricQueryEndPrologue( zet_command_list_handle_t hCommandList, zet_metric_query_handle_t hMetricQuery, 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; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zetCommandListAppendMetricMemoryBarrierPrologue( zet_command_list_handle_t hCommandList ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zetMetricQueryGetDataPrologue( zet_metric_query_handle_t hMetricQuery, size_t* pRawDataSize, uint8_t* pRawData ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zetKernelGetProfileInfoPrologue( zet_kernel_handle_t hKernel, zet_profile_properties_t* pProfileProperties ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zetTracerExpCreatePrologue( zet_context_handle_t hContext, const zet_tracer_exp_desc_t* desc, zet_tracer_exp_handle_t* phTracer ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zetTracerExpDestroyPrologue( zet_tracer_exp_handle_t hTracer ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zetTracerExpSetProloguesPrologue( zet_tracer_exp_handle_t hTracer, zet_core_callbacks_t* pCoreCbs ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zetTracerExpSetEpiloguesPrologue( zet_tracer_exp_handle_t hTracer, zet_core_callbacks_t* pCoreCbs ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zetTracerExpSetEnabledPrologue( zet_tracer_exp_handle_t hTracer, ze_bool_t enable ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t 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 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 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 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 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 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 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 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 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 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 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 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 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; + } + 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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; + } +}; +} // namespace validation_layer diff --git a/source/layers/validation/checkers/certification/zel_certification_checker.cpp b/source/layers/validation/checkers/certification/zel_certification_checker.cpp new file mode 100644 index 00000000..fc36a334 --- /dev/null +++ b/source/layers/validation/checkers/certification/zel_certification_checker.cpp @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2025 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + * @file zel_certification_checker.cpp + * + */ +#include "zel_certification_checker.h" +#include "ze_api.h" + +namespace validation_layer { +class certificationChecker certification_checker; +using ze_checker = certificationChecker::ZEcertificationChecker; + +certificationChecker::certificationChecker() { + enablecertification = getenv_tobool("ZEL_ENABLE_CERTIFICATION_CHECKER"); + if (enablecertification) { + certificationChecker::ZEcertificationChecker *zeChecker = + new certificationChecker::ZEcertificationChecker; + certificationChecker::ZEScertificationChecker *zesChecker = + new certificationChecker::ZEScertificationChecker; + certificationChecker::ZETcertificationChecker *zetChecker = + new certificationChecker::ZETcertificationChecker; + ze_api_version_t certification_version = ZE_API_VERSION_CURRENT; + const auto certification_version_string = + getenv_string("ZEL_CERTIFICATION_CHECKER_VERSION"); + if (!certification_version_string.empty()) { + const auto major = certification_version_string.substr( + 0, certification_version_string.find('.')); + const auto minor = certification_version_string.substr( + certification_version_string.find('.') + 1); + certification_version = static_cast( + ZE_MAKE_VERSION(std::stoi(major), std::stoi(minor))); + globalCertificationState.default_mode = false; + } + globalCertificationState.certification_version = certification_version; + certification_checker.zeValidation = zeChecker; + certification_checker.zetValidation = zetChecker; + certification_checker.zesValidation = zesChecker; + validation_layer::context.validationHandlers.push_back( + &certification_checker); + } +} + +certificationChecker::~certificationChecker() { + if (enablecertification) { + delete certification_checker.zeValidation; + delete certification_checker.zetValidation; + delete certification_checker.zesValidation; + } +} + +ze_result_t ze_checker::zeDriverGetApiVersionEpilogue( + ze_driver_handle_t hDriver, ze_api_version_t *version, ze_result_t result) { + auto &globalCertificationState = GlobalCertificationState::getInstance(); + if (result == ZE_RESULT_SUCCESS && version != nullptr && + globalCertificationState.default_mode) { + globalCertificationState.certification_version = *version; + } + return ZE_RESULT_SUCCESS; +} + +} // namespace validation_layer diff --git a/source/layers/validation/checkers/certification/zel_certification_checker.h b/source/layers/validation/checkers/certification/zel_certification_checker.h new file mode 100644 index 00000000..761ceefb --- /dev/null +++ b/source/layers/validation/checkers/certification/zel_certification_checker.h @@ -0,0 +1,40 @@ +/* + * + * Copyright (C) 2025 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + * @file zel_certification_checker.h + * + */ + +#pragma once + +#include "generated/ze_certification.h" +#include "generated/zes_certification.h" +#include "generated/zet_certification.h" +#include "ze_api.h" +#include "ze_validation_layer.h" +#include "zel_global_certification_state.h" + +namespace validation_layer { + +class __zedlllocal certificationChecker : public validationChecker { +public: + certificationChecker(); + ~certificationChecker(); + class ZEcertificationChecker : public ZEcertificationCheckerGenerated { + ze_result_t zeDriverGetApiVersionEpilogue(ze_driver_handle_t hDriver, + ze_api_version_t *version, + ze_result_t result) override; + }; + class ZEScertificationChecker : public ZEScertificationCheckerGenerated {}; + class ZETcertificationChecker : public ZETcertificationCheckerGenerated {}; + + bool enablecertification = false; + + GlobalCertificationState &globalCertificationState = + GlobalCertificationState::getInstance(); +}; +extern class certificationChecker certification_checker; +} // namespace validation_layer diff --git a/source/layers/validation/checkers/certification/zel_global_certification_state.h b/source/layers/validation/checkers/certification/zel_global_certification_state.h new file mode 100644 index 00000000..b4ede030 --- /dev/null +++ b/source/layers/validation/checkers/certification/zel_global_certification_state.h @@ -0,0 +1,25 @@ +/* + * + * Copyright (C) 2025 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + * @file zel_certification_checker.h + * + */ + +#pragma once + +#include "ze_api.h" + +namespace validation_layer { +class GlobalCertificationState { +public: + static GlobalCertificationState &getInstance() { + static GlobalCertificationState instance; + return instance; + } + bool default_mode = true; + ze_api_version_t certification_version = ZE_API_VERSION_1_0; +}; +} // namespace validation_layer From c34654eb46c8d6bc1663e75e06aa108121015f27 Mon Sep 17 00:00:00 2001 From: Leonardo Lopez Date: Tue, 17 Jun 2025 15:34:50 -0700 Subject: [PATCH 18/28] cmake/msvc: unify CRT model and add VTune-safe flags for RelWithDebInfo (#349) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit RelWithDebInfo was built with /MD while Release used /MT, creating cross-heap mismatches that crashed in MSVCP140.dll when VTune injected its collector DLLs. Changes ------------ • All build types now use the same C++ runtime (either all static or all dynamic, depending on the MSVC_BUILD_L0_DYNAMIC_VCRUNTIME flag). This prevents the "two-different-heaps" problem that caused the MSVCP140.dll crash when VTune was attached. • For RelWithDebInfo we also turned off “incremental linking” and kept a full PDB file. VTune can read these symbols and no longer trips over the extra jump table that incremental builds add. Bottom line: you can now profile the RelWithDebInfo build in VTune without any access-violation errors. --- CMakeLists.txt | 38 +++++++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 35d051a6..be3c65f4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -131,17 +131,22 @@ endif() #MSVC compile flags if(MSVC) IF (NOT MSVC_BUILD_L0_DYNAMIC_VCRUNTIME) - string(REPLACE "/MDd" "/MTd" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}") - string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}") + string(REPLACE "/MDd" "/MTd" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}") + string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}") + string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}") ELSE() - string(REPLACE "/MTd" "/MDd" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}") - string(REPLACE "/MT" "/MD" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}") + string(REPLACE "/MTd" "/MDd" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}") + string(REPLACE "/MT" "/MD" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}") + string(REPLACE "/MT" "/MD" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}") if(NOT (CMAKE_CXX_FLAGS_RELEASE MATCHES "/MD")) set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MD") endif() if(NOT (CMAKE_CXX_FLAGS_DEBUG MATCHES "/MDd")) set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MDd") endif() + if(NOT (CMAKE_CXX_FLAGS_RELWITHDEBINFO MATCHES "/MD")) + set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /MD") + endif() ENDIF() if(NOT CMAKE_CXX_COMPILER_ID STREQUAL IntelLLVM) @@ -158,8 +163,19 @@ if(MSVC) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc") # enable creation of PDB files for Release Builds - set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zi") - set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} ${CMAKE_CXX_LINKER_WRAPPER_FLAG}/DEBUG ${CMAKE_CXX_LINKER_WRAPPER_FLAG}/OPT:REF ${CMAKE_CXX_LINKER_WRAPPER_FLAG}/OPT:ICF") + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zi") + set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Zi") + set(CMAKE_SHARED_LINKER_FLAGS_RELEASE + "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} \ + ${CMAKE_CXX_LINKER_WRAPPER_FLAG}/DEBUG \ + ${CMAKE_CXX_LINKER_WRAPPER_FLAG}/OPT:REF \ + ${CMAKE_CXX_LINKER_WRAPPER_FLAG}/OPT:ICF") + + # VTune-friendly settings for RelWithDebInfo + set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO + "${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO} \ + ${CMAKE_CXX_LINKER_WRAPPER_FLAG}/DEBUG \ + ${CMAKE_CXX_LINKER_WRAPPER_FLAG}/INCREMENTAL:NO") # enable CET shadow stack set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${CMAKE_CXX_LINKER_WRAPPER_FLAG}/CETCOMPAT") @@ -167,12 +183,12 @@ if(MSVC) #Use of sccache with MSVC requires workaround of replacing /Zi with /Z7 #https://github.com/mozilla/sccache if(USE_Z7) #sccache - string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}") - string(REPLACE "/Zi" "/Z7" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}") - string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}") - string(REPLACE "/Zi" "/Z7" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}") + string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}") + string(REPLACE "/Zi" "/Z7" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}") + string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}") + string(REPLACE "/Zi" "/Z7" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}") string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}") - string(REPLACE "/Zi" "/Z7" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}") + string(REPLACE "/Zi" "/Z7" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}") endif() endif() From 936a12527e65206dc555ede3da9b378fb2c2edd8 Mon Sep 17 00:00:00 2001 From: "Neil R. Spruit" Date: Tue, 17 Jun 2025 16:29:12 -0700 Subject: [PATCH 19/28] Update changelog to v1.22.5 with debug info fix (#350) Signed-off-by: Neil R. Spruit --- CHANGELOG.md | 4 ++++ CMakeLists.txt | 2 +- PRODUCT_GUID.txt | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 883e196e..6894fcc5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Level zero loader changelog +## v1.22.5 +* cmake/msvc: unify CRT model and add VTune-safe flags for RelWithDebInfo +* Init certification checker in the Validation Layer +* Fix CI to run on release branches ## v1.22.4 * Block all calls to get until after init has completed to avoid race during sorting. ## v1.22.3 diff --git a/CMakeLists.txt b/CMakeLists.txt index be3c65f4..b94a524c 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.22.4) +project(level-zero VERSION 1.22.5) include(GNUInstallDirs) diff --git a/PRODUCT_GUID.txt b/PRODUCT_GUID.txt index 24be5899..42093cdd 100644 --- a/PRODUCT_GUID.txt +++ b/PRODUCT_GUID.txt @@ -1,2 +1,2 @@ -1.22.4 -55e69860-8ae7-4f60-8ad9-728c1ed2a2e7 \ No newline at end of file +1.22.5 +4810dc63-268f-4abf-b3fe-a5f98334e3d9 \ No newline at end of file From 11cfd812ba4e2c01cb36a9e1e231563bc75e5eae Mon Sep 17 00:00:00 2001 From: "Neil R. Spruit" Date: Wed, 18 Jun 2025 10:45:18 -0700 Subject: [PATCH 20/28] Check if the context is init given a user has incorrectly called driver get (#351) Signed-off-by: Neil R. Spruit --- source/lib/ze_libapi.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/lib/ze_libapi.cpp b/source/lib/ze_libapi.cpp index a18b5064..b60712b7 100644 --- a/source/lib/ze_libapi.cpp +++ b/source/lib/ze_libapi.cpp @@ -125,7 +125,7 @@ zeDriverGet( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - if (ze_lib::context->zeDdiTable == nullptr) { + if (!ze_lib::context || ze_lib::context->zeDdiTable == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } static const ze_pfnDriverGet_t pfnGet = [&result] { From 41e5e328be9011eb9932dcab67f3c19c880504d1 Mon Sep 17 00:00:00 2001 From: "Neil R. Spruit" Date: Tue, 18 Feb 2025 18:33:00 -0800 Subject: [PATCH 21/28] DDI extension support - Support in the L0 Loader for https://oneapi-src.github.io/level-zero-spec/level-zero/latest/core/EXT_Driver_DDIHandles.html#ze-extension-driver-ddi-handles - To improve the speed for each call of L0 apis into the correct driver, the new support enables for the driver to allocate a header that stores that driver's ddi tables such that the Loader does not need to perform translation of handles to/from ze_object_t. - Given a driver supports the new extension, the loader will no longer create the ze_object_t and instead use the packed ddi tables in each handle_t. - The code has been refactored such that the legacy path will continue to work for the driver that has not converted over without interfering with a driver which now uses the "fast" path. - This new code path also removes the need for handle translation by the user if the drivers all support the new extension. - This new path is enabled with ZE_ENABLE_LOADER_DRIVER_DDI_PATH=1, by default this new path is disabled. - Updated get_version helper function to expand dynamically Signed-off-by: Neil R. Spruit --- .github/workflows/build-quick-static.yml | 3 +- .github/workflows/build-quick.yml | 2 - CMakeLists.txt | 4 +- PRODUCT_GUID.txt | 4 +- samples/zello_world/zello_world.cpp | 157 +- scripts/generate_code.py | 19 +- scripts/templates/helper.py | 39 +- scripts/templates/ldrddi.cpp.mako | 80 +- scripts/templates/ldrddi.h.mako | 31 +- scripts/templates/ldrddi_driver_ddi.cpp.mako | 96 + scripts/templates/ze_loader_internal.h.mako | 12 +- source/drivers/null/ze_null.cpp | 278 +- source/drivers/null/ze_null.h | 28 +- source/inc/ze_singleton.h | 9 +- source/loader/CMakeLists.txt | 5 +- source/loader/ze_ldrddi.cpp | 1364 ++++- source/loader/ze_ldrddi.h | 1598 ++++- source/loader/ze_ldrddi_driver_ddi.cpp | 5775 ++++++++++++++++++ source/loader/ze_loader.cpp | 38 +- source/loader/ze_loader_api.cpp | 88 +- source/loader/ze_loader_internal.h | 12 +- source/loader/ze_object.h | 16 +- source/loader/zes_ldrddi.cpp | 1012 ++- source/loader/zes_ldrddi.h | 1246 +++- source/loader/zes_ldrddi_driver_ddi.cpp | 4316 +++++++++++++ source/loader/zet_ldrddi.cpp | 542 +- source/loader/zet_ldrddi.h | 719 ++- source/loader/zet_ldrddi_driver_ddi.cpp | 2156 +++++++ test/CMakeLists.txt | 204 +- test/loader_api.cpp | 1138 +++- 30 files changed, 20787 insertions(+), 204 deletions(-) create mode 100644 scripts/templates/ldrddi_driver_ddi.cpp.mako create mode 100644 source/loader/ze_ldrddi_driver_ddi.cpp create mode 100644 source/loader/zes_ldrddi_driver_ddi.cpp create mode 100644 source/loader/zet_ldrddi_driver_ddi.cpp diff --git a/.github/workflows/build-quick-static.yml b/.github/workflows/build-quick-static.yml index 85f0302b..0634a74d 100644 --- a/.github/workflows/build-quick-static.yml +++ b/.github/workflows/build-quick-static.yml @@ -42,7 +42,7 @@ jobs: - env: ZEL_LIBRARY_PATH: '${{ github.workspace }}/dynamic_build/lib' working-directory: build - run: ls $ZEL_LIBRARY_PATH;ZE_ENABLE_LOADER_DEBUG_TRACE=1 ctest -V + run: ls $ZEL_LIBRARY_PATH;ctest -V build-windows: if: github.repository_owner == 'oneapi-src' @@ -56,7 +56,6 @@ jobs: cmake -D BUILD_L0_LOADER_TESTS=1 -D BUILD_STATIC=1 .. cmake --build . --config Release - env: - ZE_ENABLE_LOADER_DEBUG_TRACE: '1' ZEL_LIBRARY_PATH: '${{ github.workspace }}/build/bin/Release' working-directory: build run: ctest -C Release -V diff --git a/.github/workflows/build-quick.yml b/.github/workflows/build-quick.yml index fbdb2c02..a0a57843 100644 --- a/.github/workflows/build-quick.yml +++ b/.github/workflows/build-quick.yml @@ -26,7 +26,6 @@ jobs: .. make -j$(nproc) - env: - ZE_ENABLE_LOADER_DEBUG_TRACE: '1' ZEL_LIBRARY_PATH: '${{ github.workspace }}/build/lib' working-directory: build run: ctest -V @@ -43,7 +42,6 @@ jobs: cmake -D BUILD_L0_LOADER_TESTS=1 .. cmake --build . --config Release - env: - ZE_ENABLE_LOADER_DEBUG_TRACE: '1' ZEL_LIBRARY_PATH: '${{ github.workspace }}/build/bin/Release' working-directory: build run: ctest -C Release -V diff --git a/CMakeLists.txt b/CMakeLists.txt index b94a524c..2b397c98 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2020-2024 Intel Corporation +# Copyright (C) 2020-2025 Intel Corporation # SPDX-License-Identifier: MIT cmake_minimum_required(VERSION 3.12.0 FATAL_ERROR) @@ -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.22.5) +project(level-zero VERSION 1.23.0) include(GNUInstallDirs) diff --git a/PRODUCT_GUID.txt b/PRODUCT_GUID.txt index 42093cdd..82243d87 100644 --- a/PRODUCT_GUID.txt +++ b/PRODUCT_GUID.txt @@ -1,2 +1,2 @@ -1.22.5 -4810dc63-268f-4abf-b3fe-a5f98334e3d9 \ No newline at end of file +1.23.0 +146652e2-0b5a-4461-b176-800135676a46 diff --git a/samples/zello_world/zello_world.cpp b/samples/zello_world/zello_world.cpp index 2facbd66..b45ce7b4 100644 --- a/samples/zello_world/zello_world.cpp +++ b/samples/zello_world/zello_world.cpp @@ -1,6 +1,6 @@ /* * - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -82,6 +82,8 @@ int main( int argc, char *argv[] ) ze_device_handle_t pDevice = nullptr; uint32_t driverCount = 0; zel_tracer_handle_t tracer = nullptr; + std::vector drivers; + std::vector devices_per_driver; if( init_ze(legacy_init, driverCount, driverTypeDesc) ) { @@ -106,7 +108,6 @@ int main( int argc, char *argv[] ) } } - std::vector drivers; if (legacy_init) { status = zeDriverGet(&driverCount, nullptr); if(status != ZE_RESULT_SUCCESS) { @@ -129,96 +130,106 @@ int main( int argc, char *argv[] ) } } - for( uint32_t driver = 0; driver < driverCount; ++driver ) + for( size_t driver = 0; driver < drivers.size(); ++driver ) { + std::cout << "Driver # " << driver << "\n"; pDriver = drivers[driver]; pDevice = findDevice( pDriver, type ); - if( pDevice ) - { - break; + if (pDevice) { + devices_per_driver.push_back(pDevice); + } else { + devices_per_driver.push_back(nullptr); } } } - if( !pDevice ) + if( devices_per_driver.empty() || drivers.empty() ) { std::cout << "Did NOT find matching " << to_string(type) <<" device!" << "\n"; return -1; } + for (size_t driver_idx = 0; driver_idx < drivers.size(); ++driver_idx) { + if (driver_idx >= devices_per_driver.size() || devices_per_driver[driver_idx] == nullptr) { + std::cout << "No valid device found for Driver #" << driver_idx << std::endl; + continue; + } + pDriver = drivers[driver_idx]; + pDevice = devices_per_driver[driver_idx]; + std::cout << "Executing on Driver #" << driver_idx << ", Device #" << 0 << std::endl; + // Create the context + ze_context_handle_t context; + ze_context_desc_t context_desc = {}; + context_desc.stype = ZE_STRUCTURE_TYPE_CONTEXT_DESC; + status = zeContextCreate(pDriver, &context_desc, &context); + if(status != ZE_RESULT_SUCCESS) { + std::cout << "zeContextCreate Failed with return code: " << to_string(status) << std::endl; + continue; + } - // Create the context - ze_context_handle_t context; - ze_context_desc_t context_desc = {}; - context_desc.stype = ZE_STRUCTURE_TYPE_CONTEXT_DESC; - status = zeContextCreate(pDriver, &context_desc, &context); - if(status != ZE_RESULT_SUCCESS) { - std::cout << "zeContextCreate Failed with return code: " << to_string(status) << std::endl; - exit(1); - } + // Create an immediate command list for direct submission + ze_command_queue_desc_t altdesc = {}; + altdesc.stype = ZE_STRUCTURE_TYPE_COMMAND_QUEUE_DESC; + ze_command_list_handle_t command_list = {}; + status = zeCommandListCreateImmediate(context, pDevice, &altdesc, &command_list); + if(status != ZE_RESULT_SUCCESS) { + std::cout << "zeCommandListCreateImmediate Failed with return code: " << to_string(status) << std::endl; + continue; + } - // Create an immediate command list for direct submission - ze_command_queue_desc_t altdesc = {}; - altdesc.stype = ZE_STRUCTURE_TYPE_COMMAND_QUEUE_DESC; - ze_command_list_handle_t command_list = {}; - status = zeCommandListCreateImmediate(context, pDevice, &altdesc, &command_list); - if(status != ZE_RESULT_SUCCESS) { - std::cout << "zeCommandListCreateImmediate Failed with return code: " << to_string(status) << std::endl; - exit(1); - } + // Create an event to be signaled by the device + ze_event_pool_desc_t ep_desc = {}; + ep_desc.stype = ZE_STRUCTURE_TYPE_EVENT_POOL_DESC; + ep_desc.count = 1; + ep_desc.flags = ZE_EVENT_POOL_FLAG_HOST_VISIBLE; + ze_event_desc_t ev_desc = {}; + ev_desc.stype = ZE_STRUCTURE_TYPE_EVENT_DESC; + ev_desc.signal = ZE_EVENT_SCOPE_FLAG_HOST; + ev_desc.wait = ZE_EVENT_SCOPE_FLAG_HOST; + ze_event_handle_t event; + ze_event_pool_handle_t event_pool; + + status = zeEventPoolCreate(context, &ep_desc, 1, &pDevice, &event_pool); + if(status != ZE_RESULT_SUCCESS) { + std::cout << "zeEventPoolCreate Failed with return code: " << to_string(status) << std::endl; + continue; + } - // Create an event to be signaled by the device - ze_event_pool_desc_t ep_desc = {}; - ep_desc.stype = ZE_STRUCTURE_TYPE_EVENT_POOL_DESC; - ep_desc.count = 1; - ep_desc.flags = ZE_EVENT_POOL_FLAG_HOST_VISIBLE; - ze_event_desc_t ev_desc = {}; - ev_desc.stype = ZE_STRUCTURE_TYPE_EVENT_DESC; - ev_desc.signal = ZE_EVENT_SCOPE_FLAG_HOST; - ev_desc.wait = ZE_EVENT_SCOPE_FLAG_HOST; - ze_event_handle_t event; - ze_event_pool_handle_t event_pool; - - status = zeEventPoolCreate(context, &ep_desc, 1, &pDevice, &event_pool); - if(status != ZE_RESULT_SUCCESS) { - std::cout << "zeEventPoolCreate Failed with return code: " << to_string(status) << std::endl; - exit(1); - } + status = zeEventCreate(event_pool, &ev_desc, &event); + if(status != ZE_RESULT_SUCCESS) { + std::cout << "zeEventCreate Failed with return code: " << to_string(status) << std::endl; + continue; + } - status = zeEventCreate(event_pool, &ev_desc, &event); - if(status != ZE_RESULT_SUCCESS) { - std::cout << "zeEventCreate Failed with return code: " << to_string(status) << std::endl; - exit(1); - } + // signal the event from the device and wait for completion + zeCommandListAppendSignalEvent(command_list, event); + zeEventHostSynchronize(event, UINT64_MAX ); + std::cout << "Congratulations, Executing on Driver #" << driver_idx << ", Device #" << 0 << " completed execution!" << std::endl; - // signal the event from the device and wait for completion - zeCommandListAppendSignalEvent(command_list, event); - zeEventHostSynchronize(event, UINT64_MAX ); - std::cout << "Congratulations, the device completed execution!\n"; - - if (!zelCheckIsLoaderInTearDown()) - zeContextDestroy(context); - if (!zelCheckIsLoaderInTearDown()) - zeCommandListDestroy(command_list); - if (!zelCheckIsLoaderInTearDown()) - zeEventDestroy(event); - if (!zelCheckIsLoaderInTearDown()) - zeEventPoolDestroy(event_pool); - - if (tracing_enabled) { - status = zelTracerDestroy(tracer); - if(status != ZE_RESULT_SUCCESS) { - std::cout << "zelTracerDestroy Failed with return code: " << to_string(status) << std::endl; - exit(1); + if (!zelCheckIsLoaderInTearDown()) + zeContextDestroy(context); + if (!zelCheckIsLoaderInTearDown()) + zeCommandListDestroy(command_list); + if (!zelCheckIsLoaderInTearDown()) + zeEventDestroy(event); + if (!zelCheckIsLoaderInTearDown()) + zeEventPoolDestroy(event_pool); + + if (tracing_enabled) { + status = zelTracerDestroy(tracer); + if(status != ZE_RESULT_SUCCESS) { + std::cout << "zelTracerDestroy Failed with return code: " << to_string(status) << std::endl; + exit(1); + } } - } - if (tracing_runtime_enabled) { - std::cout << "Disable Tracing Layer after init" << std::endl; - status = zelDisableTracingLayer(); - if(status != ZE_RESULT_SUCCESS) { - std::cout << "zelDisableTracingLayer Failed with return code: " << to_string(status) << std::endl; - exit(1); + if (tracing_runtime_enabled) { + std::cout << "Disable Tracing Layer after init" << std::endl; + status = zelDisableTracingLayer(); + if(status != ZE_RESULT_SUCCESS) { + std::cout << "zelDisableTracingLayer Failed with return code: " << to_string(status) << std::endl; + exit(1); + } } } diff --git a/scripts/generate_code.py b/scripts/generate_code.py index 6ef50434..7646c59a 100644 --- a/scripts/generate_code.py +++ b/scripts/generate_code.py @@ -1,5 +1,5 @@ """ - Copyright (C) 2019-2021 Intel Corporation + Copyright (C) 2019-2025 Intel Corporation SPDX-License-Identifier: MIT @@ -141,6 +141,23 @@ def _mako_loader_cpp(path, namespace, tags, version, specs, meta): filename = "%s.cpp"%(name) fout = os.path.join(path, filename) + print("Generating %s..."%fout) + loc += util.makoWrite( + fin, fout, + name=name, + ver=version, + namespace=namespace, + tags=tags, + specs=specs, + meta=meta) + + template = "ldrddi_driver_ddi.cpp.mako" + fin = os.path.join(templates_dir, template) + + name = "%s_ldrddi_driver_ddi"%(namespace) + filename = "%s.cpp"%(name) + fout = os.path.join(path, filename) + print("Generating %s..."%fout) loc += util.makoWrite( fin, fout, diff --git a/scripts/templates/helper.py b/scripts/templates/helper.py index 4cf99644..6acf027b 100644 --- a/scripts/templates/helper.py +++ b/scripts/templates/helper.py @@ -1,5 +1,5 @@ """ - Copyright (C) 2019-2021 Intel Corporation + Copyright (C) 2019-2025 Intel Corporation SPDX-License-Identifier: MIT @@ -1734,36 +1734,13 @@ def get_version(obj): if obj_traits.is_function(obj): ret_version = "ZE_API_VERSION_FORCE_UINT32" version = obj.get('version') - if version == "1.0": - ret_version = "ZE_API_VERSION_1_0" - if version == "1.1": - ret_version = "ZE_API_VERSION_1_1" - if version == "1.2": - ret_version = "ZE_API_VERSION_1_2" - if version == "1.3": - ret_version = "ZE_API_VERSION_1_3" - if version == "1.4": - ret_version = "ZE_API_VERSION_1_4" - if version == "1.5": - ret_version = "ZE_API_VERSION_1_5" - if version == "1.6": - ret_version = "ZE_API_VERSION_1_6" - if version == "1.7": - ret_version = "ZE_API_VERSION_1_7" - if version == "1.8": - ret_version = "ZE_API_VERSION_1_8" - if version == "1.9": - ret_version = "ZE_API_VERSION_1_9" - if version == "1.10": - ret_version = "ZE_API_VERSION_1_10" - if version == "1.11": - ret_version = "ZE_API_VERSION_1_11" - if version == "1.12": - ret_version = "ZE_API_VERSION_1_12" - if version == "1.13": - ret_version = "ZE_API_VERSION_1_13" - if (ret_version == "ZE_API_VERSION_FORCE_UINT32"): - ret_version = "ZE_API_VERSION_1_0" + if version is not None and version.startswith("1."): + try: + major, minor = version.split(".") + ret_version = f"ZE_API_VERSION_{major}_{minor}" + except Exception: + pass + assert(ret_version != "ZE_API_VERSION_FORCE_UINT32") return ret_version """ diff --git a/scripts/templates/ldrddi.cpp.mako b/scripts/templates/ldrddi.cpp.mako index 24f6ec1c..12141e6f 100644 --- a/scripts/templates/ldrddi.cpp.mako +++ b/scripts/templates/ldrddi.cpp.mako @@ -9,7 +9,7 @@ from templates import helper as th X=x.upper() %>/* * - * Copyright (C) 2019-2024 Intel Corporation + * Copyright (C) 2019-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -18,6 +18,8 @@ from templates import helper as th */ #include "${x}_loader_internal.h" +using namespace loader_driver_ddi; + namespace loader { %for obj in th.extract_objs(specs, r"function"): @@ -164,8 +166,28 @@ namespace loader { for( uint32_t i = 0; i < library_driver_handle_count; ++i ) { uint32_t driver_index = total_driver_handle_count + i; - ${obj['params'][1]['name']}[ driver_index ] = reinterpret_cast<${n}_driver_handle_t>( - context->${n}_driver_factory.getInstance( ${obj['params'][1]['name']}[ driver_index ], &drv.dditable ) ); + if (drv.driverDDIHandleSupportQueried == false) { + drv.properties = {}; + drv.properties.stype = ZE_STRUCTURE_TYPE_DRIVER_DDI_HANDLES_EXT_PROPERTIES; + drv.properties.pNext = nullptr; + ze_driver_properties_t driverProperties = {}; + driverProperties.stype = ZE_STRUCTURE_TYPE_DRIVER_PROPERTIES; + driverProperties.pNext = nullptr; + driverProperties.pNext = &drv.properties; + ze_result_t res = drv.dditable.ze.Driver.pfnGetProperties(${obj['params'][1]['name']}[ driver_index ], &driverProperties); + if (res != ZE_RESULT_SUCCESS) { + if (loader::context->debugTraceEnabled) { + std::string message = drv.name + " failed zeDriverGetProperties query, returned "; + loader::context->debug_trace_message(message, loader::to_string(res)); + } + return res; + } + drv.driverDDIHandleSupportQueried = true; + } + if (!(drv.properties.flags & ZE_DRIVER_DDI_HANDLE_EXT_FLAG_DDI_HANDLE_EXT_SUPPORTED) || !loader::context->driverDDIPathDefault) { + ${obj['params'][1]['name']}[ driver_index ] = reinterpret_cast<${n}_driver_handle_t>( + context->${n}_driver_factory.getInstance( ${obj['params'][1]['name']}[ driver_index ], &drv.dditable ) ); + } } } catch( std::bad_alloc& ) @@ -354,6 +376,40 @@ namespace loader extern "C" { #endif +%for tbl in th.get_pfntables(specs, meta, n, tags): +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for ${tbl['name']} table +__${x}dlllocal void ${X}_APICALL +${tbl['export']['name']}Legacy() +{ + // return pointers to the Loader's Functions. + %for obj in tbl['functions']: + %if 'condition' in obj: +#if ${th.subt(n, tags, obj['condition'])} + %endif + %if namespace == "ze": + loader::loaderDispatch->pCore->${tbl['name']}->${th.append_ws(th.make_pfn_name(n, tags, obj), 43)} = loader::${th.make_func_name(n, tags, obj)}; + %elif namespace == "zet": + loader::loaderDispatch->pTools->${tbl['name']}->${th.append_ws(th.make_pfn_name(n, tags, obj), 43)} = loader::${th.make_func_name(n, tags, obj)}; + %elif namespace == "zes": + loader::loaderDispatch->pSysman->${tbl['name']}->${th.append_ws(th.make_pfn_name(n, tags, obj), 43)} = loader::${th.make_func_name(n, tags, obj)}; + %endif + %if 'condition' in obj: +#else + %if namespace == "ze": + loader::loaderDispatch->pCore->${tbl['name']}->${th.append_ws(th.make_pfn_name(n, tags, obj), 43)} = nullptr; + %elif namespace == "zet": + loader::loaderDispatch->pTools->${tbl['name']}->${th.append_ws(th.make_pfn_name(n, tags, obj), 43)} = nullptr; + %elif namespace == "zes": + loader::loaderDispatch->pSysman->${tbl['name']}->${th.append_ws(th.make_pfn_name(n, tags, obj), 43)} = nullptr; + %endif +#endif + %endif + %endfor +} + +%endfor + %for tbl in th.get_pfntables(specs, meta, n, tags): /////////////////////////////////////////////////////////////////////////////// /// @brief Exported function for filling application's ${tbl['name']} table @@ -446,12 +502,27 @@ ${tbl['export']['name']}( %endif { // return pointers to loader's DDIs + %if namespace == "ze": + loader::loaderDispatch->pCore->${tbl['name']} = new ${tbl['type']}; + %elif namespace == "zet": + loader::loaderDispatch->pTools->${tbl['name']} = new ${tbl['type']}; + %elif namespace == "zes": + loader::loaderDispatch->pSysman->${tbl['name']} = new ${tbl['type']}; + %endif %for obj in tbl['functions']: if (version >= ${th.get_version(obj)}) { %if 'condition' in obj: #if ${th.subt(n, tags, obj['condition'])} %endif + %if not (re.match(r"Init", obj['name']) or re.match(r"\w+InitDrivers$", th.make_func_name(n, tags, obj)) or re.match(r"\w+DriverGet$", th.make_func_name(n, tags, obj))): + if (loader::context->driverDDIPathDefault) { + pDdiTable->${th.append_ws(th.make_pfn_name(n, tags, obj), 43)} = loader_driver_ddi::${th.make_func_name(n, tags, obj)}; + } else { pDdiTable->${th.append_ws(th.make_pfn_name(n, tags, obj), 43)} = loader::${th.make_func_name(n, tags, obj)}; + } + %else: + pDdiTable->${th.append_ws(th.make_pfn_name(n, tags, obj), 43)} = loader::${th.make_func_name(n, tags, obj)}; + %endif %if 'condition' in obj: #else pDdiTable->${th.append_ws(th.make_pfn_name(n, tags, obj), 43)} = nullptr; @@ -459,6 +530,7 @@ ${tbl['export']['name']}( %endif } %endfor + ${tbl['export']['name']}Legacy(); } else { @@ -506,4 +578,4 @@ ${tbl['export']['name']}( #if defined(__cplusplus) }; -#endif +#endif \ No newline at end of file diff --git a/scripts/templates/ldrddi.h.mako b/scripts/templates/ldrddi.h.mako index d3fc5aac..fa18990f 100644 --- a/scripts/templates/ldrddi.h.mako +++ b/scripts/templates/ldrddi.h.mako @@ -9,7 +9,7 @@ from templates import helper as th X=x.upper() %>/* * - * Copyright (C) 2019-2024 Intel Corporation + * Copyright (C) 2019-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -33,3 +33,32 @@ namespace loader %endif %endfor } + +namespace loader_driver_ddi +{ + __${x}dlllocal void ${X}_APICALL + ${n}DestroyDDiDriverTables(${n}_dditable_driver_t* pDdiTable); + %for obj in th.extract_objs(specs, r"function"): + %if not (re.match(r"Init", obj['name']) or re.match(r"\w+InitDrivers$", th.make_func_name(n, tags, obj)) or re.match(r"\w+DriverGet$", th.make_func_name(n, tags, obj))): + __${x}dlllocal ${x}_result_t ${X}_APICALL + ${th.make_func_name(n, tags, obj)}( + %for line in th.make_param_lines(n, tags, obj): + ${line} + %endfor + ); + %endif + %endfor +} + +#if defined(__cplusplus) +extern "C" { +#endif + +%for tbl in th.get_pfntables(specs, meta, n, tags): +__${x}dlllocal void ${X}_APICALL +${tbl['export']['name']}Legacy(); +%endfor + +#if defined(__cplusplus) +}; +#endif diff --git a/scripts/templates/ldrddi_driver_ddi.cpp.mako b/scripts/templates/ldrddi_driver_ddi.cpp.mako new file mode 100644 index 00000000..b279a635 --- /dev/null +++ b/scripts/templates/ldrddi_driver_ddi.cpp.mako @@ -0,0 +1,96 @@ +<%! +import re +from templates import helper as th +%><% + n=namespace + N=n.upper() + + x=tags['$x'] + X=x.upper() +%>/* + * + * Copyright (C) 2019-2025 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + * @file ${name}.cpp + * + */ +#include "${x}_loader_internal.h" + +namespace loader_driver_ddi +{ + %for obj in th.extract_objs(specs, r"function"): + %if not (re.match(r"Init", obj['name']) or re.match(r"\w+InitDrivers$", th.make_func_name(n, tags, obj)) or re.match(r"\w+DriverGet$", th.make_func_name(n, tags, obj))): + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for ${th.make_func_name(n, tags, obj)} + %if 'condition' in obj: + #if ${th.subt(n, tags, obj['condition'])} + %endif + __${x}dlllocal ${x}_result_t ${X}_APICALL + ${th.make_func_name(n, tags, obj)}( + %for line in th.make_param_lines(n, tags, obj): + ${line} + %endfor + ) + { + ${x}_result_t result = ${X}_RESULT_SUCCESS;<% + add_local = False + arrays_to_delete = [] + %> + + %for i, item in enumerate(th.get_loader_prologue(n, tags, obj, meta)): + %if 0 == i: + // extract handle's function pointer table + %if 'range' in item: + %if namespace == "ze": + auto dditable = reinterpret_cast( ${item['name']}[ 0 ] )->pCore; + %elif namespace == "zet": + auto dditable = reinterpret_cast( ${item['name']}[ 0 ] )->pTools; + %elif namespace == "zes": + auto dditable = reinterpret_cast( ${item['name']}[ 0 ] )->pSysman; + %endif + %else: + %if namespace == "ze": + auto dditable = reinterpret_cast( ${item['name']} )->pCore; + %elif namespace == "zet": + auto dditable = reinterpret_cast( ${item['name']} )->pTools; + %elif namespace == "zes": + auto dditable = reinterpret_cast( ${item['name']} )->pSysman; + %endif + %endif + if (dditable->isValidFlag == 0) + return ${X}_RESULT_ERROR_UNINITIALIZED; + // Check that api version in the driver is supported by this version of the API + if (dditable->version < ${th.get_version(obj)}) { + return ${X}_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto ${th.make_pfn_name(n, tags, obj)} = dditable->${th.get_table_name(n, tags, obj)}->${th.make_pfn_name(n, tags, obj)}; + if( nullptr == ${th.make_pfn_name(n, tags, obj)} ) + return ${X}_RESULT_ERROR_UNINITIALIZED; + %endif + %endfor + // forward to device-driver + result = ${th.make_pfn_name(n, tags, obj)}( ${", ".join(th.make_param_lines(n, tags, obj, format=["name"]))} ); + return result; + } + %if 'condition' in obj: + #endif // ${th.subt(n, tags, obj['condition'])} + %endif + + %endif + %endfor + + /////////////////////////////////////////////////////////////////////////////// + /// @brief function for removing the ddi driver tables for ${n} + __${x}dlllocal void ${X}_APICALL + ${n}DestroyDDiDriverTables(${n}_dditable_driver_t* pDdiTable) + { + // Delete ddi tables +%for tbl in th.get_pfntables(specs, meta, n, tags): + delete pDdiTable->${tbl['name']}; +%endfor + delete pDdiTable; + } + +} // namespace loader_driver_ddi \ No newline at end of file diff --git a/scripts/templates/ze_loader_internal.h.mako b/scripts/templates/ze_loader_internal.h.mako index 220aea50..0f96fbee 100644 --- a/scripts/templates/ze_loader_internal.h.mako +++ b/scripts/templates/ze_loader_internal.h.mako @@ -21,9 +21,7 @@ from templates import helper as th #include #include -#include "ze_ddi.h" -#include "zet_ddi.h" -#include "zes_ddi.h" +#include "ze_ddi_common.h" #include "ze_util.h" #include "ze_object.h" @@ -63,9 +61,10 @@ namespace loader std::string name; bool driverInuse = false; zel_driver_type_t driverType = ZEL_DRIVER_TYPE_FORCE_UINT32; - ze_driver_properties_t properties; + ze_driver_ddi_handles_ext_properties_t properties; bool pciOrderingRequested = false; bool legacyInitAttempted = false; + bool driverDDIHandleSupportQueried = false; }; using driver_vector_t = std::vector< driver_t >; @@ -118,6 +117,7 @@ namespace loader ~context_t(); bool intercept_enabled = false; bool debugTraceEnabled = false; + bool driverDDIPathDefault = false; bool tracingLayerEnabled = false; std::once_flag coreDriverSortOnce; std::once_flag sysmanDriverSortOnce; @@ -128,5 +128,9 @@ namespace loader std::shared_ptr zel_logger; }; + extern ze_handle_t* loaderDispatch; + extern ze_dditable_t* loaderZeDdiTable; + extern zet_dditable_t* loaderZetDdiTable; + extern zes_dditable_t* loaderZesDdiTable; extern context_t *context; } diff --git a/source/drivers/null/ze_null.cpp b/source/drivers/null/ze_null.cpp index 64e8e196..c0ee9748 100644 --- a/source/drivers/null/ze_null.cpp +++ b/source/drivers/null/ze_null.cpp @@ -1,6 +1,6 @@ /* * - * Copyright (C) 2019-2021 Intel Corporation + * Copyright (C) 2019-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -14,6 +14,9 @@ namespace driver { ////////////////////////////////////////////////////////////////////////// context_t context; + ze_dditable_driver_t pCore; + zet_dditable_driver_t pTools; + zes_dditable_driver_t pSysman; ////////////////////////////////////////////////////////////////////////// context_t::context_t() @@ -63,16 +66,24 @@ namespace driver ze_driver_handle_t, ze_driver_properties_t* pDriverProperties ) { - ze_driver_properties_t driverProperties = {}; - driverProperties.stype = ZE_STRUCTURE_TYPE_DRIVER_PROPERTIES; - //driverProperties.uuid - driverProperties.driverVersion = 0; + auto pNext = reinterpret_cast(pDriverProperties->pNext); + while (pNext) { + auto ddi_test_disable = getenv_string( "ZEL_TEST_NULL_DRIVER_DISABLE_DDI_EXT" ); + #ifndef ZEL_NULL_DRIVER_ID + #define ZEL_NULL_DRIVER_ID 1 + #endif + std::string null_driver_id_str = std::to_string(ZEL_NULL_DRIVER_ID); + if (pNext->stype == ZE_STRUCTURE_TYPE_DRIVER_DDI_HANDLES_EXT_PROPERTIES && (ddi_test_disable != null_driver_id_str && ddi_test_disable != "3")) { + ze_driver_ddi_handles_ext_properties_t *pDdiHandlesExtProperties = reinterpret_cast(pNext); + pDdiHandlesExtProperties->flags = ze_driver_ddi_handle_ext_flag_t::ZE_DRIVER_DDI_HANDLE_EXT_FLAG_DDI_HANDLE_EXT_SUPPORTED; + context.ddiExtensionRequested = true; + } + pNext = reinterpret_cast(pNext->pNext); + } + pDriverProperties->driverVersion = 0; - *pDriverProperties = driverProperties; return ZE_RESULT_SUCCESS; }; - - //pfnGetIPCProperties ////////////////////////////////////////////////////////////////////////// zeDdiTable.Mem.pfnAllocShared = []( @@ -122,14 +133,227 @@ namespace driver return ZE_RESULT_SUCCESS; }; - //pfnGetMemProperties - //pfnGetMemAddressRange - //pfnGetMemIpcHandle - //pfnOpenMemIpcHandle - //pfnCloseMemIpcHandle + ////////////////////////////////////////////////////////////////////////// + zeDdiTable.EventPool.pfnCreate = []( + ze_context_handle_t, + const ze_event_pool_desc_t* desc, + uint32_t, + ze_device_handle_t*, + ze_event_pool_handle_t* phEventPool ) + { + *phEventPool = reinterpret_cast(context.get()); + return ZE_RESULT_SUCCESS; + }; + + ////////////////////////////////////////////////////////////////////////// + zeDdiTable.Event.pfnCreate = []( + ze_event_pool_handle_t, + const ze_event_desc_t* desc, + ze_event_handle_t* phEvent ) + { + *phEvent = reinterpret_cast(context.get()); + return ZE_RESULT_SUCCESS; + }; + + ////////////////////////////////////////////////////////////////////////// + zeDdiTable.CommandList.pfnCreate = []( + ze_context_handle_t, + ze_device_handle_t, + const ze_command_list_desc_t* desc, + ze_command_list_handle_t* phCommandList ) + { + *phCommandList = reinterpret_cast(context.get()); + return ZE_RESULT_SUCCESS; + }; + + ////////////////////////////////////////////////////////////////////////// + zeDdiTable.CommandQueue.pfnCreate = []( + ze_context_handle_t, + ze_device_handle_t, + const ze_command_queue_desc_t* desc, + ze_command_queue_handle_t* phCommandQueue ) + { + *phCommandQueue = reinterpret_cast(context.get()); + return ZE_RESULT_SUCCESS; + }; + + ////////////////////////////////////////////////////////////////////////// + zeDdiTable.Context.pfnCreate = []( + ze_driver_handle_t, + const ze_context_desc_t*, + ze_context_handle_t* phContext ) + { + *phContext = reinterpret_cast(context.get()); + return ZE_RESULT_SUCCESS; + }; + + ////////////////////////////////////////////////////////////////////////// + zeDdiTable.Context.pfnDestroy = []( + ze_context_handle_t ) + { + return ZE_RESULT_SUCCESS; + }; + + ////////////////////////////////////////////////////////////////////////// + zeDdiTable.CommandList.pfnDestroy = []( + ze_command_list_handle_t ) + { + return ZE_RESULT_SUCCESS; + }; + + ////////////////////////////////////////////////////////////////////////// + zeDdiTable.CommandQueue.pfnDestroy = []( + ze_command_queue_handle_t ) + { + return ZE_RESULT_SUCCESS; + }; + + ////////////////////////////////////////////////////////////////////////// + zeDdiTable.EventPool.pfnDestroy = []( + ze_event_pool_handle_t ) + { + return ZE_RESULT_SUCCESS; + }; + + ////////////////////////////////////////////////////////////////////////// + zeDdiTable.Event.pfnDestroy = []( + ze_event_handle_t ) + { + return ZE_RESULT_SUCCESS; + }; + ////////////////////////////////////////////////////////////////////////// + zeDdiTable.Module.pfnCreate = []( + ze_context_handle_t, + ze_device_handle_t, + const ze_module_desc_t*, + ze_module_handle_t* phModule, + ze_module_build_log_handle_t* phModuleBuildLog ) + { + *phModule = reinterpret_cast(context.get()); + if (phModuleBuildLog) { + *phModuleBuildLog = reinterpret_cast(context.get()); + } + return ZE_RESULT_SUCCESS; + }; + + ////////////////////////////////////////////////////////////////////////// + zeDdiTable.Module.pfnDestroy = []( + ze_module_handle_t ) + { + return ZE_RESULT_SUCCESS; + }; + + ////////////////////////////////////////////////////////////////////////// + zeDdiTable.ModuleBuildLog.pfnDestroy = []( + ze_module_build_log_handle_t ) + { + return ZE_RESULT_SUCCESS; + }; + + ////////////////////////////////////////////////////////////////////////// + zeDdiTable.ModuleBuildLog.pfnGetString = []( + ze_module_build_log_handle_t, + size_t* pSize, + char* pBuildLog ) + { + const char* log = "Build log not available."; + *pSize = strlen(log) + 1; + if (pBuildLog) { + #if defined(_WIN32) + strncpy_s( pBuildLog, *pSize, log, *pSize ); + #else + strncpy( pBuildLog, log, *pSize ); + #endif + } + return ZE_RESULT_SUCCESS; + }; + + ////////////////////////////////////////////////////////////////////////// + zeDdiTable.PhysicalMem.pfnCreate = []( + ze_context_handle_t, + ze_device_handle_t, + ze_physical_mem_desc_t*, + ze_physical_mem_handle_t* phPhysicalMemory ) + { + *phPhysicalMemory = reinterpret_cast(context.get()); + return ZE_RESULT_SUCCESS; + }; + + ////////////////////////////////////////////////////////////////////////// + zeDdiTable.PhysicalMem.pfnDestroy = []( ze_context_handle_t, + ze_physical_mem_handle_t ) + { + return ZE_RESULT_SUCCESS; + }; + ////////////////////////////////////////////////////////////////////////// + zeDdiTable.Fence.pfnCreate = []( + ze_command_queue_handle_t, + const ze_fence_desc_t*, + ze_fence_handle_t* phFence ) + { + *phFence = reinterpret_cast(context.get()); + return ZE_RESULT_SUCCESS; + }; ////////////////////////////////////////////////////////////////////////// - //pfnGetSubDevices + zeDdiTable.Fence.pfnDestroy = []( + ze_fence_handle_t ) + { + return ZE_RESULT_SUCCESS; + }; + + ////////////////////////////////////////////////////////////////////////// + zeDdiTable.Image.pfnCreate = []( + ze_context_handle_t, + ze_device_handle_t, + const ze_image_desc_t*, + ze_image_handle_t* phImage ) + { + *phImage = reinterpret_cast(context.get()); + return ZE_RESULT_SUCCESS; + }; + + ////////////////////////////////////////////////////////////////////////// + zeDdiTable.Image.pfnDestroy = []( + ze_image_handle_t ) + { + return ZE_RESULT_SUCCESS; + }; + + ////////////////////////////////////////////////////////////////////////// + zeDdiTable.Sampler.pfnCreate = []( + ze_context_handle_t, + ze_device_handle_t, + const ze_sampler_desc_t*, + ze_sampler_handle_t* phSampler ) + { + *phSampler = reinterpret_cast(context.get()); + return ZE_RESULT_SUCCESS; + }; + + ////////////////////////////////////////////////////////////////////////// + zeDdiTable.Sampler.pfnDestroy = []( + ze_sampler_handle_t ) + { + return ZE_RESULT_SUCCESS; + }; + + ////////////////////////////////////////////////////////////////////////// + zeDdiTable.Kernel.pfnCreate = []( + ze_module_handle_t, + const ze_kernel_desc_t*, + ze_kernel_handle_t* phKernel ) + { + *phKernel = reinterpret_cast(context.get()); + return ZE_RESULT_SUCCESS; + }; + + ////////////////////////////////////////////////////////////////////////// + zeDdiTable.Kernel.pfnDestroy = []( + ze_kernel_handle_t ) + { + return ZE_RESULT_SUCCESS; + }; ////////////////////////////////////////////////////////////////////////// zeDdiTable.Device.pfnGetProperties = []( @@ -367,6 +591,32 @@ namespace driver if( pRawData ) *pRawData = 0; return ZE_RESULT_SUCCESS; }; + pCore.Driver = &zeDdiTable.Driver; + pCore.Device = &zeDdiTable.Device; + pCore.Mem = &zeDdiTable.Mem; + pCore.CommandList = &zeDdiTable.CommandList; + pCore.CommandQueue = &zeDdiTable.CommandQueue; + pCore.Context = &zeDdiTable.Context; + pCore.Event = &zeDdiTable.Event; + pCore.EventPool = &zeDdiTable.EventPool; + pCore.Module = &zeDdiTable.Module; + pCore.ModuleBuildLog = &zeDdiTable.ModuleBuildLog; + pCore.PhysicalMem = &zeDdiTable.PhysicalMem; + pCore.Kernel = &zeDdiTable.Kernel; + pCore.Fence = &zeDdiTable.Fence; + pCore.Image = &zeDdiTable.Image; + pCore.Sampler = &zeDdiTable.Sampler; + pCore.isValidFlag = 1; + pCore.version = ZE_API_VERSION_CURRENT; + pTools.MetricGroup = &zetDdiTable.MetricGroup; + pTools.Metric = &zetDdiTable.Metric; + pTools.MetricQuery = &zetDdiTable.MetricQuery; + pTools.MetricStreamer = &zetDdiTable.MetricStreamer; + pTools.isValidFlag = 1; + pTools.version = ZE_API_VERSION_CURRENT; + pSysman.Driver = &zesDdiTable.Driver; + pSysman.isValidFlag = 1; + pSysman.version = ZE_API_VERSION_CURRENT; } } // namespace driver diff --git a/source/drivers/null/ze_null.h b/source/drivers/null/ze_null.h index bcdc9562..57c9c630 100644 --- a/source/drivers/null/ze_null.h +++ b/source/drivers/null/ze_null.h @@ -1,6 +1,6 @@ /* * - * Copyright (C) 2019-2021 Intel Corporation + * Copyright (C) 2019-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -14,6 +14,7 @@ #include "zet_ddi.h" #include "zes_ddi.h" #include "ze_util.h" +#include "ze_ddi_common.h" #ifndef ZEL_NULL_DRIVER_ID #define ZEL_NULL_DRIVER_ID 1 @@ -21,6 +22,16 @@ namespace driver { + extern ze_dditable_driver_t pCore; + extern zet_dditable_driver_t pTools; + extern zes_dditable_driver_t pSysman; + struct __zedlllocal BaseNullHandle : ze_handle_t { + BaseNullHandle() { + pCore = &driver::pCore; + pTools = &driver::pTools; + pSysman = &driver::pSysman; + } + }; /////////////////////////////////////////////////////////////////////////////// class __zedlllocal context_t { @@ -30,13 +41,24 @@ namespace driver ze_dditable_t zeDdiTable = {}; zet_dditable_t zetDdiTable = {}; zes_dditable_t zesDdiTable = {}; + std::vector globalBaseNullHandle; + bool ddiExtensionRequested = false; context_t(); - ~context_t() = default; + ~context_t() { + for (auto handle : globalBaseNullHandle) { + delete handle; + } + } void* get( void ) { static uint64_t count = 0x80800000; - return reinterpret_cast( ++count ); + if (ddiExtensionRequested) { + globalBaseNullHandle.push_back(new BaseNullHandle()); + return reinterpret_cast(globalBaseNullHandle.back()); + } else { + return reinterpret_cast( ++count ); + } } }; diff --git a/source/inc/ze_singleton.h b/source/inc/ze_singleton.h index 3be4a9b9..7f7d09a0 100644 --- a/source/inc/ze_singleton.h +++ b/source/inc/ze_singleton.h @@ -1,6 +1,6 @@ /* * - * Copyright (C) 2019-2021 Intel Corporation + * Copyright (C) 2019-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -9,6 +9,7 @@ #include #include #include +#include ////////////////////////////////////////////////////////////////////////// /// a abstract factory for creation of singleton objects @@ -63,6 +64,12 @@ class singleton_factory_t return iter->second.get(); } + bool hasInstance( _key_t _key ) + { + std::lock_guard lk( mut ); + return map.find( getKey( _key ) ) != map.end(); + } + ////////////////////////////////////////////////////////////////////////// /// once the key is no longer valid, release the singleton void release( _key_t _key ) diff --git a/source/loader/CMakeLists.txt b/source/loader/CMakeLists.txt index e3f8d139..b2a5ad64 100644 --- a/source/loader/CMakeLists.txt +++ b/source/loader/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2020 Intel Corporation +# Copyright (C) 2020-2025 Intel Corporation # SPDX-License-Identifier: MIT @@ -9,10 +9,13 @@ target_sources(${TARGET_LOADER_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/ze_loader.cpp ${CMAKE_CURRENT_SOURCE_DIR}/ze_loader_api.cpp ${CMAKE_CURRENT_SOURCE_DIR}/ze_ldrddi.h + ${CMAKE_CURRENT_SOURCE_DIR}/ze_ldrddi_driver_ddi.cpp ${CMAKE_CURRENT_SOURCE_DIR}/ze_ldrddi.cpp ${CMAKE_CURRENT_SOURCE_DIR}/zet_ldrddi.h + ${CMAKE_CURRENT_SOURCE_DIR}/zet_ldrddi_driver_ddi.cpp ${CMAKE_CURRENT_SOURCE_DIR}/zet_ldrddi.cpp ${CMAKE_CURRENT_SOURCE_DIR}/zes_ldrddi.h + ${CMAKE_CURRENT_SOURCE_DIR}/zes_ldrddi_driver_ddi.cpp ${CMAKE_CURRENT_SOURCE_DIR}/zes_ldrddi.cpp ${CMAKE_CURRENT_SOURCE_DIR}/zel_tracing_ldrddi.cpp ${CMAKE_CURRENT_SOURCE_DIR}/driver_discovery.h diff --git a/source/loader/ze_ldrddi.cpp b/source/loader/ze_ldrddi.cpp index 88f30e4d..882628fe 100644 --- a/source/loader/ze_ldrddi.cpp +++ b/source/loader/ze_ldrddi.cpp @@ -1,6 +1,6 @@ /* * - * Copyright (C) 2019-2024 Intel Corporation + * Copyright (C) 2019-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -9,6 +9,8 @@ */ #include "ze_loader_internal.h" +using namespace loader_driver_ddi; + namespace loader { /////////////////////////////////////////////////////////////////////////////// @@ -99,8 +101,28 @@ namespace loader { for( uint32_t i = 0; i < library_driver_handle_count; ++i ) { uint32_t driver_index = total_driver_handle_count + i; - phDrivers[ driver_index ] = reinterpret_cast( - context->ze_driver_factory.getInstance( phDrivers[ driver_index ], &drv.dditable ) ); + if (drv.driverDDIHandleSupportQueried == false) { + drv.properties = {}; + drv.properties.stype = ZE_STRUCTURE_TYPE_DRIVER_DDI_HANDLES_EXT_PROPERTIES; + drv.properties.pNext = nullptr; + ze_driver_properties_t driverProperties = {}; + driverProperties.stype = ZE_STRUCTURE_TYPE_DRIVER_PROPERTIES; + driverProperties.pNext = nullptr; + driverProperties.pNext = &drv.properties; + ze_result_t res = drv.dditable.ze.Driver.pfnGetProperties(phDrivers[ driver_index ], &driverProperties); + if (res != ZE_RESULT_SUCCESS) { + if (loader::context->debugTraceEnabled) { + std::string message = drv.name + " failed zeDriverGetProperties query, returned "; + loader::context->debug_trace_message(message, loader::to_string(res)); + } + return res; + } + drv.driverDDIHandleSupportQueried = true; + } + if (!(drv.properties.flags & ZE_DRIVER_DDI_HANDLE_EXT_FLAG_DDI_HANDLE_EXT_SUPPORTED) || !loader::context->driverDDIPathDefault) { + phDrivers[ driver_index ] = reinterpret_cast( + context->ze_driver_factory.getInstance( phDrivers[ driver_index ], &drv.dditable ) ); + } } } catch( std::bad_alloc& ) @@ -187,8 +209,28 @@ namespace loader { for( uint32_t i = 0; i < library_driver_handle_count; ++i ) { uint32_t driver_index = total_driver_handle_count + i; - phDrivers[ driver_index ] = reinterpret_cast( - context->ze_driver_factory.getInstance( phDrivers[ driver_index ], &drv.dditable ) ); + if (drv.driverDDIHandleSupportQueried == false) { + drv.properties = {}; + drv.properties.stype = ZE_STRUCTURE_TYPE_DRIVER_DDI_HANDLES_EXT_PROPERTIES; + drv.properties.pNext = nullptr; + ze_driver_properties_t driverProperties = {}; + driverProperties.stype = ZE_STRUCTURE_TYPE_DRIVER_PROPERTIES; + driverProperties.pNext = nullptr; + driverProperties.pNext = &drv.properties; + ze_result_t res = drv.dditable.ze.Driver.pfnGetProperties(phDrivers[ driver_index ], &driverProperties); + if (res != ZE_RESULT_SUCCESS) { + if (loader::context->debugTraceEnabled) { + std::string message = drv.name + " failed zeDriverGetProperties query, returned "; + loader::context->debug_trace_message(message, loader::to_string(res)); + } + return res; + } + drv.driverDDIHandleSupportQueried = true; + } + if (!(drv.properties.flags & ZE_DRIVER_DDI_HANDLE_EXT_FLAG_DDI_HANDLE_EXT_SUPPORTED) || !loader::context->driverDDIPathDefault) { + phDrivers[ driver_index ] = reinterpret_cast( + context->ze_driver_factory.getInstance( phDrivers[ driver_index ], &drv.dditable ) ); + } } } catch( std::bad_alloc& ) @@ -6877,6 +6919,450 @@ namespace loader extern "C" { #endif +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for Global table +__zedlllocal void ZE_APICALL +zeGetGlobalProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pCore->Global->pfnInit = loader::zeInit; + loader::loaderDispatch->pCore->Global->pfnInitDrivers = loader::zeInitDrivers; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for RTASBuilder table +__zedlllocal void ZE_APICALL +zeGetRTASBuilderProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pCore->RTASBuilder->pfnCreateExt = loader::zeRTASBuilderCreateExt; + loader::loaderDispatch->pCore->RTASBuilder->pfnGetBuildPropertiesExt = loader::zeRTASBuilderGetBuildPropertiesExt; + loader::loaderDispatch->pCore->RTASBuilder->pfnBuildExt = loader::zeRTASBuilderBuildExt; + loader::loaderDispatch->pCore->RTASBuilder->pfnCommandListAppendCopyExt = loader::zeRTASBuilderCommandListAppendCopyExt; + loader::loaderDispatch->pCore->RTASBuilder->pfnDestroyExt = loader::zeRTASBuilderDestroyExt; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for RTASBuilderExp table +__zedlllocal void ZE_APICALL +zeGetRTASBuilderExpProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pCore->RTASBuilderExp->pfnCreateExp = loader::zeRTASBuilderCreateExp; + loader::loaderDispatch->pCore->RTASBuilderExp->pfnGetBuildPropertiesExp = loader::zeRTASBuilderGetBuildPropertiesExp; + loader::loaderDispatch->pCore->RTASBuilderExp->pfnBuildExp = loader::zeRTASBuilderBuildExp; + loader::loaderDispatch->pCore->RTASBuilderExp->pfnDestroyExp = loader::zeRTASBuilderDestroyExp; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for RTASParallelOperation table +__zedlllocal void ZE_APICALL +zeGetRTASParallelOperationProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pCore->RTASParallelOperation->pfnCreateExt = loader::zeRTASParallelOperationCreateExt; + loader::loaderDispatch->pCore->RTASParallelOperation->pfnGetPropertiesExt = loader::zeRTASParallelOperationGetPropertiesExt; + loader::loaderDispatch->pCore->RTASParallelOperation->pfnJoinExt = loader::zeRTASParallelOperationJoinExt; + loader::loaderDispatch->pCore->RTASParallelOperation->pfnDestroyExt = loader::zeRTASParallelOperationDestroyExt; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for RTASParallelOperationExp table +__zedlllocal void ZE_APICALL +zeGetRTASParallelOperationExpProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pCore->RTASParallelOperationExp->pfnCreateExp = loader::zeRTASParallelOperationCreateExp; + loader::loaderDispatch->pCore->RTASParallelOperationExp->pfnGetPropertiesExp = loader::zeRTASParallelOperationGetPropertiesExp; + loader::loaderDispatch->pCore->RTASParallelOperationExp->pfnJoinExp = loader::zeRTASParallelOperationJoinExp; + loader::loaderDispatch->pCore->RTASParallelOperationExp->pfnDestroyExp = loader::zeRTASParallelOperationDestroyExp; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for Driver table +__zedlllocal void ZE_APICALL +zeGetDriverProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pCore->Driver->pfnGet = loader::zeDriverGet; + loader::loaderDispatch->pCore->Driver->pfnGetApiVersion = loader::zeDriverGetApiVersion; + loader::loaderDispatch->pCore->Driver->pfnGetProperties = loader::zeDriverGetProperties; + loader::loaderDispatch->pCore->Driver->pfnGetIpcProperties = loader::zeDriverGetIpcProperties; + loader::loaderDispatch->pCore->Driver->pfnGetExtensionProperties = loader::zeDriverGetExtensionProperties; + loader::loaderDispatch->pCore->Driver->pfnGetExtensionFunctionAddress = loader::zeDriverGetExtensionFunctionAddress; + loader::loaderDispatch->pCore->Driver->pfnRTASFormatCompatibilityCheckExt = loader::zeDriverRTASFormatCompatibilityCheckExt; + loader::loaderDispatch->pCore->Driver->pfnGetLastErrorDescription = loader::zeDriverGetLastErrorDescription; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for DriverExp table +__zedlllocal void ZE_APICALL +zeGetDriverExpProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pCore->DriverExp->pfnRTASFormatCompatibilityCheckExp = loader::zeDriverRTASFormatCompatibilityCheckExp; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for Device table +__zedlllocal void ZE_APICALL +zeGetDeviceProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pCore->Device->pfnGet = loader::zeDeviceGet; + loader::loaderDispatch->pCore->Device->pfnGetSubDevices = loader::zeDeviceGetSubDevices; + loader::loaderDispatch->pCore->Device->pfnGetProperties = loader::zeDeviceGetProperties; + loader::loaderDispatch->pCore->Device->pfnGetComputeProperties = loader::zeDeviceGetComputeProperties; + loader::loaderDispatch->pCore->Device->pfnGetModuleProperties = loader::zeDeviceGetModuleProperties; + loader::loaderDispatch->pCore->Device->pfnGetCommandQueueGroupProperties = loader::zeDeviceGetCommandQueueGroupProperties; + loader::loaderDispatch->pCore->Device->pfnGetMemoryProperties = loader::zeDeviceGetMemoryProperties; + loader::loaderDispatch->pCore->Device->pfnGetMemoryAccessProperties = loader::zeDeviceGetMemoryAccessProperties; + loader::loaderDispatch->pCore->Device->pfnGetCacheProperties = loader::zeDeviceGetCacheProperties; + loader::loaderDispatch->pCore->Device->pfnGetImageProperties = loader::zeDeviceGetImageProperties; + loader::loaderDispatch->pCore->Device->pfnGetExternalMemoryProperties = loader::zeDeviceGetExternalMemoryProperties; + loader::loaderDispatch->pCore->Device->pfnGetP2PProperties = loader::zeDeviceGetP2PProperties; + loader::loaderDispatch->pCore->Device->pfnCanAccessPeer = loader::zeDeviceCanAccessPeer; + loader::loaderDispatch->pCore->Device->pfnGetStatus = loader::zeDeviceGetStatus; + loader::loaderDispatch->pCore->Device->pfnGetGlobalTimestamps = loader::zeDeviceGetGlobalTimestamps; + loader::loaderDispatch->pCore->Device->pfnImportExternalSemaphoreExt = loader::zeDeviceImportExternalSemaphoreExt; + loader::loaderDispatch->pCore->Device->pfnReleaseExternalSemaphoreExt = loader::zeDeviceReleaseExternalSemaphoreExt; + loader::loaderDispatch->pCore->Device->pfnGetVectorWidthPropertiesExt = loader::zeDeviceGetVectorWidthPropertiesExt; + loader::loaderDispatch->pCore->Device->pfnReserveCacheExt = loader::zeDeviceReserveCacheExt; + loader::loaderDispatch->pCore->Device->pfnSetCacheAdviceExt = loader::zeDeviceSetCacheAdviceExt; + loader::loaderDispatch->pCore->Device->pfnPciGetPropertiesExt = loader::zeDevicePciGetPropertiesExt; + loader::loaderDispatch->pCore->Device->pfnGetRootDevice = loader::zeDeviceGetRootDevice; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for DeviceExp table +__zedlllocal void ZE_APICALL +zeGetDeviceExpProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pCore->DeviceExp->pfnGetFabricVertexExp = loader::zeDeviceGetFabricVertexExp; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for Context table +__zedlllocal void ZE_APICALL +zeGetContextProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pCore->Context->pfnCreate = loader::zeContextCreate; + loader::loaderDispatch->pCore->Context->pfnDestroy = loader::zeContextDestroy; + loader::loaderDispatch->pCore->Context->pfnGetStatus = loader::zeContextGetStatus; + loader::loaderDispatch->pCore->Context->pfnSystemBarrier = loader::zeContextSystemBarrier; + loader::loaderDispatch->pCore->Context->pfnMakeMemoryResident = loader::zeContextMakeMemoryResident; + loader::loaderDispatch->pCore->Context->pfnEvictMemory = loader::zeContextEvictMemory; + loader::loaderDispatch->pCore->Context->pfnMakeImageResident = loader::zeContextMakeImageResident; + loader::loaderDispatch->pCore->Context->pfnEvictImage = loader::zeContextEvictImage; + loader::loaderDispatch->pCore->Context->pfnCreateEx = loader::zeContextCreateEx; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for CommandQueue table +__zedlllocal void ZE_APICALL +zeGetCommandQueueProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pCore->CommandQueue->pfnCreate = loader::zeCommandQueueCreate; + 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->pfnGetOrdinal = loader::zeCommandQueueGetOrdinal; + loader::loaderDispatch->pCore->CommandQueue->pfnGetIndex = loader::zeCommandQueueGetIndex; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for CommandList table +__zedlllocal void ZE_APICALL +zeGetCommandListProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pCore->CommandList->pfnCreate = loader::zeCommandListCreate; + loader::loaderDispatch->pCore->CommandList->pfnCreateImmediate = loader::zeCommandListCreateImmediate; + loader::loaderDispatch->pCore->CommandList->pfnDestroy = loader::zeCommandListDestroy; + loader::loaderDispatch->pCore->CommandList->pfnClose = loader::zeCommandListClose; + loader::loaderDispatch->pCore->CommandList->pfnReset = loader::zeCommandListReset; + loader::loaderDispatch->pCore->CommandList->pfnAppendWriteGlobalTimestamp = loader::zeCommandListAppendWriteGlobalTimestamp; + loader::loaderDispatch->pCore->CommandList->pfnAppendBarrier = loader::zeCommandListAppendBarrier; + loader::loaderDispatch->pCore->CommandList->pfnAppendMemoryRangesBarrier = loader::zeCommandListAppendMemoryRangesBarrier; + loader::loaderDispatch->pCore->CommandList->pfnAppendMemoryCopy = loader::zeCommandListAppendMemoryCopy; + loader::loaderDispatch->pCore->CommandList->pfnAppendMemoryFill = loader::zeCommandListAppendMemoryFill; + loader::loaderDispatch->pCore->CommandList->pfnAppendMemoryCopyRegion = loader::zeCommandListAppendMemoryCopyRegion; + loader::loaderDispatch->pCore->CommandList->pfnAppendMemoryCopyFromContext = loader::zeCommandListAppendMemoryCopyFromContext; + loader::loaderDispatch->pCore->CommandList->pfnAppendImageCopy = loader::zeCommandListAppendImageCopy; + loader::loaderDispatch->pCore->CommandList->pfnAppendImageCopyRegion = loader::zeCommandListAppendImageCopyRegion; + loader::loaderDispatch->pCore->CommandList->pfnAppendImageCopyToMemory = loader::zeCommandListAppendImageCopyToMemory; + loader::loaderDispatch->pCore->CommandList->pfnAppendImageCopyFromMemory = loader::zeCommandListAppendImageCopyFromMemory; + loader::loaderDispatch->pCore->CommandList->pfnAppendMemoryPrefetch = loader::zeCommandListAppendMemoryPrefetch; + loader::loaderDispatch->pCore->CommandList->pfnAppendMemAdvise = loader::zeCommandListAppendMemAdvise; + loader::loaderDispatch->pCore->CommandList->pfnAppendSignalEvent = loader::zeCommandListAppendSignalEvent; + loader::loaderDispatch->pCore->CommandList->pfnAppendWaitOnEvents = loader::zeCommandListAppendWaitOnEvents; + loader::loaderDispatch->pCore->CommandList->pfnAppendEventReset = loader::zeCommandListAppendEventReset; + loader::loaderDispatch->pCore->CommandList->pfnAppendQueryKernelTimestamps = loader::zeCommandListAppendQueryKernelTimestamps; + loader::loaderDispatch->pCore->CommandList->pfnAppendLaunchKernel = loader::zeCommandListAppendLaunchKernel; + loader::loaderDispatch->pCore->CommandList->pfnAppendLaunchCooperativeKernel = loader::zeCommandListAppendLaunchCooperativeKernel; + loader::loaderDispatch->pCore->CommandList->pfnAppendLaunchKernelIndirect = loader::zeCommandListAppendLaunchKernelIndirect; + loader::loaderDispatch->pCore->CommandList->pfnAppendLaunchMultipleKernelsIndirect = loader::zeCommandListAppendLaunchMultipleKernelsIndirect; + loader::loaderDispatch->pCore->CommandList->pfnAppendSignalExternalSemaphoreExt = loader::zeCommandListAppendSignalExternalSemaphoreExt; + loader::loaderDispatch->pCore->CommandList->pfnAppendWaitExternalSemaphoreExt = loader::zeCommandListAppendWaitExternalSemaphoreExt; + loader::loaderDispatch->pCore->CommandList->pfnAppendImageCopyToMemoryExt = loader::zeCommandListAppendImageCopyToMemoryExt; + loader::loaderDispatch->pCore->CommandList->pfnAppendImageCopyFromMemoryExt = loader::zeCommandListAppendImageCopyFromMemoryExt; + loader::loaderDispatch->pCore->CommandList->pfnHostSynchronize = loader::zeCommandListHostSynchronize; + loader::loaderDispatch->pCore->CommandList->pfnGetDeviceHandle = loader::zeCommandListGetDeviceHandle; + loader::loaderDispatch->pCore->CommandList->pfnGetContextHandle = loader::zeCommandListGetContextHandle; + loader::loaderDispatch->pCore->CommandList->pfnGetOrdinal = loader::zeCommandListGetOrdinal; + loader::loaderDispatch->pCore->CommandList->pfnImmediateGetIndex = loader::zeCommandListImmediateGetIndex; + loader::loaderDispatch->pCore->CommandList->pfnIsImmediate = loader::zeCommandListIsImmediate; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for CommandListExp table +__zedlllocal void ZE_APICALL +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->pfnCreateCloneExp = loader::zeCommandListCreateCloneExp; + loader::loaderDispatch->pCore->CommandListExp->pfnImmediateAppendCommandListsExp = loader::zeCommandListImmediateAppendCommandListsExp; + loader::loaderDispatch->pCore->CommandListExp->pfnGetNextCommandIdExp = loader::zeCommandListGetNextCommandIdExp; + loader::loaderDispatch->pCore->CommandListExp->pfnUpdateMutableCommandsExp = loader::zeCommandListUpdateMutableCommandsExp; + loader::loaderDispatch->pCore->CommandListExp->pfnUpdateMutableCommandSignalEventExp = loader::zeCommandListUpdateMutableCommandSignalEventExp; + loader::loaderDispatch->pCore->CommandListExp->pfnUpdateMutableCommandWaitEventsExp = loader::zeCommandListUpdateMutableCommandWaitEventsExp; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for Event table +__zedlllocal void ZE_APICALL +zeGetEventProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pCore->Event->pfnCreate = loader::zeEventCreate; + loader::loaderDispatch->pCore->Event->pfnDestroy = loader::zeEventDestroy; + loader::loaderDispatch->pCore->Event->pfnHostSignal = loader::zeEventHostSignal; + loader::loaderDispatch->pCore->Event->pfnHostSynchronize = loader::zeEventHostSynchronize; + loader::loaderDispatch->pCore->Event->pfnQueryStatus = loader::zeEventQueryStatus; + loader::loaderDispatch->pCore->Event->pfnHostReset = loader::zeEventHostReset; + loader::loaderDispatch->pCore->Event->pfnQueryKernelTimestamp = loader::zeEventQueryKernelTimestamp; + loader::loaderDispatch->pCore->Event->pfnQueryKernelTimestampsExt = loader::zeEventQueryKernelTimestampsExt; + loader::loaderDispatch->pCore->Event->pfnGetEventPool = loader::zeEventGetEventPool; + loader::loaderDispatch->pCore->Event->pfnGetSignalScope = loader::zeEventGetSignalScope; + loader::loaderDispatch->pCore->Event->pfnGetWaitScope = loader::zeEventGetWaitScope; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for EventExp table +__zedlllocal void ZE_APICALL +zeGetEventExpProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pCore->EventExp->pfnQueryTimestampsExp = loader::zeEventQueryTimestampsExp; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for EventPool table +__zedlllocal void ZE_APICALL +zeGetEventPoolProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pCore->EventPool->pfnCreate = loader::zeEventPoolCreate; + loader::loaderDispatch->pCore->EventPool->pfnDestroy = loader::zeEventPoolDestroy; + loader::loaderDispatch->pCore->EventPool->pfnGetIpcHandle = loader::zeEventPoolGetIpcHandle; + loader::loaderDispatch->pCore->EventPool->pfnOpenIpcHandle = loader::zeEventPoolOpenIpcHandle; + loader::loaderDispatch->pCore->EventPool->pfnCloseIpcHandle = loader::zeEventPoolCloseIpcHandle; + loader::loaderDispatch->pCore->EventPool->pfnPutIpcHandle = loader::zeEventPoolPutIpcHandle; + loader::loaderDispatch->pCore->EventPool->pfnGetContextHandle = loader::zeEventPoolGetContextHandle; + loader::loaderDispatch->pCore->EventPool->pfnGetFlags = loader::zeEventPoolGetFlags; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for Fence table +__zedlllocal void ZE_APICALL +zeGetFenceProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pCore->Fence->pfnCreate = loader::zeFenceCreate; + loader::loaderDispatch->pCore->Fence->pfnDestroy = loader::zeFenceDestroy; + loader::loaderDispatch->pCore->Fence->pfnHostSynchronize = loader::zeFenceHostSynchronize; + loader::loaderDispatch->pCore->Fence->pfnQueryStatus = loader::zeFenceQueryStatus; + loader::loaderDispatch->pCore->Fence->pfnReset = loader::zeFenceReset; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for Image table +__zedlllocal void ZE_APICALL +zeGetImageProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pCore->Image->pfnGetProperties = loader::zeImageGetProperties; + loader::loaderDispatch->pCore->Image->pfnCreate = loader::zeImageCreate; + loader::loaderDispatch->pCore->Image->pfnDestroy = loader::zeImageDestroy; + loader::loaderDispatch->pCore->Image->pfnGetAllocPropertiesExt = loader::zeImageGetAllocPropertiesExt; + loader::loaderDispatch->pCore->Image->pfnViewCreateExt = loader::zeImageViewCreateExt; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for ImageExp table +__zedlllocal void ZE_APICALL +zeGetImageExpProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pCore->ImageExp->pfnGetMemoryPropertiesExp = loader::zeImageGetMemoryPropertiesExp; + loader::loaderDispatch->pCore->ImageExp->pfnViewCreateExp = loader::zeImageViewCreateExp; + loader::loaderDispatch->pCore->ImageExp->pfnGetDeviceOffsetExp = loader::zeImageGetDeviceOffsetExp; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for Kernel table +__zedlllocal void ZE_APICALL +zeGetKernelProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pCore->Kernel->pfnCreate = loader::zeKernelCreate; + loader::loaderDispatch->pCore->Kernel->pfnDestroy = loader::zeKernelDestroy; + loader::loaderDispatch->pCore->Kernel->pfnSetCacheConfig = loader::zeKernelSetCacheConfig; + loader::loaderDispatch->pCore->Kernel->pfnSetGroupSize = loader::zeKernelSetGroupSize; + loader::loaderDispatch->pCore->Kernel->pfnSuggestGroupSize = loader::zeKernelSuggestGroupSize; + loader::loaderDispatch->pCore->Kernel->pfnSuggestMaxCooperativeGroupCount = loader::zeKernelSuggestMaxCooperativeGroupCount; + loader::loaderDispatch->pCore->Kernel->pfnSetArgumentValue = loader::zeKernelSetArgumentValue; + loader::loaderDispatch->pCore->Kernel->pfnSetIndirectAccess = loader::zeKernelSetIndirectAccess; + loader::loaderDispatch->pCore->Kernel->pfnGetIndirectAccess = loader::zeKernelGetIndirectAccess; + loader::loaderDispatch->pCore->Kernel->pfnGetSourceAttributes = loader::zeKernelGetSourceAttributes; + loader::loaderDispatch->pCore->Kernel->pfnGetProperties = loader::zeKernelGetProperties; + loader::loaderDispatch->pCore->Kernel->pfnGetName = loader::zeKernelGetName; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for KernelExp table +__zedlllocal void ZE_APICALL +zeGetKernelExpProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pCore->KernelExp->pfnSetGlobalOffsetExp = loader::zeKernelSetGlobalOffsetExp; + loader::loaderDispatch->pCore->KernelExp->pfnGetBinaryExp = loader::zeKernelGetBinaryExp; + loader::loaderDispatch->pCore->KernelExp->pfnSchedulingHintExp = loader::zeKernelSchedulingHintExp; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for Mem table +__zedlllocal void ZE_APICALL +zeGetMemProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pCore->Mem->pfnAllocShared = loader::zeMemAllocShared; + loader::loaderDispatch->pCore->Mem->pfnAllocDevice = loader::zeMemAllocDevice; + loader::loaderDispatch->pCore->Mem->pfnAllocHost = loader::zeMemAllocHost; + loader::loaderDispatch->pCore->Mem->pfnFree = loader::zeMemFree; + loader::loaderDispatch->pCore->Mem->pfnGetAllocProperties = loader::zeMemGetAllocProperties; + loader::loaderDispatch->pCore->Mem->pfnGetAddressRange = loader::zeMemGetAddressRange; + loader::loaderDispatch->pCore->Mem->pfnGetIpcHandle = loader::zeMemGetIpcHandle; + loader::loaderDispatch->pCore->Mem->pfnOpenIpcHandle = loader::zeMemOpenIpcHandle; + loader::loaderDispatch->pCore->Mem->pfnCloseIpcHandle = loader::zeMemCloseIpcHandle; + loader::loaderDispatch->pCore->Mem->pfnFreeExt = loader::zeMemFreeExt; + loader::loaderDispatch->pCore->Mem->pfnPutIpcHandle = loader::zeMemPutIpcHandle; + loader::loaderDispatch->pCore->Mem->pfnGetPitchFor2dImage = loader::zeMemGetPitchFor2dImage; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for MemExp table +__zedlllocal void ZE_APICALL +zeGetMemExpProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pCore->MemExp->pfnGetIpcHandleFromFileDescriptorExp = loader::zeMemGetIpcHandleFromFileDescriptorExp; + loader::loaderDispatch->pCore->MemExp->pfnGetFileDescriptorFromIpcHandleExp = loader::zeMemGetFileDescriptorFromIpcHandleExp; + loader::loaderDispatch->pCore->MemExp->pfnSetAtomicAccessAttributeExp = loader::zeMemSetAtomicAccessAttributeExp; + loader::loaderDispatch->pCore->MemExp->pfnGetAtomicAccessAttributeExp = loader::zeMemGetAtomicAccessAttributeExp; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for Module table +__zedlllocal void ZE_APICALL +zeGetModuleProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pCore->Module->pfnCreate = loader::zeModuleCreate; + loader::loaderDispatch->pCore->Module->pfnDestroy = loader::zeModuleDestroy; + loader::loaderDispatch->pCore->Module->pfnDynamicLink = loader::zeModuleDynamicLink; + loader::loaderDispatch->pCore->Module->pfnGetNativeBinary = loader::zeModuleGetNativeBinary; + loader::loaderDispatch->pCore->Module->pfnGetGlobalPointer = loader::zeModuleGetGlobalPointer; + loader::loaderDispatch->pCore->Module->pfnGetKernelNames = loader::zeModuleGetKernelNames; + loader::loaderDispatch->pCore->Module->pfnGetProperties = loader::zeModuleGetProperties; + loader::loaderDispatch->pCore->Module->pfnGetFunctionPointer = loader::zeModuleGetFunctionPointer; + loader::loaderDispatch->pCore->Module->pfnInspectLinkageExt = loader::zeModuleInspectLinkageExt; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for ModuleBuildLog table +__zedlllocal void ZE_APICALL +zeGetModuleBuildLogProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pCore->ModuleBuildLog->pfnDestroy = loader::zeModuleBuildLogDestroy; + loader::loaderDispatch->pCore->ModuleBuildLog->pfnGetString = loader::zeModuleBuildLogGetString; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for PhysicalMem table +__zedlllocal void ZE_APICALL +zeGetPhysicalMemProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pCore->PhysicalMem->pfnCreate = loader::zePhysicalMemCreate; + loader::loaderDispatch->pCore->PhysicalMem->pfnDestroy = loader::zePhysicalMemDestroy; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for Sampler table +__zedlllocal void ZE_APICALL +zeGetSamplerProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pCore->Sampler->pfnCreate = loader::zeSamplerCreate; + loader::loaderDispatch->pCore->Sampler->pfnDestroy = loader::zeSamplerDestroy; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for VirtualMem table +__zedlllocal void ZE_APICALL +zeGetVirtualMemProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pCore->VirtualMem->pfnReserve = loader::zeVirtualMemReserve; + loader::loaderDispatch->pCore->VirtualMem->pfnFree = loader::zeVirtualMemFree; + loader::loaderDispatch->pCore->VirtualMem->pfnQueryPageSize = loader::zeVirtualMemQueryPageSize; + loader::loaderDispatch->pCore->VirtualMem->pfnMap = loader::zeVirtualMemMap; + loader::loaderDispatch->pCore->VirtualMem->pfnUnmap = loader::zeVirtualMemUnmap; + loader::loaderDispatch->pCore->VirtualMem->pfnSetAccessAttribute = loader::zeVirtualMemSetAccessAttribute; + loader::loaderDispatch->pCore->VirtualMem->pfnGetAccessAttribute = loader::zeVirtualMemGetAccessAttribute; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for FabricEdgeExp table +__zedlllocal void ZE_APICALL +zeGetFabricEdgeExpProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pCore->FabricEdgeExp->pfnGetExp = loader::zeFabricEdgeGetExp; + loader::loaderDispatch->pCore->FabricEdgeExp->pfnGetVerticesExp = loader::zeFabricEdgeGetVerticesExp; + loader::loaderDispatch->pCore->FabricEdgeExp->pfnGetPropertiesExp = loader::zeFabricEdgeGetPropertiesExp; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for FabricVertexExp table +__zedlllocal void ZE_APICALL +zeGetFabricVertexExpProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pCore->FabricVertexExp->pfnGetExp = loader::zeFabricVertexGetExp; + loader::loaderDispatch->pCore->FabricVertexExp->pfnGetSubVerticesExp = loader::zeFabricVertexGetSubVerticesExp; + loader::loaderDispatch->pCore->FabricVertexExp->pfnGetPropertiesExp = loader::zeFabricVertexGetPropertiesExp; + loader::loaderDispatch->pCore->FabricVertexExp->pfnGetDeviceExp = loader::zeFabricVertexGetDeviceExp; +} + + /////////////////////////////////////////////////////////////////////////////// /// @brief Exported function for filling application's Global table /// with current process' addresses @@ -6935,12 +7421,14 @@ 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; + pDdiTable->pfnInit = loader::zeInit; } if (version >= ZE_API_VERSION_1_10) { - pDdiTable->pfnInitDrivers = loader::zeInitDrivers; + pDdiTable->pfnInitDrivers = loader::zeInitDrivers; } + zeGetGlobalProcAddrTableLegacy(); } else { @@ -7033,21 +7521,43 @@ zeGetRTASBuilderProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pCore->RTASBuilder = new ze_rtas_builder_dditable_t; if (version >= ZE_API_VERSION_1_13) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnCreateExt = loader_driver_ddi::zeRTASBuilderCreateExt; + } else { pDdiTable->pfnCreateExt = loader::zeRTASBuilderCreateExt; } + } if (version >= ZE_API_VERSION_1_13) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetBuildPropertiesExt = loader_driver_ddi::zeRTASBuilderGetBuildPropertiesExt; + } else { pDdiTable->pfnGetBuildPropertiesExt = loader::zeRTASBuilderGetBuildPropertiesExt; } + } if (version >= ZE_API_VERSION_1_13) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnBuildExt = loader_driver_ddi::zeRTASBuilderBuildExt; + } else { pDdiTable->pfnBuildExt = loader::zeRTASBuilderBuildExt; } + } if (version >= ZE_API_VERSION_1_13) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnCommandListAppendCopyExt = loader_driver_ddi::zeRTASBuilderCommandListAppendCopyExt; + } else { pDdiTable->pfnCommandListAppendCopyExt = loader::zeRTASBuilderCommandListAppendCopyExt; } + } if (version >= ZE_API_VERSION_1_13) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnDestroyExt = loader_driver_ddi::zeRTASBuilderDestroyExt; + } else { pDdiTable->pfnDestroyExt = loader::zeRTASBuilderDestroyExt; } + } + zeGetRTASBuilderProcAddrTableLegacy(); } else { @@ -7130,18 +7640,36 @@ zeGetRTASBuilderExpProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pCore->RTASBuilderExp = new ze_rtas_builder_exp_dditable_t; if (version >= ZE_API_VERSION_1_7) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnCreateExp = loader_driver_ddi::zeRTASBuilderCreateExp; + } else { pDdiTable->pfnCreateExp = loader::zeRTASBuilderCreateExp; } + } if (version >= ZE_API_VERSION_1_7) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetBuildPropertiesExp = loader_driver_ddi::zeRTASBuilderGetBuildPropertiesExp; + } else { pDdiTable->pfnGetBuildPropertiesExp = loader::zeRTASBuilderGetBuildPropertiesExp; } + } if (version >= ZE_API_VERSION_1_7) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnBuildExp = loader_driver_ddi::zeRTASBuilderBuildExp; + } else { pDdiTable->pfnBuildExp = loader::zeRTASBuilderBuildExp; } + } if (version >= ZE_API_VERSION_1_7) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnDestroyExp = loader_driver_ddi::zeRTASBuilderDestroyExp; + } else { pDdiTable->pfnDestroyExp = loader::zeRTASBuilderDestroyExp; } + } + zeGetRTASBuilderExpProcAddrTableLegacy(); } else { @@ -7234,18 +7762,36 @@ zeGetRTASParallelOperationProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pCore->RTASParallelOperation = new ze_rtas_parallel_operation_dditable_t; if (version >= ZE_API_VERSION_1_13) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnCreateExt = loader_driver_ddi::zeRTASParallelOperationCreateExt; + } else { pDdiTable->pfnCreateExt = loader::zeRTASParallelOperationCreateExt; } + } if (version >= ZE_API_VERSION_1_13) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetPropertiesExt = loader_driver_ddi::zeRTASParallelOperationGetPropertiesExt; + } else { pDdiTable->pfnGetPropertiesExt = loader::zeRTASParallelOperationGetPropertiesExt; } + } if (version >= ZE_API_VERSION_1_13) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnJoinExt = loader_driver_ddi::zeRTASParallelOperationJoinExt; + } else { pDdiTable->pfnJoinExt = loader::zeRTASParallelOperationJoinExt; } + } if (version >= ZE_API_VERSION_1_13) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnDestroyExt = loader_driver_ddi::zeRTASParallelOperationDestroyExt; + } else { pDdiTable->pfnDestroyExt = loader::zeRTASParallelOperationDestroyExt; } + } + zeGetRTASParallelOperationProcAddrTableLegacy(); } else { @@ -7328,18 +7874,36 @@ zeGetRTASParallelOperationExpProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pCore->RTASParallelOperationExp = new ze_rtas_parallel_operation_exp_dditable_t; if (version >= ZE_API_VERSION_1_7) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnCreateExp = loader_driver_ddi::zeRTASParallelOperationCreateExp; + } else { pDdiTable->pfnCreateExp = loader::zeRTASParallelOperationCreateExp; } + } if (version >= ZE_API_VERSION_1_7) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetPropertiesExp = loader_driver_ddi::zeRTASParallelOperationGetPropertiesExp; + } else { pDdiTable->pfnGetPropertiesExp = loader::zeRTASParallelOperationGetPropertiesExp; } + } if (version >= ZE_API_VERSION_1_7) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnJoinExp = loader_driver_ddi::zeRTASParallelOperationJoinExp; + } else { pDdiTable->pfnJoinExp = loader::zeRTASParallelOperationJoinExp; } + } if (version >= ZE_API_VERSION_1_7) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnDestroyExp = loader_driver_ddi::zeRTASParallelOperationDestroyExp; + } else { pDdiTable->pfnDestroyExp = loader::zeRTASParallelOperationDestroyExp; } + } + zeGetRTASParallelOperationExpProcAddrTableLegacy(); } else { @@ -7432,30 +7996,60 @@ zeGetDriverProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pCore->Driver = new ze_driver_dditable_t; if (version >= ZE_API_VERSION_1_0) { - pDdiTable->pfnGet = loader::zeDriverGet; + pDdiTable->pfnGet = loader::zeDriverGet; } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetApiVersion = loader_driver_ddi::zeDriverGetApiVersion; + } else { pDdiTable->pfnGetApiVersion = loader::zeDriverGetApiVersion; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetProperties = loader_driver_ddi::zeDriverGetProperties; + } else { pDdiTable->pfnGetProperties = loader::zeDriverGetProperties; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetIpcProperties = loader_driver_ddi::zeDriverGetIpcProperties; + } else { pDdiTable->pfnGetIpcProperties = loader::zeDriverGetIpcProperties; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetExtensionProperties = loader_driver_ddi::zeDriverGetExtensionProperties; + } else { pDdiTable->pfnGetExtensionProperties = loader::zeDriverGetExtensionProperties; } + } if (version >= ZE_API_VERSION_1_1) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetExtensionFunctionAddress = loader_driver_ddi::zeDriverGetExtensionFunctionAddress; + } else { pDdiTable->pfnGetExtensionFunctionAddress = loader::zeDriverGetExtensionFunctionAddress; } + } if (version >= ZE_API_VERSION_1_13) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnRTASFormatCompatibilityCheckExt = loader_driver_ddi::zeDriverRTASFormatCompatibilityCheckExt; + } else { pDdiTable->pfnRTASFormatCompatibilityCheckExt = loader::zeDriverRTASFormatCompatibilityCheckExt; } + } if (version >= ZE_API_VERSION_1_6) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetLastErrorDescription = loader_driver_ddi::zeDriverGetLastErrorDescription; + } else { pDdiTable->pfnGetLastErrorDescription = loader::zeDriverGetLastErrorDescription; } + } + zeGetDriverProcAddrTableLegacy(); } else { @@ -7538,9 +8132,15 @@ zeGetDriverExpProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pCore->DriverExp = new ze_driver_exp_dditable_t; if (version >= ZE_API_VERSION_1_7) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnRTASFormatCompatibilityCheckExp = loader_driver_ddi::zeDriverRTASFormatCompatibilityCheckExp; + } else { pDdiTable->pfnRTASFormatCompatibilityCheckExp = loader::zeDriverRTASFormatCompatibilityCheckExp; } + } + zeGetDriverExpProcAddrTableLegacy(); } else { @@ -7633,72 +8233,162 @@ zeGetDeviceProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pCore->Device = new ze_device_dditable_t; if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGet = loader_driver_ddi::zeDeviceGet; + } else { pDdiTable->pfnGet = loader::zeDeviceGet; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetSubDevices = loader_driver_ddi::zeDeviceGetSubDevices; + } else { pDdiTable->pfnGetSubDevices = loader::zeDeviceGetSubDevices; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetProperties = loader_driver_ddi::zeDeviceGetProperties; + } else { pDdiTable->pfnGetProperties = loader::zeDeviceGetProperties; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetComputeProperties = loader_driver_ddi::zeDeviceGetComputeProperties; + } else { pDdiTable->pfnGetComputeProperties = loader::zeDeviceGetComputeProperties; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetModuleProperties = loader_driver_ddi::zeDeviceGetModuleProperties; + } else { pDdiTable->pfnGetModuleProperties = loader::zeDeviceGetModuleProperties; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetCommandQueueGroupProperties = loader_driver_ddi::zeDeviceGetCommandQueueGroupProperties; + } else { pDdiTable->pfnGetCommandQueueGroupProperties = loader::zeDeviceGetCommandQueueGroupProperties; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetMemoryProperties = loader_driver_ddi::zeDeviceGetMemoryProperties; + } else { pDdiTable->pfnGetMemoryProperties = loader::zeDeviceGetMemoryProperties; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetMemoryAccessProperties = loader_driver_ddi::zeDeviceGetMemoryAccessProperties; + } else { pDdiTable->pfnGetMemoryAccessProperties = loader::zeDeviceGetMemoryAccessProperties; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetCacheProperties = loader_driver_ddi::zeDeviceGetCacheProperties; + } else { pDdiTable->pfnGetCacheProperties = loader::zeDeviceGetCacheProperties; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetImageProperties = loader_driver_ddi::zeDeviceGetImageProperties; + } else { pDdiTable->pfnGetImageProperties = loader::zeDeviceGetImageProperties; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetExternalMemoryProperties = loader_driver_ddi::zeDeviceGetExternalMemoryProperties; + } else { pDdiTable->pfnGetExternalMemoryProperties = loader::zeDeviceGetExternalMemoryProperties; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetP2PProperties = loader_driver_ddi::zeDeviceGetP2PProperties; + } else { pDdiTable->pfnGetP2PProperties = loader::zeDeviceGetP2PProperties; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnCanAccessPeer = loader_driver_ddi::zeDeviceCanAccessPeer; + } else { pDdiTable->pfnCanAccessPeer = loader::zeDeviceCanAccessPeer; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetStatus = loader_driver_ddi::zeDeviceGetStatus; + } else { pDdiTable->pfnGetStatus = loader::zeDeviceGetStatus; } + } if (version >= ZE_API_VERSION_1_1) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetGlobalTimestamps = loader_driver_ddi::zeDeviceGetGlobalTimestamps; + } else { pDdiTable->pfnGetGlobalTimestamps = loader::zeDeviceGetGlobalTimestamps; } + } if (version >= ZE_API_VERSION_1_12) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnImportExternalSemaphoreExt = loader_driver_ddi::zeDeviceImportExternalSemaphoreExt; + } else { pDdiTable->pfnImportExternalSemaphoreExt = loader::zeDeviceImportExternalSemaphoreExt; } + } if (version >= ZE_API_VERSION_1_12) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnReleaseExternalSemaphoreExt = loader_driver_ddi::zeDeviceReleaseExternalSemaphoreExt; + } else { pDdiTable->pfnReleaseExternalSemaphoreExt = loader::zeDeviceReleaseExternalSemaphoreExt; } + } if (version >= ZE_API_VERSION_1_13) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetVectorWidthPropertiesExt = loader_driver_ddi::zeDeviceGetVectorWidthPropertiesExt; + } else { pDdiTable->pfnGetVectorWidthPropertiesExt = loader::zeDeviceGetVectorWidthPropertiesExt; } + } if (version >= ZE_API_VERSION_1_2) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnReserveCacheExt = loader_driver_ddi::zeDeviceReserveCacheExt; + } else { pDdiTable->pfnReserveCacheExt = loader::zeDeviceReserveCacheExt; } + } if (version >= ZE_API_VERSION_1_2) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnSetCacheAdviceExt = loader_driver_ddi::zeDeviceSetCacheAdviceExt; + } else { pDdiTable->pfnSetCacheAdviceExt = loader::zeDeviceSetCacheAdviceExt; } + } if (version >= ZE_API_VERSION_1_3) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnPciGetPropertiesExt = loader_driver_ddi::zeDevicePciGetPropertiesExt; + } else { pDdiTable->pfnPciGetPropertiesExt = loader::zeDevicePciGetPropertiesExt; } + } if (version >= ZE_API_VERSION_1_7) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetRootDevice = loader_driver_ddi::zeDeviceGetRootDevice; + } else { pDdiTable->pfnGetRootDevice = loader::zeDeviceGetRootDevice; } + } + zeGetDeviceProcAddrTableLegacy(); } else { @@ -7781,9 +8471,15 @@ zeGetDeviceExpProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pCore->DeviceExp = new ze_device_exp_dditable_t; if (version >= ZE_API_VERSION_1_4) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetFabricVertexExp = loader_driver_ddi::zeDeviceGetFabricVertexExp; + } else { pDdiTable->pfnGetFabricVertexExp = loader::zeDeviceGetFabricVertexExp; } + } + zeGetDeviceExpProcAddrTableLegacy(); } else { @@ -7876,33 +8572,71 @@ zeGetContextProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pCore->Context = new ze_context_dditable_t; if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnCreate = loader_driver_ddi::zeContextCreate; + } else { pDdiTable->pfnCreate = loader::zeContextCreate; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnDestroy = loader_driver_ddi::zeContextDestroy; + } else { pDdiTable->pfnDestroy = loader::zeContextDestroy; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetStatus = loader_driver_ddi::zeContextGetStatus; + } else { pDdiTable->pfnGetStatus = loader::zeContextGetStatus; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnSystemBarrier = loader_driver_ddi::zeContextSystemBarrier; + } else { pDdiTable->pfnSystemBarrier = loader::zeContextSystemBarrier; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnMakeMemoryResident = loader_driver_ddi::zeContextMakeMemoryResident; + } else { pDdiTable->pfnMakeMemoryResident = loader::zeContextMakeMemoryResident; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnEvictMemory = loader_driver_ddi::zeContextEvictMemory; + } else { pDdiTable->pfnEvictMemory = loader::zeContextEvictMemory; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnMakeImageResident = loader_driver_ddi::zeContextMakeImageResident; + } else { pDdiTable->pfnMakeImageResident = loader::zeContextMakeImageResident; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnEvictImage = loader_driver_ddi::zeContextEvictImage; + } else { pDdiTable->pfnEvictImage = loader::zeContextEvictImage; } + } if (version >= ZE_API_VERSION_1_1) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnCreateEx = loader_driver_ddi::zeContextCreateEx; + } else { pDdiTable->pfnCreateEx = loader::zeContextCreateEx; } + } + zeGetContextProcAddrTableLegacy(); } else { @@ -7995,24 +8729,50 @@ zeGetCommandQueueProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pCore->CommandQueue = new ze_command_queue_dditable_t; if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnCreate = loader_driver_ddi::zeCommandQueueCreate; + } else { pDdiTable->pfnCreate = loader::zeCommandQueueCreate; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnDestroy = loader_driver_ddi::zeCommandQueueDestroy; + } else { pDdiTable->pfnDestroy = loader::zeCommandQueueDestroy; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnExecuteCommandLists = loader_driver_ddi::zeCommandQueueExecuteCommandLists; + } else { pDdiTable->pfnExecuteCommandLists = loader::zeCommandQueueExecuteCommandLists; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnSynchronize = loader_driver_ddi::zeCommandQueueSynchronize; + } else { pDdiTable->pfnSynchronize = loader::zeCommandQueueSynchronize; } + } if (version >= ZE_API_VERSION_1_9) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetOrdinal = loader_driver_ddi::zeCommandQueueGetOrdinal; + } else { pDdiTable->pfnGetOrdinal = loader::zeCommandQueueGetOrdinal; } + } if (version >= ZE_API_VERSION_1_9) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetIndex = loader_driver_ddi::zeCommandQueueGetIndex; + } else { pDdiTable->pfnGetIndex = loader::zeCommandQueueGetIndex; } + } + zeGetCommandQueueProcAddrTableLegacy(); } else { @@ -8105,114 +8865,260 @@ zeGetCommandListProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pCore->CommandList = new ze_command_list_dditable_t; if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnCreate = loader_driver_ddi::zeCommandListCreate; + } else { pDdiTable->pfnCreate = loader::zeCommandListCreate; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnCreateImmediate = loader_driver_ddi::zeCommandListCreateImmediate; + } else { pDdiTable->pfnCreateImmediate = loader::zeCommandListCreateImmediate; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnDestroy = loader_driver_ddi::zeCommandListDestroy; + } else { pDdiTable->pfnDestroy = loader::zeCommandListDestroy; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnClose = loader_driver_ddi::zeCommandListClose; + } else { pDdiTable->pfnClose = loader::zeCommandListClose; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnReset = loader_driver_ddi::zeCommandListReset; + } else { pDdiTable->pfnReset = loader::zeCommandListReset; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnAppendWriteGlobalTimestamp = loader_driver_ddi::zeCommandListAppendWriteGlobalTimestamp; + } else { pDdiTable->pfnAppendWriteGlobalTimestamp = loader::zeCommandListAppendWriteGlobalTimestamp; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnAppendBarrier = loader_driver_ddi::zeCommandListAppendBarrier; + } else { pDdiTable->pfnAppendBarrier = loader::zeCommandListAppendBarrier; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnAppendMemoryRangesBarrier = loader_driver_ddi::zeCommandListAppendMemoryRangesBarrier; + } else { pDdiTable->pfnAppendMemoryRangesBarrier = loader::zeCommandListAppendMemoryRangesBarrier; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnAppendMemoryCopy = loader_driver_ddi::zeCommandListAppendMemoryCopy; + } else { pDdiTable->pfnAppendMemoryCopy = loader::zeCommandListAppendMemoryCopy; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnAppendMemoryFill = loader_driver_ddi::zeCommandListAppendMemoryFill; + } else { pDdiTable->pfnAppendMemoryFill = loader::zeCommandListAppendMemoryFill; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnAppendMemoryCopyRegion = loader_driver_ddi::zeCommandListAppendMemoryCopyRegion; + } else { pDdiTable->pfnAppendMemoryCopyRegion = loader::zeCommandListAppendMemoryCopyRegion; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnAppendMemoryCopyFromContext = loader_driver_ddi::zeCommandListAppendMemoryCopyFromContext; + } else { pDdiTable->pfnAppendMemoryCopyFromContext = loader::zeCommandListAppendMemoryCopyFromContext; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnAppendImageCopy = loader_driver_ddi::zeCommandListAppendImageCopy; + } else { pDdiTable->pfnAppendImageCopy = loader::zeCommandListAppendImageCopy; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnAppendImageCopyRegion = loader_driver_ddi::zeCommandListAppendImageCopyRegion; + } else { pDdiTable->pfnAppendImageCopyRegion = loader::zeCommandListAppendImageCopyRegion; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnAppendImageCopyToMemory = loader_driver_ddi::zeCommandListAppendImageCopyToMemory; + } else { pDdiTable->pfnAppendImageCopyToMemory = loader::zeCommandListAppendImageCopyToMemory; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnAppendImageCopyFromMemory = loader_driver_ddi::zeCommandListAppendImageCopyFromMemory; + } else { pDdiTable->pfnAppendImageCopyFromMemory = loader::zeCommandListAppendImageCopyFromMemory; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnAppendMemoryPrefetch = loader_driver_ddi::zeCommandListAppendMemoryPrefetch; + } else { pDdiTable->pfnAppendMemoryPrefetch = loader::zeCommandListAppendMemoryPrefetch; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnAppendMemAdvise = loader_driver_ddi::zeCommandListAppendMemAdvise; + } else { pDdiTable->pfnAppendMemAdvise = loader::zeCommandListAppendMemAdvise; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnAppendSignalEvent = loader_driver_ddi::zeCommandListAppendSignalEvent; + } else { pDdiTable->pfnAppendSignalEvent = loader::zeCommandListAppendSignalEvent; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnAppendWaitOnEvents = loader_driver_ddi::zeCommandListAppendWaitOnEvents; + } else { pDdiTable->pfnAppendWaitOnEvents = loader::zeCommandListAppendWaitOnEvents; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnAppendEventReset = loader_driver_ddi::zeCommandListAppendEventReset; + } else { pDdiTable->pfnAppendEventReset = loader::zeCommandListAppendEventReset; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnAppendQueryKernelTimestamps = loader_driver_ddi::zeCommandListAppendQueryKernelTimestamps; + } else { pDdiTable->pfnAppendQueryKernelTimestamps = loader::zeCommandListAppendQueryKernelTimestamps; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnAppendLaunchKernel = loader_driver_ddi::zeCommandListAppendLaunchKernel; + } else { pDdiTable->pfnAppendLaunchKernel = loader::zeCommandListAppendLaunchKernel; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnAppendLaunchCooperativeKernel = loader_driver_ddi::zeCommandListAppendLaunchCooperativeKernel; + } else { pDdiTable->pfnAppendLaunchCooperativeKernel = loader::zeCommandListAppendLaunchCooperativeKernel; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnAppendLaunchKernelIndirect = loader_driver_ddi::zeCommandListAppendLaunchKernelIndirect; + } else { pDdiTable->pfnAppendLaunchKernelIndirect = loader::zeCommandListAppendLaunchKernelIndirect; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnAppendLaunchMultipleKernelsIndirect = loader_driver_ddi::zeCommandListAppendLaunchMultipleKernelsIndirect; + } else { pDdiTable->pfnAppendLaunchMultipleKernelsIndirect = loader::zeCommandListAppendLaunchMultipleKernelsIndirect; } + } if (version >= ZE_API_VERSION_1_12) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnAppendSignalExternalSemaphoreExt = loader_driver_ddi::zeCommandListAppendSignalExternalSemaphoreExt; + } else { pDdiTable->pfnAppendSignalExternalSemaphoreExt = loader::zeCommandListAppendSignalExternalSemaphoreExt; } + } if (version >= ZE_API_VERSION_1_12) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnAppendWaitExternalSemaphoreExt = loader_driver_ddi::zeCommandListAppendWaitExternalSemaphoreExt; + } else { pDdiTable->pfnAppendWaitExternalSemaphoreExt = loader::zeCommandListAppendWaitExternalSemaphoreExt; } + } if (version >= ZE_API_VERSION_1_3) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnAppendImageCopyToMemoryExt = loader_driver_ddi::zeCommandListAppendImageCopyToMemoryExt; + } else { pDdiTable->pfnAppendImageCopyToMemoryExt = loader::zeCommandListAppendImageCopyToMemoryExt; } + } if (version >= ZE_API_VERSION_1_3) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnAppendImageCopyFromMemoryExt = loader_driver_ddi::zeCommandListAppendImageCopyFromMemoryExt; + } else { pDdiTable->pfnAppendImageCopyFromMemoryExt = loader::zeCommandListAppendImageCopyFromMemoryExt; } + } if (version >= ZE_API_VERSION_1_6) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnHostSynchronize = loader_driver_ddi::zeCommandListHostSynchronize; + } else { pDdiTable->pfnHostSynchronize = loader::zeCommandListHostSynchronize; } + } if (version >= ZE_API_VERSION_1_9) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetDeviceHandle = loader_driver_ddi::zeCommandListGetDeviceHandle; + } else { pDdiTable->pfnGetDeviceHandle = loader::zeCommandListGetDeviceHandle; } + } if (version >= ZE_API_VERSION_1_9) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetContextHandle = loader_driver_ddi::zeCommandListGetContextHandle; + } else { pDdiTable->pfnGetContextHandle = loader::zeCommandListGetContextHandle; } + } if (version >= ZE_API_VERSION_1_9) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetOrdinal = loader_driver_ddi::zeCommandListGetOrdinal; + } else { pDdiTable->pfnGetOrdinal = loader::zeCommandListGetOrdinal; } + } if (version >= ZE_API_VERSION_1_9) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnImmediateGetIndex = loader_driver_ddi::zeCommandListImmediateGetIndex; + } else { pDdiTable->pfnImmediateGetIndex = loader::zeCommandListImmediateGetIndex; } + } if (version >= ZE_API_VERSION_1_9) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnIsImmediate = loader_driver_ddi::zeCommandListIsImmediate; + } else { pDdiTable->pfnIsImmediate = loader::zeCommandListIsImmediate; } + } + zeGetCommandListProcAddrTableLegacy(); } else { @@ -8295,30 +9201,64 @@ zeGetCommandListExpProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pCore->CommandListExp = new ze_command_list_exp_dditable_t; if (version >= ZE_API_VERSION_1_10) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetNextCommandIdWithKernelsExp = loader_driver_ddi::zeCommandListGetNextCommandIdWithKernelsExp; + } else { pDdiTable->pfnGetNextCommandIdWithKernelsExp = loader::zeCommandListGetNextCommandIdWithKernelsExp; } + } if (version >= ZE_API_VERSION_1_10) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnUpdateMutableCommandKernelsExp = loader_driver_ddi::zeCommandListUpdateMutableCommandKernelsExp; + } else { pDdiTable->pfnUpdateMutableCommandKernelsExp = loader::zeCommandListUpdateMutableCommandKernelsExp; } + } if (version >= ZE_API_VERSION_1_9) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnCreateCloneExp = loader_driver_ddi::zeCommandListCreateCloneExp; + } else { pDdiTable->pfnCreateCloneExp = loader::zeCommandListCreateCloneExp; } + } if (version >= ZE_API_VERSION_1_9) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnImmediateAppendCommandListsExp = loader_driver_ddi::zeCommandListImmediateAppendCommandListsExp; + } else { pDdiTable->pfnImmediateAppendCommandListsExp = loader::zeCommandListImmediateAppendCommandListsExp; } + } if (version >= ZE_API_VERSION_1_9) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetNextCommandIdExp = loader_driver_ddi::zeCommandListGetNextCommandIdExp; + } else { pDdiTable->pfnGetNextCommandIdExp = loader::zeCommandListGetNextCommandIdExp; } + } if (version >= ZE_API_VERSION_1_9) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnUpdateMutableCommandsExp = loader_driver_ddi::zeCommandListUpdateMutableCommandsExp; + } else { pDdiTable->pfnUpdateMutableCommandsExp = loader::zeCommandListUpdateMutableCommandsExp; } + } if (version >= ZE_API_VERSION_1_9) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnUpdateMutableCommandSignalEventExp = loader_driver_ddi::zeCommandListUpdateMutableCommandSignalEventExp; + } else { pDdiTable->pfnUpdateMutableCommandSignalEventExp = loader::zeCommandListUpdateMutableCommandSignalEventExp; } + } if (version >= ZE_API_VERSION_1_9) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnUpdateMutableCommandWaitEventsExp = loader_driver_ddi::zeCommandListUpdateMutableCommandWaitEventsExp; + } else { pDdiTable->pfnUpdateMutableCommandWaitEventsExp = loader::zeCommandListUpdateMutableCommandWaitEventsExp; } + } + zeGetCommandListExpProcAddrTableLegacy(); } else { @@ -8411,39 +9351,85 @@ zeGetEventProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pCore->Event = new ze_event_dditable_t; if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnCreate = loader_driver_ddi::zeEventCreate; + } else { pDdiTable->pfnCreate = loader::zeEventCreate; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnDestroy = loader_driver_ddi::zeEventDestroy; + } else { pDdiTable->pfnDestroy = loader::zeEventDestroy; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnHostSignal = loader_driver_ddi::zeEventHostSignal; + } else { pDdiTable->pfnHostSignal = loader::zeEventHostSignal; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnHostSynchronize = loader_driver_ddi::zeEventHostSynchronize; + } else { pDdiTable->pfnHostSynchronize = loader::zeEventHostSynchronize; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnQueryStatus = loader_driver_ddi::zeEventQueryStatus; + } else { pDdiTable->pfnQueryStatus = loader::zeEventQueryStatus; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnHostReset = loader_driver_ddi::zeEventHostReset; + } else { pDdiTable->pfnHostReset = loader::zeEventHostReset; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnQueryKernelTimestamp = loader_driver_ddi::zeEventQueryKernelTimestamp; + } else { pDdiTable->pfnQueryKernelTimestamp = loader::zeEventQueryKernelTimestamp; } + } if (version >= ZE_API_VERSION_1_6) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnQueryKernelTimestampsExt = loader_driver_ddi::zeEventQueryKernelTimestampsExt; + } else { pDdiTable->pfnQueryKernelTimestampsExt = loader::zeEventQueryKernelTimestampsExt; } + } if (version >= ZE_API_VERSION_1_9) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetEventPool = loader_driver_ddi::zeEventGetEventPool; + } else { pDdiTable->pfnGetEventPool = loader::zeEventGetEventPool; } + } if (version >= ZE_API_VERSION_1_9) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetSignalScope = loader_driver_ddi::zeEventGetSignalScope; + } else { pDdiTable->pfnGetSignalScope = loader::zeEventGetSignalScope; } + } if (version >= ZE_API_VERSION_1_9) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetWaitScope = loader_driver_ddi::zeEventGetWaitScope; + } else { pDdiTable->pfnGetWaitScope = loader::zeEventGetWaitScope; } + } + zeGetEventProcAddrTableLegacy(); } else { @@ -8526,9 +9512,15 @@ zeGetEventExpProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pCore->EventExp = new ze_event_exp_dditable_t; if (version >= ZE_API_VERSION_1_2) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnQueryTimestampsExp = loader_driver_ddi::zeEventQueryTimestampsExp; + } else { pDdiTable->pfnQueryTimestampsExp = loader::zeEventQueryTimestampsExp; } + } + zeGetEventExpProcAddrTableLegacy(); } else { @@ -8621,30 +9613,64 @@ zeGetEventPoolProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pCore->EventPool = new ze_event_pool_dditable_t; if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnCreate = loader_driver_ddi::zeEventPoolCreate; + } else { pDdiTable->pfnCreate = loader::zeEventPoolCreate; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnDestroy = loader_driver_ddi::zeEventPoolDestroy; + } else { pDdiTable->pfnDestroy = loader::zeEventPoolDestroy; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetIpcHandle = loader_driver_ddi::zeEventPoolGetIpcHandle; + } else { pDdiTable->pfnGetIpcHandle = loader::zeEventPoolGetIpcHandle; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnOpenIpcHandle = loader_driver_ddi::zeEventPoolOpenIpcHandle; + } else { pDdiTable->pfnOpenIpcHandle = loader::zeEventPoolOpenIpcHandle; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnCloseIpcHandle = loader_driver_ddi::zeEventPoolCloseIpcHandle; + } else { pDdiTable->pfnCloseIpcHandle = loader::zeEventPoolCloseIpcHandle; } + } if (version >= ZE_API_VERSION_1_6) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnPutIpcHandle = loader_driver_ddi::zeEventPoolPutIpcHandle; + } else { pDdiTable->pfnPutIpcHandle = loader::zeEventPoolPutIpcHandle; } + } if (version >= ZE_API_VERSION_1_9) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetContextHandle = loader_driver_ddi::zeEventPoolGetContextHandle; + } else { pDdiTable->pfnGetContextHandle = loader::zeEventPoolGetContextHandle; } + } if (version >= ZE_API_VERSION_1_9) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetFlags = loader_driver_ddi::zeEventPoolGetFlags; + } else { pDdiTable->pfnGetFlags = loader::zeEventPoolGetFlags; } + } + zeGetEventPoolProcAddrTableLegacy(); } else { @@ -8737,21 +9763,43 @@ zeGetFenceProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pCore->Fence = new ze_fence_dditable_t; if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnCreate = loader_driver_ddi::zeFenceCreate; + } else { pDdiTable->pfnCreate = loader::zeFenceCreate; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnDestroy = loader_driver_ddi::zeFenceDestroy; + } else { pDdiTable->pfnDestroy = loader::zeFenceDestroy; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnHostSynchronize = loader_driver_ddi::zeFenceHostSynchronize; + } else { pDdiTable->pfnHostSynchronize = loader::zeFenceHostSynchronize; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnQueryStatus = loader_driver_ddi::zeFenceQueryStatus; + } else { pDdiTable->pfnQueryStatus = loader::zeFenceQueryStatus; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnReset = loader_driver_ddi::zeFenceReset; + } else { pDdiTable->pfnReset = loader::zeFenceReset; } + } + zeGetFenceProcAddrTableLegacy(); } else { @@ -8844,21 +9892,43 @@ zeGetImageProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pCore->Image = new ze_image_dditable_t; if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetProperties = loader_driver_ddi::zeImageGetProperties; + } else { pDdiTable->pfnGetProperties = loader::zeImageGetProperties; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnCreate = loader_driver_ddi::zeImageCreate; + } else { pDdiTable->pfnCreate = loader::zeImageCreate; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnDestroy = loader_driver_ddi::zeImageDestroy; + } else { pDdiTable->pfnDestroy = loader::zeImageDestroy; } + } if (version >= ZE_API_VERSION_1_3) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetAllocPropertiesExt = loader_driver_ddi::zeImageGetAllocPropertiesExt; + } else { pDdiTable->pfnGetAllocPropertiesExt = loader::zeImageGetAllocPropertiesExt; } + } if (version >= ZE_API_VERSION_1_5) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnViewCreateExt = loader_driver_ddi::zeImageViewCreateExt; + } else { pDdiTable->pfnViewCreateExt = loader::zeImageViewCreateExt; } + } + zeGetImageProcAddrTableLegacy(); } else { @@ -8941,15 +10011,29 @@ zeGetImageExpProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pCore->ImageExp = new ze_image_exp_dditable_t; if (version >= ZE_API_VERSION_1_2) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetMemoryPropertiesExp = loader_driver_ddi::zeImageGetMemoryPropertiesExp; + } else { pDdiTable->pfnGetMemoryPropertiesExp = loader::zeImageGetMemoryPropertiesExp; } + } if (version >= ZE_API_VERSION_1_2) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnViewCreateExp = loader_driver_ddi::zeImageViewCreateExp; + } else { pDdiTable->pfnViewCreateExp = loader::zeImageViewCreateExp; } + } if (version >= ZE_API_VERSION_1_9) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetDeviceOffsetExp = loader_driver_ddi::zeImageGetDeviceOffsetExp; + } else { pDdiTable->pfnGetDeviceOffsetExp = loader::zeImageGetDeviceOffsetExp; } + } + zeGetImageExpProcAddrTableLegacy(); } else { @@ -9042,42 +10126,92 @@ zeGetKernelProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pCore->Kernel = new ze_kernel_dditable_t; if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnCreate = loader_driver_ddi::zeKernelCreate; + } else { pDdiTable->pfnCreate = loader::zeKernelCreate; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnDestroy = loader_driver_ddi::zeKernelDestroy; + } else { pDdiTable->pfnDestroy = loader::zeKernelDestroy; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnSetCacheConfig = loader_driver_ddi::zeKernelSetCacheConfig; + } else { pDdiTable->pfnSetCacheConfig = loader::zeKernelSetCacheConfig; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnSetGroupSize = loader_driver_ddi::zeKernelSetGroupSize; + } else { pDdiTable->pfnSetGroupSize = loader::zeKernelSetGroupSize; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnSuggestGroupSize = loader_driver_ddi::zeKernelSuggestGroupSize; + } else { pDdiTable->pfnSuggestGroupSize = loader::zeKernelSuggestGroupSize; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnSuggestMaxCooperativeGroupCount = loader_driver_ddi::zeKernelSuggestMaxCooperativeGroupCount; + } else { pDdiTable->pfnSuggestMaxCooperativeGroupCount = loader::zeKernelSuggestMaxCooperativeGroupCount; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnSetArgumentValue = loader_driver_ddi::zeKernelSetArgumentValue; + } else { pDdiTable->pfnSetArgumentValue = loader::zeKernelSetArgumentValue; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnSetIndirectAccess = loader_driver_ddi::zeKernelSetIndirectAccess; + } else { pDdiTable->pfnSetIndirectAccess = loader::zeKernelSetIndirectAccess; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetIndirectAccess = loader_driver_ddi::zeKernelGetIndirectAccess; + } else { pDdiTable->pfnGetIndirectAccess = loader::zeKernelGetIndirectAccess; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetSourceAttributes = loader_driver_ddi::zeKernelGetSourceAttributes; + } else { pDdiTable->pfnGetSourceAttributes = loader::zeKernelGetSourceAttributes; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetProperties = loader_driver_ddi::zeKernelGetProperties; + } else { pDdiTable->pfnGetProperties = loader::zeKernelGetProperties; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetName = loader_driver_ddi::zeKernelGetName; + } else { pDdiTable->pfnGetName = loader::zeKernelGetName; } + } + zeGetKernelProcAddrTableLegacy(); } else { @@ -9160,15 +10294,29 @@ zeGetKernelExpProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pCore->KernelExp = new ze_kernel_exp_dditable_t; if (version >= ZE_API_VERSION_1_1) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnSetGlobalOffsetExp = loader_driver_ddi::zeKernelSetGlobalOffsetExp; + } else { pDdiTable->pfnSetGlobalOffsetExp = loader::zeKernelSetGlobalOffsetExp; } + } if (version >= ZE_API_VERSION_1_11) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetBinaryExp = loader_driver_ddi::zeKernelGetBinaryExp; + } else { pDdiTable->pfnGetBinaryExp = loader::zeKernelGetBinaryExp; } + } if (version >= ZE_API_VERSION_1_2) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnSchedulingHintExp = loader_driver_ddi::zeKernelSchedulingHintExp; + } else { pDdiTable->pfnSchedulingHintExp = loader::zeKernelSchedulingHintExp; } + } + zeGetKernelExpProcAddrTableLegacy(); } else { @@ -9261,42 +10409,92 @@ zeGetMemProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pCore->Mem = new ze_mem_dditable_t; if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnAllocShared = loader_driver_ddi::zeMemAllocShared; + } else { pDdiTable->pfnAllocShared = loader::zeMemAllocShared; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnAllocDevice = loader_driver_ddi::zeMemAllocDevice; + } else { pDdiTable->pfnAllocDevice = loader::zeMemAllocDevice; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnAllocHost = loader_driver_ddi::zeMemAllocHost; + } else { pDdiTable->pfnAllocHost = loader::zeMemAllocHost; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnFree = loader_driver_ddi::zeMemFree; + } else { pDdiTable->pfnFree = loader::zeMemFree; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetAllocProperties = loader_driver_ddi::zeMemGetAllocProperties; + } else { pDdiTable->pfnGetAllocProperties = loader::zeMemGetAllocProperties; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetAddressRange = loader_driver_ddi::zeMemGetAddressRange; + } else { pDdiTable->pfnGetAddressRange = loader::zeMemGetAddressRange; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetIpcHandle = loader_driver_ddi::zeMemGetIpcHandle; + } else { pDdiTable->pfnGetIpcHandle = loader::zeMemGetIpcHandle; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnOpenIpcHandle = loader_driver_ddi::zeMemOpenIpcHandle; + } else { pDdiTable->pfnOpenIpcHandle = loader::zeMemOpenIpcHandle; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnCloseIpcHandle = loader_driver_ddi::zeMemCloseIpcHandle; + } else { pDdiTable->pfnCloseIpcHandle = loader::zeMemCloseIpcHandle; } + } if (version >= ZE_API_VERSION_1_3) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnFreeExt = loader_driver_ddi::zeMemFreeExt; + } else { pDdiTable->pfnFreeExt = loader::zeMemFreeExt; } + } if (version >= ZE_API_VERSION_1_6) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnPutIpcHandle = loader_driver_ddi::zeMemPutIpcHandle; + } else { pDdiTable->pfnPutIpcHandle = loader::zeMemPutIpcHandle; } + } if (version >= ZE_API_VERSION_1_9) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetPitchFor2dImage = loader_driver_ddi::zeMemGetPitchFor2dImage; + } else { pDdiTable->pfnGetPitchFor2dImage = loader::zeMemGetPitchFor2dImage; } + } + zeGetMemProcAddrTableLegacy(); } else { @@ -9379,18 +10577,36 @@ zeGetMemExpProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pCore->MemExp = new ze_mem_exp_dditable_t; if (version >= ZE_API_VERSION_1_6) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetIpcHandleFromFileDescriptorExp = loader_driver_ddi::zeMemGetIpcHandleFromFileDescriptorExp; + } else { pDdiTable->pfnGetIpcHandleFromFileDescriptorExp = loader::zeMemGetIpcHandleFromFileDescriptorExp; } + } if (version >= ZE_API_VERSION_1_6) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetFileDescriptorFromIpcHandleExp = loader_driver_ddi::zeMemGetFileDescriptorFromIpcHandleExp; + } else { pDdiTable->pfnGetFileDescriptorFromIpcHandleExp = loader::zeMemGetFileDescriptorFromIpcHandleExp; } + } if (version >= ZE_API_VERSION_1_7) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnSetAtomicAccessAttributeExp = loader_driver_ddi::zeMemSetAtomicAccessAttributeExp; + } else { pDdiTable->pfnSetAtomicAccessAttributeExp = loader::zeMemSetAtomicAccessAttributeExp; } + } if (version >= ZE_API_VERSION_1_7) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetAtomicAccessAttributeExp = loader_driver_ddi::zeMemGetAtomicAccessAttributeExp; + } else { pDdiTable->pfnGetAtomicAccessAttributeExp = loader::zeMemGetAtomicAccessAttributeExp; } + } + zeGetMemExpProcAddrTableLegacy(); } else { @@ -9483,33 +10699,71 @@ zeGetModuleProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pCore->Module = new ze_module_dditable_t; if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnCreate = loader_driver_ddi::zeModuleCreate; + } else { pDdiTable->pfnCreate = loader::zeModuleCreate; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnDestroy = loader_driver_ddi::zeModuleDestroy; + } else { pDdiTable->pfnDestroy = loader::zeModuleDestroy; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnDynamicLink = loader_driver_ddi::zeModuleDynamicLink; + } else { pDdiTable->pfnDynamicLink = loader::zeModuleDynamicLink; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetNativeBinary = loader_driver_ddi::zeModuleGetNativeBinary; + } else { pDdiTable->pfnGetNativeBinary = loader::zeModuleGetNativeBinary; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetGlobalPointer = loader_driver_ddi::zeModuleGetGlobalPointer; + } else { pDdiTable->pfnGetGlobalPointer = loader::zeModuleGetGlobalPointer; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetKernelNames = loader_driver_ddi::zeModuleGetKernelNames; + } else { pDdiTable->pfnGetKernelNames = loader::zeModuleGetKernelNames; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetProperties = loader_driver_ddi::zeModuleGetProperties; + } else { pDdiTable->pfnGetProperties = loader::zeModuleGetProperties; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetFunctionPointer = loader_driver_ddi::zeModuleGetFunctionPointer; + } else { pDdiTable->pfnGetFunctionPointer = loader::zeModuleGetFunctionPointer; } + } if (version >= ZE_API_VERSION_1_3) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnInspectLinkageExt = loader_driver_ddi::zeModuleInspectLinkageExt; + } else { pDdiTable->pfnInspectLinkageExt = loader::zeModuleInspectLinkageExt; } + } + zeGetModuleProcAddrTableLegacy(); } else { @@ -9602,12 +10856,22 @@ zeGetModuleBuildLogProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pCore->ModuleBuildLog = new ze_module_build_log_dditable_t; if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnDestroy = loader_driver_ddi::zeModuleBuildLogDestroy; + } else { pDdiTable->pfnDestroy = loader::zeModuleBuildLogDestroy; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetString = loader_driver_ddi::zeModuleBuildLogGetString; + } else { pDdiTable->pfnGetString = loader::zeModuleBuildLogGetString; } + } + zeGetModuleBuildLogProcAddrTableLegacy(); } else { @@ -9700,12 +10964,22 @@ zeGetPhysicalMemProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pCore->PhysicalMem = new ze_physical_mem_dditable_t; if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnCreate = loader_driver_ddi::zePhysicalMemCreate; + } else { pDdiTable->pfnCreate = loader::zePhysicalMemCreate; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnDestroy = loader_driver_ddi::zePhysicalMemDestroy; + } else { pDdiTable->pfnDestroy = loader::zePhysicalMemDestroy; } + } + zeGetPhysicalMemProcAddrTableLegacy(); } else { @@ -9798,12 +11072,22 @@ zeGetSamplerProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pCore->Sampler = new ze_sampler_dditable_t; if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnCreate = loader_driver_ddi::zeSamplerCreate; + } else { pDdiTable->pfnCreate = loader::zeSamplerCreate; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnDestroy = loader_driver_ddi::zeSamplerDestroy; + } else { pDdiTable->pfnDestroy = loader::zeSamplerDestroy; } + } + zeGetSamplerProcAddrTableLegacy(); } else { @@ -9896,27 +11180,57 @@ zeGetVirtualMemProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pCore->VirtualMem = new ze_virtual_mem_dditable_t; if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnReserve = loader_driver_ddi::zeVirtualMemReserve; + } else { pDdiTable->pfnReserve = loader::zeVirtualMemReserve; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnFree = loader_driver_ddi::zeVirtualMemFree; + } else { pDdiTable->pfnFree = loader::zeVirtualMemFree; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnQueryPageSize = loader_driver_ddi::zeVirtualMemQueryPageSize; + } else { pDdiTable->pfnQueryPageSize = loader::zeVirtualMemQueryPageSize; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnMap = loader_driver_ddi::zeVirtualMemMap; + } else { pDdiTable->pfnMap = loader::zeVirtualMemMap; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnUnmap = loader_driver_ddi::zeVirtualMemUnmap; + } else { pDdiTable->pfnUnmap = loader::zeVirtualMemUnmap; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnSetAccessAttribute = loader_driver_ddi::zeVirtualMemSetAccessAttribute; + } else { pDdiTable->pfnSetAccessAttribute = loader::zeVirtualMemSetAccessAttribute; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetAccessAttribute = loader_driver_ddi::zeVirtualMemGetAccessAttribute; + } else { pDdiTable->pfnGetAccessAttribute = loader::zeVirtualMemGetAccessAttribute; } + } + zeGetVirtualMemProcAddrTableLegacy(); } else { @@ -9999,15 +11313,29 @@ zeGetFabricEdgeExpProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pCore->FabricEdgeExp = new ze_fabric_edge_exp_dditable_t; if (version >= ZE_API_VERSION_1_4) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetExp = loader_driver_ddi::zeFabricEdgeGetExp; + } else { pDdiTable->pfnGetExp = loader::zeFabricEdgeGetExp; } + } if (version >= ZE_API_VERSION_1_4) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetVerticesExp = loader_driver_ddi::zeFabricEdgeGetVerticesExp; + } else { pDdiTable->pfnGetVerticesExp = loader::zeFabricEdgeGetVerticesExp; } + } if (version >= ZE_API_VERSION_1_4) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetPropertiesExp = loader_driver_ddi::zeFabricEdgeGetPropertiesExp; + } else { pDdiTable->pfnGetPropertiesExp = loader::zeFabricEdgeGetPropertiesExp; } + } + zeGetFabricEdgeExpProcAddrTableLegacy(); } else { @@ -10090,18 +11418,36 @@ zeGetFabricVertexExpProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pCore->FabricVertexExp = new ze_fabric_vertex_exp_dditable_t; if (version >= ZE_API_VERSION_1_4) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetExp = loader_driver_ddi::zeFabricVertexGetExp; + } else { pDdiTable->pfnGetExp = loader::zeFabricVertexGetExp; } + } if (version >= ZE_API_VERSION_1_4) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetSubVerticesExp = loader_driver_ddi::zeFabricVertexGetSubVerticesExp; + } else { pDdiTable->pfnGetSubVerticesExp = loader::zeFabricVertexGetSubVerticesExp; } + } if (version >= ZE_API_VERSION_1_4) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetPropertiesExp = loader_driver_ddi::zeFabricVertexGetPropertiesExp; + } else { pDdiTable->pfnGetPropertiesExp = loader::zeFabricVertexGetPropertiesExp; } + } if (version >= ZE_API_VERSION_1_4) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetDeviceExp = loader_driver_ddi::zeFabricVertexGetDeviceExp; + } else { pDdiTable->pfnGetDeviceExp = loader::zeFabricVertexGetDeviceExp; } + } + zeGetFabricVertexExpProcAddrTableLegacy(); } else { @@ -10142,4 +11488,4 @@ zeGetFabricVertexExpProcAddrTable( #if defined(__cplusplus) }; -#endif +#endif \ No newline at end of file diff --git a/source/loader/ze_ldrddi.h b/source/loader/ze_ldrddi.h index 609bb853..5f6d89e3 100644 --- a/source/loader/ze_ldrddi.h +++ b/source/loader/ze_ldrddi.h @@ -1,6 +1,6 @@ /* * - * Copyright (C) 2019-2024 Intel Corporation + * Copyright (C) 2019-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -76,3 +76,1599 @@ namespace loader 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 >; } + +namespace loader_driver_ddi +{ + __zedlllocal void ZE_APICALL + zeDestroyDDiDriverTables(ze_dditable_driver_t* pDdiTable); + __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 + ); + __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 + ); + __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 + ); + __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. + ); + __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 + ); + __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. + ); + __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. + ); + __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. + ); + __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. + ); + __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 + ); + __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 + ); + __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 + ); + __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 command queue group properties. + ///< if count is zero, then the driver shall update the value with the + ///< total number of command queue group properties available. + ///< if count is greater than the number of command queue group properties + ///< available, then the driver shall update the value with the correct + ///< number of command queue group properties available. + 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 group properties + ///< available, then driver shall only retrieve that number of command + ///< queue group properties. + ); + __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. + ); + __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 + ); + __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. + ); + __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 + ); + __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 + ); + __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 + ); + __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 + ); + __zedlllocal ze_result_t ZE_APICALL + zeDeviceGetStatus( + ze_device_handle_t hDevice ///< [in] handle of the device + ); + __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. + ); + __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 + ); + __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 + ); + __zedlllocal ze_result_t ZE_APICALL + zeContextDestroy( + ze_context_handle_t hContext ///< [in][release] handle of context object to destroy + ); + __zedlllocal ze_result_t ZE_APICALL + zeContextGetStatus( + ze_context_handle_t hContext ///< [in] handle of context object + ); + __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 + ); + __zedlllocal ze_result_t ZE_APICALL + zeCommandQueueDestroy( + ze_command_queue_handle_t hCommandQueue ///< [in][release] handle of command queue object to destroy + ); + __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 + ); + __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. + ); + __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 + ); + __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 + ); + __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 + ); + __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 + ); + __zedlllocal ze_result_t ZE_APICALL + zeCommandListDestroy( + ze_command_list_handle_t hCommandList ///< [in][release] handle of command list object to destroy + ); + __zedlllocal ze_result_t ZE_APICALL + zeCommandListClose( + ze_command_list_handle_t hCommandList ///< [in] handle of command list object to close + ); + __zedlllocal ze_result_t ZE_APICALL + zeCommandListReset( + ze_command_list_handle_t hCommandList ///< [in] handle of command list object to reset + ); + __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. + 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 + ); + __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. + ); + __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 + ); + __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 + ); + __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 + ); + __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 + ); + __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) + ); + __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 + ); + __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 + ); + __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 + ); + __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 + ); + __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 + ); + __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 + ); + __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 + ); + __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 + ); + __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 + ); + __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 + ); + __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 + ); + __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 + ); + __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 + ); + __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 + ); + __zedlllocal ze_result_t ZE_APICALL + zeEventPoolDestroy( + ze_event_pool_handle_t hEventPool ///< [in][release] handle of event pool object to destroy + ); + __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 + ); + __zedlllocal ze_result_t ZE_APICALL + zeEventDestroy( + ze_event_handle_t hEvent ///< [in][release] handle of event object to destroy + ); + __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 + ); + __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 + ); + __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 + ); + __zedlllocal ze_result_t ZE_APICALL + zeEventPoolCloseIpcHandle( + ze_event_pool_handle_t hEventPool ///< [in][release] handle of event pool object + ); + __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 + ); + __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 + ); + __zedlllocal ze_result_t ZE_APICALL + zeEventHostSignal( + ze_event_handle_t hEvent ///< [in] handle of the event + ); + __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. + ); + __zedlllocal ze_result_t ZE_APICALL + zeEventQueryStatus( + ze_event_handle_t hEvent ///< [in] handle of the event + ); + __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 + ); + __zedlllocal ze_result_t ZE_APICALL + zeEventHostReset( + ze_event_handle_t hEvent ///< [in] handle of the event + ); + __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. + ); + __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 + ); + __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 + ); + __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. + ); + __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. + ); + __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 + ); + __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 + ); + __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 + ); + __zedlllocal ze_result_t ZE_APICALL + zeFenceDestroy( + ze_fence_handle_t hFence ///< [in][release] handle of fence object to destroy + ); + __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. + ); + __zedlllocal ze_result_t ZE_APICALL + zeFenceQueryStatus( + ze_fence_handle_t hFence ///< [in] handle of the fence + ); + __zedlllocal ze_result_t ZE_APICALL + zeFenceReset( + ze_fence_handle_t hFence ///< [in] handle of the fence + ); + __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 + ); + __zedlllocal 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 + ); + __zedlllocal ze_result_t ZE_APICALL + zeImageDestroy( + ze_image_handle_t hImage ///< [in][release] handle of image object to destroy + ); + __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 + ); + __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 + ); + __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 + ); + __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 + ); + __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 + ); + __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 + ); + __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 + ); + __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 + ); + __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 + ); + __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 + ); + __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 + ); + __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 + ); + __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. + ); + __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 + ); + __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. + ); + __zedlllocal ze_result_t ZE_APICALL + zeModuleDestroy( + ze_module_handle_t hModule ///< [in][release] handle of the module + ); + __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. + ); + __zedlllocal ze_result_t ZE_APICALL + zeModuleBuildLogDestroy( + ze_module_build_log_handle_t hModuleBuildLog ///< [in][release] handle of the module build log object. + ); + __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. + ); + __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 + ); + __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 + ); + __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. + ); + __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. + ); + __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 + ); + __zedlllocal ze_result_t ZE_APICALL + zeKernelDestroy( + ze_kernel_handle_t hKernel ///< [in][release] handle of the kernel object + ); + __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. + ); + __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 + ); + __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 + ); + __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. + ); + __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. + ); + __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 + ); + __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. + ); + __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. + ); + __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. + ); + __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. + ); + __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. + ); + __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 + ); + __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 + ); + __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 + ); + __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 + ); + __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 + ); + __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 + ); + __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 + ); + __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 + ); + __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 + ); + __zedlllocal ze_result_t ZE_APICALL + zeSamplerDestroy( + ze_sampler_handle_t hSampler ///< [in][release] handle of the sampler + ); + __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. + ); + __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. + ); + __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. + ); + __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 + ); + __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 + ); + __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. + ); + __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. + ); + __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. + ); + __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. + ); + __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 + ); + __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 vector of external semaphore handles + ///< to be appended into command list. + ze_external_semaphore_signal_params_ext_t* signalParams,///< [in] 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 vector of external semaphore handles + ///< to append into command list. + ze_external_semaphore_wait_params_ext_t* waitParams,///< [in] 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 + 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. + ); + __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. + ); + __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 + ); + __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. + ); + __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 + ); + __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 + ); + __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 + ); + __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 + ); + __zedlllocal ze_result_t ZE_APICALL + zeRTASBuilderDestroyExp( + ze_rtas_builder_exp_handle_t hBuilder ///< [in][release] handle of builder object to destroy + ); + __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 + ); + __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 + ); + __zedlllocal ze_result_t ZE_APICALL + zeRTASParallelOperationJoinExp( + ze_rtas_parallel_operation_exp_handle_t hParallelOperation ///< [in] handle of parallel operation object + ); + __zedlllocal ze_result_t ZE_APICALL + zeRTASParallelOperationDestroyExp( + ze_rtas_parallel_operation_exp_handle_t hParallelOperation ///< [in][release] handle of parallel operation object to destroy + ); + __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 + ); + __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 + ); + __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 + ); + __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) + ); + __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 + ); + __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 + ); + __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 + ); + __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 + ); + __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 + ); + __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 + ); +} + +#if defined(__cplusplus) +extern "C" { +#endif + +__zedlllocal void ZE_APICALL +zeGetGlobalProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zeGetRTASBuilderProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zeGetRTASBuilderExpProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zeGetRTASParallelOperationProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zeGetRTASParallelOperationExpProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zeGetDriverProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zeGetDriverExpProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zeGetDeviceProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zeGetDeviceExpProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zeGetContextProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zeGetCommandQueueProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zeGetCommandListProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zeGetCommandListExpProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zeGetEventProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zeGetEventExpProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zeGetEventPoolProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zeGetFenceProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zeGetImageProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zeGetImageExpProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zeGetKernelProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zeGetKernelExpProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zeGetMemProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zeGetMemExpProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zeGetModuleProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zeGetModuleBuildLogProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zeGetPhysicalMemProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zeGetSamplerProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zeGetVirtualMemProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zeGetFabricEdgeExpProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zeGetFabricVertexExpProcAddrTableLegacy(); + +#if defined(__cplusplus) +}; +#endif diff --git a/source/loader/ze_ldrddi_driver_ddi.cpp b/source/loader/ze_ldrddi_driver_ddi.cpp new file mode 100644 index 00000000..452ab5b6 --- /dev/null +++ b/source/loader/ze_ldrddi_driver_ddi.cpp @@ -0,0 +1,5775 @@ +/* + * + * Copyright (C) 2019-2025 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + * @file ze_ldrddi_driver_ddi.cpp + * + */ +#include "ze_loader_internal.h" + +namespace loader_driver_ddi +{ + /////////////////////////////////////////////////////////////////////////////// + /// @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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetApiVersion = dditable->Driver->pfnGetApiVersion; + if( nullptr == pfnGetApiVersion ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetApiVersion( hDriver, version ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetProperties = dditable->Driver->pfnGetProperties; + if( nullptr == pfnGetProperties ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetProperties( hDriver, pDriverProperties ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetIpcProperties = dditable->Driver->pfnGetIpcProperties; + if( nullptr == pfnGetIpcProperties ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetIpcProperties( hDriver, pIpcProperties ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @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. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetExtensionProperties = dditable->Driver->pfnGetExtensionProperties; + if( nullptr == pfnGetExtensionProperties ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetExtensionProperties( hDriver, pCount, pExtensionProperties ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_1) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetExtensionFunctionAddress = dditable->Driver->pfnGetExtensionFunctionAddress; + if( nullptr == pfnGetExtensionFunctionAddress ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetExtensionFunctionAddress( hDriver, name, ppFunctionAddress ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @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. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_6) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetLastErrorDescription = dditable->Driver->pfnGetLastErrorDescription; + if( nullptr == pfnGetLastErrorDescription ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetLastErrorDescription( hDriver, ppString ); + return 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. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGet = dditable->Device->pfnGet; + if( nullptr == pfnGet ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGet( hDriver, pCount, phDevices ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @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. + ) + { + 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_7) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetRootDevice = dditable->Device->pfnGetRootDevice; + if( nullptr == pfnGetRootDevice ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetRootDevice( hDevice, phRootDevice ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @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. + ) + { + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetSubDevices = dditable->Device->pfnGetSubDevices; + if( nullptr == pfnGetSubDevices ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetSubDevices( hDevice, pCount, phSubdevices ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @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 + ) + { + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetProperties = dditable->Device->pfnGetProperties; + if( nullptr == pfnGetProperties ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetProperties( hDevice, pDeviceProperties ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @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 + ) + { + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetComputeProperties = dditable->Device->pfnGetComputeProperties; + if( nullptr == pfnGetComputeProperties ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetComputeProperties( hDevice, pComputeProperties ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @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 + ) + { + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetModuleProperties = dditable->Device->pfnGetModuleProperties; + if( nullptr == pfnGetModuleProperties ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetModuleProperties( hDevice, pModuleProperties ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @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 command queue group properties. + ///< if count is zero, then the driver shall update the value with the + ///< total number of command queue group properties available. + ///< if count is greater than the number of command queue group properties + ///< available, then the driver shall update the value with the correct + ///< number of command queue group properties available. + 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 group properties + ///< available, then driver shall only retrieve that number of command + ///< queue group properties. + ) + { + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetCommandQueueGroupProperties = dditable->Device->pfnGetCommandQueueGroupProperties; + if( nullptr == pfnGetCommandQueueGroupProperties ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetCommandQueueGroupProperties( hDevice, pCount, pCommandQueueGroupProperties ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @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. + ) + { + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetMemoryProperties = dditable->Device->pfnGetMemoryProperties; + if( nullptr == pfnGetMemoryProperties ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetMemoryProperties( hDevice, pCount, pMemProperties ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @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 + ) + { + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetMemoryAccessProperties = dditable->Device->pfnGetMemoryAccessProperties; + if( nullptr == pfnGetMemoryAccessProperties ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetMemoryAccessProperties( hDevice, pMemAccessProperties ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @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. + ) + { + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetCacheProperties = dditable->Device->pfnGetCacheProperties; + if( nullptr == pfnGetCacheProperties ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetCacheProperties( hDevice, pCount, pCacheProperties ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @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 + ) + { + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetImageProperties = dditable->Device->pfnGetImageProperties; + if( nullptr == pfnGetImageProperties ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetImageProperties( hDevice, pImageProperties ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @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 + ) + { + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetExternalMemoryProperties = dditable->Device->pfnGetExternalMemoryProperties; + if( nullptr == pfnGetExternalMemoryProperties ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetExternalMemoryProperties( hDevice, pExternalMemoryProperties ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeDeviceGetP2PProperties + __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 + ) + { + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetP2PProperties = dditable->Device->pfnGetP2PProperties; + if( nullptr == pfnGetP2PProperties ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetP2PProperties( hDevice, hPeerDevice, pP2PProperties ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @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 + ) + { + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnCanAccessPeer = dditable->Device->pfnCanAccessPeer; + if( nullptr == pfnCanAccessPeer ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnCanAccessPeer( hDevice, hPeerDevice, value ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeDeviceGetStatus + __zedlllocal ze_result_t ZE_APICALL + zeDeviceGetStatus( + ze_device_handle_t hDevice ///< [in] handle of the device + ) + { + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetStatus = dditable->Device->pfnGetStatus; + if( nullptr == pfnGetStatus ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetStatus( hDevice ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @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 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. + ) + { + 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_1) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetGlobalTimestamps = dditable->Device->pfnGetGlobalTimestamps; + if( nullptr == pfnGetGlobalTimestamps ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetGlobalTimestamps( hDevice, hostTimestamp, deviceTimestamp ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeContextCreate + __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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnCreate = dditable->Context->pfnCreate; + if( nullptr == pfnCreate ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnCreate( hDriver, desc, phContext ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeContextCreateEx + __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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_1) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnCreateEx = dditable->Context->pfnCreateEx; + if( nullptr == pfnCreateEx ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnCreateEx( hDriver, desc, numDevices, phDevices, phContext ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnDestroy = dditable->Context->pfnDestroy; + if( nullptr == pfnDestroy ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnDestroy( hContext ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeContextGetStatus + __zedlllocal ze_result_t ZE_APICALL + zeContextGetStatus( + ze_context_handle_t hContext ///< [in] handle of context object + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetStatus = dditable->Context->pfnGetStatus; + if( nullptr == pfnGetStatus ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetStatus( hContext ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandQueueCreate + __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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnCreate = dditable->CommandQueue->pfnCreate; + if( nullptr == pfnCreate ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnCreate( hContext, hDevice, desc, phCommandQueue ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandQueueDestroy + __zedlllocal ze_result_t ZE_APICALL + zeCommandQueueDestroy( + ze_command_queue_handle_t hCommandQueue ///< [in][release] handle of command queue object to destroy + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hCommandQueue )->pCore; + if (dditable->isValidFlag == 0) + return ZE_RESULT_ERROR_UNINITIALIZED; + // Check that api version in the driver is supported by this version of the API + if (dditable->version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnDestroy = dditable->CommandQueue->pfnDestroy; + if( nullptr == pfnDestroy ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnDestroy( hCommandQueue ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandQueueExecuteCommandLists + __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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hCommandQueue )->pCore; + if (dditable->isValidFlag == 0) + return ZE_RESULT_ERROR_UNINITIALIZED; + // Check that api version in the driver is supported by this version of the API + if (dditable->version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnExecuteCommandLists = dditable->CommandQueue->pfnExecuteCommandLists; + if( nullptr == pfnExecuteCommandLists ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnExecuteCommandLists( hCommandQueue, numCommandLists, phCommandLists, hFence ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @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. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hCommandQueue )->pCore; + if (dditable->isValidFlag == 0) + return ZE_RESULT_ERROR_UNINITIALIZED; + // Check that api version in the driver is supported by this version of the API + if (dditable->version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnSynchronize = dditable->CommandQueue->pfnSynchronize; + if( nullptr == pfnSynchronize ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnSynchronize( hCommandQueue, timeout ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandQueueGetOrdinal + __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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hCommandQueue )->pCore; + if (dditable->isValidFlag == 0) + return ZE_RESULT_ERROR_UNINITIALIZED; + // Check that api version in the driver is supported by this version of the API + if (dditable->version < ZE_API_VERSION_1_9) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetOrdinal = dditable->CommandQueue->pfnGetOrdinal; + if( nullptr == pfnGetOrdinal ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetOrdinal( hCommandQueue, pOrdinal ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandQueueGetIndex + __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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hCommandQueue )->pCore; + if (dditable->isValidFlag == 0) + return ZE_RESULT_ERROR_UNINITIALIZED; + // Check that api version in the driver is supported by this version of the API + if (dditable->version < ZE_API_VERSION_1_9) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetIndex = dditable->CommandQueue->pfnGetIndex; + if( nullptr == pfnGetIndex ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetIndex( hCommandQueue, pIndex ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListCreate + __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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnCreate = dditable->CommandList->pfnCreate; + if( nullptr == pfnCreate ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnCreate( hContext, hDevice, desc, phCommandList ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListCreateImmediate + __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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnCreateImmediate = dditable->CommandList->pfnCreateImmediate; + if( nullptr == pfnCreateImmediate ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnCreateImmediate( hContext, hDevice, altdesc, phCommandList ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListDestroy + __zedlllocal ze_result_t ZE_APICALL + zeCommandListDestroy( + ze_command_list_handle_t hCommandList ///< [in][release] handle of command list object to destroy + ) + { + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnDestroy = dditable->CommandList->pfnDestroy; + if( nullptr == pfnDestroy ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnDestroy( hCommandList ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListClose + __zedlllocal ze_result_t ZE_APICALL + zeCommandListClose( + ze_command_list_handle_t hCommandList ///< [in] handle of command list object to close + ) + { + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnClose = dditable->CommandList->pfnClose; + if( nullptr == pfnClose ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnClose( hCommandList ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListReset + __zedlllocal ze_result_t ZE_APICALL + zeCommandListReset( + ze_command_list_handle_t hCommandList ///< [in] handle of command list object to reset + ) + { + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnReset = dditable->CommandList->pfnReset; + if( nullptr == pfnReset ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnReset( hCommandList ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListAppendWriteGlobalTimestamp + __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. + 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 + ) + { + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnAppendWriteGlobalTimestamp = dditable->CommandList->pfnAppendWriteGlobalTimestamp; + if( nullptr == pfnAppendWriteGlobalTimestamp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnAppendWriteGlobalTimestamp( hCommandList, dstptr, hSignalEvent, numWaitEvents, phWaitEvents ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListHostSynchronize + __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. + ) + { + 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_6) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnHostSynchronize = dditable->CommandList->pfnHostSynchronize; + if( nullptr == pfnHostSynchronize ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnHostSynchronize( hCommandList, timeout ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListGetDeviceHandle + __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 + ) + { + 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_9) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetDeviceHandle = dditable->CommandList->pfnGetDeviceHandle; + if( nullptr == pfnGetDeviceHandle ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetDeviceHandle( hCommandList, phDevice ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListGetContextHandle + __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 + ) + { + 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_9) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetContextHandle = dditable->CommandList->pfnGetContextHandle; + if( nullptr == pfnGetContextHandle ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetContextHandle( hCommandList, phContext ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListGetOrdinal + __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 + ) + { + 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_9) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetOrdinal = dditable->CommandList->pfnGetOrdinal; + if( nullptr == pfnGetOrdinal ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetOrdinal( hCommandList, pOrdinal ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListImmediateGetIndex + __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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_9) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnImmediateGetIndex = dditable->CommandList->pfnImmediateGetIndex; + if( nullptr == pfnImmediateGetIndex ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnImmediateGetIndex( hCommandListImmediate, pIndex ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListIsImmediate + __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) + ) + { + 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_9) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnIsImmediate = dditable->CommandList->pfnIsImmediate; + if( nullptr == pfnIsImmediate ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnIsImmediate( hCommandList, pIsImmediate ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListAppendBarrier + __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 + ) + { + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnAppendBarrier = dditable->CommandList->pfnAppendBarrier; + if( nullptr == pfnAppendBarrier ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnAppendBarrier( hCommandList, hSignalEvent, numWaitEvents, phWaitEvents ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListAppendMemoryRangesBarrier + __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 + ) + { + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnAppendMemoryRangesBarrier = dditable->CommandList->pfnAppendMemoryRangesBarrier; + if( nullptr == pfnAppendMemoryRangesBarrier ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnAppendMemoryRangesBarrier( hCommandList, numRanges, pRangeSizes, pRanges, hSignalEvent, numWaitEvents, phWaitEvents ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnSystemBarrier = dditable->Context->pfnSystemBarrier; + if( nullptr == pfnSystemBarrier ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnSystemBarrier( hContext, hDevice ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListAppendMemoryCopy + __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 + ) + { + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnAppendMemoryCopy = dditable->CommandList->pfnAppendMemoryCopy; + if( nullptr == pfnAppendMemoryCopy ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnAppendMemoryCopy( hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListAppendMemoryFill + __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 + ) + { + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnAppendMemoryFill = dditable->CommandList->pfnAppendMemoryFill; + if( nullptr == pfnAppendMemoryFill ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnAppendMemoryFill( hCommandList, ptr, pattern, pattern_size, size, hSignalEvent, numWaitEvents, phWaitEvents ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListAppendMemoryCopyRegion + __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 + ) + { + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnAppendMemoryCopyRegion = dditable->CommandList->pfnAppendMemoryCopyRegion; + if( nullptr == pfnAppendMemoryCopyRegion ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnAppendMemoryCopyRegion( hCommandList, dstptr, dstRegion, dstPitch, dstSlicePitch, srcptr, srcRegion, srcPitch, srcSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListAppendMemoryCopyFromContext + __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 + ) + { + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnAppendMemoryCopyFromContext = dditable->CommandList->pfnAppendMemoryCopyFromContext; + if( nullptr == pfnAppendMemoryCopyFromContext ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnAppendMemoryCopyFromContext( hCommandList, dstptr, hContextSrc, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListAppendImageCopy + __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 + ) + { + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnAppendImageCopy = dditable->CommandList->pfnAppendImageCopy; + if( nullptr == pfnAppendImageCopy ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnAppendImageCopy( hCommandList, hDstImage, hSrcImage, hSignalEvent, numWaitEvents, phWaitEvents ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListAppendImageCopyRegion + __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 + ) + { + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnAppendImageCopyRegion = dditable->CommandList->pfnAppendImageCopyRegion; + if( nullptr == pfnAppendImageCopyRegion ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnAppendImageCopyRegion( hCommandList, hDstImage, hSrcImage, pDstRegion, pSrcRegion, hSignalEvent, numWaitEvents, phWaitEvents ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListAppendImageCopyToMemory + __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 + ) + { + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnAppendImageCopyToMemory = dditable->CommandList->pfnAppendImageCopyToMemory; + if( nullptr == pfnAppendImageCopyToMemory ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnAppendImageCopyToMemory( hCommandList, dstptr, hSrcImage, pSrcRegion, hSignalEvent, numWaitEvents, phWaitEvents ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListAppendImageCopyFromMemory + __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 + ) + { + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnAppendImageCopyFromMemory = dditable->CommandList->pfnAppendImageCopyFromMemory; + if( nullptr == pfnAppendImageCopyFromMemory ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnAppendImageCopyFromMemory( hCommandList, hDstImage, srcptr, pDstRegion, hSignalEvent, numWaitEvents, phWaitEvents ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListAppendMemoryPrefetch + __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 + ) + { + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnAppendMemoryPrefetch = dditable->CommandList->pfnAppendMemoryPrefetch; + if( nullptr == pfnAppendMemoryPrefetch ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnAppendMemoryPrefetch( hCommandList, ptr, size ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListAppendMemAdvise + __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 + ) + { + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnAppendMemAdvise = dditable->CommandList->pfnAppendMemAdvise; + if( nullptr == pfnAppendMemAdvise ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnAppendMemAdvise( hCommandList, hDevice, ptr, size, advice ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeEventPoolCreate + __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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnCreate = dditable->EventPool->pfnCreate; + if( nullptr == pfnCreate ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnCreate( hContext, desc, numDevices, phDevices, phEventPool ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeEventPoolDestroy + __zedlllocal ze_result_t ZE_APICALL + zeEventPoolDestroy( + ze_event_pool_handle_t hEventPool ///< [in][release] handle of event pool object to destroy + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hEventPool )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnDestroy = dditable->EventPool->pfnDestroy; + if( nullptr == pfnDestroy ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnDestroy( hEventPool ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeEventCreate + __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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hEventPool )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnCreate = dditable->Event->pfnCreate; + if( nullptr == pfnCreate ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnCreate( hEventPool, desc, phEvent ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeEventDestroy + __zedlllocal ze_result_t ZE_APICALL + zeEventDestroy( + ze_event_handle_t hEvent ///< [in][release] handle of event object to destroy + ) + { + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnDestroy = dditable->Event->pfnDestroy; + if( nullptr == pfnDestroy ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnDestroy( hEvent ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeEventPoolGetIpcHandle + __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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hEventPool )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetIpcHandle = dditable->EventPool->pfnGetIpcHandle; + if( nullptr == pfnGetIpcHandle ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetIpcHandle( hEventPool, phIpc ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeEventPoolPutIpcHandle + __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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_6) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnPutIpcHandle = dditable->EventPool->pfnPutIpcHandle; + if( nullptr == pfnPutIpcHandle ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnPutIpcHandle( hContext, hIpc ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeEventPoolOpenIpcHandle + __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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnOpenIpcHandle = dditable->EventPool->pfnOpenIpcHandle; + if( nullptr == pfnOpenIpcHandle ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnOpenIpcHandle( hContext, hIpc, phEventPool ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeEventPoolCloseIpcHandle + __zedlllocal ze_result_t ZE_APICALL + zeEventPoolCloseIpcHandle( + ze_event_pool_handle_t hEventPool ///< [in][release] handle of event pool object + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hEventPool )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnCloseIpcHandle = dditable->EventPool->pfnCloseIpcHandle; + if( nullptr == pfnCloseIpcHandle ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnCloseIpcHandle( hEventPool ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListAppendSignalEvent + __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 + ) + { + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnAppendSignalEvent = dditable->CommandList->pfnAppendSignalEvent; + if( nullptr == pfnAppendSignalEvent ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnAppendSignalEvent( hCommandList, hEvent ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListAppendWaitOnEvents + __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 + ) + { + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnAppendWaitOnEvents = dditable->CommandList->pfnAppendWaitOnEvents; + if( nullptr == pfnAppendWaitOnEvents ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnAppendWaitOnEvents( hCommandList, numEvents, phEvents ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeEventHostSignal + __zedlllocal ze_result_t ZE_APICALL + zeEventHostSignal( + ze_event_handle_t hEvent ///< [in] handle of the event + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnHostSignal = dditable->Event->pfnHostSignal; + if( nullptr == pfnHostSignal ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnHostSignal( hEvent ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeEventHostSynchronize + __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. + ) + { + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnHostSynchronize = dditable->Event->pfnHostSynchronize; + if( nullptr == pfnHostSynchronize ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnHostSynchronize( hEvent, timeout ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeEventQueryStatus + __zedlllocal ze_result_t ZE_APICALL + zeEventQueryStatus( + ze_event_handle_t hEvent ///< [in] handle of the event + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnQueryStatus = dditable->Event->pfnQueryStatus; + if( nullptr == pfnQueryStatus ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnQueryStatus( hEvent ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListAppendEventReset + __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 + ) + { + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnAppendEventReset = dditable->CommandList->pfnAppendEventReset; + if( nullptr == pfnAppendEventReset ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnAppendEventReset( hCommandList, hEvent ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeEventHostReset + __zedlllocal ze_result_t ZE_APICALL + zeEventHostReset( + ze_event_handle_t hEvent ///< [in] handle of the event + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnHostReset = dditable->Event->pfnHostReset; + if( nullptr == pfnHostReset ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnHostReset( hEvent ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeEventQueryKernelTimestamp + __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. + ) + { + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnQueryKernelTimestamp = dditable->Event->pfnQueryKernelTimestamp; + if( nullptr == pfnQueryKernelTimestamp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnQueryKernelTimestamp( hEvent, dstptr ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListAppendQueryKernelTimestamps + __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 + ) + { + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnAppendQueryKernelTimestamps = dditable->CommandList->pfnAppendQueryKernelTimestamps; + if( nullptr == pfnAppendQueryKernelTimestamps ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnAppendQueryKernelTimestamps( hCommandList, numEvents, phEvents, dstptr, pOffsets, hSignalEvent, numWaitEvents, phWaitEvents ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeEventGetEventPool + __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 + ) + { + 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_9) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetEventPool = dditable->Event->pfnGetEventPool; + if( nullptr == pfnGetEventPool ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetEventPool( hEvent, phEventPool ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeEventGetSignalScope + __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. + ) + { + 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_9) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetSignalScope = dditable->Event->pfnGetSignalScope; + if( nullptr == pfnGetSignalScope ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetSignalScope( hEvent, pSignalScope ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeEventGetWaitScope + __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. + ) + { + 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_9) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetWaitScope = dditable->Event->pfnGetWaitScope; + if( nullptr == pfnGetWaitScope ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetWaitScope( hEvent, pWaitScope ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeEventPoolGetContextHandle + __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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hEventPool )->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) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetContextHandle = dditable->EventPool->pfnGetContextHandle; + if( nullptr == pfnGetContextHandle ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetContextHandle( hEventPool, phContext ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeEventPoolGetFlags + __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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hEventPool )->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) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetFlags = dditable->EventPool->pfnGetFlags; + if( nullptr == pfnGetFlags ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetFlags( hEventPool, pFlags ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeFenceCreate + __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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hCommandQueue )->pCore; + if (dditable->isValidFlag == 0) + return ZE_RESULT_ERROR_UNINITIALIZED; + // Check that api version in the driver is supported by this version of the API + if (dditable->version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnCreate = dditable->Fence->pfnCreate; + if( nullptr == pfnCreate ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnCreate( hCommandQueue, desc, phFence ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeFenceDestroy + __zedlllocal ze_result_t ZE_APICALL + zeFenceDestroy( + ze_fence_handle_t hFence ///< [in][release] handle of fence object to destroy + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hFence )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnDestroy = dditable->Fence->pfnDestroy; + if( nullptr == pfnDestroy ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnDestroy( hFence ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeFenceHostSynchronize + __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. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hFence )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnHostSynchronize = dditable->Fence->pfnHostSynchronize; + if( nullptr == pfnHostSynchronize ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnHostSynchronize( hFence, timeout ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeFenceQueryStatus + __zedlllocal ze_result_t ZE_APICALL + zeFenceQueryStatus( + ze_fence_handle_t hFence ///< [in] handle of the fence + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hFence )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnQueryStatus = dditable->Fence->pfnQueryStatus; + if( nullptr == pfnQueryStatus ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnQueryStatus( hFence ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeFenceReset + __zedlllocal ze_result_t ZE_APICALL + zeFenceReset( + ze_fence_handle_t hFence ///< [in] handle of the fence + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hFence )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnReset = dditable->Fence->pfnReset; + if( nullptr == pfnReset ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnReset( hFence ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeImageGetProperties + __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 + ) + { + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetProperties = dditable->Image->pfnGetProperties; + if( nullptr == pfnGetProperties ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetProperties( hDevice, desc, pImageProperties ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeImageCreate + __zedlllocal 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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnCreate = dditable->Image->pfnCreate; + if( nullptr == pfnCreate ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnCreate( hContext, hDevice, desc, phImage ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeImageDestroy + __zedlllocal ze_result_t ZE_APICALL + zeImageDestroy( + ze_image_handle_t hImage ///< [in][release] handle of image object to destroy + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnDestroy = dditable->Image->pfnDestroy; + if( nullptr == pfnDestroy ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnDestroy( hImage ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeMemAllocShared + __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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnAllocShared = dditable->Mem->pfnAllocShared; + if( nullptr == pfnAllocShared ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnAllocShared( hContext, device_desc, host_desc, size, alignment, hDevice, pptr ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnAllocDevice = dditable->Mem->pfnAllocDevice; + if( nullptr == pfnAllocDevice ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnAllocDevice( hContext, device_desc, size, alignment, hDevice, pptr ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeMemAllocHost + __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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnAllocHost = dditable->Mem->pfnAllocHost; + if( nullptr == pfnAllocHost ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnAllocHost( hContext, host_desc, size, alignment, pptr ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeMemFree + __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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnFree = dditable->Mem->pfnFree; + if( nullptr == pfnFree ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnFree( hContext, ptr ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeMemGetAllocProperties + __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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetAllocProperties = dditable->Mem->pfnGetAllocProperties; + if( nullptr == pfnGetAllocProperties ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetAllocProperties( hContext, ptr, pMemAllocProperties, phDevice ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeMemGetAddressRange + __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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetAddressRange = dditable->Mem->pfnGetAddressRange; + if( nullptr == pfnGetAddressRange ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetAddressRange( hContext, ptr, pBase, pSize ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeMemGetIpcHandle + __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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetIpcHandle = dditable->Mem->pfnGetIpcHandle; + if( nullptr == pfnGetIpcHandle ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetIpcHandle( hContext, ptr, pIpcHandle ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeMemGetIpcHandleFromFileDescriptorExp + __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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_6) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetIpcHandleFromFileDescriptorExp = dditable->MemExp->pfnGetIpcHandleFromFileDescriptorExp; + if( nullptr == pfnGetIpcHandleFromFileDescriptorExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetIpcHandleFromFileDescriptorExp( hContext, handle, pIpcHandle ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeMemGetFileDescriptorFromIpcHandleExp + __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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_6) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetFileDescriptorFromIpcHandleExp = dditable->MemExp->pfnGetFileDescriptorFromIpcHandleExp; + if( nullptr == pfnGetFileDescriptorFromIpcHandleExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetFileDescriptorFromIpcHandleExp( hContext, ipcHandle, pHandle ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeMemPutIpcHandle + __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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_6) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnPutIpcHandle = dditable->Mem->pfnPutIpcHandle; + if( nullptr == pfnPutIpcHandle ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnPutIpcHandle( hContext, handle ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeMemOpenIpcHandle + __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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnOpenIpcHandle = dditable->Mem->pfnOpenIpcHandle; + if( nullptr == pfnOpenIpcHandle ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnOpenIpcHandle( hContext, hDevice, handle, flags, pptr ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeMemCloseIpcHandle + __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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnCloseIpcHandle = dditable->Mem->pfnCloseIpcHandle; + if( nullptr == pfnCloseIpcHandle ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnCloseIpcHandle( hContext, ptr ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeMemSetAtomicAccessAttributeExp + __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. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnSetAtomicAccessAttributeExp = dditable->MemExp->pfnSetAtomicAccessAttributeExp; + if( nullptr == pfnSetAtomicAccessAttributeExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnSetAtomicAccessAttributeExp( hContext, hDevice, ptr, size, attr ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeMemGetAtomicAccessAttributeExp + __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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetAtomicAccessAttributeExp = dditable->MemExp->pfnGetAtomicAccessAttributeExp; + if( nullptr == pfnGetAtomicAccessAttributeExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetAtomicAccessAttributeExp( hContext, hDevice, ptr, size, pAttr ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeModuleCreate + __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. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnCreate = dditable->Module->pfnCreate; + if( nullptr == pfnCreate ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnCreate( hContext, hDevice, desc, phModule, phBuildLog ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeModuleDestroy + __zedlllocal ze_result_t ZE_APICALL + zeModuleDestroy( + ze_module_handle_t hModule ///< [in][release] handle of the module + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hModule )->pCore; + if (dditable->isValidFlag == 0) + return ZE_RESULT_ERROR_UNINITIALIZED; + // Check that api version in the driver is supported by this version of the API + if (dditable->version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnDestroy = dditable->Module->pfnDestroy; + if( nullptr == pfnDestroy ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnDestroy( hModule ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeModuleDynamicLink + __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. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnDynamicLink = dditable->Module->pfnDynamicLink; + if( nullptr == pfnDynamicLink ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnDynamicLink( numModules, phModules, phLinkLog ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @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. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hModuleBuildLog )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnDestroy = dditable->ModuleBuildLog->pfnDestroy; + if( nullptr == pfnDestroy ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnDestroy( hModuleBuildLog ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeModuleBuildLogGetString + __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. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hModuleBuildLog )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetString = dditable->ModuleBuildLog->pfnGetString; + if( nullptr == pfnGetString ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetString( hModuleBuildLog, pSize, pBuildLog ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeModuleGetNativeBinary + __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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hModule )->pCore; + if (dditable->isValidFlag == 0) + return ZE_RESULT_ERROR_UNINITIALIZED; + // Check that api version in the driver is supported by this version of the API + if (dditable->version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetNativeBinary = dditable->Module->pfnGetNativeBinary; + if( nullptr == pfnGetNativeBinary ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetNativeBinary( hModule, pSize, pModuleNativeBinary ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeModuleGetGlobalPointer + __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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hModule )->pCore; + if (dditable->isValidFlag == 0) + return ZE_RESULT_ERROR_UNINITIALIZED; + // Check that api version in the driver is supported by this version of the API + if (dditable->version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetGlobalPointer = dditable->Module->pfnGetGlobalPointer; + if( nullptr == pfnGetGlobalPointer ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetGlobalPointer( hModule, pGlobalName, pSize, pptr ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeModuleGetKernelNames + __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. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hModule )->pCore; + if (dditable->isValidFlag == 0) + return ZE_RESULT_ERROR_UNINITIALIZED; + // Check that api version in the driver is supported by this version of the API + if (dditable->version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetKernelNames = dditable->Module->pfnGetKernelNames; + if( nullptr == pfnGetKernelNames ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetKernelNames( hModule, pCount, pNames ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeModuleGetProperties + __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. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hModule )->pCore; + if (dditable->isValidFlag == 0) + return ZE_RESULT_ERROR_UNINITIALIZED; + // Check that api version in the driver is supported by this version of the API + if (dditable->version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetProperties = dditable->Module->pfnGetProperties; + if( nullptr == pfnGetProperties ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetProperties( hModule, pModuleProperties ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeKernelCreate + __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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hModule )->pCore; + if (dditable->isValidFlag == 0) + return ZE_RESULT_ERROR_UNINITIALIZED; + // Check that api version in the driver is supported by this version of the API + if (dditable->version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnCreate = dditable->Kernel->pfnCreate; + if( nullptr == pfnCreate ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnCreate( hModule, desc, phKernel ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeKernelDestroy + __zedlllocal ze_result_t ZE_APICALL + zeKernelDestroy( + ze_kernel_handle_t hKernel ///< [in][release] handle of the kernel object + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hKernel )->pCore; + if (dditable->isValidFlag == 0) + return ZE_RESULT_ERROR_UNINITIALIZED; + // Check that api version in the driver is supported by this version of the API + if (dditable->version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnDestroy = dditable->Kernel->pfnDestroy; + if( nullptr == pfnDestroy ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnDestroy( hKernel ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeModuleGetFunctionPointer + __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. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hModule )->pCore; + if (dditable->isValidFlag == 0) + return ZE_RESULT_ERROR_UNINITIALIZED; + // Check that api version in the driver is supported by this version of the API + if (dditable->version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetFunctionPointer = dditable->Module->pfnGetFunctionPointer; + if( nullptr == pfnGetFunctionPointer ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetFunctionPointer( hModule, pFunctionName, pfnFunction ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeKernelSetGroupSize + __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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hKernel )->pCore; + if (dditable->isValidFlag == 0) + return ZE_RESULT_ERROR_UNINITIALIZED; + // Check that api version in the driver is supported by this version of the API + if (dditable->version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnSetGroupSize = dditable->Kernel->pfnSetGroupSize; + if( nullptr == pfnSetGroupSize ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnSetGroupSize( hKernel, groupSizeX, groupSizeY, groupSizeZ ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeKernelSuggestGroupSize + __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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hKernel )->pCore; + if (dditable->isValidFlag == 0) + return ZE_RESULT_ERROR_UNINITIALIZED; + // Check that api version in the driver is supported by this version of the API + if (dditable->version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnSuggestGroupSize = dditable->Kernel->pfnSuggestGroupSize; + if( nullptr == pfnSuggestGroupSize ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnSuggestGroupSize( hKernel, globalSizeX, globalSizeY, globalSizeZ, groupSizeX, groupSizeY, groupSizeZ ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeKernelSuggestMaxCooperativeGroupCount + __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. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hKernel )->pCore; + if (dditable->isValidFlag == 0) + return ZE_RESULT_ERROR_UNINITIALIZED; + // Check that api version in the driver is supported by this version of the API + if (dditable->version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnSuggestMaxCooperativeGroupCount = dditable->Kernel->pfnSuggestMaxCooperativeGroupCount; + if( nullptr == pfnSuggestMaxCooperativeGroupCount ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnSuggestMaxCooperativeGroupCount( hKernel, totalGroupCount ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeKernelSetArgumentValue + __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. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hKernel )->pCore; + if (dditable->isValidFlag == 0) + return ZE_RESULT_ERROR_UNINITIALIZED; + // Check that api version in the driver is supported by this version of the API + if (dditable->version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnSetArgumentValue = dditable->Kernel->pfnSetArgumentValue; + if( nullptr == pfnSetArgumentValue ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnSetArgumentValue( hKernel, argIndex, argSize, pArgValue ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeKernelSetIndirectAccess + __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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hKernel )->pCore; + if (dditable->isValidFlag == 0) + return ZE_RESULT_ERROR_UNINITIALIZED; + // Check that api version in the driver is supported by this version of the API + if (dditable->version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnSetIndirectAccess = dditable->Kernel->pfnSetIndirectAccess; + if( nullptr == pfnSetIndirectAccess ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnSetIndirectAccess( hKernel, flags ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeKernelGetIndirectAccess + __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. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hKernel )->pCore; + if (dditable->isValidFlag == 0) + return ZE_RESULT_ERROR_UNINITIALIZED; + // Check that api version in the driver is supported by this version of the API + if (dditable->version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetIndirectAccess = dditable->Kernel->pfnGetIndirectAccess; + if( nullptr == pfnGetIndirectAccess ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetIndirectAccess( hKernel, pFlags ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeKernelGetSourceAttributes + __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. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hKernel )->pCore; + if (dditable->isValidFlag == 0) + return ZE_RESULT_ERROR_UNINITIALIZED; + // Check that api version in the driver is supported by this version of the API + if (dditable->version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetSourceAttributes = dditable->Kernel->pfnGetSourceAttributes; + if( nullptr == pfnGetSourceAttributes ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetSourceAttributes( hKernel, pSize, pString ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeKernelSetCacheConfig + __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. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hKernel )->pCore; + if (dditable->isValidFlag == 0) + return ZE_RESULT_ERROR_UNINITIALIZED; + // Check that api version in the driver is supported by this version of the API + if (dditable->version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnSetCacheConfig = dditable->Kernel->pfnSetCacheConfig; + if( nullptr == pfnSetCacheConfig ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnSetCacheConfig( hKernel, flags ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeKernelGetProperties + __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. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hKernel )->pCore; + if (dditable->isValidFlag == 0) + return ZE_RESULT_ERROR_UNINITIALIZED; + // Check that api version in the driver is supported by this version of the API + if (dditable->version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetProperties = dditable->Kernel->pfnGetProperties; + if( nullptr == pfnGetProperties ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetProperties( hKernel, pKernelProperties ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeKernelGetName + __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. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hKernel )->pCore; + if (dditable->isValidFlag == 0) + return ZE_RESULT_ERROR_UNINITIALIZED; + // Check that api version in the driver is supported by this version of the API + if (dditable->version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetName = dditable->Kernel->pfnGetName; + if( nullptr == pfnGetName ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetName( hKernel, pSize, pName ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListAppendLaunchKernel + __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 + ) + { + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnAppendLaunchKernel = dditable->CommandList->pfnAppendLaunchKernel; + if( nullptr == pfnAppendLaunchKernel ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnAppendLaunchKernel( hCommandList, hKernel, pLaunchFuncArgs, hSignalEvent, numWaitEvents, phWaitEvents ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListAppendLaunchCooperativeKernel + __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 + ) + { + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnAppendLaunchCooperativeKernel = dditable->CommandList->pfnAppendLaunchCooperativeKernel; + if( nullptr == pfnAppendLaunchCooperativeKernel ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnAppendLaunchCooperativeKernel( hCommandList, hKernel, pLaunchFuncArgs, hSignalEvent, numWaitEvents, phWaitEvents ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListAppendLaunchKernelIndirect + __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 + ) + { + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnAppendLaunchKernelIndirect = dditable->CommandList->pfnAppendLaunchKernelIndirect; + if( nullptr == pfnAppendLaunchKernelIndirect ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnAppendLaunchKernelIndirect( hCommandList, hKernel, pLaunchArgumentsBuffer, hSignalEvent, numWaitEvents, phWaitEvents ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListAppendLaunchMultipleKernelsIndirect + __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 + ) + { + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnAppendLaunchMultipleKernelsIndirect = dditable->CommandList->pfnAppendLaunchMultipleKernelsIndirect; + if( nullptr == pfnAppendLaunchMultipleKernelsIndirect ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnAppendLaunchMultipleKernelsIndirect( hCommandList, numKernels, phKernels, pCountBuffer, pLaunchArgumentsBuffer, hSignalEvent, numWaitEvents, phWaitEvents ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeContextMakeMemoryResident + __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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnMakeMemoryResident = dditable->Context->pfnMakeMemoryResident; + if( nullptr == pfnMakeMemoryResident ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnMakeMemoryResident( hContext, hDevice, ptr, size ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeContextEvictMemory + __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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnEvictMemory = dditable->Context->pfnEvictMemory; + if( nullptr == pfnEvictMemory ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnEvictMemory( hContext, hDevice, ptr, size ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeContextMakeImageResident + __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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnMakeImageResident = dditable->Context->pfnMakeImageResident; + if( nullptr == pfnMakeImageResident ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnMakeImageResident( hContext, hDevice, hImage ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeContextEvictImage + __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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnEvictImage = dditable->Context->pfnEvictImage; + if( nullptr == pfnEvictImage ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnEvictImage( hContext, hDevice, hImage ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeSamplerCreate + __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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnCreate = dditable->Sampler->pfnCreate; + if( nullptr == pfnCreate ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnCreate( hContext, hDevice, desc, phSampler ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeSamplerDestroy + __zedlllocal ze_result_t ZE_APICALL + zeSamplerDestroy( + ze_sampler_handle_t hSampler ///< [in][release] handle of the sampler + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hSampler )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnDestroy = dditable->Sampler->pfnDestroy; + if( nullptr == pfnDestroy ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnDestroy( hSampler ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeVirtualMemReserve + __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. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnReserve = dditable->VirtualMem->pfnReserve; + if( nullptr == pfnReserve ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnReserve( hContext, pStart, size, pptr ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeVirtualMemFree + __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. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnFree = dditable->VirtualMem->pfnFree; + if( nullptr == pfnFree ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnFree( hContext, ptr, size ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeVirtualMemQueryPageSize + __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. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnQueryPageSize = dditable->VirtualMem->pfnQueryPageSize; + if( nullptr == pfnQueryPageSize ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnQueryPageSize( hContext, hDevice, size, pagesize ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zePhysicalMemCreate + __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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnCreate = dditable->PhysicalMem->pfnCreate; + if( nullptr == pfnCreate ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnCreate( hContext, hDevice, desc, phPhysicalMemory ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zePhysicalMemDestroy + __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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnDestroy = dditable->PhysicalMem->pfnDestroy; + if( nullptr == pfnDestroy ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnDestroy( hContext, hPhysicalMemory ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeVirtualMemMap + __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. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnMap = dditable->VirtualMem->pfnMap; + if( nullptr == pfnMap ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnMap( hContext, ptr, size, hPhysicalMemory, offset, access ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeVirtualMemUnmap + __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. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnUnmap = dditable->VirtualMem->pfnUnmap; + if( nullptr == pfnUnmap ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnUnmap( hContext, ptr, size ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeVirtualMemSetAccessAttribute + __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. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnSetAccessAttribute = dditable->VirtualMem->pfnSetAccessAttribute; + if( nullptr == pfnSetAccessAttribute ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnSetAccessAttribute( hContext, ptr, size, access ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeVirtualMemGetAccessAttribute + __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. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetAccessAttribute = dditable->VirtualMem->pfnGetAccessAttribute; + if( nullptr == pfnGetAccessAttribute ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetAccessAttribute( hContext, ptr, size, access, outSize ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeKernelSetGlobalOffsetExp + __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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hKernel )->pCore; + if (dditable->isValidFlag == 0) + return ZE_RESULT_ERROR_UNINITIALIZED; + // Check that api version in the driver is supported by this version of the API + if (dditable->version < ZE_API_VERSION_1_1) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnSetGlobalOffsetExp = dditable->KernelExp->pfnSetGlobalOffsetExp; + if( nullptr == pfnSetGlobalOffsetExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnSetGlobalOffsetExp( hKernel, offsetX, offsetY, offsetZ ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeKernelGetBinaryExp + __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. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hKernel )->pCore; + if (dditable->isValidFlag == 0) + return ZE_RESULT_ERROR_UNINITIALIZED; + // Check that api version in the driver is supported by this version of the API + if (dditable->version < ZE_API_VERSION_1_11) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetBinaryExp = dditable->KernelExp->pfnGetBinaryExp; + if( nullptr == pfnGetBinaryExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetBinaryExp( hKernel, pSize, pKernelBinary ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeDeviceImportExternalSemaphoreExt + __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. + ) + { + 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_12) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnImportExternalSemaphoreExt = dditable->Device->pfnImportExternalSemaphoreExt; + if( nullptr == pfnImportExternalSemaphoreExt ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnImportExternalSemaphoreExt( hDevice, desc, phSemaphore ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeDeviceReleaseExternalSemaphoreExt + __zedlllocal ze_result_t ZE_APICALL + 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( 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_12) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnReleaseExternalSemaphoreExt = dditable->Device->pfnReleaseExternalSemaphoreExt; + if( nullptr == pfnReleaseExternalSemaphoreExt ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnReleaseExternalSemaphoreExt( hSemaphore ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListAppendSignalExternalSemaphoreExt + __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 vector of external semaphore handles + ///< to be appended into command list. + ze_external_semaphore_signal_params_ext_t* signalParams,///< [in] 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( 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_12) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnAppendSignalExternalSemaphoreExt = dditable->CommandList->pfnAppendSignalExternalSemaphoreExt; + if( nullptr == pfnAppendSignalExternalSemaphoreExt ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnAppendSignalExternalSemaphoreExt( hCommandList, numSemaphores, phSemaphores, signalParams, hSignalEvent, numWaitEvents, phWaitEvents ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListAppendWaitExternalSemaphoreExt + __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 vector of external semaphore handles + ///< to append into command list. + ze_external_semaphore_wait_params_ext_t* waitParams,///< [in] 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( 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_12) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnAppendWaitExternalSemaphoreExt = dditable->CommandList->pfnAppendWaitExternalSemaphoreExt; + if( nullptr == pfnAppendWaitExternalSemaphoreExt ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnAppendWaitExternalSemaphoreExt( hCommandList, numSemaphores, phSemaphores, waitParams, hSignalEvent, numWaitEvents, phWaitEvents ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASBuilderCreateExt + __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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnCreateExt = dditable->RTASBuilder->pfnCreateExt; + if( nullptr == pfnCreateExt ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnCreateExt( hDriver, pDescriptor, phBuilder ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASBuilderGetBuildPropertiesExt + __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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_13) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetBuildPropertiesExt = dditable->RTASBuilder->pfnGetBuildPropertiesExt; + if( nullptr == pfnGetBuildPropertiesExt ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetBuildPropertiesExt( hBuilder, pBuildOpDescriptor, pProperties ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnRTASFormatCompatibilityCheckExt = dditable->Driver->pfnRTASFormatCompatibilityCheckExt; + if( nullptr == pfnRTASFormatCompatibilityCheckExt ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnRTASFormatCompatibilityCheckExt( hDriver, rtasFormatA, rtasFormatB ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASBuilderBuildExt + __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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_13) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnBuildExt = dditable->RTASBuilder->pfnBuildExt; + if( nullptr == pfnBuildExt ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnBuildExt( hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASBuilderCommandListAppendCopyExt + __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 + ) + { + 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_13) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnCommandListAppendCopyExt = dditable->RTASBuilder->pfnCommandListAppendCopyExt; + if( nullptr == pfnCommandListAppendCopyExt ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnCommandListAppendCopyExt( hCommandList, dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASBuilderDestroyExt + __zedlllocal ze_result_t ZE_APICALL + 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( 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_13) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnDestroyExt = dditable->RTASBuilder->pfnDestroyExt; + if( nullptr == pfnDestroyExt ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnDestroyExt( hBuilder ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnCreateExt = dditable->RTASParallelOperation->pfnCreateExt; + if( nullptr == pfnCreateExt ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnCreateExt( hDriver, phParallelOperation ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_13) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetPropertiesExt = dditable->RTASParallelOperation->pfnGetPropertiesExt; + if( nullptr == pfnGetPropertiesExt ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetPropertiesExt( hParallelOperation, pProperties ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASParallelOperationJoinExt + __zedlllocal ze_result_t ZE_APICALL + 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( 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_13) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnJoinExt = dditable->RTASParallelOperation->pfnJoinExt; + if( nullptr == pfnJoinExt ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnJoinExt( hParallelOperation ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASParallelOperationDestroyExt + __zedlllocal ze_result_t ZE_APICALL + 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( 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_13) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnDestroyExt = dditable->RTASParallelOperation->pfnDestroyExt; + if( nullptr == pfnDestroyExt ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnDestroyExt( hParallelOperation ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeDeviceGetVectorWidthPropertiesExt + __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. + ) + { + 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_13) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetVectorWidthPropertiesExt = dditable->Device->pfnGetVectorWidthPropertiesExt; + if( nullptr == pfnGetVectorWidthPropertiesExt ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetVectorWidthPropertiesExt( hDevice, pCount, pVectorWidthProperties ); + 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; + } + 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; + } + 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 + if (dditable->version < ZE_API_VERSION_1_2) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnQueryTimestampsExp = dditable->EventExp->pfnQueryTimestampsExp; + if( nullptr == pfnQueryTimestampsExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // 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 handle's function pointer table + 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_2) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetMemoryPropertiesExp = dditable->ImageExp->pfnGetMemoryPropertiesExp; + if( nullptr == pfnGetMemoryPropertiesExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // 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 handle's function pointer table + 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_5) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnViewCreateExt = dditable->Image->pfnViewCreateExt; + if( nullptr == pfnViewCreateExt ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnViewCreateExt( hContext, hDevice, desc, hImage, phImageView ); + 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; + + // extract handle's function pointer table + 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) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnViewCreateExp = dditable->ImageExp->pfnViewCreateExp; + if( nullptr == pfnViewCreateExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnViewCreateExp( hContext, hDevice, desc, hImage, phImageView ); + 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; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hKernel )->pCore; + if (dditable->isValidFlag == 0) + return ZE_RESULT_ERROR_UNINITIALIZED; + // Check that api version in the driver is supported by this version of the API + if (dditable->version < ZE_API_VERSION_1_2) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnSchedulingHintExp = dditable->KernelExp->pfnSchedulingHintExp; + if( nullptr == pfnSchedulingHintExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnSchedulingHintExp( hKernel, pHint ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeDevicePciGetPropertiesExt + __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. + ) + { + 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_3) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnPciGetPropertiesExt = dditable->Device->pfnPciGetPropertiesExt; + if( nullptr == pfnPciGetPropertiesExt ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnPciGetPropertiesExt( hDevice, pPciProperties ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListAppendImageCopyToMemoryExt + __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 + ) + { + 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_3) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnAppendImageCopyToMemoryExt = dditable->CommandList->pfnAppendImageCopyToMemoryExt; + if( nullptr == pfnAppendImageCopyToMemoryExt ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnAppendImageCopyToMemoryExt( hCommandList, dstptr, hSrcImage, pSrcRegion, destRowPitch, destSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListAppendImageCopyFromMemoryExt + __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 + ) + { + 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_3) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnAppendImageCopyFromMemoryExt = dditable->CommandList->pfnAppendImageCopyFromMemoryExt; + if( nullptr == pfnAppendImageCopyFromMemoryExt ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnAppendImageCopyFromMemoryExt( hCommandList, hDstImage, srcptr, pDstRegion, srcRowPitch, srcSlicePitch, hSignalEvent, numWaitEvents, phWaitEvents ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeImageGetAllocPropertiesExt + __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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_3) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetAllocPropertiesExt = dditable->Image->pfnGetAllocPropertiesExt; + if( nullptr == pfnGetAllocPropertiesExt ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetAllocPropertiesExt( hContext, hImage, pImageAllocProperties ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeModuleInspectLinkageExt + __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. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_3) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnInspectLinkageExt = dditable->Module->pfnInspectLinkageExt; + if( nullptr == pfnInspectLinkageExt ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnInspectLinkageExt( pInspectDesc, numModules, phModules, phLog ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeMemFreeExt + __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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_3) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnFreeExt = dditable->Mem->pfnFreeExt; + if( nullptr == pfnFreeExt ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnFreeExt( hContext, pMemFreeDesc, ptr ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeFabricVertexGetExp + __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. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetExp = dditable->FabricVertexExp->pfnGetExp; + if( nullptr == pfnGetExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetExp( hDriver, pCount, phVertices ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeFabricVertexGetSubVerticesExp + __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. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_4) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetSubVerticesExp = dditable->FabricVertexExp->pfnGetSubVerticesExp; + if( nullptr == pfnGetSubVerticesExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetSubVerticesExp( hVertex, pCount, phSubvertices ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeFabricVertexGetPropertiesExp + __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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_4) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetPropertiesExp = dditable->FabricVertexExp->pfnGetPropertiesExp; + if( nullptr == pfnGetPropertiesExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetPropertiesExp( hVertex, pVertexProperties ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_4) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetDeviceExp = dditable->FabricVertexExp->pfnGetDeviceExp; + if( nullptr == pfnGetDeviceExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetDeviceExp( hVertex, phDevice ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeDeviceGetFabricVertexExp + __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 + ) + { + 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_4) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetFabricVertexExp = dditable->DeviceExp->pfnGetFabricVertexExp; + if( nullptr == pfnGetFabricVertexExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetFabricVertexExp( hDevice, phVertex ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeFabricEdgeGetExp + __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. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_4) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetExp = dditable->FabricEdgeExp->pfnGetExp; + if( nullptr == pfnGetExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetExp( hVertexA, hVertexB, pCount, phEdges ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeFabricEdgeGetVerticesExp + __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. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_4) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetVerticesExp = dditable->FabricEdgeExp->pfnGetVerticesExp; + if( nullptr == pfnGetVerticesExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetVerticesExp( hEdge, phVertexA, phVertexB ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeFabricEdgeGetPropertiesExp + __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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_4) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetPropertiesExp = dditable->FabricEdgeExp->pfnGetPropertiesExp; + if( nullptr == pfnGetPropertiesExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetPropertiesExp( hEdge, pEdgeProperties ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @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. + ) + { + 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_6) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnQueryKernelTimestampsExt = dditable->Event->pfnQueryKernelTimestampsExt; + if( nullptr == pfnQueryKernelTimestampsExt ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnQueryKernelTimestampsExt( hEvent, hDevice, pCount, pResults ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASBuilderCreateExp + __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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_7) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnCreateExp = dditable->RTASBuilderExp->pfnCreateExp; + if( nullptr == pfnCreateExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnCreateExp( hDriver, pDescriptor, phBuilder ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASBuilderGetBuildPropertiesExp + __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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_7) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetBuildPropertiesExp = dditable->RTASBuilderExp->pfnGetBuildPropertiesExp; + if( nullptr == pfnGetBuildPropertiesExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetBuildPropertiesExp( hBuilder, pBuildOpDescriptor, pProperties ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeDriverRTASFormatCompatibilityCheckExp + __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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_7) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnRTASFormatCompatibilityCheckExp = dditable->DriverExp->pfnRTASFormatCompatibilityCheckExp; + if( nullptr == pfnRTASFormatCompatibilityCheckExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnRTASFormatCompatibilityCheckExp( hDriver, rtasFormatA, rtasFormatB ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASBuilderBuildExp + __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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_7) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnBuildExp = dditable->RTASBuilderExp->pfnBuildExp; + if( nullptr == pfnBuildExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnBuildExp( hBuilder, pBuildOpDescriptor, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASBuilderDestroyExp + __zedlllocal ze_result_t ZE_APICALL + 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( 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_7) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnDestroyExp = dditable->RTASBuilderExp->pfnDestroyExp; + if( nullptr == pfnDestroyExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnDestroyExp( hBuilder ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASParallelOperationCreateExp + __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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_7) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnCreateExp = dditable->RTASParallelOperationExp->pfnCreateExp; + if( nullptr == pfnCreateExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnCreateExp( hDriver, phParallelOperation ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASParallelOperationGetPropertiesExp + __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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetPropertiesExp = dditable->RTASParallelOperationExp->pfnGetPropertiesExp; + if( nullptr == pfnGetPropertiesExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetPropertiesExp( hParallelOperation, pProperties ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASParallelOperationJoinExp + __zedlllocal ze_result_t ZE_APICALL + 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( 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) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnJoinExp = dditable->RTASParallelOperationExp->pfnJoinExp; + if( nullptr == pfnJoinExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnJoinExp( hParallelOperation ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeRTASParallelOperationDestroyExp + __zedlllocal ze_result_t ZE_APICALL + 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( 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) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnDestroyExp = dditable->RTASParallelOperationExp->pfnDestroyExp; + if( nullptr == pfnDestroyExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnDestroyExp( hParallelOperation ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeMemGetPitchFor2dImage + __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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_9) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetPitchFor2dImage = dditable->Mem->pfnGetPitchFor2dImage; + if( nullptr == pfnGetPitchFor2dImage ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + 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 handle's function pointer table + 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_9) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetDeviceOffsetExp = dditable->ImageExp->pfnGetDeviceOffsetExp; + if( nullptr == pfnGetDeviceOffsetExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // 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 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_9) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnCreateCloneExp = dditable->CommandListExp->pfnCreateCloneExp; + if( nullptr == pfnCreateCloneExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnCreateCloneExp( hCommandList, phClonedCommandList ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListImmediateAppendCommandListsExp + __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) + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_9) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnImmediateAppendCommandListsExp = dditable->CommandListExp->pfnImmediateAppendCommandListsExp; + if( nullptr == pfnImmediateAppendCommandListsExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnImmediateAppendCommandListsExp( hCommandListImmediate, numCommandLists, phCommandLists, hSignalEvent, numWaitEvents, phWaitEvents ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListGetNextCommandIdExp + __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 + ) + { + 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_9) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetNextCommandIdExp = dditable->CommandListExp->pfnGetNextCommandIdExp; + if( nullptr == pfnGetNextCommandIdExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetNextCommandIdExp( hCommandList, desc, pCommandId ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListGetNextCommandIdWithKernelsExp + __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 + ) + { + 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_10) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetNextCommandIdWithKernelsExp = dditable->CommandListExp->pfnGetNextCommandIdWithKernelsExp; + if( nullptr == pfnGetNextCommandIdWithKernelsExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetNextCommandIdWithKernelsExp( hCommandList, desc, numKernels, phKernels, pCommandId ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListUpdateMutableCommandsExp + __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 + ) + { + 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_9) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnUpdateMutableCommandsExp = dditable->CommandListExp->pfnUpdateMutableCommandsExp; + if( nullptr == pfnUpdateMutableCommandsExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnUpdateMutableCommandsExp( hCommandList, desc ); + 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 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_9) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnUpdateMutableCommandSignalEventExp = dditable->CommandListExp->pfnUpdateMutableCommandSignalEventExp; + if( nullptr == pfnUpdateMutableCommandSignalEventExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // 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 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_9) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnUpdateMutableCommandWaitEventsExp = dditable->CommandListExp->pfnUpdateMutableCommandWaitEventsExp; + if( nullptr == pfnUpdateMutableCommandWaitEventsExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnUpdateMutableCommandWaitEventsExp( hCommandList, commandId, numWaitEvents, phWaitEvents ); + 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 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_10) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnUpdateMutableCommandKernelsExp = dditable->CommandListExp->pfnUpdateMutableCommandKernelsExp; + if( nullptr == pfnUpdateMutableCommandKernelsExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnUpdateMutableCommandKernelsExp( hCommandList, numKernels, pCommandId, phKernels ); + return result; + } + + + /////////////////////////////////////////////////////////////////////////////// + /// @brief function for removing the ddi driver tables for ze + __zedlllocal void ZE_APICALL + zeDestroyDDiDriverTables(ze_dditable_driver_t* pDdiTable) + { + // Delete ddi tables + delete pDdiTable->Global; + delete pDdiTable->RTASBuilder; + delete pDdiTable->RTASBuilderExp; + delete pDdiTable->RTASParallelOperation; + delete pDdiTable->RTASParallelOperationExp; + delete pDdiTable->Driver; + delete pDdiTable->DriverExp; + delete pDdiTable->Device; + delete pDdiTable->DeviceExp; + delete pDdiTable->Context; + delete pDdiTable->CommandQueue; + delete pDdiTable->CommandList; + delete pDdiTable->CommandListExp; + delete pDdiTable->Event; + delete pDdiTable->EventExp; + delete pDdiTable->EventPool; + delete pDdiTable->Fence; + delete pDdiTable->Image; + delete pDdiTable->ImageExp; + delete pDdiTable->Kernel; + delete pDdiTable->KernelExp; + delete pDdiTable->Mem; + delete pDdiTable->MemExp; + delete pDdiTable->Module; + delete pDdiTable->ModuleBuildLog; + delete pDdiTable->PhysicalMem; + delete pDdiTable->Sampler; + delete pDdiTable->VirtualMem; + delete pDdiTable->FabricEdgeExp; + delete pDdiTable->FabricVertexExp; + delete pDdiTable; + } + +} // namespace loader_driver_ddi \ No newline at end of file diff --git a/source/loader/ze_loader.cpp b/source/loader/ze_loader.cpp index fb05f7e6..b3ef06ad 100644 --- a/source/loader/ze_loader.cpp +++ b/source/loader/ze_loader.cpp @@ -1,6 +1,6 @@ /* * - * Copyright (C) 2019-2021 Intel Corporation + * Copyright (C) 2019-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -18,6 +18,10 @@ namespace loader { + ze_handle_t* loaderDispatch = nullptr; + ze_dditable_t* loaderZeDdiTable = nullptr; + zet_dditable_t* loaderZetDdiTable = nullptr; + zes_dditable_t* loaderZesDdiTable = nullptr; /////////////////////////////////////////////////////////////////////////////// context_t *context; @@ -172,10 +176,13 @@ namespace loader } for (auto handle : driverHandles) { - ze_driver_properties_t properties = {}; - properties.stype = ZE_STRUCTURE_TYPE_DRIVER_PROPERTIES; - properties.pNext = nullptr; - ze_result_t res = driver.dditable.ze.Driver.pfnGetProperties(handle, &properties); + driver.properties = {}; + driver.properties.stype = ZE_STRUCTURE_TYPE_DRIVER_DDI_HANDLES_EXT_PROPERTIES; + driver.properties.pNext = nullptr; + ze_driver_properties_t driverProperties = {}; + driverProperties.stype = ZE_STRUCTURE_TYPE_DRIVER_PROPERTIES; + driverProperties.pNext = &driver.properties; + ze_result_t res = driver.dditable.ze.Driver.pfnGetProperties(handle, &driverProperties); if (res != ZE_RESULT_SUCCESS) { if (debugTraceEnabled) { std::string message = "driverSorting " + driver.name + " failed, zeDriverGetProperties returned "; @@ -183,7 +190,7 @@ namespace loader } continue; } - driver.properties = properties; + driver.driverDDIHandleSupportQueried = true; uint32_t deviceCount = 0; res = driver.dditable.ze.Device.pfnGet( handle, &deviceCount, nullptr ); if( ZE_RESULT_SUCCESS != res ) { @@ -457,7 +464,21 @@ namespace loader if (driverEnvironmentQueried) { return ZE_RESULT_SUCCESS; } + loader::loaderDispatch = new ze_handle_t(); + loader::loaderDispatch->pCore = new ze_dditable_driver_t(); + loader::loaderDispatch->pCore->version = ZE_API_VERSION_CURRENT; + loader::loaderDispatch->pCore->isValidFlag = 1; + loader::loaderDispatch->pTools = new zet_dditable_driver_t(); + loader::loaderDispatch->pTools->version = ZE_API_VERSION_CURRENT; + loader::loaderDispatch->pTools->isValidFlag = 1; + loader::loaderDispatch->pSysman = new zes_dditable_driver_t(); + loader::loaderDispatch->pSysman->version = ZE_API_VERSION_CURRENT; + loader::loaderDispatch->pSysman->isValidFlag = 1; + loader::loaderZeDdiTable = new ze_dditable_t(); + loader::loaderZetDdiTable = new zet_dditable_t(); + loader::loaderZesDdiTable = new zes_dditable_t(); debugTraceEnabled = getenv_tobool( "ZE_ENABLE_LOADER_DEBUG_TRACE" ); + driverDDIPathDefault = getenv_tobool( "ZE_ENABLE_LOADER_DRIVER_DDI_PATH" ); auto discoveredDrivers = discoverEnabledDrivers(); std::string loadLibraryErrorValue; @@ -661,7 +682,10 @@ namespace loader } } } - + loader_driver_ddi::zeDestroyDDiDriverTables(loader::loaderDispatch->pCore); + loader_driver_ddi::zetDestroyDDiDriverTables(loader::loaderDispatch->pTools); + loader_driver_ddi::zesDestroyDDiDriverTables(loader::loaderDispatch->pSysman); + delete loader::loaderDispatch; }; void context_t::add_loader_version(){ diff --git a/source/loader/ze_loader_api.cpp b/source/loader/ze_loader_api.cpp index 3c1c8902..314ec1ba 100644 --- a/source/loader/ze_loader_api.cpp +++ b/source/loader/ze_loader_api.cpp @@ -1,6 +1,6 @@ /* * - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -87,57 +87,89 @@ zelLoaderGetVersionsInternal( ZE_DLLEXPORT ze_result_t ZE_APICALL zelLoaderTranslateHandleInternal( zel_handle_type_t handleType, - void *handleIn, + void *handleIn, void **handleOut) { + if (!handleIn || !handleOut) { + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + } if(!loader::context->intercept_enabled) { *handleOut = handleIn; return ZE_RESULT_SUCCESS; } + *handleOut = handleIn; switch(handleType){ case ZEL_HANDLE_DRIVER: - *handleOut = reinterpret_cast( handleIn )->handle; + if (loader::context->ze_driver_factory.hasInstance(reinterpret_cast(handleIn)->handle)) { + *handleOut = reinterpret_cast( handleIn )->handle; + } break; case ZEL_HANDLE_DEVICE: - *handleOut = reinterpret_cast( handleIn )->handle; + if (loader::context->ze_device_factory.hasInstance(reinterpret_cast(handleIn)->handle)){ + *handleOut = reinterpret_cast( handleIn )->handle; + } break; case ZEL_HANDLE_CONTEXT: - *handleOut = reinterpret_cast( handleIn )->handle; - break; - case ZEL_HANDLE_COMMAND_QUEUE: - *handleOut = reinterpret_cast( handleIn )->handle; + if (loader::context->ze_context_factory.hasInstance(reinterpret_cast(handleIn)->handle)) { + *handleOut = reinterpret_cast( handleIn )->handle; + } + break; + case ZEL_HANDLE_COMMAND_QUEUE: + if (loader::context->ze_command_queue_factory.hasInstance(reinterpret_cast(handleIn)->handle)) { + *handleOut = reinterpret_cast( handleIn )->handle; + } break; - case ZEL_HANDLE_COMMAND_LIST: - *handleOut = reinterpret_cast( handleIn )->handle; + case ZEL_HANDLE_COMMAND_LIST: + if (loader::context->ze_command_list_factory.hasInstance(reinterpret_cast(handleIn)->handle)) { + *handleOut = reinterpret_cast( handleIn )->handle; + } break; - case ZEL_HANDLE_FENCE: - *handleOut = reinterpret_cast( handleIn )->handle; + case ZEL_HANDLE_FENCE: + if (loader::context->ze_fence_factory.hasInstance(reinterpret_cast(handleIn)->handle)) { + *handleOut = reinterpret_cast( handleIn )->handle; + } break; - case ZEL_HANDLE_EVENT_POOL: - *handleOut = reinterpret_cast( handleIn )->handle; + case ZEL_HANDLE_EVENT_POOL: + if (loader::context->ze_event_pool_factory.hasInstance(reinterpret_cast(handleIn)->handle)) { + *handleOut = reinterpret_cast( handleIn )->handle; + } break; - case ZEL_HANDLE_EVENT: - *handleOut = reinterpret_cast( handleIn )->handle; + case ZEL_HANDLE_EVENT: + if (loader::context->ze_event_factory.hasInstance(reinterpret_cast(handleIn)->handle)) { + *handleOut = reinterpret_cast( handleIn )->handle; + } break; - case ZEL_HANDLE_IMAGE: - *handleOut = reinterpret_cast( handleIn )->handle; + case ZEL_HANDLE_IMAGE: + if (loader::context->ze_image_factory.hasInstance(reinterpret_cast(handleIn)->handle)) { + *handleOut = reinterpret_cast( handleIn )->handle; + } break; - case ZEL_HANDLE_MODULE: - *handleOut = reinterpret_cast( handleIn )->handle; + case ZEL_HANDLE_MODULE: + if (loader::context->ze_module_factory.hasInstance(reinterpret_cast(handleIn)->handle)) { + *handleOut = reinterpret_cast( handleIn )->handle; + } break; - case ZEL_HANDLE_MODULE_BUILD_LOG: - *handleOut = reinterpret_cast( handleIn )->handle; + case ZEL_HANDLE_MODULE_BUILD_LOG: + if (loader::context->ze_module_build_log_factory.hasInstance(reinterpret_cast(handleIn)->handle)) { + *handleOut = reinterpret_cast( handleIn )->handle; + } break; - case ZEL_HANDLE_KERNEL: - *handleOut = reinterpret_cast( handleIn )->handle; + case ZEL_HANDLE_KERNEL: + if (loader::context->ze_kernel_factory.hasInstance(reinterpret_cast(handleIn)->handle)) { + *handleOut = reinterpret_cast( handleIn )->handle; + } break; - case ZEL_HANDLE_SAMPLER: - *handleOut = reinterpret_cast( handleIn )->handle; + case ZEL_HANDLE_SAMPLER: + if (loader::context->ze_sampler_factory.hasInstance(reinterpret_cast(handleIn)->handle)) { + *handleOut = reinterpret_cast( handleIn )->handle; + } break; - case ZEL_HANDLE_PHYSICAL_MEM: - *handleOut = reinterpret_cast( handleIn )->handle; + case ZEL_HANDLE_PHYSICAL_MEM: + if (loader::context->ze_physical_mem_factory.hasInstance(reinterpret_cast(handleIn)->handle)) { + *handleOut = reinterpret_cast( handleIn )->handle; + } break; default: return ZE_RESULT_ERROR_INVALID_ENUMERATION; diff --git a/source/loader/ze_loader_internal.h b/source/loader/ze_loader_internal.h index 94f123e9..1ce407f2 100644 --- a/source/loader/ze_loader_internal.h +++ b/source/loader/ze_loader_internal.h @@ -12,9 +12,7 @@ #include #include -#include "ze_ddi.h" -#include "zet_ddi.h" -#include "zes_ddi.h" +#include "ze_ddi_common.h" #include "ze_util.h" #include "ze_object.h" @@ -54,9 +52,10 @@ namespace loader std::string name; bool driverInuse = false; zel_driver_type_t driverType = ZEL_DRIVER_TYPE_FORCE_UINT32; - ze_driver_properties_t properties; + ze_driver_ddi_handles_ext_properties_t properties; bool pciOrderingRequested = false; bool legacyInitAttempted = false; + bool driverDDIHandleSupportQueried = false; }; using driver_vector_t = std::vector< driver_t >; @@ -154,6 +153,7 @@ namespace loader ~context_t(); bool intercept_enabled = false; bool debugTraceEnabled = false; + bool driverDDIPathDefault = false; bool tracingLayerEnabled = false; std::once_flag coreDriverSortOnce; std::once_flag sysmanDriverSortOnce; @@ -164,5 +164,9 @@ namespace loader std::shared_ptr zel_logger; }; + extern ze_handle_t* loaderDispatch; + extern ze_dditable_t* loaderZeDdiTable; + extern zet_dditable_t* loaderZetDdiTable; + extern zes_dditable_t* loaderZesDdiTable; extern context_t *context; } diff --git a/source/loader/ze_object.h b/source/loader/ze_object.h index 0420e737..417d82bf 100644 --- a/source/loader/ze_object.h +++ b/source/loader/ze_object.h @@ -1,6 +1,6 @@ /* * - * Copyright (C) 2019-2021 Intel Corporation + * Copyright (C) 2019-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -9,6 +9,7 @@ */ #pragma once #include "ze_singleton.h" +#include "ze_ddi_common.h" ////////////////////////////////////////////////////////////////////////// struct dditable_t @@ -18,13 +19,21 @@ struct dditable_t zes_dditable_t zes; }; +namespace loader { + + extern ze_handle_t* loaderDispatch; + +} + ////////////////////////////////////////////////////////////////////////// template class object_t { public: using handle_t = _handle_t; - + ze_dditable_driver_t *pCore; + zet_dditable_driver_t *pTools; + zes_dditable_driver_t *pSysman; handle_t handle; dditable_t* dditable; @@ -33,6 +42,9 @@ class object_t object_t( handle_t _handle, dditable_t* _dditable ) : handle( _handle ), dditable( _dditable ) { + pCore = loader::loaderDispatch->pCore; + pTools = loader::loaderDispatch->pTools; + pSysman = loader::loaderDispatch->pSysman; } ~object_t() = default; diff --git a/source/loader/zes_ldrddi.cpp b/source/loader/zes_ldrddi.cpp index 9e80fa9d..179e72f8 100644 --- a/source/loader/zes_ldrddi.cpp +++ b/source/loader/zes_ldrddi.cpp @@ -1,6 +1,6 @@ /* * - * Copyright (C) 2019-2024 Intel Corporation + * Copyright (C) 2019-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -9,6 +9,8 @@ */ #include "ze_loader_internal.h" +using namespace loader_driver_ddi; + namespace loader { /////////////////////////////////////////////////////////////////////////////// @@ -103,8 +105,28 @@ namespace loader { for( uint32_t i = 0; i < library_driver_handle_count; ++i ) { uint32_t driver_index = total_driver_handle_count + i; - phDrivers[ driver_index ] = reinterpret_cast( - context->zes_driver_factory.getInstance( phDrivers[ driver_index ], &drv.dditable ) ); + if (drv.driverDDIHandleSupportQueried == false) { + drv.properties = {}; + drv.properties.stype = ZE_STRUCTURE_TYPE_DRIVER_DDI_HANDLES_EXT_PROPERTIES; + drv.properties.pNext = nullptr; + ze_driver_properties_t driverProperties = {}; + driverProperties.stype = ZE_STRUCTURE_TYPE_DRIVER_PROPERTIES; + driverProperties.pNext = nullptr; + driverProperties.pNext = &drv.properties; + ze_result_t res = drv.dditable.ze.Driver.pfnGetProperties(phDrivers[ driver_index ], &driverProperties); + if (res != ZE_RESULT_SUCCESS) { + if (loader::context->debugTraceEnabled) { + std::string message = drv.name + " failed zeDriverGetProperties query, returned "; + loader::context->debug_trace_message(message, loader::to_string(res)); + } + return res; + } + drv.driverDDIHandleSupportQueried = true; + } + if (!(drv.properties.flags & ZE_DRIVER_DDI_HANDLE_EXT_FLAG_DDI_HANDLE_EXT_SUPPORTED) || !loader::context->driverDDIPathDefault) { + phDrivers[ driver_index ] = reinterpret_cast( + context->zes_driver_factory.getInstance( phDrivers[ driver_index ], &drv.dditable ) ); + } } } catch( std::bad_alloc& ) @@ -4584,6 +4606,348 @@ namespace loader extern "C" { #endif +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for Global table +__zedlllocal void ZE_APICALL +zesGetGlobalProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pSysman->Global->pfnInit = loader::zesInit; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for Device table +__zedlllocal void ZE_APICALL +zesGetDeviceProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pSysman->Device->pfnGetProperties = loader::zesDeviceGetProperties; + loader::loaderDispatch->pSysman->Device->pfnGetState = loader::zesDeviceGetState; + loader::loaderDispatch->pSysman->Device->pfnReset = loader::zesDeviceReset; + loader::loaderDispatch->pSysman->Device->pfnProcessesGetState = loader::zesDeviceProcessesGetState; + loader::loaderDispatch->pSysman->Device->pfnPciGetProperties = loader::zesDevicePciGetProperties; + loader::loaderDispatch->pSysman->Device->pfnPciGetState = loader::zesDevicePciGetState; + loader::loaderDispatch->pSysman->Device->pfnPciGetBars = loader::zesDevicePciGetBars; + loader::loaderDispatch->pSysman->Device->pfnPciGetStats = loader::zesDevicePciGetStats; + loader::loaderDispatch->pSysman->Device->pfnEnumDiagnosticTestSuites = loader::zesDeviceEnumDiagnosticTestSuites; + loader::loaderDispatch->pSysman->Device->pfnEnumEngineGroups = loader::zesDeviceEnumEngineGroups; + loader::loaderDispatch->pSysman->Device->pfnEventRegister = loader::zesDeviceEventRegister; + loader::loaderDispatch->pSysman->Device->pfnEnumFabricPorts = loader::zesDeviceEnumFabricPorts; + loader::loaderDispatch->pSysman->Device->pfnEnumFans = loader::zesDeviceEnumFans; + loader::loaderDispatch->pSysman->Device->pfnEnumFirmwares = loader::zesDeviceEnumFirmwares; + loader::loaderDispatch->pSysman->Device->pfnEnumFrequencyDomains = loader::zesDeviceEnumFrequencyDomains; + loader::loaderDispatch->pSysman->Device->pfnEnumLeds = loader::zesDeviceEnumLeds; + loader::loaderDispatch->pSysman->Device->pfnEnumMemoryModules = loader::zesDeviceEnumMemoryModules; + loader::loaderDispatch->pSysman->Device->pfnEnumPerformanceFactorDomains = loader::zesDeviceEnumPerformanceFactorDomains; + loader::loaderDispatch->pSysman->Device->pfnEnumPowerDomains = loader::zesDeviceEnumPowerDomains; + loader::loaderDispatch->pSysman->Device->pfnGetCardPowerDomain = loader::zesDeviceGetCardPowerDomain; + loader::loaderDispatch->pSysman->Device->pfnEnumPsus = loader::zesDeviceEnumPsus; + loader::loaderDispatch->pSysman->Device->pfnEnumRasErrorSets = loader::zesDeviceEnumRasErrorSets; + loader::loaderDispatch->pSysman->Device->pfnEnumSchedulers = loader::zesDeviceEnumSchedulers; + loader::loaderDispatch->pSysman->Device->pfnEnumStandbyDomains = loader::zesDeviceEnumStandbyDomains; + loader::loaderDispatch->pSysman->Device->pfnEnumTemperatureSensors = loader::zesDeviceEnumTemperatureSensors; + loader::loaderDispatch->pSysman->Device->pfnEccAvailable = loader::zesDeviceEccAvailable; + loader::loaderDispatch->pSysman->Device->pfnEccConfigurable = loader::zesDeviceEccConfigurable; + loader::loaderDispatch->pSysman->Device->pfnGetEccState = loader::zesDeviceGetEccState; + loader::loaderDispatch->pSysman->Device->pfnSetEccState = loader::zesDeviceSetEccState; + loader::loaderDispatch->pSysman->Device->pfnGet = loader::zesDeviceGet; + loader::loaderDispatch->pSysman->Device->pfnSetOverclockWaiver = loader::zesDeviceSetOverclockWaiver; + loader::loaderDispatch->pSysman->Device->pfnGetOverclockDomains = loader::zesDeviceGetOverclockDomains; + loader::loaderDispatch->pSysman->Device->pfnGetOverclockControls = loader::zesDeviceGetOverclockControls; + loader::loaderDispatch->pSysman->Device->pfnResetOverclockSettings = loader::zesDeviceResetOverclockSettings; + loader::loaderDispatch->pSysman->Device->pfnReadOverclockState = loader::zesDeviceReadOverclockState; + loader::loaderDispatch->pSysman->Device->pfnEnumOverclockDomains = loader::zesDeviceEnumOverclockDomains; + loader::loaderDispatch->pSysman->Device->pfnResetExt = loader::zesDeviceResetExt; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for DeviceExp table +__zedlllocal void ZE_APICALL +zesGetDeviceExpProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pSysman->DeviceExp->pfnEnumEnabledVFExp = loader::zesDeviceEnumEnabledVFExp; + loader::loaderDispatch->pSysman->DeviceExp->pfnGetSubDevicePropertiesExp = loader::zesDeviceGetSubDevicePropertiesExp; + loader::loaderDispatch->pSysman->DeviceExp->pfnEnumActiveVFExp = loader::zesDeviceEnumActiveVFExp; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for Driver table +__zedlllocal void ZE_APICALL +zesGetDriverProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pSysman->Driver->pfnEventListen = loader::zesDriverEventListen; + loader::loaderDispatch->pSysman->Driver->pfnEventListenEx = loader::zesDriverEventListenEx; + loader::loaderDispatch->pSysman->Driver->pfnGet = loader::zesDriverGet; + loader::loaderDispatch->pSysman->Driver->pfnGetExtensionProperties = loader::zesDriverGetExtensionProperties; + loader::loaderDispatch->pSysman->Driver->pfnGetExtensionFunctionAddress = loader::zesDriverGetExtensionFunctionAddress; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for DriverExp table +__zedlllocal void ZE_APICALL +zesGetDriverExpProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pSysman->DriverExp->pfnGetDeviceByUuidExp = loader::zesDriverGetDeviceByUuidExp; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for Diagnostics table +__zedlllocal void ZE_APICALL +zesGetDiagnosticsProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pSysman->Diagnostics->pfnGetProperties = loader::zesDiagnosticsGetProperties; + loader::loaderDispatch->pSysman->Diagnostics->pfnGetTests = loader::zesDiagnosticsGetTests; + loader::loaderDispatch->pSysman->Diagnostics->pfnRunTests = loader::zesDiagnosticsRunTests; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for Engine table +__zedlllocal void ZE_APICALL +zesGetEngineProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pSysman->Engine->pfnGetProperties = loader::zesEngineGetProperties; + loader::loaderDispatch->pSysman->Engine->pfnGetActivity = loader::zesEngineGetActivity; + loader::loaderDispatch->pSysman->Engine->pfnGetActivityExt = loader::zesEngineGetActivityExt; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for FabricPort table +__zedlllocal void ZE_APICALL +zesGetFabricPortProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pSysman->FabricPort->pfnGetProperties = loader::zesFabricPortGetProperties; + loader::loaderDispatch->pSysman->FabricPort->pfnGetLinkType = loader::zesFabricPortGetLinkType; + loader::loaderDispatch->pSysman->FabricPort->pfnGetConfig = loader::zesFabricPortGetConfig; + loader::loaderDispatch->pSysman->FabricPort->pfnSetConfig = loader::zesFabricPortSetConfig; + loader::loaderDispatch->pSysman->FabricPort->pfnGetState = loader::zesFabricPortGetState; + loader::loaderDispatch->pSysman->FabricPort->pfnGetThroughput = loader::zesFabricPortGetThroughput; + loader::loaderDispatch->pSysman->FabricPort->pfnGetFabricErrorCounters = loader::zesFabricPortGetFabricErrorCounters; + loader::loaderDispatch->pSysman->FabricPort->pfnGetMultiPortThroughput = loader::zesFabricPortGetMultiPortThroughput; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for Fan table +__zedlllocal void ZE_APICALL +zesGetFanProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pSysman->Fan->pfnGetProperties = loader::zesFanGetProperties; + loader::loaderDispatch->pSysman->Fan->pfnGetConfig = loader::zesFanGetConfig; + loader::loaderDispatch->pSysman->Fan->pfnSetDefaultMode = loader::zesFanSetDefaultMode; + loader::loaderDispatch->pSysman->Fan->pfnSetFixedSpeedMode = loader::zesFanSetFixedSpeedMode; + loader::loaderDispatch->pSysman->Fan->pfnSetSpeedTableMode = loader::zesFanSetSpeedTableMode; + loader::loaderDispatch->pSysman->Fan->pfnGetState = loader::zesFanGetState; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for Firmware table +__zedlllocal void ZE_APICALL +zesGetFirmwareProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pSysman->Firmware->pfnGetProperties = loader::zesFirmwareGetProperties; + loader::loaderDispatch->pSysman->Firmware->pfnFlash = loader::zesFirmwareFlash; + loader::loaderDispatch->pSysman->Firmware->pfnGetFlashProgress = loader::zesFirmwareGetFlashProgress; + loader::loaderDispatch->pSysman->Firmware->pfnGetConsoleLogs = loader::zesFirmwareGetConsoleLogs; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for FirmwareExp table +__zedlllocal void ZE_APICALL +zesGetFirmwareExpProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pSysman->FirmwareExp->pfnGetSecurityVersionExp = loader::zesFirmwareGetSecurityVersionExp; + loader::loaderDispatch->pSysman->FirmwareExp->pfnSetSecurityVersionExp = loader::zesFirmwareSetSecurityVersionExp; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for Frequency table +__zedlllocal void ZE_APICALL +zesGetFrequencyProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pSysman->Frequency->pfnGetProperties = loader::zesFrequencyGetProperties; + loader::loaderDispatch->pSysman->Frequency->pfnGetAvailableClocks = loader::zesFrequencyGetAvailableClocks; + loader::loaderDispatch->pSysman->Frequency->pfnGetRange = loader::zesFrequencyGetRange; + loader::loaderDispatch->pSysman->Frequency->pfnSetRange = loader::zesFrequencySetRange; + loader::loaderDispatch->pSysman->Frequency->pfnGetState = loader::zesFrequencyGetState; + loader::loaderDispatch->pSysman->Frequency->pfnGetThrottleTime = loader::zesFrequencyGetThrottleTime; + loader::loaderDispatch->pSysman->Frequency->pfnOcGetCapabilities = loader::zesFrequencyOcGetCapabilities; + loader::loaderDispatch->pSysman->Frequency->pfnOcGetFrequencyTarget = loader::zesFrequencyOcGetFrequencyTarget; + loader::loaderDispatch->pSysman->Frequency->pfnOcSetFrequencyTarget = loader::zesFrequencyOcSetFrequencyTarget; + loader::loaderDispatch->pSysman->Frequency->pfnOcGetVoltageTarget = loader::zesFrequencyOcGetVoltageTarget; + loader::loaderDispatch->pSysman->Frequency->pfnOcSetVoltageTarget = loader::zesFrequencyOcSetVoltageTarget; + loader::loaderDispatch->pSysman->Frequency->pfnOcSetMode = loader::zesFrequencyOcSetMode; + loader::loaderDispatch->pSysman->Frequency->pfnOcGetMode = loader::zesFrequencyOcGetMode; + loader::loaderDispatch->pSysman->Frequency->pfnOcGetIccMax = loader::zesFrequencyOcGetIccMax; + loader::loaderDispatch->pSysman->Frequency->pfnOcSetIccMax = loader::zesFrequencyOcSetIccMax; + loader::loaderDispatch->pSysman->Frequency->pfnOcGetTjMax = loader::zesFrequencyOcGetTjMax; + loader::loaderDispatch->pSysman->Frequency->pfnOcSetTjMax = loader::zesFrequencyOcSetTjMax; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for Led table +__zedlllocal void ZE_APICALL +zesGetLedProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pSysman->Led->pfnGetProperties = loader::zesLedGetProperties; + loader::loaderDispatch->pSysman->Led->pfnGetState = loader::zesLedGetState; + loader::loaderDispatch->pSysman->Led->pfnSetState = loader::zesLedSetState; + loader::loaderDispatch->pSysman->Led->pfnSetColor = loader::zesLedSetColor; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for Memory table +__zedlllocal void ZE_APICALL +zesGetMemoryProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pSysman->Memory->pfnGetProperties = loader::zesMemoryGetProperties; + loader::loaderDispatch->pSysman->Memory->pfnGetState = loader::zesMemoryGetState; + loader::loaderDispatch->pSysman->Memory->pfnGetBandwidth = loader::zesMemoryGetBandwidth; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for Overclock table +__zedlllocal void ZE_APICALL +zesGetOverclockProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pSysman->Overclock->pfnGetDomainProperties = loader::zesOverclockGetDomainProperties; + loader::loaderDispatch->pSysman->Overclock->pfnGetDomainVFProperties = loader::zesOverclockGetDomainVFProperties; + loader::loaderDispatch->pSysman->Overclock->pfnGetDomainControlProperties = loader::zesOverclockGetDomainControlProperties; + loader::loaderDispatch->pSysman->Overclock->pfnGetControlCurrentValue = loader::zesOverclockGetControlCurrentValue; + loader::loaderDispatch->pSysman->Overclock->pfnGetControlPendingValue = loader::zesOverclockGetControlPendingValue; + loader::loaderDispatch->pSysman->Overclock->pfnSetControlUserValue = loader::zesOverclockSetControlUserValue; + loader::loaderDispatch->pSysman->Overclock->pfnGetControlState = loader::zesOverclockGetControlState; + loader::loaderDispatch->pSysman->Overclock->pfnGetVFPointValues = loader::zesOverclockGetVFPointValues; + loader::loaderDispatch->pSysman->Overclock->pfnSetVFPointValues = loader::zesOverclockSetVFPointValues; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for PerformanceFactor table +__zedlllocal void ZE_APICALL +zesGetPerformanceFactorProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pSysman->PerformanceFactor->pfnGetProperties = loader::zesPerformanceFactorGetProperties; + loader::loaderDispatch->pSysman->PerformanceFactor->pfnGetConfig = loader::zesPerformanceFactorGetConfig; + loader::loaderDispatch->pSysman->PerformanceFactor->pfnSetConfig = loader::zesPerformanceFactorSetConfig; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for Power table +__zedlllocal void ZE_APICALL +zesGetPowerProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pSysman->Power->pfnGetProperties = loader::zesPowerGetProperties; + loader::loaderDispatch->pSysman->Power->pfnGetEnergyCounter = loader::zesPowerGetEnergyCounter; + loader::loaderDispatch->pSysman->Power->pfnGetLimits = loader::zesPowerGetLimits; + loader::loaderDispatch->pSysman->Power->pfnSetLimits = loader::zesPowerSetLimits; + loader::loaderDispatch->pSysman->Power->pfnGetEnergyThreshold = loader::zesPowerGetEnergyThreshold; + loader::loaderDispatch->pSysman->Power->pfnSetEnergyThreshold = loader::zesPowerSetEnergyThreshold; + loader::loaderDispatch->pSysman->Power->pfnGetLimitsExt = loader::zesPowerGetLimitsExt; + loader::loaderDispatch->pSysman->Power->pfnSetLimitsExt = loader::zesPowerSetLimitsExt; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for Psu table +__zedlllocal void ZE_APICALL +zesGetPsuProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pSysman->Psu->pfnGetProperties = loader::zesPsuGetProperties; + loader::loaderDispatch->pSysman->Psu->pfnGetState = loader::zesPsuGetState; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for Ras table +__zedlllocal void ZE_APICALL +zesGetRasProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pSysman->Ras->pfnGetProperties = loader::zesRasGetProperties; + loader::loaderDispatch->pSysman->Ras->pfnGetConfig = loader::zesRasGetConfig; + loader::loaderDispatch->pSysman->Ras->pfnSetConfig = loader::zesRasSetConfig; + loader::loaderDispatch->pSysman->Ras->pfnGetState = loader::zesRasGetState; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for RasExp table +__zedlllocal void ZE_APICALL +zesGetRasExpProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pSysman->RasExp->pfnGetStateExp = loader::zesRasGetStateExp; + loader::loaderDispatch->pSysman->RasExp->pfnClearStateExp = loader::zesRasClearStateExp; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for Scheduler table +__zedlllocal void ZE_APICALL +zesGetSchedulerProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pSysman->Scheduler->pfnGetProperties = loader::zesSchedulerGetProperties; + loader::loaderDispatch->pSysman->Scheduler->pfnGetCurrentMode = loader::zesSchedulerGetCurrentMode; + loader::loaderDispatch->pSysman->Scheduler->pfnGetTimeoutModeProperties = loader::zesSchedulerGetTimeoutModeProperties; + loader::loaderDispatch->pSysman->Scheduler->pfnGetTimesliceModeProperties = loader::zesSchedulerGetTimesliceModeProperties; + loader::loaderDispatch->pSysman->Scheduler->pfnSetTimeoutMode = loader::zesSchedulerSetTimeoutMode; + loader::loaderDispatch->pSysman->Scheduler->pfnSetTimesliceMode = loader::zesSchedulerSetTimesliceMode; + loader::loaderDispatch->pSysman->Scheduler->pfnSetExclusiveMode = loader::zesSchedulerSetExclusiveMode; + loader::loaderDispatch->pSysman->Scheduler->pfnSetComputeUnitDebugMode = loader::zesSchedulerSetComputeUnitDebugMode; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for Standby table +__zedlllocal void ZE_APICALL +zesGetStandbyProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pSysman->Standby->pfnGetProperties = loader::zesStandbyGetProperties; + loader::loaderDispatch->pSysman->Standby->pfnGetMode = loader::zesStandbyGetMode; + loader::loaderDispatch->pSysman->Standby->pfnSetMode = loader::zesStandbySetMode; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for Temperature table +__zedlllocal void ZE_APICALL +zesGetTemperatureProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pSysman->Temperature->pfnGetProperties = loader::zesTemperatureGetProperties; + loader::loaderDispatch->pSysman->Temperature->pfnGetConfig = loader::zesTemperatureGetConfig; + loader::loaderDispatch->pSysman->Temperature->pfnSetConfig = loader::zesTemperatureSetConfig; + loader::loaderDispatch->pSysman->Temperature->pfnGetState = loader::zesTemperatureGetState; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for VFManagementExp table +__zedlllocal void ZE_APICALL +zesGetVFManagementExpProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pSysman->VFManagementExp->pfnGetVFCapabilitiesExp = loader::zesVFManagementGetVFCapabilitiesExp; + loader::loaderDispatch->pSysman->VFManagementExp->pfnGetVFMemoryUtilizationExp2 = loader::zesVFManagementGetVFMemoryUtilizationExp2; + loader::loaderDispatch->pSysman->VFManagementExp->pfnGetVFEngineUtilizationExp2 = loader::zesVFManagementGetVFEngineUtilizationExp2; + loader::loaderDispatch->pSysman->VFManagementExp->pfnGetVFCapabilitiesExp2 = loader::zesVFManagementGetVFCapabilitiesExp2; + loader::loaderDispatch->pSysman->VFManagementExp->pfnGetVFPropertiesExp = loader::zesVFManagementGetVFPropertiesExp; + loader::loaderDispatch->pSysman->VFManagementExp->pfnGetVFMemoryUtilizationExp = loader::zesVFManagementGetVFMemoryUtilizationExp; + loader::loaderDispatch->pSysman->VFManagementExp->pfnGetVFEngineUtilizationExp = loader::zesVFManagementGetVFEngineUtilizationExp; + loader::loaderDispatch->pSysman->VFManagementExp->pfnSetVFTelemetryModeExp = loader::zesVFManagementSetVFTelemetryModeExp; + loader::loaderDispatch->pSysman->VFManagementExp->pfnSetVFTelemetrySamplingIntervalExp = loader::zesVFManagementSetVFTelemetrySamplingIntervalExp; +} + + /////////////////////////////////////////////////////////////////////////////// /// @brief Exported function for filling application's Global table /// with current process' addresses @@ -4643,9 +5007,11 @@ zesGetGlobalProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pSysman->Global = new zes_global_dditable_t; if (version >= ZE_API_VERSION_1_5) { - pDdiTable->pfnInit = loader::zesInit; + pDdiTable->pfnInit = loader::zesInit; } + zesGetGlobalProcAddrTableLegacy(); } else { @@ -4722,117 +5088,267 @@ zesGetDeviceProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pSysman->Device = new zes_device_dditable_t; if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetProperties = loader_driver_ddi::zesDeviceGetProperties; + } else { pDdiTable->pfnGetProperties = loader::zesDeviceGetProperties; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetState = loader_driver_ddi::zesDeviceGetState; + } else { pDdiTable->pfnGetState = loader::zesDeviceGetState; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnReset = loader_driver_ddi::zesDeviceReset; + } else { pDdiTable->pfnReset = loader::zesDeviceReset; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnProcessesGetState = loader_driver_ddi::zesDeviceProcessesGetState; + } else { pDdiTable->pfnProcessesGetState = loader::zesDeviceProcessesGetState; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnPciGetProperties = loader_driver_ddi::zesDevicePciGetProperties; + } else { pDdiTable->pfnPciGetProperties = loader::zesDevicePciGetProperties; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnPciGetState = loader_driver_ddi::zesDevicePciGetState; + } else { pDdiTable->pfnPciGetState = loader::zesDevicePciGetState; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnPciGetBars = loader_driver_ddi::zesDevicePciGetBars; + } else { pDdiTable->pfnPciGetBars = loader::zesDevicePciGetBars; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnPciGetStats = loader_driver_ddi::zesDevicePciGetStats; + } else { pDdiTable->pfnPciGetStats = loader::zesDevicePciGetStats; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnEnumDiagnosticTestSuites = loader_driver_ddi::zesDeviceEnumDiagnosticTestSuites; + } else { pDdiTable->pfnEnumDiagnosticTestSuites = loader::zesDeviceEnumDiagnosticTestSuites; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnEnumEngineGroups = loader_driver_ddi::zesDeviceEnumEngineGroups; + } else { pDdiTable->pfnEnumEngineGroups = loader::zesDeviceEnumEngineGroups; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnEventRegister = loader_driver_ddi::zesDeviceEventRegister; + } else { pDdiTable->pfnEventRegister = loader::zesDeviceEventRegister; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnEnumFabricPorts = loader_driver_ddi::zesDeviceEnumFabricPorts; + } else { pDdiTable->pfnEnumFabricPorts = loader::zesDeviceEnumFabricPorts; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnEnumFans = loader_driver_ddi::zesDeviceEnumFans; + } else { pDdiTable->pfnEnumFans = loader::zesDeviceEnumFans; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnEnumFirmwares = loader_driver_ddi::zesDeviceEnumFirmwares; + } else { pDdiTable->pfnEnumFirmwares = loader::zesDeviceEnumFirmwares; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnEnumFrequencyDomains = loader_driver_ddi::zesDeviceEnumFrequencyDomains; + } else { pDdiTable->pfnEnumFrequencyDomains = loader::zesDeviceEnumFrequencyDomains; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnEnumLeds = loader_driver_ddi::zesDeviceEnumLeds; + } else { pDdiTable->pfnEnumLeds = loader::zesDeviceEnumLeds; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnEnumMemoryModules = loader_driver_ddi::zesDeviceEnumMemoryModules; + } else { pDdiTable->pfnEnumMemoryModules = loader::zesDeviceEnumMemoryModules; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnEnumPerformanceFactorDomains = loader_driver_ddi::zesDeviceEnumPerformanceFactorDomains; + } else { pDdiTable->pfnEnumPerformanceFactorDomains = loader::zesDeviceEnumPerformanceFactorDomains; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnEnumPowerDomains = loader_driver_ddi::zesDeviceEnumPowerDomains; + } else { pDdiTable->pfnEnumPowerDomains = loader::zesDeviceEnumPowerDomains; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetCardPowerDomain = loader_driver_ddi::zesDeviceGetCardPowerDomain; + } else { pDdiTable->pfnGetCardPowerDomain = loader::zesDeviceGetCardPowerDomain; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnEnumPsus = loader_driver_ddi::zesDeviceEnumPsus; + } else { pDdiTable->pfnEnumPsus = loader::zesDeviceEnumPsus; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnEnumRasErrorSets = loader_driver_ddi::zesDeviceEnumRasErrorSets; + } else { pDdiTable->pfnEnumRasErrorSets = loader::zesDeviceEnumRasErrorSets; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnEnumSchedulers = loader_driver_ddi::zesDeviceEnumSchedulers; + } else { pDdiTable->pfnEnumSchedulers = loader::zesDeviceEnumSchedulers; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnEnumStandbyDomains = loader_driver_ddi::zesDeviceEnumStandbyDomains; + } else { pDdiTable->pfnEnumStandbyDomains = loader::zesDeviceEnumStandbyDomains; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnEnumTemperatureSensors = loader_driver_ddi::zesDeviceEnumTemperatureSensors; + } else { pDdiTable->pfnEnumTemperatureSensors = loader::zesDeviceEnumTemperatureSensors; } + } if (version >= ZE_API_VERSION_1_4) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnEccAvailable = loader_driver_ddi::zesDeviceEccAvailable; + } else { pDdiTable->pfnEccAvailable = loader::zesDeviceEccAvailable; } + } if (version >= ZE_API_VERSION_1_4) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnEccConfigurable = loader_driver_ddi::zesDeviceEccConfigurable; + } else { pDdiTable->pfnEccConfigurable = loader::zesDeviceEccConfigurable; } + } if (version >= ZE_API_VERSION_1_4) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetEccState = loader_driver_ddi::zesDeviceGetEccState; + } else { pDdiTable->pfnGetEccState = loader::zesDeviceGetEccState; } + } if (version >= ZE_API_VERSION_1_4) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnSetEccState = loader_driver_ddi::zesDeviceSetEccState; + } else { pDdiTable->pfnSetEccState = loader::zesDeviceSetEccState; } + } if (version >= ZE_API_VERSION_1_5) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGet = loader_driver_ddi::zesDeviceGet; + } else { pDdiTable->pfnGet = loader::zesDeviceGet; } + } if (version >= ZE_API_VERSION_1_5) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnSetOverclockWaiver = loader_driver_ddi::zesDeviceSetOverclockWaiver; + } else { pDdiTable->pfnSetOverclockWaiver = loader::zesDeviceSetOverclockWaiver; } + } if (version >= ZE_API_VERSION_1_5) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetOverclockDomains = loader_driver_ddi::zesDeviceGetOverclockDomains; + } else { pDdiTable->pfnGetOverclockDomains = loader::zesDeviceGetOverclockDomains; } + } if (version >= ZE_API_VERSION_1_5) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetOverclockControls = loader_driver_ddi::zesDeviceGetOverclockControls; + } else { pDdiTable->pfnGetOverclockControls = loader::zesDeviceGetOverclockControls; } + } if (version >= ZE_API_VERSION_1_5) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnResetOverclockSettings = loader_driver_ddi::zesDeviceResetOverclockSettings; + } else { pDdiTable->pfnResetOverclockSettings = loader::zesDeviceResetOverclockSettings; } + } if (version >= ZE_API_VERSION_1_5) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnReadOverclockState = loader_driver_ddi::zesDeviceReadOverclockState; + } else { pDdiTable->pfnReadOverclockState = loader::zesDeviceReadOverclockState; } + } if (version >= ZE_API_VERSION_1_5) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnEnumOverclockDomains = loader_driver_ddi::zesDeviceEnumOverclockDomains; + } else { pDdiTable->pfnEnumOverclockDomains = loader::zesDeviceEnumOverclockDomains; } + } if (version >= ZE_API_VERSION_1_7) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnResetExt = loader_driver_ddi::zesDeviceResetExt; + } else { pDdiTable->pfnResetExt = loader::zesDeviceResetExt; } + } + zesGetDeviceProcAddrTableLegacy(); } else { @@ -4899,15 +5415,29 @@ zesGetDeviceExpProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pSysman->DeviceExp = new zes_device_exp_dditable_t; if (version >= ZE_API_VERSION_1_10) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnEnumEnabledVFExp = loader_driver_ddi::zesDeviceEnumEnabledVFExp; + } else { pDdiTable->pfnEnumEnabledVFExp = loader::zesDeviceEnumEnabledVFExp; } + } if (version >= ZE_API_VERSION_1_9) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetSubDevicePropertiesExp = loader_driver_ddi::zesDeviceGetSubDevicePropertiesExp; + } else { pDdiTable->pfnGetSubDevicePropertiesExp = loader::zesDeviceGetSubDevicePropertiesExp; } + } if (version >= ZE_API_VERSION_1_9) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnEnumActiveVFExp = loader_driver_ddi::zesDeviceEnumActiveVFExp; + } else { pDdiTable->pfnEnumActiveVFExp = loader::zesDeviceEnumActiveVFExp; } + } + zesGetDeviceExpProcAddrTableLegacy(); } else { @@ -4984,21 +5514,39 @@ zesGetDriverProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pSysman->Driver = new zes_driver_dditable_t; if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnEventListen = loader_driver_ddi::zesDriverEventListen; + } else { pDdiTable->pfnEventListen = loader::zesDriverEventListen; } + } if (version >= ZE_API_VERSION_1_1) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnEventListenEx = loader_driver_ddi::zesDriverEventListenEx; + } else { pDdiTable->pfnEventListenEx = loader::zesDriverEventListenEx; } + } if (version >= ZE_API_VERSION_1_5) { - pDdiTable->pfnGet = loader::zesDriverGet; + pDdiTable->pfnGet = loader::zesDriverGet; } if (version >= ZE_API_VERSION_1_8) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetExtensionProperties = loader_driver_ddi::zesDriverGetExtensionProperties; + } else { pDdiTable->pfnGetExtensionProperties = loader::zesDriverGetExtensionProperties; } + } if (version >= ZE_API_VERSION_1_8) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetExtensionFunctionAddress = loader_driver_ddi::zesDriverGetExtensionFunctionAddress; + } else { pDdiTable->pfnGetExtensionFunctionAddress = loader::zesDriverGetExtensionFunctionAddress; } + } + zesGetDriverProcAddrTableLegacy(); } else { @@ -5065,9 +5613,15 @@ zesGetDriverExpProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pSysman->DriverExp = new zes_driver_exp_dditable_t; if (version >= ZE_API_VERSION_1_9) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetDeviceByUuidExp = loader_driver_ddi::zesDriverGetDeviceByUuidExp; + } else { pDdiTable->pfnGetDeviceByUuidExp = loader::zesDriverGetDeviceByUuidExp; } + } + zesGetDriverExpProcAddrTableLegacy(); } else { @@ -5144,15 +5698,29 @@ zesGetDiagnosticsProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pSysman->Diagnostics = new zes_diagnostics_dditable_t; if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetProperties = loader_driver_ddi::zesDiagnosticsGetProperties; + } else { pDdiTable->pfnGetProperties = loader::zesDiagnosticsGetProperties; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetTests = loader_driver_ddi::zesDiagnosticsGetTests; + } else { pDdiTable->pfnGetTests = loader::zesDiagnosticsGetTests; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnRunTests = loader_driver_ddi::zesDiagnosticsRunTests; + } else { pDdiTable->pfnRunTests = loader::zesDiagnosticsRunTests; } + } + zesGetDiagnosticsProcAddrTableLegacy(); } else { @@ -5229,15 +5797,29 @@ zesGetEngineProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pSysman->Engine = new zes_engine_dditable_t; if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetProperties = loader_driver_ddi::zesEngineGetProperties; + } else { pDdiTable->pfnGetProperties = loader::zesEngineGetProperties; } + } if (version >= ZE_API_VERSION_1_7) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetActivity = loader_driver_ddi::zesEngineGetActivity; + } else { pDdiTable->pfnGetActivity = loader::zesEngineGetActivity; } + } if (version >= ZE_API_VERSION_1_7) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetActivityExt = loader_driver_ddi::zesEngineGetActivityExt; + } else { pDdiTable->pfnGetActivityExt = loader::zesEngineGetActivityExt; } + } + zesGetEngineProcAddrTableLegacy(); } else { @@ -5314,30 +5896,64 @@ zesGetFabricPortProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pSysman->FabricPort = new zes_fabric_port_dditable_t; if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetProperties = loader_driver_ddi::zesFabricPortGetProperties; + } else { pDdiTable->pfnGetProperties = loader::zesFabricPortGetProperties; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetLinkType = loader_driver_ddi::zesFabricPortGetLinkType; + } else { pDdiTable->pfnGetLinkType = loader::zesFabricPortGetLinkType; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetConfig = loader_driver_ddi::zesFabricPortGetConfig; + } else { pDdiTable->pfnGetConfig = loader::zesFabricPortGetConfig; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnSetConfig = loader_driver_ddi::zesFabricPortSetConfig; + } else { pDdiTable->pfnSetConfig = loader::zesFabricPortSetConfig; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetState = loader_driver_ddi::zesFabricPortGetState; + } else { pDdiTable->pfnGetState = loader::zesFabricPortGetState; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetThroughput = loader_driver_ddi::zesFabricPortGetThroughput; + } else { pDdiTable->pfnGetThroughput = loader::zesFabricPortGetThroughput; } + } if (version >= ZE_API_VERSION_1_7) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetFabricErrorCounters = loader_driver_ddi::zesFabricPortGetFabricErrorCounters; + } else { pDdiTable->pfnGetFabricErrorCounters = loader::zesFabricPortGetFabricErrorCounters; } + } if (version >= ZE_API_VERSION_1_7) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetMultiPortThroughput = loader_driver_ddi::zesFabricPortGetMultiPortThroughput; + } else { pDdiTable->pfnGetMultiPortThroughput = loader::zesFabricPortGetMultiPortThroughput; } + } + zesGetFabricPortProcAddrTableLegacy(); } else { @@ -5414,24 +6030,50 @@ zesGetFanProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pSysman->Fan = new zes_fan_dditable_t; if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetProperties = loader_driver_ddi::zesFanGetProperties; + } else { pDdiTable->pfnGetProperties = loader::zesFanGetProperties; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetConfig = loader_driver_ddi::zesFanGetConfig; + } else { pDdiTable->pfnGetConfig = loader::zesFanGetConfig; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnSetDefaultMode = loader_driver_ddi::zesFanSetDefaultMode; + } else { pDdiTable->pfnSetDefaultMode = loader::zesFanSetDefaultMode; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnSetFixedSpeedMode = loader_driver_ddi::zesFanSetFixedSpeedMode; + } else { pDdiTable->pfnSetFixedSpeedMode = loader::zesFanSetFixedSpeedMode; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnSetSpeedTableMode = loader_driver_ddi::zesFanSetSpeedTableMode; + } else { pDdiTable->pfnSetSpeedTableMode = loader::zesFanSetSpeedTableMode; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetState = loader_driver_ddi::zesFanGetState; + } else { pDdiTable->pfnGetState = loader::zesFanGetState; } + } + zesGetFanProcAddrTableLegacy(); } else { @@ -5508,18 +6150,36 @@ zesGetFirmwareProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pSysman->Firmware = new zes_firmware_dditable_t; if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetProperties = loader_driver_ddi::zesFirmwareGetProperties; + } else { pDdiTable->pfnGetProperties = loader::zesFirmwareGetProperties; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnFlash = loader_driver_ddi::zesFirmwareFlash; + } else { pDdiTable->pfnFlash = loader::zesFirmwareFlash; } + } if (version >= ZE_API_VERSION_1_8) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetFlashProgress = loader_driver_ddi::zesFirmwareGetFlashProgress; + } else { pDdiTable->pfnGetFlashProgress = loader::zesFirmwareGetFlashProgress; } + } if (version >= ZE_API_VERSION_1_9) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetConsoleLogs = loader_driver_ddi::zesFirmwareGetConsoleLogs; + } else { pDdiTable->pfnGetConsoleLogs = loader::zesFirmwareGetConsoleLogs; } + } + zesGetFirmwareProcAddrTableLegacy(); } else { @@ -5586,12 +6246,22 @@ zesGetFirmwareExpProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pSysman->FirmwareExp = new zes_firmware_exp_dditable_t; if (version >= ZE_API_VERSION_1_9) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetSecurityVersionExp = loader_driver_ddi::zesFirmwareGetSecurityVersionExp; + } else { pDdiTable->pfnGetSecurityVersionExp = loader::zesFirmwareGetSecurityVersionExp; } + } if (version >= ZE_API_VERSION_1_9) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnSetSecurityVersionExp = loader_driver_ddi::zesFirmwareSetSecurityVersionExp; + } else { pDdiTable->pfnSetSecurityVersionExp = loader::zesFirmwareSetSecurityVersionExp; } + } + zesGetFirmwareExpProcAddrTableLegacy(); } else { @@ -5668,57 +6338,127 @@ zesGetFrequencyProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pSysman->Frequency = new zes_frequency_dditable_t; if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetProperties = loader_driver_ddi::zesFrequencyGetProperties; + } else { pDdiTable->pfnGetProperties = loader::zesFrequencyGetProperties; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetAvailableClocks = loader_driver_ddi::zesFrequencyGetAvailableClocks; + } else { pDdiTable->pfnGetAvailableClocks = loader::zesFrequencyGetAvailableClocks; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetRange = loader_driver_ddi::zesFrequencyGetRange; + } else { pDdiTable->pfnGetRange = loader::zesFrequencyGetRange; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnSetRange = loader_driver_ddi::zesFrequencySetRange; + } else { pDdiTable->pfnSetRange = loader::zesFrequencySetRange; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetState = loader_driver_ddi::zesFrequencyGetState; + } else { pDdiTable->pfnGetState = loader::zesFrequencyGetState; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetThrottleTime = loader_driver_ddi::zesFrequencyGetThrottleTime; + } else { pDdiTable->pfnGetThrottleTime = loader::zesFrequencyGetThrottleTime; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnOcGetCapabilities = loader_driver_ddi::zesFrequencyOcGetCapabilities; + } else { pDdiTable->pfnOcGetCapabilities = loader::zesFrequencyOcGetCapabilities; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnOcGetFrequencyTarget = loader_driver_ddi::zesFrequencyOcGetFrequencyTarget; + } else { pDdiTable->pfnOcGetFrequencyTarget = loader::zesFrequencyOcGetFrequencyTarget; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnOcSetFrequencyTarget = loader_driver_ddi::zesFrequencyOcSetFrequencyTarget; + } else { pDdiTable->pfnOcSetFrequencyTarget = loader::zesFrequencyOcSetFrequencyTarget; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnOcGetVoltageTarget = loader_driver_ddi::zesFrequencyOcGetVoltageTarget; + } else { pDdiTable->pfnOcGetVoltageTarget = loader::zesFrequencyOcGetVoltageTarget; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnOcSetVoltageTarget = loader_driver_ddi::zesFrequencyOcSetVoltageTarget; + } else { pDdiTable->pfnOcSetVoltageTarget = loader::zesFrequencyOcSetVoltageTarget; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnOcSetMode = loader_driver_ddi::zesFrequencyOcSetMode; + } else { pDdiTable->pfnOcSetMode = loader::zesFrequencyOcSetMode; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnOcGetMode = loader_driver_ddi::zesFrequencyOcGetMode; + } else { pDdiTable->pfnOcGetMode = loader::zesFrequencyOcGetMode; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnOcGetIccMax = loader_driver_ddi::zesFrequencyOcGetIccMax; + } else { pDdiTable->pfnOcGetIccMax = loader::zesFrequencyOcGetIccMax; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnOcSetIccMax = loader_driver_ddi::zesFrequencyOcSetIccMax; + } else { pDdiTable->pfnOcSetIccMax = loader::zesFrequencyOcSetIccMax; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnOcGetTjMax = loader_driver_ddi::zesFrequencyOcGetTjMax; + } else { pDdiTable->pfnOcGetTjMax = loader::zesFrequencyOcGetTjMax; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnOcSetTjMax = loader_driver_ddi::zesFrequencyOcSetTjMax; + } else { pDdiTable->pfnOcSetTjMax = loader::zesFrequencyOcSetTjMax; } + } + zesGetFrequencyProcAddrTableLegacy(); } else { @@ -5795,18 +6535,36 @@ zesGetLedProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pSysman->Led = new zes_led_dditable_t; if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetProperties = loader_driver_ddi::zesLedGetProperties; + } else { pDdiTable->pfnGetProperties = loader::zesLedGetProperties; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetState = loader_driver_ddi::zesLedGetState; + } else { pDdiTable->pfnGetState = loader::zesLedGetState; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnSetState = loader_driver_ddi::zesLedSetState; + } else { pDdiTable->pfnSetState = loader::zesLedSetState; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnSetColor = loader_driver_ddi::zesLedSetColor; + } else { pDdiTable->pfnSetColor = loader::zesLedSetColor; } + } + zesGetLedProcAddrTableLegacy(); } else { @@ -5883,15 +6641,29 @@ zesGetMemoryProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pSysman->Memory = new zes_memory_dditable_t; if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetProperties = loader_driver_ddi::zesMemoryGetProperties; + } else { pDdiTable->pfnGetProperties = loader::zesMemoryGetProperties; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetState = loader_driver_ddi::zesMemoryGetState; + } else { pDdiTable->pfnGetState = loader::zesMemoryGetState; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetBandwidth = loader_driver_ddi::zesMemoryGetBandwidth; + } else { pDdiTable->pfnGetBandwidth = loader::zesMemoryGetBandwidth; } + } + zesGetMemoryProcAddrTableLegacy(); } else { @@ -5972,33 +6744,71 @@ zesGetOverclockProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pSysman->Overclock = new zes_overclock_dditable_t; if (version >= ZE_API_VERSION_1_5) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetDomainProperties = loader_driver_ddi::zesOverclockGetDomainProperties; + } else { pDdiTable->pfnGetDomainProperties = loader::zesOverclockGetDomainProperties; } + } if (version >= ZE_API_VERSION_1_5) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetDomainVFProperties = loader_driver_ddi::zesOverclockGetDomainVFProperties; + } else { pDdiTable->pfnGetDomainVFProperties = loader::zesOverclockGetDomainVFProperties; } + } if (version >= ZE_API_VERSION_1_5) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetDomainControlProperties = loader_driver_ddi::zesOverclockGetDomainControlProperties; + } else { pDdiTable->pfnGetDomainControlProperties = loader::zesOverclockGetDomainControlProperties; } + } if (version >= ZE_API_VERSION_1_5) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetControlCurrentValue = loader_driver_ddi::zesOverclockGetControlCurrentValue; + } else { pDdiTable->pfnGetControlCurrentValue = loader::zesOverclockGetControlCurrentValue; } + } if (version >= ZE_API_VERSION_1_5) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetControlPendingValue = loader_driver_ddi::zesOverclockGetControlPendingValue; + } else { pDdiTable->pfnGetControlPendingValue = loader::zesOverclockGetControlPendingValue; } + } if (version >= ZE_API_VERSION_1_5) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnSetControlUserValue = loader_driver_ddi::zesOverclockSetControlUserValue; + } else { pDdiTable->pfnSetControlUserValue = loader::zesOverclockSetControlUserValue; } + } if (version >= ZE_API_VERSION_1_5) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetControlState = loader_driver_ddi::zesOverclockGetControlState; + } else { pDdiTable->pfnGetControlState = loader::zesOverclockGetControlState; } + } if (version >= ZE_API_VERSION_1_5) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetVFPointValues = loader_driver_ddi::zesOverclockGetVFPointValues; + } else { pDdiTable->pfnGetVFPointValues = loader::zesOverclockGetVFPointValues; } + } if (version >= ZE_API_VERSION_1_5) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnSetVFPointValues = loader_driver_ddi::zesOverclockSetVFPointValues; + } else { pDdiTable->pfnSetVFPointValues = loader::zesOverclockSetVFPointValues; } + } + zesGetOverclockProcAddrTableLegacy(); } else { @@ -6075,15 +6885,29 @@ zesGetPerformanceFactorProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pSysman->PerformanceFactor = new zes_performance_factor_dditable_t; if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetProperties = loader_driver_ddi::zesPerformanceFactorGetProperties; + } else { pDdiTable->pfnGetProperties = loader::zesPerformanceFactorGetProperties; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetConfig = loader_driver_ddi::zesPerformanceFactorGetConfig; + } else { pDdiTable->pfnGetConfig = loader::zesPerformanceFactorGetConfig; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnSetConfig = loader_driver_ddi::zesPerformanceFactorSetConfig; + } else { pDdiTable->pfnSetConfig = loader::zesPerformanceFactorSetConfig; } + } + zesGetPerformanceFactorProcAddrTableLegacy(); } else { @@ -6160,30 +6984,64 @@ zesGetPowerProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pSysman->Power = new zes_power_dditable_t; if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetProperties = loader_driver_ddi::zesPowerGetProperties; + } else { pDdiTable->pfnGetProperties = loader::zesPowerGetProperties; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetEnergyCounter = loader_driver_ddi::zesPowerGetEnergyCounter; + } else { pDdiTable->pfnGetEnergyCounter = loader::zesPowerGetEnergyCounter; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetLimits = loader_driver_ddi::zesPowerGetLimits; + } else { pDdiTable->pfnGetLimits = loader::zesPowerGetLimits; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnSetLimits = loader_driver_ddi::zesPowerSetLimits; + } else { pDdiTable->pfnSetLimits = loader::zesPowerSetLimits; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetEnergyThreshold = loader_driver_ddi::zesPowerGetEnergyThreshold; + } else { pDdiTable->pfnGetEnergyThreshold = loader::zesPowerGetEnergyThreshold; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnSetEnergyThreshold = loader_driver_ddi::zesPowerSetEnergyThreshold; + } else { pDdiTable->pfnSetEnergyThreshold = loader::zesPowerSetEnergyThreshold; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetLimitsExt = loader_driver_ddi::zesPowerGetLimitsExt; + } else { pDdiTable->pfnGetLimitsExt = loader::zesPowerGetLimitsExt; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnSetLimitsExt = loader_driver_ddi::zesPowerSetLimitsExt; + } else { pDdiTable->pfnSetLimitsExt = loader::zesPowerSetLimitsExt; } + } + zesGetPowerProcAddrTableLegacy(); } else { @@ -6260,12 +7118,22 @@ zesGetPsuProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pSysman->Psu = new zes_psu_dditable_t; if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetProperties = loader_driver_ddi::zesPsuGetProperties; + } else { pDdiTable->pfnGetProperties = loader::zesPsuGetProperties; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetState = loader_driver_ddi::zesPsuGetState; + } else { pDdiTable->pfnGetState = loader::zesPsuGetState; } + } + zesGetPsuProcAddrTableLegacy(); } else { @@ -6342,18 +7210,36 @@ zesGetRasProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pSysman->Ras = new zes_ras_dditable_t; if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetProperties = loader_driver_ddi::zesRasGetProperties; + } else { pDdiTable->pfnGetProperties = loader::zesRasGetProperties; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetConfig = loader_driver_ddi::zesRasGetConfig; + } else { pDdiTable->pfnGetConfig = loader::zesRasGetConfig; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnSetConfig = loader_driver_ddi::zesRasSetConfig; + } else { pDdiTable->pfnSetConfig = loader::zesRasSetConfig; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetState = loader_driver_ddi::zesRasGetState; + } else { pDdiTable->pfnGetState = loader::zesRasGetState; } + } + zesGetRasProcAddrTableLegacy(); } else { @@ -6420,12 +7306,22 @@ zesGetRasExpProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pSysman->RasExp = new zes_ras_exp_dditable_t; if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetStateExp = loader_driver_ddi::zesRasGetStateExp; + } else { pDdiTable->pfnGetStateExp = loader::zesRasGetStateExp; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnClearStateExp = loader_driver_ddi::zesRasClearStateExp; + } else { pDdiTable->pfnClearStateExp = loader::zesRasClearStateExp; } + } + zesGetRasExpProcAddrTableLegacy(); } else { @@ -6502,30 +7398,64 @@ zesGetSchedulerProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pSysman->Scheduler = new zes_scheduler_dditable_t; if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetProperties = loader_driver_ddi::zesSchedulerGetProperties; + } else { pDdiTable->pfnGetProperties = loader::zesSchedulerGetProperties; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetCurrentMode = loader_driver_ddi::zesSchedulerGetCurrentMode; + } else { pDdiTable->pfnGetCurrentMode = loader::zesSchedulerGetCurrentMode; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetTimeoutModeProperties = loader_driver_ddi::zesSchedulerGetTimeoutModeProperties; + } else { pDdiTable->pfnGetTimeoutModeProperties = loader::zesSchedulerGetTimeoutModeProperties; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetTimesliceModeProperties = loader_driver_ddi::zesSchedulerGetTimesliceModeProperties; + } else { pDdiTable->pfnGetTimesliceModeProperties = loader::zesSchedulerGetTimesliceModeProperties; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnSetTimeoutMode = loader_driver_ddi::zesSchedulerSetTimeoutMode; + } else { pDdiTable->pfnSetTimeoutMode = loader::zesSchedulerSetTimeoutMode; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnSetTimesliceMode = loader_driver_ddi::zesSchedulerSetTimesliceMode; + } else { pDdiTable->pfnSetTimesliceMode = loader::zesSchedulerSetTimesliceMode; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnSetExclusiveMode = loader_driver_ddi::zesSchedulerSetExclusiveMode; + } else { pDdiTable->pfnSetExclusiveMode = loader::zesSchedulerSetExclusiveMode; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnSetComputeUnitDebugMode = loader_driver_ddi::zesSchedulerSetComputeUnitDebugMode; + } else { pDdiTable->pfnSetComputeUnitDebugMode = loader::zesSchedulerSetComputeUnitDebugMode; } + } + zesGetSchedulerProcAddrTableLegacy(); } else { @@ -6602,15 +7532,29 @@ zesGetStandbyProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pSysman->Standby = new zes_standby_dditable_t; if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetProperties = loader_driver_ddi::zesStandbyGetProperties; + } else { pDdiTable->pfnGetProperties = loader::zesStandbyGetProperties; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetMode = loader_driver_ddi::zesStandbyGetMode; + } else { pDdiTable->pfnGetMode = loader::zesStandbyGetMode; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnSetMode = loader_driver_ddi::zesStandbySetMode; + } else { pDdiTable->pfnSetMode = loader::zesStandbySetMode; } + } + zesGetStandbyProcAddrTableLegacy(); } else { @@ -6687,18 +7631,36 @@ zesGetTemperatureProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pSysman->Temperature = new zes_temperature_dditable_t; if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetProperties = loader_driver_ddi::zesTemperatureGetProperties; + } else { pDdiTable->pfnGetProperties = loader::zesTemperatureGetProperties; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetConfig = loader_driver_ddi::zesTemperatureGetConfig; + } else { pDdiTable->pfnGetConfig = loader::zesTemperatureGetConfig; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnSetConfig = loader_driver_ddi::zesTemperatureSetConfig; + } else { pDdiTable->pfnSetConfig = loader::zesTemperatureSetConfig; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetState = loader_driver_ddi::zesTemperatureGetState; + } else { pDdiTable->pfnGetState = loader::zesTemperatureGetState; } + } + zesGetTemperatureProcAddrTableLegacy(); } else { @@ -6765,33 +7727,71 @@ zesGetVFManagementExpProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pSysman->VFManagementExp = new zes_vf_management_exp_dditable_t; if (version >= ZE_API_VERSION_1_10) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetVFCapabilitiesExp = loader_driver_ddi::zesVFManagementGetVFCapabilitiesExp; + } else { pDdiTable->pfnGetVFCapabilitiesExp = loader::zesVFManagementGetVFCapabilitiesExp; } + } if (version >= ZE_API_VERSION_1_10) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetVFMemoryUtilizationExp2 = loader_driver_ddi::zesVFManagementGetVFMemoryUtilizationExp2; + } else { pDdiTable->pfnGetVFMemoryUtilizationExp2 = loader::zesVFManagementGetVFMemoryUtilizationExp2; } + } if (version >= ZE_API_VERSION_1_10) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetVFEngineUtilizationExp2 = loader_driver_ddi::zesVFManagementGetVFEngineUtilizationExp2; + } else { pDdiTable->pfnGetVFEngineUtilizationExp2 = loader::zesVFManagementGetVFEngineUtilizationExp2; } + } if (version >= ZE_API_VERSION_1_12) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetVFCapabilitiesExp2 = loader_driver_ddi::zesVFManagementGetVFCapabilitiesExp2; + } else { pDdiTable->pfnGetVFCapabilitiesExp2 = loader::zesVFManagementGetVFCapabilitiesExp2; } + } if (version >= ZE_API_VERSION_1_9) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetVFPropertiesExp = loader_driver_ddi::zesVFManagementGetVFPropertiesExp; + } else { pDdiTable->pfnGetVFPropertiesExp = loader::zesVFManagementGetVFPropertiesExp; } + } if (version >= ZE_API_VERSION_1_9) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetVFMemoryUtilizationExp = loader_driver_ddi::zesVFManagementGetVFMemoryUtilizationExp; + } else { pDdiTable->pfnGetVFMemoryUtilizationExp = loader::zesVFManagementGetVFMemoryUtilizationExp; } + } if (version >= ZE_API_VERSION_1_9) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetVFEngineUtilizationExp = loader_driver_ddi::zesVFManagementGetVFEngineUtilizationExp; + } else { pDdiTable->pfnGetVFEngineUtilizationExp = loader::zesVFManagementGetVFEngineUtilizationExp; } + } if (version >= ZE_API_VERSION_1_9) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnSetVFTelemetryModeExp = loader_driver_ddi::zesVFManagementSetVFTelemetryModeExp; + } else { pDdiTable->pfnSetVFTelemetryModeExp = loader::zesVFManagementSetVFTelemetryModeExp; } + } if (version >= ZE_API_VERSION_1_9) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnSetVFTelemetrySamplingIntervalExp = loader_driver_ddi::zesVFManagementSetVFTelemetrySamplingIntervalExp; + } else { pDdiTable->pfnSetVFTelemetrySamplingIntervalExp = loader::zesVFManagementSetVFTelemetrySamplingIntervalExp; } + } + zesGetVFManagementExpProcAddrTableLegacy(); } else { @@ -6816,4 +7816,4 @@ zesGetVFManagementExpProcAddrTable( #if defined(__cplusplus) }; -#endif +#endif \ No newline at end of file diff --git a/source/loader/zes_ldrddi.h b/source/loader/zes_ldrddi.h index 53573c17..a9438284 100644 --- a/source/loader/zes_ldrddi.h +++ b/source/loader/zes_ldrddi.h @@ -1,6 +1,6 @@ /* * - * Copyright (C) 2019-2024 Intel Corporation + * Copyright (C) 2019-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -70,3 +70,1247 @@ namespace loader using zes_vf_factory_t = singleton_factory_t < zes_vf_object_t, zes_vf_handle_t >; } + +namespace loader_driver_ddi +{ + __zedlllocal void ZE_APICALL + zesDestroyDDiDriverTables(zes_dditable_driver_t* pDdiTable); + __zedlllocal ze_result_t ZE_APICALL + zesDriverGetExtensionProperties( + zes_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. + zes_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. + ); + __zedlllocal ze_result_t ZE_APICALL + zesDriverGetExtensionFunctionAddress( + zes_driver_handle_t hDriver, ///< [in] handle of the driver instance + const char* name, ///< [in] extension function name + void** ppFunctionAddress ///< [out] pointer to function pointer + ); + __zedlllocal ze_result_t ZE_APICALL + zesDeviceGet( + zes_driver_handle_t hDriver, ///< [in] handle of the sysman driver instance + uint32_t* pCount, ///< [in,out] pointer to the number of sysman devices. + ///< if count is zero, then the driver shall update the value with the + ///< total number of sysman devices available. + ///< if count is greater than the number of sysman devices available, then + ///< the driver shall update the value with the correct number of sysman + ///< devices available. + zes_device_handle_t* phDevices ///< [in,out][optional][range(0, *pCount)] array of handle of sysman devices. + ///< if count is less than the number of sysman devices available, then + ///< driver shall only retrieve that number of sysman devices. + ); + __zedlllocal ze_result_t ZE_APICALL + zesDeviceGetProperties( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + zes_device_properties_t* pProperties ///< [in,out] Structure that will contain information about the device. + ); + __zedlllocal ze_result_t ZE_APICALL + zesDeviceGetState( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + zes_device_state_t* pState ///< [in,out] Structure that will contain information about the device. + ); + __zedlllocal ze_result_t ZE_APICALL + zesDeviceReset( + zes_device_handle_t hDevice, ///< [in] Sysman handle for the device + ze_bool_t force ///< [in] If set to true, all applications that are currently using the + ///< device will be forcibly killed. + ); + __zedlllocal ze_result_t ZE_APICALL + zesDeviceResetExt( + zes_device_handle_t hDevice, ///< [in] Sysman handle for the device + zes_reset_properties_t* pProperties ///< [in] Device reset properties to apply + ); + __zedlllocal ze_result_t ZE_APICALL + zesDeviceProcessesGetState( + zes_device_handle_t hDevice, ///< [in] Sysman handle for the device + uint32_t* pCount, ///< [in,out] pointer to the number of processes. + ///< if count is zero, then the driver shall update the value with the + ///< total number of processes currently attached to the device. + ///< if count is greater than the number of processes currently attached to + ///< the device, then the driver shall update the value with the correct + ///< number of processes. + zes_process_state_t* pProcesses ///< [in,out][optional][range(0, *pCount)] array of process information. + ///< if count is less than the number of processes currently attached to + ///< the device, then the driver shall only retrieve information about that + ///< number of processes. In this case, the return code will ::ZE_RESULT_ERROR_INVALID_SIZE. + ); + __zedlllocal ze_result_t ZE_APICALL + zesDevicePciGetProperties( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + zes_pci_properties_t* pProperties ///< [in,out] Will contain the PCI properties. + ); + __zedlllocal ze_result_t ZE_APICALL + zesDevicePciGetState( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + zes_pci_state_t* pState ///< [in,out] Will contain the PCI properties. + ); + __zedlllocal ze_result_t ZE_APICALL + zesDevicePciGetBars( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + uint32_t* pCount, ///< [in,out] pointer to the number of PCI bars. + ///< if count is zero, then the driver shall update the value with the + ///< total number of PCI bars that are setup. + ///< if count is greater than the number of PCI bars that are setup, then + ///< the driver shall update the value with the correct number of PCI bars. + zes_pci_bar_properties_t* pProperties ///< [in,out][optional][range(0, *pCount)] array of information about setup + ///< PCI bars. + ///< if count is less than the number of PCI bars that are setup, then the + ///< driver shall only retrieve information about that number of PCI bars. + ); + __zedlllocal ze_result_t ZE_APICALL + zesDevicePciGetStats( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + zes_pci_stats_t* pStats ///< [in,out] Will contain a snapshot of the latest stats. + ); + __zedlllocal ze_result_t ZE_APICALL + zesDeviceSetOverclockWaiver( + zes_device_handle_t hDevice ///< [in] Sysman handle of the device. + ); + __zedlllocal ze_result_t ZE_APICALL + zesDeviceGetOverclockDomains( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + uint32_t* pOverclockDomains ///< [in,out] Returns the overclock domains that are supported (a bit for + ///< each of enum ::zes_overclock_domain_t). If no bits are set, the device + ///< doesn't support overclocking. + ); + __zedlllocal ze_result_t ZE_APICALL + zesDeviceGetOverclockControls( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + zes_overclock_domain_t domainType, ///< [in] Domain type. + uint32_t* pAvailableControls ///< [in,out] Returns the overclock controls that are supported for the + ///< specified overclock domain (a bit for each of enum + ///< ::zes_overclock_control_t). + ); + __zedlllocal ze_result_t ZE_APICALL + zesDeviceResetOverclockSettings( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + ze_bool_t onShippedState ///< [in] True will reset to shipped state; false will reset to + ///< manufacturing state + ); + __zedlllocal ze_result_t ZE_APICALL + zesDeviceReadOverclockState( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + zes_overclock_mode_t* pOverclockMode, ///< [out] One of overclock mode. + ze_bool_t* pWaiverSetting, ///< [out] Waiver setting: 0 = Waiver not set, 1 = waiver has been set. + ze_bool_t* pOverclockState, ///< [out] Current settings 0 =manufacturing state, 1= shipped state).. + zes_pending_action_t* pPendingAction, ///< [out] This enum is returned when the driver attempts to set an + ///< overclock control or reset overclock settings. + ze_bool_t* pPendingReset ///< [out] Pending reset 0 =manufacturing state, 1= shipped state).. + ); + __zedlllocal ze_result_t ZE_APICALL + zesDeviceEnumOverclockDomains( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + uint32_t* pCount, ///< [in,out] pointer to the number of components of this type. + ///< if count is zero, then the driver shall update the value with the + ///< total number of components of this type that are available. + ///< if count is greater than the number of components of this type that + ///< are available, then the driver shall update the value with the correct + ///< number of components. + zes_overclock_handle_t* phDomainHandle ///< [in,out][optional][range(0, *pCount)] array of handle of components of + ///< this type. + ///< if count is less than the number of components of this type that are + ///< available, then the driver shall only retrieve that number of + ///< component handles. + ); + __zedlllocal ze_result_t ZE_APICALL + zesOverclockGetDomainProperties( + zes_overclock_handle_t hDomainHandle, ///< [in] Handle for the component domain. + zes_overclock_properties_t* pDomainProperties ///< [in,out] The overclock properties for the specified domain. + ); + __zedlllocal ze_result_t ZE_APICALL + zesOverclockGetDomainVFProperties( + zes_overclock_handle_t hDomainHandle, ///< [in] Handle for the component domain. + zes_vf_property_t* pVFProperties ///< [in,out] The VF min,max,step for a specified domain. + ); + __zedlllocal ze_result_t ZE_APICALL + zesOverclockGetDomainControlProperties( + zes_overclock_handle_t hDomainHandle, ///< [in] Handle for the component domain. + zes_overclock_control_t DomainControl, ///< [in] Handle for the component. + zes_control_property_t* pControlProperties ///< [in,out] overclock control values. + ); + __zedlllocal ze_result_t ZE_APICALL + zesOverclockGetControlCurrentValue( + zes_overclock_handle_t hDomainHandle, ///< [in] Handle for the component. + zes_overclock_control_t DomainControl, ///< [in] Overclock Control. + double* pValue ///< [in,out] Getting overclock control value for the specified control. + ); + __zedlllocal ze_result_t ZE_APICALL + zesOverclockGetControlPendingValue( + zes_overclock_handle_t hDomainHandle, ///< [in] Handle for the component domain. + zes_overclock_control_t DomainControl, ///< [in] Overclock Control. + double* pValue ///< [out] Returns the pending value for a given control. The units and + ///< format of the value depend on the control type. + ); + __zedlllocal ze_result_t ZE_APICALL + zesOverclockSetControlUserValue( + zes_overclock_handle_t hDomainHandle, ///< [in] Handle for the component domain. + zes_overclock_control_t DomainControl, ///< [in] Domain Control. + double pValue, ///< [in] The new value of the control. The units and format of the value + ///< depend on the control type. + zes_pending_action_t* pPendingAction ///< [out] Pending overclock setting. + ); + __zedlllocal ze_result_t ZE_APICALL + zesOverclockGetControlState( + zes_overclock_handle_t hDomainHandle, ///< [in] Handle for the component domain. + zes_overclock_control_t DomainControl, ///< [in] Domain Control. + zes_control_state_t* pControlState, ///< [out] Current overclock control state. + zes_pending_action_t* pPendingAction ///< [out] Pending overclock setting. + ); + __zedlllocal ze_result_t ZE_APICALL + zesOverclockGetVFPointValues( + zes_overclock_handle_t hDomainHandle, ///< [in] Handle for the component domain. + zes_vf_type_t VFType, ///< [in] Voltage or Freqency point to read. + zes_vf_array_type_t VFArrayType, ///< [in] User,Default or Live VF array to read from + uint32_t PointIndex, ///< [in] Point index - number between (0, max_num_points - 1). + uint32_t* PointValue ///< [out] Returns the frequency in 1kHz units or voltage in millivolt + ///< units from the custom V-F curve at the specified zero-based index + ); + __zedlllocal ze_result_t ZE_APICALL + zesOverclockSetVFPointValues( + zes_overclock_handle_t hDomainHandle, ///< [in] Handle for the component domain. + zes_vf_type_t VFType, ///< [in] Voltage or Freqency point to read. + uint32_t PointIndex, ///< [in] Point index - number between (0, max_num_points - 1). + uint32_t PointValue ///< [in] Writes frequency in 1kHz units or voltage in millivolt units to + ///< custom V-F curve at the specified zero-based index + ); + __zedlllocal ze_result_t ZE_APICALL + zesDeviceEnumDiagnosticTestSuites( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + uint32_t* pCount, ///< [in,out] pointer to the number of components of this type. + ///< if count is zero, then the driver shall update the value with the + ///< total number of components of this type that are available. + ///< if count is greater than the number of components of this type that + ///< are available, then the driver shall update the value with the correct + ///< number of components. + zes_diag_handle_t* phDiagnostics ///< [in,out][optional][range(0, *pCount)] array of handle of components of + ///< this type. + ///< if count is less than the number of components of this type that are + ///< available, then the driver shall only retrieve that number of + ///< component handles. + ); + __zedlllocal ze_result_t ZE_APICALL + zesDiagnosticsGetProperties( + zes_diag_handle_t hDiagnostics, ///< [in] Handle for the component. + zes_diag_properties_t* pProperties ///< [in,out] Structure describing the properties of a diagnostics test + ///< suite + ); + __zedlllocal ze_result_t ZE_APICALL + zesDiagnosticsGetTests( + zes_diag_handle_t hDiagnostics, ///< [in] Handle for the component. + uint32_t* pCount, ///< [in,out] pointer to the number of tests. + ///< if count is zero, then the driver shall update the value with the + ///< total number of tests that are available. + ///< if count is greater than the number of tests that are available, then + ///< the driver shall update the value with the correct number of tests. + zes_diag_test_t* pTests ///< [in,out][optional][range(0, *pCount)] array of information about + ///< individual tests sorted by increasing value of the `index` member of ::zes_diag_test_t. + ///< if count is less than the number of tests that are available, then the + ///< driver shall only retrieve that number of tests. + ); + __zedlllocal ze_result_t ZE_APICALL + zesDiagnosticsRunTests( + zes_diag_handle_t hDiagnostics, ///< [in] Handle for the component. + uint32_t startIndex, ///< [in] The index of the first test to run. Set to + ///< ::ZES_DIAG_FIRST_TEST_INDEX to start from the beginning. + uint32_t endIndex, ///< [in] The index of the last test to run. Set to + ///< ::ZES_DIAG_LAST_TEST_INDEX to complete all tests after the start test. + zes_diag_result_t* pResult ///< [in,out] The result of the diagnostics + ); + __zedlllocal ze_result_t ZE_APICALL + zesDeviceEccAvailable( + zes_device_handle_t hDevice, ///< [in] Handle for the component. + ze_bool_t* pAvailable ///< [out] ECC functionality is available (true)/unavailable (false). + ); + __zedlllocal ze_result_t ZE_APICALL + zesDeviceEccConfigurable( + zes_device_handle_t hDevice, ///< [in] Handle for the component. + ze_bool_t* pConfigurable ///< [out] ECC can be enabled/disabled (true)/enabled/disabled (false). + ); + __zedlllocal ze_result_t ZE_APICALL + zesDeviceGetEccState( + zes_device_handle_t hDevice, ///< [in] Handle for the component. + zes_device_ecc_properties_t* pState ///< [out] ECC state, pending state, and pending action for state change. + ); + __zedlllocal ze_result_t ZE_APICALL + zesDeviceSetEccState( + zes_device_handle_t hDevice, ///< [in] Handle for the component. + const zes_device_ecc_desc_t* newState, ///< [in] Pointer to desired ECC state. + zes_device_ecc_properties_t* pState ///< [out] ECC state, pending state, and pending action for state change. + ); + __zedlllocal ze_result_t ZE_APICALL + zesDeviceEnumEngineGroups( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + uint32_t* pCount, ///< [in,out] pointer to the number of components of this type. + ///< if count is zero, then the driver shall update the value with the + ///< total number of components of this type that are available. + ///< if count is greater than the number of components of this type that + ///< are available, then the driver shall update the value with the correct + ///< number of components. + zes_engine_handle_t* phEngine ///< [in,out][optional][range(0, *pCount)] array of handle of components of + ///< this type. + ///< if count is less than the number of components of this type that are + ///< available, then the driver shall only retrieve that number of + ///< component handles. + ); + __zedlllocal ze_result_t ZE_APICALL + zesEngineGetProperties( + zes_engine_handle_t hEngine, ///< [in] Handle for the component. + zes_engine_properties_t* pProperties ///< [in,out] The properties for the specified engine group. + ); + __zedlllocal ze_result_t ZE_APICALL + zesEngineGetActivity( + zes_engine_handle_t hEngine, ///< [in] Handle for the component. + zes_engine_stats_t* pStats ///< [in,out] Will contain a snapshot of the engine group activity + ///< counters. + ); + __zedlllocal ze_result_t ZE_APICALL + zesDeviceEventRegister( + zes_device_handle_t hDevice, ///< [in] The device handle. + zes_event_type_flags_t events ///< [in] List of events to listen to. + ); + __zedlllocal ze_result_t ZE_APICALL + zesDriverEventListen( + ze_driver_handle_t hDriver, ///< [in] handle of the driver instance + uint32_t timeout, ///< [in] if non-zero, then indicates the maximum time (in milliseconds) to + ///< yield before returning ::ZE_RESULT_SUCCESS or ::ZE_RESULT_NOT_READY; + ///< if zero, then will check status and return immediately; + ///< if `UINT32_MAX`, then function will not return until events arrive. + uint32_t count, ///< [in] Number of device handles in phDevices. + zes_device_handle_t* phDevices, ///< [in][range(0, count)] Device handles to listen to for events. Only + ///< devices from the provided driver handle can be specified in this list. + uint32_t* pNumDeviceEvents, ///< [in,out] Will contain the actual number of devices in phDevices that + ///< generated events. If non-zero, check pEvents to determine the devices + ///< and events that were received. + zes_event_type_flags_t* pEvents ///< [in,out] An array that will continue the list of events for each + ///< device listened in phDevices. + ///< This array must be at least as big as count. + ///< For every device handle in phDevices, this will provide the events + ///< that occurred for that device at the same position in this array. If + ///< no event was received for a given device, the corresponding array + ///< entry will be zero. + ); + __zedlllocal ze_result_t ZE_APICALL + zesDriverEventListenEx( + ze_driver_handle_t hDriver, ///< [in] handle of the driver instance + uint64_t timeout, ///< [in] if non-zero, then indicates the maximum time (in milliseconds) to + ///< yield before returning ::ZE_RESULT_SUCCESS or ::ZE_RESULT_NOT_READY; + ///< if zero, then will check status and return immediately; + ///< if `UINT64_MAX`, then function will not return until events arrive. + uint32_t count, ///< [in] Number of device handles in phDevices. + zes_device_handle_t* phDevices, ///< [in][range(0, count)] Device handles to listen to for events. Only + ///< devices from the provided driver handle can be specified in this list. + uint32_t* pNumDeviceEvents, ///< [in,out] Will contain the actual number of devices in phDevices that + ///< generated events. If non-zero, check pEvents to determine the devices + ///< and events that were received. + zes_event_type_flags_t* pEvents ///< [in,out] An array that will continue the list of events for each + ///< device listened in phDevices. + ///< This array must be at least as big as count. + ///< For every device handle in phDevices, this will provide the events + ///< that occurred for that device at the same position in this array. If + ///< no event was received for a given device, the corresponding array + ///< entry will be zero. + ); + __zedlllocal ze_result_t ZE_APICALL + zesDeviceEnumFabricPorts( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + uint32_t* pCount, ///< [in,out] pointer to the number of components of this type. + ///< if count is zero, then the driver shall update the value with the + ///< total number of components of this type that are available. + ///< if count is greater than the number of components of this type that + ///< are available, then the driver shall update the value with the correct + ///< number of components. + zes_fabric_port_handle_t* phPort ///< [in,out][optional][range(0, *pCount)] array of handle of components of + ///< this type. + ///< if count is less than the number of components of this type that are + ///< available, then the driver shall only retrieve that number of + ///< component handles. + ); + __zedlllocal ze_result_t ZE_APICALL + zesFabricPortGetProperties( + zes_fabric_port_handle_t hPort, ///< [in] Handle for the component. + zes_fabric_port_properties_t* pProperties ///< [in,out] Will contain properties of the Fabric Port. + ); + __zedlllocal ze_result_t ZE_APICALL + zesFabricPortGetLinkType( + zes_fabric_port_handle_t hPort, ///< [in] Handle for the component. + zes_fabric_link_type_t* pLinkType ///< [in,out] Will contain details about the link attached to the Fabric + ///< port. + ); + __zedlllocal ze_result_t ZE_APICALL + zesFabricPortGetConfig( + zes_fabric_port_handle_t hPort, ///< [in] Handle for the component. + zes_fabric_port_config_t* pConfig ///< [in,out] Will contain configuration of the Fabric Port. + ); + __zedlllocal ze_result_t ZE_APICALL + zesFabricPortSetConfig( + zes_fabric_port_handle_t hPort, ///< [in] Handle for the component. + const zes_fabric_port_config_t* pConfig ///< [in] Contains new configuration of the Fabric Port. + ); + __zedlllocal ze_result_t ZE_APICALL + zesFabricPortGetState( + zes_fabric_port_handle_t hPort, ///< [in] Handle for the component. + zes_fabric_port_state_t* pState ///< [in,out] Will contain the current state of the Fabric Port + ); + __zedlllocal ze_result_t ZE_APICALL + zesFabricPortGetThroughput( + zes_fabric_port_handle_t hPort, ///< [in] Handle for the component. + zes_fabric_port_throughput_t* pThroughput ///< [in,out] Will contain the Fabric port throughput counters. + ); + __zedlllocal ze_result_t ZE_APICALL + zesFabricPortGetFabricErrorCounters( + zes_fabric_port_handle_t hPort, ///< [in] Handle for the component. + zes_fabric_port_error_counters_t* pErrors ///< [in,out] Will contain the Fabric port Error counters. + ); + __zedlllocal ze_result_t ZE_APICALL + zesFabricPortGetMultiPortThroughput( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + uint32_t numPorts, ///< [in] Number of ports enumerated in function ::zesDeviceEnumFabricPorts + zes_fabric_port_handle_t* phPort, ///< [in][range(0, numPorts)] array of fabric port handles provided by user + ///< to gather throughput values. + zes_fabric_port_throughput_t** pThroughput ///< [out][range(0, numPorts)] array of fabric port throughput counters + ///< from multiple ports of type ::zes_fabric_port_throughput_t. + ); + __zedlllocal ze_result_t ZE_APICALL + zesDeviceEnumFans( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + uint32_t* pCount, ///< [in,out] pointer to the number of components of this type. + ///< if count is zero, then the driver shall update the value with the + ///< total number of components of this type that are available. + ///< if count is greater than the number of components of this type that + ///< are available, then the driver shall update the value with the correct + ///< number of components. + zes_fan_handle_t* phFan ///< [in,out][optional][range(0, *pCount)] array of handle of components of + ///< this type. + ///< if count is less than the number of components of this type that are + ///< available, then the driver shall only retrieve that number of + ///< component handles. + ); + __zedlllocal ze_result_t ZE_APICALL + zesFanGetProperties( + zes_fan_handle_t hFan, ///< [in] Handle for the component. + zes_fan_properties_t* pProperties ///< [in,out] Will contain the properties of the fan. + ); + __zedlllocal ze_result_t ZE_APICALL + zesFanGetConfig( + zes_fan_handle_t hFan, ///< [in] Handle for the component. + zes_fan_config_t* pConfig ///< [in,out] Will contain the current configuration of the fan. + ); + __zedlllocal ze_result_t ZE_APICALL + zesFanSetDefaultMode( + zes_fan_handle_t hFan ///< [in] Handle for the component. + ); + __zedlllocal ze_result_t ZE_APICALL + zesFanSetFixedSpeedMode( + zes_fan_handle_t hFan, ///< [in] Handle for the component. + const zes_fan_speed_t* speed ///< [in] The fixed fan speed setting + ); + __zedlllocal ze_result_t ZE_APICALL + zesFanSetSpeedTableMode( + zes_fan_handle_t hFan, ///< [in] Handle for the component. + const zes_fan_speed_table_t* speedTable ///< [in] A table containing temperature/speed pairs. + ); + __zedlllocal ze_result_t ZE_APICALL + zesFanGetState( + zes_fan_handle_t hFan, ///< [in] Handle for the component. + zes_fan_speed_units_t units, ///< [in] The units in which the fan speed should be returned. + int32_t* pSpeed ///< [in,out] Will contain the current speed of the fan in the units + ///< requested. A value of -1 indicates that the fan speed cannot be + ///< measured. + ); + __zedlllocal ze_result_t ZE_APICALL + zesDeviceEnumFirmwares( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + uint32_t* pCount, ///< [in,out] pointer to the number of components of this type. + ///< if count is zero, then the driver shall update the value with the + ///< total number of components of this type that are available. + ///< if count is greater than the number of components of this type that + ///< are available, then the driver shall update the value with the correct + ///< number of components. + zes_firmware_handle_t* phFirmware ///< [in,out][optional][range(0, *pCount)] array of handle of components of + ///< this type. + ///< if count is less than the number of components of this type that are + ///< available, then the driver shall only retrieve that number of + ///< component handles. + ); + __zedlllocal ze_result_t ZE_APICALL + zesFirmwareGetProperties( + zes_firmware_handle_t hFirmware, ///< [in] Handle for the component. + zes_firmware_properties_t* pProperties ///< [in,out] Pointer to an array that will hold the properties of the + ///< firmware + ); + __zedlllocal ze_result_t ZE_APICALL + zesFirmwareFlash( + zes_firmware_handle_t hFirmware, ///< [in] Handle for the component. + void* pImage, ///< [in] Image of the new firmware to flash. + uint32_t size ///< [in] Size of the flash image. + ); + __zedlllocal ze_result_t ZE_APICALL + zesFirmwareGetFlashProgress( + zes_firmware_handle_t hFirmware, ///< [in] Handle for the component. + uint32_t* pCompletionPercent ///< [in,out] Pointer to the Completion Percentage of Firmware Update + ); + __zedlllocal ze_result_t ZE_APICALL + zesFirmwareGetConsoleLogs( + zes_firmware_handle_t hFirmware, ///< [in] Handle for the component. + size_t* pSize, ///< [in,out] size of firmware log + char* pFirmwareLog ///< [in,out][optional] pointer to null-terminated string of the log. + ); + __zedlllocal ze_result_t ZE_APICALL + zesDeviceEnumFrequencyDomains( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + uint32_t* pCount, ///< [in,out] pointer to the number of components of this type. + ///< if count is zero, then the driver shall update the value with the + ///< total number of components of this type that are available. + ///< if count is greater than the number of components of this type that + ///< are available, then the driver shall update the value with the correct + ///< number of components. + zes_freq_handle_t* phFrequency ///< [in,out][optional][range(0, *pCount)] array of handle of components of + ///< this type. + ///< if count is less than the number of components of this type that are + ///< available, then the driver shall only retrieve that number of + ///< component handles. + ); + __zedlllocal ze_result_t ZE_APICALL + zesFrequencyGetProperties( + zes_freq_handle_t hFrequency, ///< [in] Handle for the component. + zes_freq_properties_t* pProperties ///< [in,out] The frequency properties for the specified domain. + ); + __zedlllocal ze_result_t ZE_APICALL + zesFrequencyGetAvailableClocks( + zes_freq_handle_t hFrequency, ///< [in] Sysman handle of the device. + uint32_t* pCount, ///< [in,out] pointer to the number of frequencies. + ///< if count is zero, then the driver shall update the value with the + ///< total number of frequencies that are available. + ///< if count is greater than the number of frequencies that are available, + ///< then the driver shall update the value with the correct number of frequencies. + double* phFrequency ///< [in,out][optional][range(0, *pCount)] array of frequencies in units of + ///< MHz and sorted from slowest to fastest. + ///< if count is less than the number of frequencies that are available, + ///< then the driver shall only retrieve that number of frequencies. + ); + __zedlllocal ze_result_t ZE_APICALL + zesFrequencyGetRange( + zes_freq_handle_t hFrequency, ///< [in] Handle for the component. + zes_freq_range_t* pLimits ///< [in,out] The range between which the hardware can operate for the + ///< specified domain. + ); + __zedlllocal ze_result_t ZE_APICALL + zesFrequencySetRange( + zes_freq_handle_t hFrequency, ///< [in] Handle for the component. + const zes_freq_range_t* pLimits ///< [in] The limits between which the hardware can operate for the + ///< specified domain. + ); + __zedlllocal ze_result_t ZE_APICALL + zesFrequencyGetState( + zes_freq_handle_t hFrequency, ///< [in] Handle for the component. + zes_freq_state_t* pState ///< [in,out] Frequency state for the specified domain. + ); + __zedlllocal ze_result_t ZE_APICALL + zesFrequencyGetThrottleTime( + zes_freq_handle_t hFrequency, ///< [in] Handle for the component. + zes_freq_throttle_time_t* pThrottleTime ///< [in,out] Will contain a snapshot of the throttle time counters for the + ///< specified domain. + ); + __zedlllocal ze_result_t ZE_APICALL + zesFrequencyOcGetCapabilities( + zes_freq_handle_t hFrequency, ///< [in] Handle for the component. + zes_oc_capabilities_t* pOcCapabilities ///< [in,out] Pointer to the capabilities structure. + ); + __zedlllocal ze_result_t ZE_APICALL + zesFrequencyOcGetFrequencyTarget( + zes_freq_handle_t hFrequency, ///< [in] Handle for the component. + double* pCurrentOcFrequency ///< [out] Overclocking Frequency in MHz, if extended moded is supported, + ///< will returned in 1 Mhz granularity, else, in multiples of 50 Mhz. This + ///< cannot be greater than the `maxOcFrequency` member of + ///< ::zes_oc_capabilities_t. + ); + __zedlllocal ze_result_t ZE_APICALL + zesFrequencyOcSetFrequencyTarget( + zes_freq_handle_t hFrequency, ///< [in] Handle for the component. + double CurrentOcFrequency ///< [in] Overclocking Frequency in MHz, if extended moded is supported, it + ///< could be set in 1 Mhz granularity, else, in multiples of 50 Mhz. This + ///< cannot be greater than the `maxOcFrequency` member of + ///< ::zes_oc_capabilities_t. + ); + __zedlllocal ze_result_t ZE_APICALL + zesFrequencyOcGetVoltageTarget( + zes_freq_handle_t hFrequency, ///< [in] Handle for the component. + double* pCurrentVoltageTarget, ///< [out] Overclock voltage in Volts. This cannot be greater than the + ///< `maxOcVoltage` member of ::zes_oc_capabilities_t. + double* pCurrentVoltageOffset ///< [out] This voltage offset is applied to all points on the + ///< voltage/frequency curve, including the new overclock voltageTarget. + ///< Valid range is between the `minOcVoltageOffset` and + ///< `maxOcVoltageOffset` members of ::zes_oc_capabilities_t. + ); + __zedlllocal ze_result_t ZE_APICALL + zesFrequencyOcSetVoltageTarget( + zes_freq_handle_t hFrequency, ///< [in] Handle for the component. + double CurrentVoltageTarget, ///< [in] Overclock voltage in Volts. This cannot be greater than the + ///< `maxOcVoltage` member of ::zes_oc_capabilities_t. + double CurrentVoltageOffset ///< [in] This voltage offset is applied to all points on the + ///< voltage/frequency curve, include the new overclock voltageTarget. + ///< Valid range is between the `minOcVoltageOffset` and + ///< `maxOcVoltageOffset` members of ::zes_oc_capabilities_t. + ); + __zedlllocal ze_result_t ZE_APICALL + zesFrequencyOcSetMode( + zes_freq_handle_t hFrequency, ///< [in] Handle for the component. + zes_oc_mode_t CurrentOcMode ///< [in] Current Overclocking Mode ::zes_oc_mode_t. + ); + __zedlllocal ze_result_t ZE_APICALL + zesFrequencyOcGetMode( + zes_freq_handle_t hFrequency, ///< [in] Handle for the component. + zes_oc_mode_t* pCurrentOcMode ///< [out] Current Overclocking Mode ::zes_oc_mode_t. + ); + __zedlllocal ze_result_t ZE_APICALL + zesFrequencyOcGetIccMax( + zes_freq_handle_t hFrequency, ///< [in] Handle for the component. + double* pOcIccMax ///< [in,out] Will contain the maximum current limit in Amperes on + ///< successful return. + ); + __zedlllocal ze_result_t ZE_APICALL + zesFrequencyOcSetIccMax( + zes_freq_handle_t hFrequency, ///< [in] Handle for the component. + double ocIccMax ///< [in] The new maximum current limit in Amperes. + ); + __zedlllocal ze_result_t ZE_APICALL + zesFrequencyOcGetTjMax( + zes_freq_handle_t hFrequency, ///< [in] Handle for the component. + double* pOcTjMax ///< [in,out] Will contain the maximum temperature limit in degrees Celsius + ///< on successful return. + ); + __zedlllocal ze_result_t ZE_APICALL + zesFrequencyOcSetTjMax( + zes_freq_handle_t hFrequency, ///< [in] Handle for the component. + double ocTjMax ///< [in] The new maximum temperature limit in degrees Celsius. + ); + __zedlllocal ze_result_t ZE_APICALL + zesDeviceEnumLeds( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + uint32_t* pCount, ///< [in,out] pointer to the number of components of this type. + ///< if count is zero, then the driver shall update the value with the + ///< total number of components of this type that are available. + ///< if count is greater than the number of components of this type that + ///< are available, then the driver shall update the value with the correct + ///< number of components. + zes_led_handle_t* phLed ///< [in,out][optional][range(0, *pCount)] array of handle of components of + ///< this type. + ///< if count is less than the number of components of this type that are + ///< available, then the driver shall only retrieve that number of + ///< component handles. + ); + __zedlllocal ze_result_t ZE_APICALL + zesLedGetProperties( + zes_led_handle_t hLed, ///< [in] Handle for the component. + zes_led_properties_t* pProperties ///< [in,out] Will contain the properties of the LED. + ); + __zedlllocal ze_result_t ZE_APICALL + zesLedGetState( + zes_led_handle_t hLed, ///< [in] Handle for the component. + zes_led_state_t* pState ///< [in,out] Will contain the current state of the LED. + ); + __zedlllocal ze_result_t ZE_APICALL + zesLedSetState( + zes_led_handle_t hLed, ///< [in] Handle for the component. + ze_bool_t enable ///< [in] Set to TRUE to turn the LED on, FALSE to turn off. + ); + __zedlllocal ze_result_t ZE_APICALL + zesLedSetColor( + zes_led_handle_t hLed, ///< [in] Handle for the component. + const zes_led_color_t* pColor ///< [in] New color of the LED. + ); + __zedlllocal ze_result_t ZE_APICALL + zesDeviceEnumMemoryModules( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + uint32_t* pCount, ///< [in,out] pointer to the number of components of this type. + ///< if count is zero, then the driver shall update the value with the + ///< total number of components of this type that are available. + ///< if count is greater than the number of components of this type that + ///< are available, then the driver shall update the value with the correct + ///< number of components. + zes_mem_handle_t* phMemory ///< [in,out][optional][range(0, *pCount)] array of handle of components of + ///< this type. + ///< if count is less than the number of components of this type that are + ///< available, then the driver shall only retrieve that number of + ///< component handles. + ); + __zedlllocal ze_result_t ZE_APICALL + zesMemoryGetProperties( + zes_mem_handle_t hMemory, ///< [in] Handle for the component. + zes_mem_properties_t* pProperties ///< [in,out] Will contain memory properties. + ); + __zedlllocal ze_result_t ZE_APICALL + zesMemoryGetState( + zes_mem_handle_t hMemory, ///< [in] Handle for the component. + zes_mem_state_t* pState ///< [in,out] Will contain the current health and allocated memory. + ); + __zedlllocal ze_result_t ZE_APICALL + zesMemoryGetBandwidth( + zes_mem_handle_t hMemory, ///< [in] Handle for the component. + zes_mem_bandwidth_t* pBandwidth ///< [in,out] Will contain the total number of bytes read from and written + ///< to memory, as well as the current maximum bandwidth. + ); + __zedlllocal ze_result_t ZE_APICALL + zesDeviceEnumPerformanceFactorDomains( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + uint32_t* pCount, ///< [in,out] pointer to the number of components of this type. + ///< if count is zero, then the driver shall update the value with the + ///< total number of components of this type that are available. + ///< if count is greater than the number of components of this type that + ///< are available, then the driver shall update the value with the correct + ///< number of components. + zes_perf_handle_t* phPerf ///< [in,out][optional][range(0, *pCount)] array of handle of components of + ///< this type. + ///< if count is less than the number of components of this type that are + ///< available, then the driver shall only retrieve that number of + ///< component handles. + ); + __zedlllocal ze_result_t ZE_APICALL + zesPerformanceFactorGetProperties( + zes_perf_handle_t hPerf, ///< [in] Handle for the Performance Factor domain. + zes_perf_properties_t* pProperties ///< [in,out] Will contain information about the specified Performance + ///< Factor domain. + ); + __zedlllocal ze_result_t ZE_APICALL + zesPerformanceFactorGetConfig( + zes_perf_handle_t hPerf, ///< [in] Handle for the Performance Factor domain. + double* pFactor ///< [in,out] Will contain the actual Performance Factor being used by the + ///< hardware (may not be the same as the requested Performance Factor). + ); + __zedlllocal ze_result_t ZE_APICALL + zesPerformanceFactorSetConfig( + zes_perf_handle_t hPerf, ///< [in] Handle for the Performance Factor domain. + double factor ///< [in] The new Performance Factor. + ); + __zedlllocal ze_result_t ZE_APICALL + zesDeviceEnumPowerDomains( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + uint32_t* pCount, ///< [in,out] pointer to the number of components of this type. + ///< if count is zero, then the driver shall update the value with the + ///< total number of components of this type that are available. + ///< if count is greater than the number of components of this type that + ///< are available, then the driver shall update the value with the correct + ///< number of components. + zes_pwr_handle_t* phPower ///< [in,out][optional][range(0, *pCount)] array of handle of components of + ///< this type. + ///< if count is less than the number of components of this type that are + ///< available, then the driver shall only retrieve that number of + ///< component handles. + ); + __zedlllocal ze_result_t ZE_APICALL + zesDeviceGetCardPowerDomain( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + zes_pwr_handle_t* phPower ///< [in,out] power domain handle for the entire PCIe card. + ); + __zedlllocal ze_result_t ZE_APICALL + zesPowerGetProperties( + zes_pwr_handle_t hPower, ///< [in] Handle for the component. + zes_power_properties_t* pProperties ///< [in,out] Structure that will contain property data. + ); + __zedlllocal ze_result_t ZE_APICALL + zesPowerGetEnergyCounter( + zes_pwr_handle_t hPower, ///< [in] Handle for the component. + zes_power_energy_counter_t* pEnergy ///< [in,out] Will contain the latest snapshot of the energy counter and + ///< timestamp when the last counter value was measured. + ); + __zedlllocal ze_result_t ZE_APICALL + zesPowerGetLimits( + zes_pwr_handle_t hPower, ///< [in] Handle for the component. + zes_power_sustained_limit_t* pSustained, ///< [in,out][optional] The sustained power limit. If this is null, the + ///< current sustained power limits will not be returned. + zes_power_burst_limit_t* pBurst, ///< [in,out][optional] The burst power limit. If this is null, the current + ///< peak power limits will not be returned. + zes_power_peak_limit_t* pPeak ///< [in,out][optional] The peak power limit. If this is null, the peak + ///< power limits will not be returned. + ); + __zedlllocal ze_result_t ZE_APICALL + zesPowerSetLimits( + zes_pwr_handle_t hPower, ///< [in] Handle for the component. + const zes_power_sustained_limit_t* pSustained, ///< [in][optional] The sustained power limit. If this is null, no changes + ///< will be made to the sustained power limits. + const zes_power_burst_limit_t* pBurst, ///< [in][optional] The burst power limit. If this is null, no changes will + ///< be made to the burst power limits. + const zes_power_peak_limit_t* pPeak ///< [in][optional] The peak power limit. If this is null, no changes will + ///< be made to the peak power limits. + ); + __zedlllocal ze_result_t ZE_APICALL + zesPowerGetEnergyThreshold( + zes_pwr_handle_t hPower, ///< [in] Handle for the component. + zes_energy_threshold_t* pThreshold ///< [in,out] Returns information about the energy threshold setting - + ///< enabled/energy threshold/process ID. + ); + __zedlllocal ze_result_t ZE_APICALL + zesPowerSetEnergyThreshold( + zes_pwr_handle_t hPower, ///< [in] Handle for the component. + double threshold ///< [in] The energy threshold to be set in joules. + ); + __zedlllocal ze_result_t ZE_APICALL + zesDeviceEnumPsus( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + uint32_t* pCount, ///< [in,out] pointer to the number of components of this type. + ///< if count is zero, then the driver shall update the value with the + ///< total number of components of this type that are available. + ///< if count is greater than the number of components of this type that + ///< are available, then the driver shall update the value with the correct + ///< number of components. + zes_psu_handle_t* phPsu ///< [in,out][optional][range(0, *pCount)] array of handle of components of + ///< this type. + ///< if count is less than the number of components of this type that are + ///< available, then the driver shall only retrieve that number of + ///< component handles. + ); + __zedlllocal ze_result_t ZE_APICALL + zesPsuGetProperties( + zes_psu_handle_t hPsu, ///< [in] Handle for the component. + zes_psu_properties_t* pProperties ///< [in,out] Will contain the properties of the power supply. + ); + __zedlllocal ze_result_t ZE_APICALL + zesPsuGetState( + zes_psu_handle_t hPsu, ///< [in] Handle for the component. + zes_psu_state_t* pState ///< [in,out] Will contain the current state of the power supply. + ); + __zedlllocal ze_result_t ZE_APICALL + zesDeviceEnumRasErrorSets( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + uint32_t* pCount, ///< [in,out] pointer to the number of components of this type. + ///< if count is zero, then the driver shall update the value with the + ///< total number of components of this type that are available. + ///< if count is greater than the number of components of this type that + ///< are available, then the driver shall update the value with the correct + ///< number of components. + zes_ras_handle_t* phRas ///< [in,out][optional][range(0, *pCount)] array of handle of components of + ///< this type. + ///< if count is less than the number of components of this type that are + ///< available, then the driver shall only retrieve that number of + ///< component handles. + ); + __zedlllocal ze_result_t ZE_APICALL + zesRasGetProperties( + zes_ras_handle_t hRas, ///< [in] Handle for the component. + zes_ras_properties_t* pProperties ///< [in,out] Structure describing RAS properties + ); + __zedlllocal ze_result_t ZE_APICALL + zesRasGetConfig( + zes_ras_handle_t hRas, ///< [in] Handle for the component. + zes_ras_config_t* pConfig ///< [in,out] Will be populed with the current RAS configuration - + ///< thresholds used to trigger events + ); + __zedlllocal ze_result_t ZE_APICALL + zesRasSetConfig( + zes_ras_handle_t hRas, ///< [in] Handle for the component. + const zes_ras_config_t* pConfig ///< [in] Change the RAS configuration - thresholds used to trigger events + ); + __zedlllocal ze_result_t ZE_APICALL + zesRasGetState( + zes_ras_handle_t hRas, ///< [in] Handle for the component. + ze_bool_t clear, ///< [in] Set to 1 to clear the counters of this type + zes_ras_state_t* pState ///< [in,out] Breakdown of where errors have occurred + ); + __zedlllocal ze_result_t ZE_APICALL + zesDeviceEnumSchedulers( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + uint32_t* pCount, ///< [in,out] pointer to the number of components of this type. + ///< if count is zero, then the driver shall update the value with the + ///< total number of components of this type that are available. + ///< if count is greater than the number of components of this type that + ///< are available, then the driver shall update the value with the correct + ///< number of components. + zes_sched_handle_t* phScheduler ///< [in,out][optional][range(0, *pCount)] array of handle of components of + ///< this type. + ///< if count is less than the number of components of this type that are + ///< available, then the driver shall only retrieve that number of + ///< component handles. + ); + __zedlllocal ze_result_t ZE_APICALL + zesSchedulerGetProperties( + zes_sched_handle_t hScheduler, ///< [in] Handle for the component. + zes_sched_properties_t* pProperties ///< [in,out] Structure that will contain property data. + ); + __zedlllocal ze_result_t ZE_APICALL + zesSchedulerGetCurrentMode( + zes_sched_handle_t hScheduler, ///< [in] Sysman handle for the component. + zes_sched_mode_t* pMode ///< [in,out] Will contain the current scheduler mode. + ); + __zedlllocal ze_result_t ZE_APICALL + zesSchedulerGetTimeoutModeProperties( + zes_sched_handle_t hScheduler, ///< [in] Sysman handle for the component. + ze_bool_t getDefaults, ///< [in] If TRUE, the driver will return the system default properties for + ///< this mode, otherwise it will return the current properties. + zes_sched_timeout_properties_t* pConfig ///< [in,out] Will contain the current parameters for this mode. + ); + __zedlllocal ze_result_t ZE_APICALL + zesSchedulerGetTimesliceModeProperties( + zes_sched_handle_t hScheduler, ///< [in] Sysman handle for the component. + ze_bool_t getDefaults, ///< [in] If TRUE, the driver will return the system default properties for + ///< this mode, otherwise it will return the current properties. + zes_sched_timeslice_properties_t* pConfig ///< [in,out] Will contain the current parameters for this mode. + ); + __zedlllocal ze_result_t ZE_APICALL + zesSchedulerSetTimeoutMode( + zes_sched_handle_t hScheduler, ///< [in] Sysman handle for the component. + zes_sched_timeout_properties_t* pProperties, ///< [in] The properties to use when configurating this mode. + ze_bool_t* pNeedReload ///< [in,out] Will be set to TRUE if a device driver reload is needed to + ///< apply the new scheduler mode. + ); + __zedlllocal ze_result_t ZE_APICALL + zesSchedulerSetTimesliceMode( + zes_sched_handle_t hScheduler, ///< [in] Sysman handle for the component. + zes_sched_timeslice_properties_t* pProperties, ///< [in] The properties to use when configurating this mode. + ze_bool_t* pNeedReload ///< [in,out] Will be set to TRUE if a device driver reload is needed to + ///< apply the new scheduler mode. + ); + __zedlllocal ze_result_t ZE_APICALL + zesSchedulerSetExclusiveMode( + zes_sched_handle_t hScheduler, ///< [in] Sysman handle for the component. + ze_bool_t* pNeedReload ///< [in,out] Will be set to TRUE if a device driver reload is needed to + ///< apply the new scheduler mode. + ); + __zedlllocal ze_result_t ZE_APICALL + zesSchedulerSetComputeUnitDebugMode( + zes_sched_handle_t hScheduler, ///< [in] Sysman handle for the component. + ze_bool_t* pNeedReload ///< [in,out] Will be set to TRUE if a device driver reload is needed to + ///< apply the new scheduler mode. + ); + __zedlllocal ze_result_t ZE_APICALL + zesDeviceEnumStandbyDomains( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + uint32_t* pCount, ///< [in,out] pointer to the number of components of this type. + ///< if count is zero, then the driver shall update the value with the + ///< total number of components of this type that are available. + ///< if count is greater than the number of components of this type that + ///< are available, then the driver shall update the value with the correct + ///< number of components. + zes_standby_handle_t* phStandby ///< [in,out][optional][range(0, *pCount)] array of handle of components of + ///< this type. + ///< if count is less than the number of components of this type that are + ///< available, then the driver shall only retrieve that number of + ///< component handles. + ); + __zedlllocal ze_result_t ZE_APICALL + zesStandbyGetProperties( + zes_standby_handle_t hStandby, ///< [in] Handle for the component. + zes_standby_properties_t* pProperties ///< [in,out] Will contain the standby hardware properties. + ); + __zedlllocal ze_result_t ZE_APICALL + zesStandbyGetMode( + zes_standby_handle_t hStandby, ///< [in] Handle for the component. + zes_standby_promo_mode_t* pMode ///< [in,out] Will contain the current standby mode. + ); + __zedlllocal ze_result_t ZE_APICALL + zesStandbySetMode( + zes_standby_handle_t hStandby, ///< [in] Handle for the component. + zes_standby_promo_mode_t mode ///< [in] New standby mode. + ); + __zedlllocal ze_result_t ZE_APICALL + zesDeviceEnumTemperatureSensors( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + uint32_t* pCount, ///< [in,out] pointer to the number of components of this type. + ///< if count is zero, then the driver shall update the value with the + ///< total number of components of this type that are available. + ///< if count is greater than the number of components of this type that + ///< are available, then the driver shall update the value with the correct + ///< number of components. + zes_temp_handle_t* phTemperature ///< [in,out][optional][range(0, *pCount)] array of handle of components of + ///< this type. + ///< if count is less than the number of components of this type that are + ///< available, then the driver shall only retrieve that number of + ///< component handles. + ); + __zedlllocal ze_result_t ZE_APICALL + zesTemperatureGetProperties( + zes_temp_handle_t hTemperature, ///< [in] Handle for the component. + zes_temp_properties_t* pProperties ///< [in,out] Will contain the temperature sensor properties. + ); + __zedlllocal ze_result_t ZE_APICALL + zesTemperatureGetConfig( + zes_temp_handle_t hTemperature, ///< [in] Handle for the component. + zes_temp_config_t* pConfig ///< [in,out] Returns current configuration. + ); + __zedlllocal ze_result_t ZE_APICALL + zesTemperatureSetConfig( + zes_temp_handle_t hTemperature, ///< [in] Handle for the component. + const zes_temp_config_t* pConfig ///< [in] New configuration. + ); + __zedlllocal ze_result_t ZE_APICALL + zesTemperatureGetState( + zes_temp_handle_t hTemperature, ///< [in] Handle for the component. + double* pTemperature ///< [in,out] Will contain the temperature read from the specified sensor + ///< in degrees Celsius. + ); + __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 + ///< zero, then the driver shall update the value with the total number of + ///< components of this type that are available. If count is greater than + ///< the number of components of this type that are available, then the + ///< driver shall update the value with the correct number of components. + zes_power_limit_ext_desc_t* pSustained ///< [in,out][optional][range(0, *pCount)] Array of query results for power + ///< limit descriptors. If count is less than the number of components of + ///< this type that are available, then the driver shall only retrieve that + ///< number of components. + ); + __zedlllocal ze_result_t ZE_APICALL + zesPowerSetLimitsExt( + zes_pwr_handle_t hPower, ///< [in] Handle for the component. + uint32_t* pCount, ///< [in] Pointer to the number of power limit descriptors. + zes_power_limit_ext_desc_t* pSustained ///< [in][optional][range(0, *pCount)] Array of power limit descriptors. + ); + __zedlllocal ze_result_t ZE_APICALL + zesEngineGetActivityExt( + zes_engine_handle_t hEngine, ///< [in] Handle for the component. + uint32_t* pCount, ///< [in,out] Pointer to the number of VF engine stats descriptors. + ///< - if count is zero, the driver shall update the value with the total + ///< number of engine stats available. + ///< - if count is greater than the total number of engine stats + ///< available, the driver shall update the value with the correct number + ///< of engine stats available. + ///< - The count returned is the sum of number of VF instances currently + ///< available and the PF instance. + zes_engine_stats_t* pStats ///< [in,out][optional][range(0, *pCount)] array of engine group activity counters. + ///< - if count is less than the total number of engine stats available, + ///< then driver shall only retrieve that number of stats. + ///< - the implementation shall populate the vector with engine stat for + ///< PF at index 0 of the vector followed by user provided pCount-1 number + ///< of VF engine stats. + ); + __zedlllocal ze_result_t ZE_APICALL + zesRasGetStateExp( + zes_ras_handle_t hRas, ///< [in] Handle for the component. + uint32_t* pCount, ///< [in,out] pointer to the number of RAS state structures that can be retrieved. + ///< if count is zero, then the driver shall update the value with the + ///< total number of error categories for which state can be retrieved. + ///< if count is greater than the number of RAS states available, then the + ///< driver shall update the value with the correct number of RAS states available. + zes_ras_state_exp_t* pState ///< [in,out][optional][range(0, *pCount)] array of query results for RAS + ///< error states for different categories. + ///< if count is less than the number of RAS states available, then driver + ///< shall only retrieve that number of RAS states. + ); + __zedlllocal ze_result_t ZE_APICALL + zesRasClearStateExp( + zes_ras_handle_t hRas, ///< [in] Handle for the component. + zes_ras_error_category_exp_t category ///< [in] category for which error counter is to be cleared. + ); + __zedlllocal ze_result_t ZE_APICALL + zesFirmwareGetSecurityVersionExp( + zes_firmware_handle_t hFirmware, ///< [in] Handle for the component. + char* pVersion ///< [in,out] NULL terminated string value. The string "unknown" will be + ///< returned if this property cannot be determined. + ); + __zedlllocal ze_result_t ZE_APICALL + zesFirmwareSetSecurityVersionExp( + zes_firmware_handle_t hFirmware ///< [in] Handle for the component. + ); + __zedlllocal ze_result_t ZE_APICALL + zesDeviceGetSubDevicePropertiesExp( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + 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 currently attached to the device. + ///< if count is greater than the number of sub devices currently attached + ///< to the device, then the driver shall update the value with the correct + ///< number of sub devices. + zes_subdevice_exp_properties_t* pSubdeviceProps ///< [in,out][optional][range(0, *pCount)] array of sub device property structures. + ///< if count is less than the number of sysman sub devices available, then + ///< the driver shall only retrieve that number of sub device property structures. + ); + __zedlllocal ze_result_t ZE_APICALL + zesDriverGetDeviceByUuidExp( + zes_driver_handle_t hDriver, ///< [in] handle of the sysman driver instance + zes_uuid_t uuid, ///< [in] universal unique identifier. + zes_device_handle_t* phDevice, ///< [out] Sysman handle of the device. + ze_bool_t* onSubdevice, ///< [out] True if the UUID belongs to the sub-device; false means that + ///< UUID belongs to the root device. + uint32_t* subdeviceId ///< [out] If onSubdevice is true, this gives the ID of the sub-device + ); + __zedlllocal ze_result_t ZE_APICALL + zesDeviceEnumActiveVFExp( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + uint32_t* pCount, ///< [in,out] pointer to the number of components of this type. + ///< if count is zero, then the driver shall update the value with the + ///< total number of components of this type that are available. + ///< if count is greater than the number of components of this type that + ///< are available, then the driver shall update the value with the correct + ///< number of components. + zes_vf_handle_t* phVFhandle ///< [in,out][optional][range(0, *pCount)] array of handle of components of + ///< this type. + ///< if count is less than the number of components of this type that are + ///< available, then the driver shall only retrieve that number of + ///< component handles. + ); + __zedlllocal ze_result_t ZE_APICALL + zesVFManagementGetVFPropertiesExp( + zes_vf_handle_t hVFhandle, ///< [in] Sysman handle for the VF component. + zes_vf_exp_properties_t* pProperties ///< [in,out] Will contain VF properties. + ); + __zedlllocal ze_result_t ZE_APICALL + zesVFManagementGetVFMemoryUtilizationExp( + zes_vf_handle_t hVFhandle, ///< [in] Sysman handle for the component. + uint32_t* pCount, ///< [in,out] Pointer to the number of VF memory stats descriptors. + ///< - if count is zero, the driver shall update the value with the total + ///< number of memory stats available. + ///< - if count is greater than the total number of memory stats + ///< available, the driver shall update the value with the correct number + ///< of memory stats available. + ///< - The count returned is the sum of number of VF instances currently + ///< available and the PF instance. + zes_vf_util_mem_exp_t* pMemUtil ///< [in,out][optional][range(0, *pCount)] array of memory group activity counters. + ///< - if count is less than the total number of memory stats available, + ///< then driver shall only retrieve that number of stats. + ///< - the implementation shall populate the vector pCount-1 number of VF + ///< memory stats. + ); + __zedlllocal ze_result_t ZE_APICALL + zesVFManagementGetVFEngineUtilizationExp( + zes_vf_handle_t hVFhandle, ///< [in] Sysman handle for the component. + uint32_t* pCount, ///< [in,out] Pointer to the number of VF engine stats descriptors. + ///< - if count is zero, the driver shall update the value with the total + ///< number of engine stats available. + ///< - if count is greater than the total number of engine stats + ///< available, the driver shall update the value with the correct number + ///< of engine stats available. + ///< - The count returned is the sum of number of VF instances currently + ///< available and the PF instance. + zes_vf_util_engine_exp_t* pEngineUtil ///< [in,out][optional][range(0, *pCount)] array of engine group activity counters. + ///< - if count is less than the total number of engine stats available, + ///< then driver shall only retrieve that number of stats. + ///< - the implementation shall populate the vector pCount-1 number of VF + ///< engine stats. + ); + __zedlllocal ze_result_t ZE_APICALL + zesVFManagementSetVFTelemetryModeExp( + zes_vf_handle_t hVFhandle, ///< [in] Sysman handle for the component. + zes_vf_info_util_exp_flags_t flags, ///< [in] utilization flags to enable or disable. May be 0 or a valid + ///< combination of ::zes_vf_info_util_exp_flag_t. + ze_bool_t enable ///< [in] Enable utilization telemetry. + ); + __zedlllocal ze_result_t ZE_APICALL + zesVFManagementSetVFTelemetrySamplingIntervalExp( + zes_vf_handle_t hVFhandle, ///< [in] Sysman handle for the component. + zes_vf_info_util_exp_flags_t flag, ///< [in] utilization flags to set sampling interval. May be 0 or a valid + ///< combination of ::zes_vf_info_util_exp_flag_t. + uint64_t samplingInterval ///< [in] Sampling interval value. + ); + __zedlllocal ze_result_t ZE_APICALL + zesDeviceEnumEnabledVFExp( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + uint32_t* pCount, ///< [in,out] pointer to the number of components of this type. + ///< if count is zero, then the driver shall update the value with the + ///< total number of components of this type that are available. + ///< if count is greater than the number of components of this type that + ///< are available, then the driver shall update the value with the correct + ///< number of components. + zes_vf_handle_t* phVFhandle ///< [in,out][optional][range(0, *pCount)] array of handle of components of + ///< this type. + ///< if count is less than the number of components of this type that are + ///< available, then the driver shall only retrieve that number of + ///< component handles. + ); + __zedlllocal ze_result_t ZE_APICALL + zesVFManagementGetVFCapabilitiesExp( + zes_vf_handle_t hVFhandle, ///< [in] Sysman handle for the VF component. + zes_vf_exp_capabilities_t* pCapability ///< [in,out] Will contain VF capability. + ); + __zedlllocal ze_result_t ZE_APICALL + zesVFManagementGetVFMemoryUtilizationExp2( + zes_vf_handle_t hVFhandle, ///< [in] Sysman handle for the component. + uint32_t* pCount, ///< [in,out] Pointer to the number of VF memory stats descriptors. + ///< - if count is zero, the driver shall update the value with the total + ///< number of memory stats available. + ///< - if count is greater than the total number of memory stats + ///< available, the driver shall update the value with the correct number + ///< of memory stats available. + zes_vf_util_mem_exp2_t* pMemUtil ///< [in,out][optional][range(0, *pCount)] array of memory group activity counters. + ///< - if count is less than the total number of memory stats available, + ///< then driver shall only retrieve that number of stats. + ///< - the implementation shall populate the vector pCount-1 number of VF + ///< memory stats. + ); + __zedlllocal ze_result_t ZE_APICALL + zesVFManagementGetVFEngineUtilizationExp2( + zes_vf_handle_t hVFhandle, ///< [in] Sysman handle for the component. + uint32_t* pCount, ///< [in,out] Pointer to the number of VF engine stats descriptors. + ///< - if count is zero, the driver shall update the value with the total + ///< number of engine stats available. + ///< - if count is greater than the total number of engine stats + ///< available, the driver shall update the value with the correct number + ///< of engine stats available. + zes_vf_util_engine_exp2_t* pEngineUtil ///< [in,out][optional][range(0, *pCount)] array of engine group activity counters. + ///< - if count is less than the total number of engine stats available, + ///< then driver shall only retrieve that number of stats. + ///< - the implementation shall populate the vector pCount-1 number of VF + ///< engine stats. + ); + __zedlllocal ze_result_t ZE_APICALL + zesVFManagementGetVFCapabilitiesExp2( + zes_vf_handle_t hVFhandle, ///< [in] Sysman handle for the VF component. + zes_vf_exp2_capabilities_t* pCapability ///< [in,out] Will contain VF capability. + ); +} + +#if defined(__cplusplus) +extern "C" { +#endif + +__zedlllocal void ZE_APICALL +zesGetGlobalProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zesGetDeviceProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zesGetDeviceExpProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zesGetDriverProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zesGetDriverExpProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zesGetDiagnosticsProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zesGetEngineProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zesGetFabricPortProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zesGetFanProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zesGetFirmwareProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zesGetFirmwareExpProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zesGetFrequencyProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zesGetLedProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zesGetMemoryProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zesGetOverclockProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zesGetPerformanceFactorProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zesGetPowerProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zesGetPsuProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zesGetRasProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zesGetRasExpProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zesGetSchedulerProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zesGetStandbyProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zesGetTemperatureProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zesGetVFManagementExpProcAddrTableLegacy(); + +#if defined(__cplusplus) +}; +#endif diff --git a/source/loader/zes_ldrddi_driver_ddi.cpp b/source/loader/zes_ldrddi_driver_ddi.cpp new file mode 100644 index 00000000..55a39b08 --- /dev/null +++ b/source/loader/zes_ldrddi_driver_ddi.cpp @@ -0,0 +1,4316 @@ +/* + * + * Copyright (C) 2019-2025 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + * @file zes_ldrddi_driver_ddi.cpp + * + */ +#include "ze_loader_internal.h" + +namespace loader_driver_ddi +{ + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesDriverGetExtensionProperties + __zedlllocal ze_result_t ZE_APICALL + zesDriverGetExtensionProperties( + zes_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. + zes_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. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hDriver )->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_8) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetExtensionProperties = dditable->Driver->pfnGetExtensionProperties; + if( nullptr == pfnGetExtensionProperties ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetExtensionProperties( hDriver, pCount, pExtensionProperties ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesDriverGetExtensionFunctionAddress + __zedlllocal ze_result_t ZE_APICALL + zesDriverGetExtensionFunctionAddress( + zes_driver_handle_t hDriver, ///< [in] handle of the driver instance + const char* name, ///< [in] extension function name + void** ppFunctionAddress ///< [out] pointer to function pointer + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hDriver )->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_8) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetExtensionFunctionAddress = dditable->Driver->pfnGetExtensionFunctionAddress; + if( nullptr == pfnGetExtensionFunctionAddress ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetExtensionFunctionAddress( hDriver, name, ppFunctionAddress ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesDeviceGet + __zedlllocal ze_result_t ZE_APICALL + zesDeviceGet( + zes_driver_handle_t hDriver, ///< [in] handle of the sysman driver instance + uint32_t* pCount, ///< [in,out] pointer to the number of sysman devices. + ///< if count is zero, then the driver shall update the value with the + ///< total number of sysman devices available. + ///< if count is greater than the number of sysman devices available, then + ///< the driver shall update the value with the correct number of sysman + ///< devices available. + zes_device_handle_t* phDevices ///< [in,out][optional][range(0, *pCount)] array of handle of sysman devices. + ///< if count is less than the number of sysman devices available, then + ///< driver shall only retrieve that number of sysman devices. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hDriver )->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_5) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGet = dditable->Device->pfnGet; + if( nullptr == pfnGet ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGet( hDriver, pCount, phDevices ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesDeviceGetProperties + __zedlllocal ze_result_t ZE_APICALL + zesDeviceGetProperties( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + zes_device_properties_t* pProperties ///< [in,out] Structure that will contain information about the device. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hDevice )->pSysman; + if (dditable->isValidFlag == 0) + return ZE_RESULT_ERROR_UNINITIALIZED; + // Check that api version in the driver is supported by this version of the API + if (dditable->version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetProperties = dditable->Device->pfnGetProperties; + if( nullptr == pfnGetProperties ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetProperties( hDevice, pProperties ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesDeviceGetState + __zedlllocal ze_result_t ZE_APICALL + zesDeviceGetState( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + zes_device_state_t* pState ///< [in,out] Structure that will contain information about the device. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hDevice )->pSysman; + if (dditable->isValidFlag == 0) + return ZE_RESULT_ERROR_UNINITIALIZED; + // Check that api version in the driver is supported by this version of the API + if (dditable->version < ZE_API_VERSION_1_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetState = dditable->Device->pfnGetState; + if( nullptr == pfnGetState ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetState( hDevice, pState ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesDeviceReset + __zedlllocal ze_result_t ZE_APICALL + zesDeviceReset( + zes_device_handle_t hDevice, ///< [in] Sysman handle for the device + ze_bool_t force ///< [in] If set to true, all applications that are currently using the + ///< device will be forcibly killed. + ) + { + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnReset = dditable->Device->pfnReset; + if( nullptr == pfnReset ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnReset( hDevice, force ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesDeviceResetExt + __zedlllocal ze_result_t ZE_APICALL + zesDeviceResetExt( + zes_device_handle_t hDevice, ///< [in] Sysman handle for the device + zes_reset_properties_t* pProperties ///< [in] Device reset properties to apply + ) + { + 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_7) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnResetExt = dditable->Device->pfnResetExt; + if( nullptr == pfnResetExt ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnResetExt( hDevice, pProperties ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesDeviceProcessesGetState + __zedlllocal ze_result_t ZE_APICALL + zesDeviceProcessesGetState( + zes_device_handle_t hDevice, ///< [in] Sysman handle for the device + uint32_t* pCount, ///< [in,out] pointer to the number of processes. + ///< if count is zero, then the driver shall update the value with the + ///< total number of processes currently attached to the device. + ///< if count is greater than the number of processes currently attached to + ///< the device, then the driver shall update the value with the correct + ///< number of processes. + zes_process_state_t* pProcesses ///< [in,out][optional][range(0, *pCount)] array of process information. + ///< if count is less than the number of processes currently attached to + ///< the device, then the driver shall only retrieve information about that + ///< number of processes. In this case, the return code will ::ZE_RESULT_ERROR_INVALID_SIZE. + ) + { + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnProcessesGetState = dditable->Device->pfnProcessesGetState; + if( nullptr == pfnProcessesGetState ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnProcessesGetState( hDevice, pCount, pProcesses ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesDevicePciGetProperties + __zedlllocal ze_result_t ZE_APICALL + zesDevicePciGetProperties( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + zes_pci_properties_t* pProperties ///< [in,out] Will contain the PCI properties. + ) + { + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnPciGetProperties = dditable->Device->pfnPciGetProperties; + if( nullptr == pfnPciGetProperties ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnPciGetProperties( hDevice, pProperties ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesDevicePciGetState + __zedlllocal ze_result_t ZE_APICALL + zesDevicePciGetState( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + zes_pci_state_t* pState ///< [in,out] Will contain the PCI properties. + ) + { + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnPciGetState = dditable->Device->pfnPciGetState; + if( nullptr == pfnPciGetState ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnPciGetState( hDevice, pState ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesDevicePciGetBars + __zedlllocal ze_result_t ZE_APICALL + zesDevicePciGetBars( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + uint32_t* pCount, ///< [in,out] pointer to the number of PCI bars. + ///< if count is zero, then the driver shall update the value with the + ///< total number of PCI bars that are setup. + ///< if count is greater than the number of PCI bars that are setup, then + ///< the driver shall update the value with the correct number of PCI bars. + zes_pci_bar_properties_t* pProperties ///< [in,out][optional][range(0, *pCount)] array of information about setup + ///< PCI bars. + ///< if count is less than the number of PCI bars that are setup, then the + ///< driver shall only retrieve information about that number of PCI bars. + ) + { + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnPciGetBars = dditable->Device->pfnPciGetBars; + if( nullptr == pfnPciGetBars ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnPciGetBars( hDevice, pCount, pProperties ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesDevicePciGetStats + __zedlllocal ze_result_t ZE_APICALL + zesDevicePciGetStats( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + zes_pci_stats_t* pStats ///< [in,out] Will contain a snapshot of the latest stats. + ) + { + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnPciGetStats = dditable->Device->pfnPciGetStats; + if( nullptr == pfnPciGetStats ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnPciGetStats( hDevice, pStats ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesDeviceSetOverclockWaiver + __zedlllocal ze_result_t ZE_APICALL + zesDeviceSetOverclockWaiver( + zes_device_handle_t hDevice ///< [in] Sysman handle of the device. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hDevice )->pSysman; + if (dditable->isValidFlag == 0) + return ZE_RESULT_ERROR_UNINITIALIZED; + // Check that api version in the driver is supported by this version of the API + if (dditable->version < ZE_API_VERSION_1_5) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnSetOverclockWaiver = dditable->Device->pfnSetOverclockWaiver; + if( nullptr == pfnSetOverclockWaiver ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnSetOverclockWaiver( hDevice ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesDeviceGetOverclockDomains + __zedlllocal ze_result_t ZE_APICALL + zesDeviceGetOverclockDomains( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + uint32_t* pOverclockDomains ///< [in,out] Returns the overclock domains that are supported (a bit for + ///< each of enum ::zes_overclock_domain_t). If no bits are set, the device + ///< doesn't support overclocking. + ) + { + 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_5) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetOverclockDomains = dditable->Device->pfnGetOverclockDomains; + if( nullptr == pfnGetOverclockDomains ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetOverclockDomains( hDevice, pOverclockDomains ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesDeviceGetOverclockControls + __zedlllocal ze_result_t ZE_APICALL + zesDeviceGetOverclockControls( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + zes_overclock_domain_t domainType, ///< [in] Domain type. + uint32_t* pAvailableControls ///< [in,out] Returns the overclock controls that are supported for the + ///< specified overclock domain (a bit for each of enum + ///< ::zes_overclock_control_t). + ) + { + 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_5) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetOverclockControls = dditable->Device->pfnGetOverclockControls; + if( nullptr == pfnGetOverclockControls ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetOverclockControls( hDevice, domainType, pAvailableControls ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesDeviceResetOverclockSettings + __zedlllocal ze_result_t ZE_APICALL + zesDeviceResetOverclockSettings( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + ze_bool_t onShippedState ///< [in] True will reset to shipped state; false will reset to + ///< manufacturing state + ) + { + 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_5) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnResetOverclockSettings = dditable->Device->pfnResetOverclockSettings; + if( nullptr == pfnResetOverclockSettings ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnResetOverclockSettings( hDevice, onShippedState ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesDeviceReadOverclockState + __zedlllocal ze_result_t ZE_APICALL + zesDeviceReadOverclockState( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + zes_overclock_mode_t* pOverclockMode, ///< [out] One of overclock mode. + ze_bool_t* pWaiverSetting, ///< [out] Waiver setting: 0 = Waiver not set, 1 = waiver has been set. + ze_bool_t* pOverclockState, ///< [out] Current settings 0 =manufacturing state, 1= shipped state).. + zes_pending_action_t* pPendingAction, ///< [out] This enum is returned when the driver attempts to set an + ///< overclock control or reset overclock settings. + ze_bool_t* pPendingReset ///< [out] Pending reset 0 =manufacturing state, 1= shipped state).. + ) + { + 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_5) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnReadOverclockState = dditable->Device->pfnReadOverclockState; + if( nullptr == pfnReadOverclockState ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnReadOverclockState( hDevice, pOverclockMode, pWaiverSetting, pOverclockState, pPendingAction, pPendingReset ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesDeviceEnumOverclockDomains + __zedlllocal ze_result_t ZE_APICALL + zesDeviceEnumOverclockDomains( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + uint32_t* pCount, ///< [in,out] pointer to the number of components of this type. + ///< if count is zero, then the driver shall update the value with the + ///< total number of components of this type that are available. + ///< if count is greater than the number of components of this type that + ///< are available, then the driver shall update the value with the correct + ///< number of components. + zes_overclock_handle_t* phDomainHandle ///< [in,out][optional][range(0, *pCount)] array of handle of components of + ///< this type. + ///< if count is less than the number of components of this type that are + ///< available, then the driver shall only retrieve that number of + ///< component handles. + ) + { + 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_5) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnEnumOverclockDomains = dditable->Device->pfnEnumOverclockDomains; + if( nullptr == pfnEnumOverclockDomains ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnEnumOverclockDomains( hDevice, pCount, phDomainHandle ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesOverclockGetDomainProperties + __zedlllocal ze_result_t ZE_APICALL + zesOverclockGetDomainProperties( + zes_overclock_handle_t hDomainHandle, ///< [in] Handle for the component domain. + zes_overclock_properties_t* pDomainProperties ///< [in,out] The overclock properties for the specified domain. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hDomainHandle )->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_5) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetDomainProperties = dditable->Overclock->pfnGetDomainProperties; + if( nullptr == pfnGetDomainProperties ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetDomainProperties( hDomainHandle, pDomainProperties ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesOverclockGetDomainVFProperties + __zedlllocal ze_result_t ZE_APICALL + zesOverclockGetDomainVFProperties( + zes_overclock_handle_t hDomainHandle, ///< [in] Handle for the component domain. + zes_vf_property_t* pVFProperties ///< [in,out] The VF min,max,step for a specified domain. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hDomainHandle )->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_5) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetDomainVFProperties = dditable->Overclock->pfnGetDomainVFProperties; + if( nullptr == pfnGetDomainVFProperties ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetDomainVFProperties( hDomainHandle, pVFProperties ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesOverclockGetDomainControlProperties + __zedlllocal ze_result_t ZE_APICALL + zesOverclockGetDomainControlProperties( + zes_overclock_handle_t hDomainHandle, ///< [in] Handle for the component domain. + zes_overclock_control_t DomainControl, ///< [in] Handle for the component. + zes_control_property_t* pControlProperties ///< [in,out] overclock control values. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hDomainHandle )->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_5) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetDomainControlProperties = dditable->Overclock->pfnGetDomainControlProperties; + if( nullptr == pfnGetDomainControlProperties ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetDomainControlProperties( hDomainHandle, DomainControl, pControlProperties ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesOverclockGetControlCurrentValue + __zedlllocal ze_result_t ZE_APICALL + zesOverclockGetControlCurrentValue( + zes_overclock_handle_t hDomainHandle, ///< [in] Handle for the component. + zes_overclock_control_t DomainControl, ///< [in] Overclock Control. + double* pValue ///< [in,out] Getting overclock control value for the specified control. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hDomainHandle )->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_5) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetControlCurrentValue = dditable->Overclock->pfnGetControlCurrentValue; + if( nullptr == pfnGetControlCurrentValue ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetControlCurrentValue( hDomainHandle, DomainControl, pValue ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesOverclockGetControlPendingValue + __zedlllocal ze_result_t ZE_APICALL + zesOverclockGetControlPendingValue( + zes_overclock_handle_t hDomainHandle, ///< [in] Handle for the component domain. + zes_overclock_control_t DomainControl, ///< [in] Overclock Control. + double* pValue ///< [out] Returns the pending value for a given control. The units and + ///< format of the value depend on the control type. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hDomainHandle )->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_5) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetControlPendingValue = dditable->Overclock->pfnGetControlPendingValue; + if( nullptr == pfnGetControlPendingValue ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetControlPendingValue( hDomainHandle, DomainControl, pValue ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesOverclockSetControlUserValue + __zedlllocal ze_result_t ZE_APICALL + zesOverclockSetControlUserValue( + zes_overclock_handle_t hDomainHandle, ///< [in] Handle for the component domain. + zes_overclock_control_t DomainControl, ///< [in] Domain Control. + double pValue, ///< [in] The new value of the control. The units and format of the value + ///< depend on the control type. + zes_pending_action_t* pPendingAction ///< [out] Pending overclock setting. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hDomainHandle )->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_5) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnSetControlUserValue = dditable->Overclock->pfnSetControlUserValue; + if( nullptr == pfnSetControlUserValue ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnSetControlUserValue( hDomainHandle, DomainControl, pValue, pPendingAction ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesOverclockGetControlState + __zedlllocal ze_result_t ZE_APICALL + zesOverclockGetControlState( + zes_overclock_handle_t hDomainHandle, ///< [in] Handle for the component domain. + zes_overclock_control_t DomainControl, ///< [in] Domain Control. + zes_control_state_t* pControlState, ///< [out] Current overclock control state. + zes_pending_action_t* pPendingAction ///< [out] Pending overclock setting. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hDomainHandle )->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_5) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetControlState = dditable->Overclock->pfnGetControlState; + if( nullptr == pfnGetControlState ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetControlState( hDomainHandle, DomainControl, pControlState, pPendingAction ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesOverclockGetVFPointValues + __zedlllocal ze_result_t ZE_APICALL + zesOverclockGetVFPointValues( + zes_overclock_handle_t hDomainHandle, ///< [in] Handle for the component domain. + zes_vf_type_t VFType, ///< [in] Voltage or Freqency point to read. + zes_vf_array_type_t VFArrayType, ///< [in] User,Default or Live VF array to read from + uint32_t PointIndex, ///< [in] Point index - number between (0, max_num_points - 1). + uint32_t* PointValue ///< [out] Returns the frequency in 1kHz units or voltage in millivolt + ///< units from the custom V-F curve at the specified zero-based index + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hDomainHandle )->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_5) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetVFPointValues = dditable->Overclock->pfnGetVFPointValues; + if( nullptr == pfnGetVFPointValues ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetVFPointValues( hDomainHandle, VFType, VFArrayType, PointIndex, PointValue ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesOverclockSetVFPointValues + __zedlllocal ze_result_t ZE_APICALL + zesOverclockSetVFPointValues( + zes_overclock_handle_t hDomainHandle, ///< [in] Handle for the component domain. + zes_vf_type_t VFType, ///< [in] Voltage or Freqency point to read. + uint32_t PointIndex, ///< [in] Point index - number between (0, max_num_points - 1). + uint32_t PointValue ///< [in] Writes frequency in 1kHz units or voltage in millivolt units to + ///< custom V-F curve at the specified zero-based index + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hDomainHandle )->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_5) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnSetVFPointValues = dditable->Overclock->pfnSetVFPointValues; + if( nullptr == pfnSetVFPointValues ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnSetVFPointValues( hDomainHandle, VFType, PointIndex, PointValue ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesDeviceEnumDiagnosticTestSuites + __zedlllocal ze_result_t ZE_APICALL + zesDeviceEnumDiagnosticTestSuites( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + uint32_t* pCount, ///< [in,out] pointer to the number of components of this type. + ///< if count is zero, then the driver shall update the value with the + ///< total number of components of this type that are available. + ///< if count is greater than the number of components of this type that + ///< are available, then the driver shall update the value with the correct + ///< number of components. + zes_diag_handle_t* phDiagnostics ///< [in,out][optional][range(0, *pCount)] array of handle of components of + ///< this type. + ///< if count is less than the number of components of this type that are + ///< available, then the driver shall only retrieve that number of + ///< component handles. + ) + { + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnEnumDiagnosticTestSuites = dditable->Device->pfnEnumDiagnosticTestSuites; + if( nullptr == pfnEnumDiagnosticTestSuites ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnEnumDiagnosticTestSuites( hDevice, pCount, phDiagnostics ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesDiagnosticsGetProperties + __zedlllocal ze_result_t ZE_APICALL + zesDiagnosticsGetProperties( + zes_diag_handle_t hDiagnostics, ///< [in] Handle for the component. + zes_diag_properties_t* pProperties ///< [in,out] Structure describing the properties of a diagnostics test + ///< suite + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hDiagnostics )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetProperties = dditable->Diagnostics->pfnGetProperties; + if( nullptr == pfnGetProperties ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetProperties( hDiagnostics, pProperties ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesDiagnosticsGetTests + __zedlllocal ze_result_t ZE_APICALL + zesDiagnosticsGetTests( + zes_diag_handle_t hDiagnostics, ///< [in] Handle for the component. + uint32_t* pCount, ///< [in,out] pointer to the number of tests. + ///< if count is zero, then the driver shall update the value with the + ///< total number of tests that are available. + ///< if count is greater than the number of tests that are available, then + ///< the driver shall update the value with the correct number of tests. + zes_diag_test_t* pTests ///< [in,out][optional][range(0, *pCount)] array of information about + ///< individual tests sorted by increasing value of the `index` member of ::zes_diag_test_t. + ///< if count is less than the number of tests that are available, then the + ///< driver shall only retrieve that number of tests. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hDiagnostics )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetTests = dditable->Diagnostics->pfnGetTests; + if( nullptr == pfnGetTests ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetTests( hDiagnostics, pCount, pTests ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesDiagnosticsRunTests + __zedlllocal ze_result_t ZE_APICALL + zesDiagnosticsRunTests( + zes_diag_handle_t hDiagnostics, ///< [in] Handle for the component. + uint32_t startIndex, ///< [in] The index of the first test to run. Set to + ///< ::ZES_DIAG_FIRST_TEST_INDEX to start from the beginning. + uint32_t endIndex, ///< [in] The index of the last test to run. Set to + ///< ::ZES_DIAG_LAST_TEST_INDEX to complete all tests after the start test. + zes_diag_result_t* pResult ///< [in,out] The result of the diagnostics + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hDiagnostics )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnRunTests = dditable->Diagnostics->pfnRunTests; + if( nullptr == pfnRunTests ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnRunTests( hDiagnostics, startIndex, endIndex, pResult ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesDeviceEccAvailable + __zedlllocal ze_result_t ZE_APICALL + zesDeviceEccAvailable( + zes_device_handle_t hDevice, ///< [in] Handle for the component. + ze_bool_t* pAvailable ///< [out] ECC functionality is available (true)/unavailable (false). + ) + { + 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_4) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnEccAvailable = dditable->Device->pfnEccAvailable; + if( nullptr == pfnEccAvailable ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnEccAvailable( hDevice, pAvailable ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesDeviceEccConfigurable + __zedlllocal ze_result_t ZE_APICALL + zesDeviceEccConfigurable( + zes_device_handle_t hDevice, ///< [in] Handle for the component. + ze_bool_t* pConfigurable ///< [out] ECC can be enabled/disabled (true)/enabled/disabled (false). + ) + { + 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_4) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnEccConfigurable = dditable->Device->pfnEccConfigurable; + if( nullptr == pfnEccConfigurable ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnEccConfigurable( hDevice, pConfigurable ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesDeviceGetEccState + __zedlllocal ze_result_t ZE_APICALL + zesDeviceGetEccState( + zes_device_handle_t hDevice, ///< [in] Handle for the component. + zes_device_ecc_properties_t* pState ///< [out] ECC state, pending state, and pending action for state change. + ) + { + 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_4) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetEccState = dditable->Device->pfnGetEccState; + if( nullptr == pfnGetEccState ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetEccState( hDevice, pState ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesDeviceSetEccState + __zedlllocal ze_result_t ZE_APICALL + zesDeviceSetEccState( + zes_device_handle_t hDevice, ///< [in] Handle for the component. + const zes_device_ecc_desc_t* newState, ///< [in] Pointer to desired ECC state. + zes_device_ecc_properties_t* pState ///< [out] ECC state, pending state, and pending action for state change. + ) + { + 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_4) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnSetEccState = dditable->Device->pfnSetEccState; + if( nullptr == pfnSetEccState ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnSetEccState( hDevice, newState, pState ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesDeviceEnumEngineGroups + __zedlllocal ze_result_t ZE_APICALL + zesDeviceEnumEngineGroups( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + uint32_t* pCount, ///< [in,out] pointer to the number of components of this type. + ///< if count is zero, then the driver shall update the value with the + ///< total number of components of this type that are available. + ///< if count is greater than the number of components of this type that + ///< are available, then the driver shall update the value with the correct + ///< number of components. + zes_engine_handle_t* phEngine ///< [in,out][optional][range(0, *pCount)] array of handle of components of + ///< this type. + ///< if count is less than the number of components of this type that are + ///< available, then the driver shall only retrieve that number of + ///< component handles. + ) + { + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnEnumEngineGroups = dditable->Device->pfnEnumEngineGroups; + if( nullptr == pfnEnumEngineGroups ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnEnumEngineGroups( hDevice, pCount, phEngine ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesEngineGetProperties + __zedlllocal ze_result_t ZE_APICALL + zesEngineGetProperties( + zes_engine_handle_t hEngine, ///< [in] Handle for the component. + zes_engine_properties_t* pProperties ///< [in,out] The properties for the specified engine group. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hEngine )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetProperties = dditable->Engine->pfnGetProperties; + if( nullptr == pfnGetProperties ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetProperties( hEngine, pProperties ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesEngineGetActivity + __zedlllocal ze_result_t ZE_APICALL + zesEngineGetActivity( + zes_engine_handle_t hEngine, ///< [in] Handle for the component. + zes_engine_stats_t* pStats ///< [in,out] Will contain a snapshot of the engine group activity + ///< counters. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hEngine )->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_7) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetActivity = dditable->Engine->pfnGetActivity; + if( nullptr == pfnGetActivity ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetActivity( hEngine, pStats ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesDeviceEventRegister + __zedlllocal ze_result_t ZE_APICALL + zesDeviceEventRegister( + zes_device_handle_t hDevice, ///< [in] The device handle. + zes_event_type_flags_t events ///< [in] List of events to listen to. + ) + { + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnEventRegister = dditable->Device->pfnEventRegister; + if( nullptr == pfnEventRegister ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnEventRegister( hDevice, events ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesDriverEventListen + __zedlllocal ze_result_t ZE_APICALL + zesDriverEventListen( + ze_driver_handle_t hDriver, ///< [in] handle of the driver instance + uint32_t timeout, ///< [in] if non-zero, then indicates the maximum time (in milliseconds) to + ///< yield before returning ::ZE_RESULT_SUCCESS or ::ZE_RESULT_NOT_READY; + ///< if zero, then will check status and return immediately; + ///< if `UINT32_MAX`, then function will not return until events arrive. + uint32_t count, ///< [in] Number of device handles in phDevices. + zes_device_handle_t* phDevices, ///< [in][range(0, count)] Device handles to listen to for events. Only + ///< devices from the provided driver handle can be specified in this list. + uint32_t* pNumDeviceEvents, ///< [in,out] Will contain the actual number of devices in phDevices that + ///< generated events. If non-zero, check pEvents to determine the devices + ///< and events that were received. + zes_event_type_flags_t* pEvents ///< [in,out] An array that will continue the list of events for each + ///< device listened in phDevices. + ///< This array must be at least as big as count. + ///< For every device handle in phDevices, this will provide the events + ///< that occurred for that device at the same position in this array. If + ///< no event was received for a given device, the corresponding array + ///< entry will be zero. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hDriver )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnEventListen = dditable->Driver->pfnEventListen; + if( nullptr == pfnEventListen ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnEventListen( hDriver, timeout, count, phDevices, pNumDeviceEvents, pEvents ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesDriverEventListenEx + __zedlllocal ze_result_t ZE_APICALL + zesDriverEventListenEx( + ze_driver_handle_t hDriver, ///< [in] handle of the driver instance + uint64_t timeout, ///< [in] if non-zero, then indicates the maximum time (in milliseconds) to + ///< yield before returning ::ZE_RESULT_SUCCESS or ::ZE_RESULT_NOT_READY; + ///< if zero, then will check status and return immediately; + ///< if `UINT64_MAX`, then function will not return until events arrive. + uint32_t count, ///< [in] Number of device handles in phDevices. + zes_device_handle_t* phDevices, ///< [in][range(0, count)] Device handles to listen to for events. Only + ///< devices from the provided driver handle can be specified in this list. + uint32_t* pNumDeviceEvents, ///< [in,out] Will contain the actual number of devices in phDevices that + ///< generated events. If non-zero, check pEvents to determine the devices + ///< and events that were received. + zes_event_type_flags_t* pEvents ///< [in,out] An array that will continue the list of events for each + ///< device listened in phDevices. + ///< This array must be at least as big as count. + ///< For every device handle in phDevices, this will provide the events + ///< that occurred for that device at the same position in this array. If + ///< no event was received for a given device, the corresponding array + ///< entry will be zero. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hDriver )->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_1) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnEventListenEx = dditable->Driver->pfnEventListenEx; + if( nullptr == pfnEventListenEx ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnEventListenEx( hDriver, timeout, count, phDevices, pNumDeviceEvents, pEvents ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesDeviceEnumFabricPorts + __zedlllocal ze_result_t ZE_APICALL + zesDeviceEnumFabricPorts( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + uint32_t* pCount, ///< [in,out] pointer to the number of components of this type. + ///< if count is zero, then the driver shall update the value with the + ///< total number of components of this type that are available. + ///< if count is greater than the number of components of this type that + ///< are available, then the driver shall update the value with the correct + ///< number of components. + zes_fabric_port_handle_t* phPort ///< [in,out][optional][range(0, *pCount)] array of handle of components of + ///< this type. + ///< if count is less than the number of components of this type that are + ///< available, then the driver shall only retrieve that number of + ///< component handles. + ) + { + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnEnumFabricPorts = dditable->Device->pfnEnumFabricPorts; + if( nullptr == pfnEnumFabricPorts ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnEnumFabricPorts( hDevice, pCount, phPort ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesFabricPortGetProperties + __zedlllocal ze_result_t ZE_APICALL + zesFabricPortGetProperties( + zes_fabric_port_handle_t hPort, ///< [in] Handle for the component. + zes_fabric_port_properties_t* pProperties ///< [in,out] Will contain properties of the Fabric Port. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hPort )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetProperties = dditable->FabricPort->pfnGetProperties; + if( nullptr == pfnGetProperties ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetProperties( hPort, pProperties ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesFabricPortGetLinkType + __zedlllocal ze_result_t ZE_APICALL + zesFabricPortGetLinkType( + zes_fabric_port_handle_t hPort, ///< [in] Handle for the component. + zes_fabric_link_type_t* pLinkType ///< [in,out] Will contain details about the link attached to the Fabric + ///< port. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hPort )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetLinkType = dditable->FabricPort->pfnGetLinkType; + if( nullptr == pfnGetLinkType ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetLinkType( hPort, pLinkType ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesFabricPortGetConfig + __zedlllocal ze_result_t ZE_APICALL + zesFabricPortGetConfig( + zes_fabric_port_handle_t hPort, ///< [in] Handle for the component. + zes_fabric_port_config_t* pConfig ///< [in,out] Will contain configuration of the Fabric Port. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hPort )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetConfig = dditable->FabricPort->pfnGetConfig; + if( nullptr == pfnGetConfig ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetConfig( hPort, pConfig ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesFabricPortSetConfig + __zedlllocal ze_result_t ZE_APICALL + zesFabricPortSetConfig( + zes_fabric_port_handle_t hPort, ///< [in] Handle for the component. + const zes_fabric_port_config_t* pConfig ///< [in] Contains new configuration of the Fabric Port. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hPort )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnSetConfig = dditable->FabricPort->pfnSetConfig; + if( nullptr == pfnSetConfig ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnSetConfig( hPort, pConfig ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesFabricPortGetState + __zedlllocal ze_result_t ZE_APICALL + zesFabricPortGetState( + zes_fabric_port_handle_t hPort, ///< [in] Handle for the component. + zes_fabric_port_state_t* pState ///< [in,out] Will contain the current state of the Fabric Port + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hPort )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetState = dditable->FabricPort->pfnGetState; + if( nullptr == pfnGetState ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetState( hPort, pState ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesFabricPortGetThroughput + __zedlllocal ze_result_t ZE_APICALL + zesFabricPortGetThroughput( + zes_fabric_port_handle_t hPort, ///< [in] Handle for the component. + zes_fabric_port_throughput_t* pThroughput ///< [in,out] Will contain the Fabric port throughput counters. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hPort )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetThroughput = dditable->FabricPort->pfnGetThroughput; + if( nullptr == pfnGetThroughput ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetThroughput( hPort, pThroughput ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesFabricPortGetFabricErrorCounters + __zedlllocal ze_result_t ZE_APICALL + zesFabricPortGetFabricErrorCounters( + zes_fabric_port_handle_t hPort, ///< [in] Handle for the component. + zes_fabric_port_error_counters_t* pErrors ///< [in,out] Will contain the Fabric port Error counters. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hPort )->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_7) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetFabricErrorCounters = dditable->FabricPort->pfnGetFabricErrorCounters; + if( nullptr == pfnGetFabricErrorCounters ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetFabricErrorCounters( hPort, pErrors ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesFabricPortGetMultiPortThroughput + __zedlllocal ze_result_t ZE_APICALL + zesFabricPortGetMultiPortThroughput( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + uint32_t numPorts, ///< [in] Number of ports enumerated in function ::zesDeviceEnumFabricPorts + zes_fabric_port_handle_t* phPort, ///< [in][range(0, numPorts)] array of fabric port handles provided by user + ///< to gather throughput values. + zes_fabric_port_throughput_t** pThroughput ///< [out][range(0, numPorts)] array of fabric port throughput counters + ///< from multiple ports of type ::zes_fabric_port_throughput_t. + ) + { + 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_7) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetMultiPortThroughput = dditable->FabricPort->pfnGetMultiPortThroughput; + if( nullptr == pfnGetMultiPortThroughput ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetMultiPortThroughput( hDevice, numPorts, phPort, pThroughput ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesDeviceEnumFans + __zedlllocal ze_result_t ZE_APICALL + zesDeviceEnumFans( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + uint32_t* pCount, ///< [in,out] pointer to the number of components of this type. + ///< if count is zero, then the driver shall update the value with the + ///< total number of components of this type that are available. + ///< if count is greater than the number of components of this type that + ///< are available, then the driver shall update the value with the correct + ///< number of components. + zes_fan_handle_t* phFan ///< [in,out][optional][range(0, *pCount)] array of handle of components of + ///< this type. + ///< if count is less than the number of components of this type that are + ///< available, then the driver shall only retrieve that number of + ///< component handles. + ) + { + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnEnumFans = dditable->Device->pfnEnumFans; + if( nullptr == pfnEnumFans ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnEnumFans( hDevice, pCount, phFan ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesFanGetProperties + __zedlllocal ze_result_t ZE_APICALL + zesFanGetProperties( + zes_fan_handle_t hFan, ///< [in] Handle for the component. + zes_fan_properties_t* pProperties ///< [in,out] Will contain the properties of the fan. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hFan )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetProperties = dditable->Fan->pfnGetProperties; + if( nullptr == pfnGetProperties ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetProperties( hFan, pProperties ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesFanGetConfig + __zedlllocal ze_result_t ZE_APICALL + zesFanGetConfig( + zes_fan_handle_t hFan, ///< [in] Handle for the component. + zes_fan_config_t* pConfig ///< [in,out] Will contain the current configuration of the fan. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hFan )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetConfig = dditable->Fan->pfnGetConfig; + if( nullptr == pfnGetConfig ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetConfig( hFan, pConfig ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesFanSetDefaultMode + __zedlllocal ze_result_t ZE_APICALL + zesFanSetDefaultMode( + zes_fan_handle_t hFan ///< [in] Handle for the component. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hFan )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnSetDefaultMode = dditable->Fan->pfnSetDefaultMode; + if( nullptr == pfnSetDefaultMode ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnSetDefaultMode( hFan ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesFanSetFixedSpeedMode + __zedlllocal ze_result_t ZE_APICALL + zesFanSetFixedSpeedMode( + zes_fan_handle_t hFan, ///< [in] Handle for the component. + const zes_fan_speed_t* speed ///< [in] The fixed fan speed setting + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hFan )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnSetFixedSpeedMode = dditable->Fan->pfnSetFixedSpeedMode; + if( nullptr == pfnSetFixedSpeedMode ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnSetFixedSpeedMode( hFan, speed ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesFanSetSpeedTableMode + __zedlllocal ze_result_t ZE_APICALL + zesFanSetSpeedTableMode( + zes_fan_handle_t hFan, ///< [in] Handle for the component. + const zes_fan_speed_table_t* speedTable ///< [in] A table containing temperature/speed pairs. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hFan )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnSetSpeedTableMode = dditable->Fan->pfnSetSpeedTableMode; + if( nullptr == pfnSetSpeedTableMode ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnSetSpeedTableMode( hFan, speedTable ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesFanGetState + __zedlllocal ze_result_t ZE_APICALL + zesFanGetState( + zes_fan_handle_t hFan, ///< [in] Handle for the component. + zes_fan_speed_units_t units, ///< [in] The units in which the fan speed should be returned. + int32_t* pSpeed ///< [in,out] Will contain the current speed of the fan in the units + ///< requested. A value of -1 indicates that the fan speed cannot be + ///< measured. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hFan )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetState = dditable->Fan->pfnGetState; + if( nullptr == pfnGetState ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetState( hFan, units, pSpeed ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesDeviceEnumFirmwares + __zedlllocal ze_result_t ZE_APICALL + zesDeviceEnumFirmwares( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + uint32_t* pCount, ///< [in,out] pointer to the number of components of this type. + ///< if count is zero, then the driver shall update the value with the + ///< total number of components of this type that are available. + ///< if count is greater than the number of components of this type that + ///< are available, then the driver shall update the value with the correct + ///< number of components. + zes_firmware_handle_t* phFirmware ///< [in,out][optional][range(0, *pCount)] array of handle of components of + ///< this type. + ///< if count is less than the number of components of this type that are + ///< available, then the driver shall only retrieve that number of + ///< component handles. + ) + { + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnEnumFirmwares = dditable->Device->pfnEnumFirmwares; + if( nullptr == pfnEnumFirmwares ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnEnumFirmwares( hDevice, pCount, phFirmware ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesFirmwareGetProperties + __zedlllocal ze_result_t ZE_APICALL + zesFirmwareGetProperties( + zes_firmware_handle_t hFirmware, ///< [in] Handle for the component. + zes_firmware_properties_t* pProperties ///< [in,out] Pointer to an array that will hold the properties of the + ///< firmware + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hFirmware )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetProperties = dditable->Firmware->pfnGetProperties; + if( nullptr == pfnGetProperties ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetProperties( hFirmware, pProperties ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesFirmwareFlash + __zedlllocal ze_result_t ZE_APICALL + zesFirmwareFlash( + zes_firmware_handle_t hFirmware, ///< [in] Handle for the component. + void* pImage, ///< [in] Image of the new firmware to flash. + uint32_t size ///< [in] Size of the flash image. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hFirmware )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnFlash = dditable->Firmware->pfnFlash; + if( nullptr == pfnFlash ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnFlash( hFirmware, pImage, size ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesFirmwareGetFlashProgress + __zedlllocal ze_result_t ZE_APICALL + zesFirmwareGetFlashProgress( + zes_firmware_handle_t hFirmware, ///< [in] Handle for the component. + uint32_t* pCompletionPercent ///< [in,out] Pointer to the Completion Percentage of Firmware Update + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hFirmware )->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_8) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetFlashProgress = dditable->Firmware->pfnGetFlashProgress; + if( nullptr == pfnGetFlashProgress ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetFlashProgress( hFirmware, pCompletionPercent ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesFirmwareGetConsoleLogs + __zedlllocal ze_result_t ZE_APICALL + zesFirmwareGetConsoleLogs( + zes_firmware_handle_t hFirmware, ///< [in] Handle for the component. + size_t* pSize, ///< [in,out] size of firmware log + char* pFirmwareLog ///< [in,out][optional] pointer to null-terminated string of the log. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hFirmware )->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_9) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetConsoleLogs = dditable->Firmware->pfnGetConsoleLogs; + if( nullptr == pfnGetConsoleLogs ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetConsoleLogs( hFirmware, pSize, pFirmwareLog ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesDeviceEnumFrequencyDomains + __zedlllocal ze_result_t ZE_APICALL + zesDeviceEnumFrequencyDomains( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + uint32_t* pCount, ///< [in,out] pointer to the number of components of this type. + ///< if count is zero, then the driver shall update the value with the + ///< total number of components of this type that are available. + ///< if count is greater than the number of components of this type that + ///< are available, then the driver shall update the value with the correct + ///< number of components. + zes_freq_handle_t* phFrequency ///< [in,out][optional][range(0, *pCount)] array of handle of components of + ///< this type. + ///< if count is less than the number of components of this type that are + ///< available, then the driver shall only retrieve that number of + ///< component handles. + ) + { + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnEnumFrequencyDomains = dditable->Device->pfnEnumFrequencyDomains; + if( nullptr == pfnEnumFrequencyDomains ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnEnumFrequencyDomains( hDevice, pCount, phFrequency ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesFrequencyGetProperties + __zedlllocal ze_result_t ZE_APICALL + zesFrequencyGetProperties( + zes_freq_handle_t hFrequency, ///< [in] Handle for the component. + zes_freq_properties_t* pProperties ///< [in,out] The frequency properties for the specified domain. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hFrequency )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetProperties = dditable->Frequency->pfnGetProperties; + if( nullptr == pfnGetProperties ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetProperties( hFrequency, pProperties ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesFrequencyGetAvailableClocks + __zedlllocal ze_result_t ZE_APICALL + zesFrequencyGetAvailableClocks( + zes_freq_handle_t hFrequency, ///< [in] Sysman handle of the device. + uint32_t* pCount, ///< [in,out] pointer to the number of frequencies. + ///< if count is zero, then the driver shall update the value with the + ///< total number of frequencies that are available. + ///< if count is greater than the number of frequencies that are available, + ///< then the driver shall update the value with the correct number of frequencies. + double* phFrequency ///< [in,out][optional][range(0, *pCount)] array of frequencies in units of + ///< MHz and sorted from slowest to fastest. + ///< if count is less than the number of frequencies that are available, + ///< then the driver shall only retrieve that number of frequencies. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hFrequency )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetAvailableClocks = dditable->Frequency->pfnGetAvailableClocks; + if( nullptr == pfnGetAvailableClocks ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetAvailableClocks( hFrequency, pCount, phFrequency ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesFrequencyGetRange + __zedlllocal ze_result_t ZE_APICALL + zesFrequencyGetRange( + zes_freq_handle_t hFrequency, ///< [in] Handle for the component. + zes_freq_range_t* pLimits ///< [in,out] The range between which the hardware can operate for the + ///< specified domain. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hFrequency )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetRange = dditable->Frequency->pfnGetRange; + if( nullptr == pfnGetRange ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetRange( hFrequency, pLimits ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesFrequencySetRange + __zedlllocal ze_result_t ZE_APICALL + zesFrequencySetRange( + zes_freq_handle_t hFrequency, ///< [in] Handle for the component. + const zes_freq_range_t* pLimits ///< [in] The limits between which the hardware can operate for the + ///< specified domain. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hFrequency )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnSetRange = dditable->Frequency->pfnSetRange; + if( nullptr == pfnSetRange ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnSetRange( hFrequency, pLimits ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesFrequencyGetState + __zedlllocal ze_result_t ZE_APICALL + zesFrequencyGetState( + zes_freq_handle_t hFrequency, ///< [in] Handle for the component. + zes_freq_state_t* pState ///< [in,out] Frequency state for the specified domain. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hFrequency )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetState = dditable->Frequency->pfnGetState; + if( nullptr == pfnGetState ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetState( hFrequency, pState ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesFrequencyGetThrottleTime + __zedlllocal ze_result_t ZE_APICALL + zesFrequencyGetThrottleTime( + zes_freq_handle_t hFrequency, ///< [in] Handle for the component. + zes_freq_throttle_time_t* pThrottleTime ///< [in,out] Will contain a snapshot of the throttle time counters for the + ///< specified domain. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hFrequency )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetThrottleTime = dditable->Frequency->pfnGetThrottleTime; + if( nullptr == pfnGetThrottleTime ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetThrottleTime( hFrequency, pThrottleTime ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesFrequencyOcGetCapabilities + __zedlllocal ze_result_t ZE_APICALL + zesFrequencyOcGetCapabilities( + zes_freq_handle_t hFrequency, ///< [in] Handle for the component. + zes_oc_capabilities_t* pOcCapabilities ///< [in,out] Pointer to the capabilities structure. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hFrequency )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnOcGetCapabilities = dditable->Frequency->pfnOcGetCapabilities; + if( nullptr == pfnOcGetCapabilities ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnOcGetCapabilities( hFrequency, pOcCapabilities ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesFrequencyOcGetFrequencyTarget + __zedlllocal ze_result_t ZE_APICALL + zesFrequencyOcGetFrequencyTarget( + zes_freq_handle_t hFrequency, ///< [in] Handle for the component. + double* pCurrentOcFrequency ///< [out] Overclocking Frequency in MHz, if extended moded is supported, + ///< will returned in 1 Mhz granularity, else, in multiples of 50 Mhz. This + ///< cannot be greater than the `maxOcFrequency` member of + ///< ::zes_oc_capabilities_t. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hFrequency )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnOcGetFrequencyTarget = dditable->Frequency->pfnOcGetFrequencyTarget; + if( nullptr == pfnOcGetFrequencyTarget ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnOcGetFrequencyTarget( hFrequency, pCurrentOcFrequency ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesFrequencyOcSetFrequencyTarget + __zedlllocal ze_result_t ZE_APICALL + zesFrequencyOcSetFrequencyTarget( + zes_freq_handle_t hFrequency, ///< [in] Handle for the component. + double CurrentOcFrequency ///< [in] Overclocking Frequency in MHz, if extended moded is supported, it + ///< could be set in 1 Mhz granularity, else, in multiples of 50 Mhz. This + ///< cannot be greater than the `maxOcFrequency` member of + ///< ::zes_oc_capabilities_t. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hFrequency )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnOcSetFrequencyTarget = dditable->Frequency->pfnOcSetFrequencyTarget; + if( nullptr == pfnOcSetFrequencyTarget ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnOcSetFrequencyTarget( hFrequency, CurrentOcFrequency ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesFrequencyOcGetVoltageTarget + __zedlllocal ze_result_t ZE_APICALL + zesFrequencyOcGetVoltageTarget( + zes_freq_handle_t hFrequency, ///< [in] Handle for the component. + double* pCurrentVoltageTarget, ///< [out] Overclock voltage in Volts. This cannot be greater than the + ///< `maxOcVoltage` member of ::zes_oc_capabilities_t. + double* pCurrentVoltageOffset ///< [out] This voltage offset is applied to all points on the + ///< voltage/frequency curve, including the new overclock voltageTarget. + ///< Valid range is between the `minOcVoltageOffset` and + ///< `maxOcVoltageOffset` members of ::zes_oc_capabilities_t. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hFrequency )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnOcGetVoltageTarget = dditable->Frequency->pfnOcGetVoltageTarget; + if( nullptr == pfnOcGetVoltageTarget ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnOcGetVoltageTarget( hFrequency, pCurrentVoltageTarget, pCurrentVoltageOffset ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesFrequencyOcSetVoltageTarget + __zedlllocal ze_result_t ZE_APICALL + zesFrequencyOcSetVoltageTarget( + zes_freq_handle_t hFrequency, ///< [in] Handle for the component. + double CurrentVoltageTarget, ///< [in] Overclock voltage in Volts. This cannot be greater than the + ///< `maxOcVoltage` member of ::zes_oc_capabilities_t. + double CurrentVoltageOffset ///< [in] This voltage offset is applied to all points on the + ///< voltage/frequency curve, include the new overclock voltageTarget. + ///< Valid range is between the `minOcVoltageOffset` and + ///< `maxOcVoltageOffset` members of ::zes_oc_capabilities_t. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hFrequency )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnOcSetVoltageTarget = dditable->Frequency->pfnOcSetVoltageTarget; + if( nullptr == pfnOcSetVoltageTarget ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnOcSetVoltageTarget( hFrequency, CurrentVoltageTarget, CurrentVoltageOffset ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesFrequencyOcSetMode + __zedlllocal ze_result_t ZE_APICALL + zesFrequencyOcSetMode( + zes_freq_handle_t hFrequency, ///< [in] Handle for the component. + zes_oc_mode_t CurrentOcMode ///< [in] Current Overclocking Mode ::zes_oc_mode_t. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hFrequency )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnOcSetMode = dditable->Frequency->pfnOcSetMode; + if( nullptr == pfnOcSetMode ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnOcSetMode( hFrequency, CurrentOcMode ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesFrequencyOcGetMode + __zedlllocal ze_result_t ZE_APICALL + zesFrequencyOcGetMode( + zes_freq_handle_t hFrequency, ///< [in] Handle for the component. + zes_oc_mode_t* pCurrentOcMode ///< [out] Current Overclocking Mode ::zes_oc_mode_t. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hFrequency )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnOcGetMode = dditable->Frequency->pfnOcGetMode; + if( nullptr == pfnOcGetMode ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnOcGetMode( hFrequency, pCurrentOcMode ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesFrequencyOcGetIccMax + __zedlllocal ze_result_t ZE_APICALL + zesFrequencyOcGetIccMax( + zes_freq_handle_t hFrequency, ///< [in] Handle for the component. + double* pOcIccMax ///< [in,out] Will contain the maximum current limit in Amperes on + ///< successful return. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hFrequency )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnOcGetIccMax = dditable->Frequency->pfnOcGetIccMax; + if( nullptr == pfnOcGetIccMax ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnOcGetIccMax( hFrequency, pOcIccMax ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesFrequencyOcSetIccMax + __zedlllocal ze_result_t ZE_APICALL + zesFrequencyOcSetIccMax( + zes_freq_handle_t hFrequency, ///< [in] Handle for the component. + double ocIccMax ///< [in] The new maximum current limit in Amperes. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hFrequency )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnOcSetIccMax = dditable->Frequency->pfnOcSetIccMax; + if( nullptr == pfnOcSetIccMax ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnOcSetIccMax( hFrequency, ocIccMax ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesFrequencyOcGetTjMax + __zedlllocal ze_result_t ZE_APICALL + zesFrequencyOcGetTjMax( + zes_freq_handle_t hFrequency, ///< [in] Handle for the component. + double* pOcTjMax ///< [in,out] Will contain the maximum temperature limit in degrees Celsius + ///< on successful return. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hFrequency )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnOcGetTjMax = dditable->Frequency->pfnOcGetTjMax; + if( nullptr == pfnOcGetTjMax ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnOcGetTjMax( hFrequency, pOcTjMax ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesFrequencyOcSetTjMax + __zedlllocal ze_result_t ZE_APICALL + zesFrequencyOcSetTjMax( + zes_freq_handle_t hFrequency, ///< [in] Handle for the component. + double ocTjMax ///< [in] The new maximum temperature limit in degrees Celsius. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hFrequency )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnOcSetTjMax = dditable->Frequency->pfnOcSetTjMax; + if( nullptr == pfnOcSetTjMax ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnOcSetTjMax( hFrequency, ocTjMax ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesDeviceEnumLeds + __zedlllocal ze_result_t ZE_APICALL + zesDeviceEnumLeds( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + uint32_t* pCount, ///< [in,out] pointer to the number of components of this type. + ///< if count is zero, then the driver shall update the value with the + ///< total number of components of this type that are available. + ///< if count is greater than the number of components of this type that + ///< are available, then the driver shall update the value with the correct + ///< number of components. + zes_led_handle_t* phLed ///< [in,out][optional][range(0, *pCount)] array of handle of components of + ///< this type. + ///< if count is less than the number of components of this type that are + ///< available, then the driver shall only retrieve that number of + ///< component handles. + ) + { + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnEnumLeds = dditable->Device->pfnEnumLeds; + if( nullptr == pfnEnumLeds ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnEnumLeds( hDevice, pCount, phLed ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesLedGetProperties + __zedlllocal ze_result_t ZE_APICALL + zesLedGetProperties( + zes_led_handle_t hLed, ///< [in] Handle for the component. + zes_led_properties_t* pProperties ///< [in,out] Will contain the properties of the LED. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hLed )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetProperties = dditable->Led->pfnGetProperties; + if( nullptr == pfnGetProperties ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetProperties( hLed, pProperties ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesLedGetState + __zedlllocal ze_result_t ZE_APICALL + zesLedGetState( + zes_led_handle_t hLed, ///< [in] Handle for the component. + zes_led_state_t* pState ///< [in,out] Will contain the current state of the LED. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hLed )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetState = dditable->Led->pfnGetState; + if( nullptr == pfnGetState ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetState( hLed, pState ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesLedSetState + __zedlllocal ze_result_t ZE_APICALL + zesLedSetState( + zes_led_handle_t hLed, ///< [in] Handle for the component. + ze_bool_t enable ///< [in] Set to TRUE to turn the LED on, FALSE to turn off. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hLed )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnSetState = dditable->Led->pfnSetState; + if( nullptr == pfnSetState ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnSetState( hLed, enable ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesLedSetColor + __zedlllocal ze_result_t ZE_APICALL + zesLedSetColor( + zes_led_handle_t hLed, ///< [in] Handle for the component. + const zes_led_color_t* pColor ///< [in] New color of the LED. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hLed )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnSetColor = dditable->Led->pfnSetColor; + if( nullptr == pfnSetColor ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnSetColor( hLed, pColor ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesDeviceEnumMemoryModules + __zedlllocal ze_result_t ZE_APICALL + zesDeviceEnumMemoryModules( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + uint32_t* pCount, ///< [in,out] pointer to the number of components of this type. + ///< if count is zero, then the driver shall update the value with the + ///< total number of components of this type that are available. + ///< if count is greater than the number of components of this type that + ///< are available, then the driver shall update the value with the correct + ///< number of components. + zes_mem_handle_t* phMemory ///< [in,out][optional][range(0, *pCount)] array of handle of components of + ///< this type. + ///< if count is less than the number of components of this type that are + ///< available, then the driver shall only retrieve that number of + ///< component handles. + ) + { + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnEnumMemoryModules = dditable->Device->pfnEnumMemoryModules; + if( nullptr == pfnEnumMemoryModules ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnEnumMemoryModules( hDevice, pCount, phMemory ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesMemoryGetProperties + __zedlllocal ze_result_t ZE_APICALL + zesMemoryGetProperties( + zes_mem_handle_t hMemory, ///< [in] Handle for the component. + zes_mem_properties_t* pProperties ///< [in,out] Will contain memory properties. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hMemory )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetProperties = dditable->Memory->pfnGetProperties; + if( nullptr == pfnGetProperties ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetProperties( hMemory, pProperties ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesMemoryGetState + __zedlllocal ze_result_t ZE_APICALL + zesMemoryGetState( + zes_mem_handle_t hMemory, ///< [in] Handle for the component. + zes_mem_state_t* pState ///< [in,out] Will contain the current health and allocated memory. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hMemory )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetState = dditable->Memory->pfnGetState; + if( nullptr == pfnGetState ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetState( hMemory, pState ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesMemoryGetBandwidth + __zedlllocal ze_result_t ZE_APICALL + zesMemoryGetBandwidth( + zes_mem_handle_t hMemory, ///< [in] Handle for the component. + zes_mem_bandwidth_t* pBandwidth ///< [in,out] Will contain the total number of bytes read from and written + ///< to memory, as well as the current maximum bandwidth. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hMemory )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetBandwidth = dditable->Memory->pfnGetBandwidth; + if( nullptr == pfnGetBandwidth ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetBandwidth( hMemory, pBandwidth ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesDeviceEnumPerformanceFactorDomains + __zedlllocal ze_result_t ZE_APICALL + zesDeviceEnumPerformanceFactorDomains( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + uint32_t* pCount, ///< [in,out] pointer to the number of components of this type. + ///< if count is zero, then the driver shall update the value with the + ///< total number of components of this type that are available. + ///< if count is greater than the number of components of this type that + ///< are available, then the driver shall update the value with the correct + ///< number of components. + zes_perf_handle_t* phPerf ///< [in,out][optional][range(0, *pCount)] array of handle of components of + ///< this type. + ///< if count is less than the number of components of this type that are + ///< available, then the driver shall only retrieve that number of + ///< component handles. + ) + { + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnEnumPerformanceFactorDomains = dditable->Device->pfnEnumPerformanceFactorDomains; + if( nullptr == pfnEnumPerformanceFactorDomains ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnEnumPerformanceFactorDomains( hDevice, pCount, phPerf ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesPerformanceFactorGetProperties + __zedlllocal ze_result_t ZE_APICALL + zesPerformanceFactorGetProperties( + zes_perf_handle_t hPerf, ///< [in] Handle for the Performance Factor domain. + zes_perf_properties_t* pProperties ///< [in,out] Will contain information about the specified Performance + ///< Factor domain. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hPerf )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetProperties = dditable->PerformanceFactor->pfnGetProperties; + if( nullptr == pfnGetProperties ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetProperties( hPerf, pProperties ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesPerformanceFactorGetConfig + __zedlllocal ze_result_t ZE_APICALL + zesPerformanceFactorGetConfig( + zes_perf_handle_t hPerf, ///< [in] Handle for the Performance Factor domain. + double* pFactor ///< [in,out] Will contain the actual Performance Factor being used by the + ///< hardware (may not be the same as the requested Performance Factor). + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hPerf )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetConfig = dditable->PerformanceFactor->pfnGetConfig; + if( nullptr == pfnGetConfig ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetConfig( hPerf, pFactor ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesPerformanceFactorSetConfig + __zedlllocal ze_result_t ZE_APICALL + zesPerformanceFactorSetConfig( + zes_perf_handle_t hPerf, ///< [in] Handle for the Performance Factor domain. + double factor ///< [in] The new Performance Factor. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hPerf )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnSetConfig = dditable->PerformanceFactor->pfnSetConfig; + if( nullptr == pfnSetConfig ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnSetConfig( hPerf, factor ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesDeviceEnumPowerDomains + __zedlllocal ze_result_t ZE_APICALL + zesDeviceEnumPowerDomains( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + uint32_t* pCount, ///< [in,out] pointer to the number of components of this type. + ///< if count is zero, then the driver shall update the value with the + ///< total number of components of this type that are available. + ///< if count is greater than the number of components of this type that + ///< are available, then the driver shall update the value with the correct + ///< number of components. + zes_pwr_handle_t* phPower ///< [in,out][optional][range(0, *pCount)] array of handle of components of + ///< this type. + ///< if count is less than the number of components of this type that are + ///< available, then the driver shall only retrieve that number of + ///< component handles. + ) + { + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnEnumPowerDomains = dditable->Device->pfnEnumPowerDomains; + if( nullptr == pfnEnumPowerDomains ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnEnumPowerDomains( hDevice, pCount, phPower ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesDeviceGetCardPowerDomain + __zedlllocal ze_result_t ZE_APICALL + zesDeviceGetCardPowerDomain( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + zes_pwr_handle_t* phPower ///< [in,out] power domain handle for the entire PCIe card. + ) + { + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetCardPowerDomain = dditable->Device->pfnGetCardPowerDomain; + if( nullptr == pfnGetCardPowerDomain ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetCardPowerDomain( hDevice, phPower ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesPowerGetProperties + __zedlllocal ze_result_t ZE_APICALL + zesPowerGetProperties( + zes_pwr_handle_t hPower, ///< [in] Handle for the component. + zes_power_properties_t* pProperties ///< [in,out] Structure that will contain property data. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hPower )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetProperties = dditable->Power->pfnGetProperties; + if( nullptr == pfnGetProperties ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetProperties( hPower, pProperties ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesPowerGetEnergyCounter + __zedlllocal ze_result_t ZE_APICALL + zesPowerGetEnergyCounter( + zes_pwr_handle_t hPower, ///< [in] Handle for the component. + zes_power_energy_counter_t* pEnergy ///< [in,out] Will contain the latest snapshot of the energy counter and + ///< timestamp when the last counter value was measured. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hPower )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetEnergyCounter = dditable->Power->pfnGetEnergyCounter; + if( nullptr == pfnGetEnergyCounter ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetEnergyCounter( hPower, pEnergy ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesPowerGetLimits + __zedlllocal ze_result_t ZE_APICALL + zesPowerGetLimits( + zes_pwr_handle_t hPower, ///< [in] Handle for the component. + zes_power_sustained_limit_t* pSustained, ///< [in,out][optional] The sustained power limit. If this is null, the + ///< current sustained power limits will not be returned. + zes_power_burst_limit_t* pBurst, ///< [in,out][optional] The burst power limit. If this is null, the current + ///< peak power limits will not be returned. + zes_power_peak_limit_t* pPeak ///< [in,out][optional] The peak power limit. If this is null, the peak + ///< power limits will not be returned. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hPower )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetLimits = dditable->Power->pfnGetLimits; + if( nullptr == pfnGetLimits ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetLimits( hPower, pSustained, pBurst, pPeak ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesPowerSetLimits + __zedlllocal ze_result_t ZE_APICALL + zesPowerSetLimits( + zes_pwr_handle_t hPower, ///< [in] Handle for the component. + const zes_power_sustained_limit_t* pSustained, ///< [in][optional] The sustained power limit. If this is null, no changes + ///< will be made to the sustained power limits. + const zes_power_burst_limit_t* pBurst, ///< [in][optional] The burst power limit. If this is null, no changes will + ///< be made to the burst power limits. + const zes_power_peak_limit_t* pPeak ///< [in][optional] The peak power limit. If this is null, no changes will + ///< be made to the peak power limits. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hPower )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnSetLimits = dditable->Power->pfnSetLimits; + if( nullptr == pfnSetLimits ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnSetLimits( hPower, pSustained, pBurst, pPeak ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesPowerGetEnergyThreshold + __zedlllocal ze_result_t ZE_APICALL + zesPowerGetEnergyThreshold( + zes_pwr_handle_t hPower, ///< [in] Handle for the component. + zes_energy_threshold_t* pThreshold ///< [in,out] Returns information about the energy threshold setting - + ///< enabled/energy threshold/process ID. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hPower )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetEnergyThreshold = dditable->Power->pfnGetEnergyThreshold; + if( nullptr == pfnGetEnergyThreshold ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetEnergyThreshold( hPower, pThreshold ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesPowerSetEnergyThreshold + __zedlllocal ze_result_t ZE_APICALL + zesPowerSetEnergyThreshold( + zes_pwr_handle_t hPower, ///< [in] Handle for the component. + double threshold ///< [in] The energy threshold to be set in joules. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hPower )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnSetEnergyThreshold = dditable->Power->pfnSetEnergyThreshold; + if( nullptr == pfnSetEnergyThreshold ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnSetEnergyThreshold( hPower, threshold ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesDeviceEnumPsus + __zedlllocal ze_result_t ZE_APICALL + zesDeviceEnumPsus( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + uint32_t* pCount, ///< [in,out] pointer to the number of components of this type. + ///< if count is zero, then the driver shall update the value with the + ///< total number of components of this type that are available. + ///< if count is greater than the number of components of this type that + ///< are available, then the driver shall update the value with the correct + ///< number of components. + zes_psu_handle_t* phPsu ///< [in,out][optional][range(0, *pCount)] array of handle of components of + ///< this type. + ///< if count is less than the number of components of this type that are + ///< available, then the driver shall only retrieve that number of + ///< component handles. + ) + { + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnEnumPsus = dditable->Device->pfnEnumPsus; + if( nullptr == pfnEnumPsus ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnEnumPsus( hDevice, pCount, phPsu ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesPsuGetProperties + __zedlllocal ze_result_t ZE_APICALL + zesPsuGetProperties( + zes_psu_handle_t hPsu, ///< [in] Handle for the component. + zes_psu_properties_t* pProperties ///< [in,out] Will contain the properties of the power supply. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hPsu )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetProperties = dditable->Psu->pfnGetProperties; + if( nullptr == pfnGetProperties ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetProperties( hPsu, pProperties ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesPsuGetState + __zedlllocal ze_result_t ZE_APICALL + zesPsuGetState( + zes_psu_handle_t hPsu, ///< [in] Handle for the component. + zes_psu_state_t* pState ///< [in,out] Will contain the current state of the power supply. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hPsu )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetState = dditable->Psu->pfnGetState; + if( nullptr == pfnGetState ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetState( hPsu, pState ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesDeviceEnumRasErrorSets + __zedlllocal ze_result_t ZE_APICALL + zesDeviceEnumRasErrorSets( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + uint32_t* pCount, ///< [in,out] pointer to the number of components of this type. + ///< if count is zero, then the driver shall update the value with the + ///< total number of components of this type that are available. + ///< if count is greater than the number of components of this type that + ///< are available, then the driver shall update the value with the correct + ///< number of components. + zes_ras_handle_t* phRas ///< [in,out][optional][range(0, *pCount)] array of handle of components of + ///< this type. + ///< if count is less than the number of components of this type that are + ///< available, then the driver shall only retrieve that number of + ///< component handles. + ) + { + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnEnumRasErrorSets = dditable->Device->pfnEnumRasErrorSets; + if( nullptr == pfnEnumRasErrorSets ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnEnumRasErrorSets( hDevice, pCount, phRas ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesRasGetProperties + __zedlllocal ze_result_t ZE_APICALL + zesRasGetProperties( + zes_ras_handle_t hRas, ///< [in] Handle for the component. + zes_ras_properties_t* pProperties ///< [in,out] Structure describing RAS properties + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hRas )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetProperties = dditable->Ras->pfnGetProperties; + if( nullptr == pfnGetProperties ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetProperties( hRas, pProperties ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesRasGetConfig + __zedlllocal ze_result_t ZE_APICALL + zesRasGetConfig( + zes_ras_handle_t hRas, ///< [in] Handle for the component. + zes_ras_config_t* pConfig ///< [in,out] Will be populed with the current RAS configuration - + ///< thresholds used to trigger events + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hRas )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetConfig = dditable->Ras->pfnGetConfig; + if( nullptr == pfnGetConfig ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetConfig( hRas, pConfig ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesRasSetConfig + __zedlllocal ze_result_t ZE_APICALL + zesRasSetConfig( + zes_ras_handle_t hRas, ///< [in] Handle for the component. + const zes_ras_config_t* pConfig ///< [in] Change the RAS configuration - thresholds used to trigger events + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hRas )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnSetConfig = dditable->Ras->pfnSetConfig; + if( nullptr == pfnSetConfig ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnSetConfig( hRas, pConfig ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesRasGetState + __zedlllocal ze_result_t ZE_APICALL + zesRasGetState( + zes_ras_handle_t hRas, ///< [in] Handle for the component. + ze_bool_t clear, ///< [in] Set to 1 to clear the counters of this type + zes_ras_state_t* pState ///< [in,out] Breakdown of where errors have occurred + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hRas )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetState = dditable->Ras->pfnGetState; + if( nullptr == pfnGetState ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetState( hRas, clear, pState ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesDeviceEnumSchedulers + __zedlllocal ze_result_t ZE_APICALL + zesDeviceEnumSchedulers( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + uint32_t* pCount, ///< [in,out] pointer to the number of components of this type. + ///< if count is zero, then the driver shall update the value with the + ///< total number of components of this type that are available. + ///< if count is greater than the number of components of this type that + ///< are available, then the driver shall update the value with the correct + ///< number of components. + zes_sched_handle_t* phScheduler ///< [in,out][optional][range(0, *pCount)] array of handle of components of + ///< this type. + ///< if count is less than the number of components of this type that are + ///< available, then the driver shall only retrieve that number of + ///< component handles. + ) + { + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnEnumSchedulers = dditable->Device->pfnEnumSchedulers; + if( nullptr == pfnEnumSchedulers ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnEnumSchedulers( hDevice, pCount, phScheduler ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesSchedulerGetProperties + __zedlllocal ze_result_t ZE_APICALL + zesSchedulerGetProperties( + zes_sched_handle_t hScheduler, ///< [in] Handle for the component. + zes_sched_properties_t* pProperties ///< [in,out] Structure that will contain property data. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hScheduler )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetProperties = dditable->Scheduler->pfnGetProperties; + if( nullptr == pfnGetProperties ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetProperties( hScheduler, pProperties ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesSchedulerGetCurrentMode + __zedlllocal ze_result_t ZE_APICALL + zesSchedulerGetCurrentMode( + zes_sched_handle_t hScheduler, ///< [in] Sysman handle for the component. + zes_sched_mode_t* pMode ///< [in,out] Will contain the current scheduler mode. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hScheduler )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetCurrentMode = dditable->Scheduler->pfnGetCurrentMode; + if( nullptr == pfnGetCurrentMode ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetCurrentMode( hScheduler, pMode ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesSchedulerGetTimeoutModeProperties + __zedlllocal ze_result_t ZE_APICALL + zesSchedulerGetTimeoutModeProperties( + zes_sched_handle_t hScheduler, ///< [in] Sysman handle for the component. + ze_bool_t getDefaults, ///< [in] If TRUE, the driver will return the system default properties for + ///< this mode, otherwise it will return the current properties. + zes_sched_timeout_properties_t* pConfig ///< [in,out] Will contain the current parameters for this mode. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hScheduler )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetTimeoutModeProperties = dditable->Scheduler->pfnGetTimeoutModeProperties; + if( nullptr == pfnGetTimeoutModeProperties ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetTimeoutModeProperties( hScheduler, getDefaults, pConfig ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesSchedulerGetTimesliceModeProperties + __zedlllocal ze_result_t ZE_APICALL + zesSchedulerGetTimesliceModeProperties( + zes_sched_handle_t hScheduler, ///< [in] Sysman handle for the component. + ze_bool_t getDefaults, ///< [in] If TRUE, the driver will return the system default properties for + ///< this mode, otherwise it will return the current properties. + zes_sched_timeslice_properties_t* pConfig ///< [in,out] Will contain the current parameters for this mode. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hScheduler )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetTimesliceModeProperties = dditable->Scheduler->pfnGetTimesliceModeProperties; + if( nullptr == pfnGetTimesliceModeProperties ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetTimesliceModeProperties( hScheduler, getDefaults, pConfig ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesSchedulerSetTimeoutMode + __zedlllocal ze_result_t ZE_APICALL + zesSchedulerSetTimeoutMode( + zes_sched_handle_t hScheduler, ///< [in] Sysman handle for the component. + zes_sched_timeout_properties_t* pProperties, ///< [in] The properties to use when configurating this mode. + ze_bool_t* pNeedReload ///< [in,out] Will be set to TRUE if a device driver reload is needed to + ///< apply the new scheduler mode. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hScheduler )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnSetTimeoutMode = dditable->Scheduler->pfnSetTimeoutMode; + if( nullptr == pfnSetTimeoutMode ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnSetTimeoutMode( hScheduler, pProperties, pNeedReload ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesSchedulerSetTimesliceMode + __zedlllocal ze_result_t ZE_APICALL + zesSchedulerSetTimesliceMode( + zes_sched_handle_t hScheduler, ///< [in] Sysman handle for the component. + zes_sched_timeslice_properties_t* pProperties, ///< [in] The properties to use when configurating this mode. + ze_bool_t* pNeedReload ///< [in,out] Will be set to TRUE if a device driver reload is needed to + ///< apply the new scheduler mode. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hScheduler )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnSetTimesliceMode = dditable->Scheduler->pfnSetTimesliceMode; + if( nullptr == pfnSetTimesliceMode ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnSetTimesliceMode( hScheduler, pProperties, pNeedReload ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesSchedulerSetExclusiveMode + __zedlllocal ze_result_t ZE_APICALL + zesSchedulerSetExclusiveMode( + zes_sched_handle_t hScheduler, ///< [in] Sysman handle for the component. + ze_bool_t* pNeedReload ///< [in,out] Will be set to TRUE if a device driver reload is needed to + ///< apply the new scheduler mode. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hScheduler )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnSetExclusiveMode = dditable->Scheduler->pfnSetExclusiveMode; + if( nullptr == pfnSetExclusiveMode ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnSetExclusiveMode( hScheduler, pNeedReload ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesSchedulerSetComputeUnitDebugMode + __zedlllocal ze_result_t ZE_APICALL + zesSchedulerSetComputeUnitDebugMode( + zes_sched_handle_t hScheduler, ///< [in] Sysman handle for the component. + ze_bool_t* pNeedReload ///< [in,out] Will be set to TRUE if a device driver reload is needed to + ///< apply the new scheduler mode. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hScheduler )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnSetComputeUnitDebugMode = dditable->Scheduler->pfnSetComputeUnitDebugMode; + if( nullptr == pfnSetComputeUnitDebugMode ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnSetComputeUnitDebugMode( hScheduler, pNeedReload ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesDeviceEnumStandbyDomains + __zedlllocal ze_result_t ZE_APICALL + zesDeviceEnumStandbyDomains( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + uint32_t* pCount, ///< [in,out] pointer to the number of components of this type. + ///< if count is zero, then the driver shall update the value with the + ///< total number of components of this type that are available. + ///< if count is greater than the number of components of this type that + ///< are available, then the driver shall update the value with the correct + ///< number of components. + zes_standby_handle_t* phStandby ///< [in,out][optional][range(0, *pCount)] array of handle of components of + ///< this type. + ///< if count is less than the number of components of this type that are + ///< available, then the driver shall only retrieve that number of + ///< component handles. + ) + { + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnEnumStandbyDomains = dditable->Device->pfnEnumStandbyDomains; + if( nullptr == pfnEnumStandbyDomains ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnEnumStandbyDomains( hDevice, pCount, phStandby ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesStandbyGetProperties + __zedlllocal ze_result_t ZE_APICALL + zesStandbyGetProperties( + zes_standby_handle_t hStandby, ///< [in] Handle for the component. + zes_standby_properties_t* pProperties ///< [in,out] Will contain the standby hardware properties. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hStandby )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetProperties = dditable->Standby->pfnGetProperties; + if( nullptr == pfnGetProperties ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetProperties( hStandby, pProperties ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesStandbyGetMode + __zedlllocal ze_result_t ZE_APICALL + zesStandbyGetMode( + zes_standby_handle_t hStandby, ///< [in] Handle for the component. + zes_standby_promo_mode_t* pMode ///< [in,out] Will contain the current standby mode. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hStandby )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetMode = dditable->Standby->pfnGetMode; + if( nullptr == pfnGetMode ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetMode( hStandby, pMode ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesStandbySetMode + __zedlllocal ze_result_t ZE_APICALL + zesStandbySetMode( + zes_standby_handle_t hStandby, ///< [in] Handle for the component. + zes_standby_promo_mode_t mode ///< [in] New standby mode. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hStandby )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnSetMode = dditable->Standby->pfnSetMode; + if( nullptr == pfnSetMode ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnSetMode( hStandby, mode ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesDeviceEnumTemperatureSensors + __zedlllocal ze_result_t ZE_APICALL + zesDeviceEnumTemperatureSensors( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + uint32_t* pCount, ///< [in,out] pointer to the number of components of this type. + ///< if count is zero, then the driver shall update the value with the + ///< total number of components of this type that are available. + ///< if count is greater than the number of components of this type that + ///< are available, then the driver shall update the value with the correct + ///< number of components. + zes_temp_handle_t* phTemperature ///< [in,out][optional][range(0, *pCount)] array of handle of components of + ///< this type. + ///< if count is less than the number of components of this type that are + ///< available, then the driver shall only retrieve that number of + ///< component handles. + ) + { + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnEnumTemperatureSensors = dditable->Device->pfnEnumTemperatureSensors; + if( nullptr == pfnEnumTemperatureSensors ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnEnumTemperatureSensors( hDevice, pCount, phTemperature ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesTemperatureGetProperties + __zedlllocal ze_result_t ZE_APICALL + zesTemperatureGetProperties( + zes_temp_handle_t hTemperature, ///< [in] Handle for the component. + zes_temp_properties_t* pProperties ///< [in,out] Will contain the temperature sensor properties. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hTemperature )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetProperties = dditable->Temperature->pfnGetProperties; + if( nullptr == pfnGetProperties ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetProperties( hTemperature, pProperties ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesTemperatureGetConfig + __zedlllocal ze_result_t ZE_APICALL + zesTemperatureGetConfig( + zes_temp_handle_t hTemperature, ///< [in] Handle for the component. + zes_temp_config_t* pConfig ///< [in,out] Returns current configuration. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hTemperature )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetConfig = dditable->Temperature->pfnGetConfig; + if( nullptr == pfnGetConfig ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetConfig( hTemperature, pConfig ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesTemperatureSetConfig + __zedlllocal ze_result_t ZE_APICALL + zesTemperatureSetConfig( + zes_temp_handle_t hTemperature, ///< [in] Handle for the component. + const zes_temp_config_t* pConfig ///< [in] New configuration. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hTemperature )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnSetConfig = dditable->Temperature->pfnSetConfig; + if( nullptr == pfnSetConfig ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnSetConfig( hTemperature, pConfig ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesTemperatureGetState + __zedlllocal ze_result_t ZE_APICALL + zesTemperatureGetState( + zes_temp_handle_t hTemperature, ///< [in] Handle for the component. + double* pTemperature ///< [in,out] Will contain the temperature read from the specified sensor + ///< in degrees Celsius. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hTemperature )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetState = dditable->Temperature->pfnGetState; + if( nullptr == pfnGetState ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetState( hTemperature, pTemperature ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesPowerGetLimitsExt + __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 + ///< zero, then the driver shall update the value with the total number of + ///< components of this type that are available. If count is greater than + ///< the number of components of this type that are available, then the + ///< driver shall update the value with the correct number of components. + zes_power_limit_ext_desc_t* pSustained ///< [in,out][optional][range(0, *pCount)] Array of query results for power + ///< limit descriptors. If count is less than the number of components of + ///< this type that are available, then the driver shall only retrieve that + ///< number of components. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hPower )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetLimitsExt = dditable->Power->pfnGetLimitsExt; + if( nullptr == pfnGetLimitsExt ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetLimitsExt( hPower, pCount, pSustained ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesPowerSetLimitsExt + __zedlllocal ze_result_t ZE_APICALL + zesPowerSetLimitsExt( + zes_pwr_handle_t hPower, ///< [in] Handle for the component. + uint32_t* pCount, ///< [in] Pointer to the number of power limit descriptors. + zes_power_limit_ext_desc_t* pSustained ///< [in][optional][range(0, *pCount)] Array of power limit descriptors. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hPower )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnSetLimitsExt = dditable->Power->pfnSetLimitsExt; + if( nullptr == pfnSetLimitsExt ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnSetLimitsExt( hPower, pCount, pSustained ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesEngineGetActivityExt + __zedlllocal ze_result_t ZE_APICALL + zesEngineGetActivityExt( + zes_engine_handle_t hEngine, ///< [in] Handle for the component. + uint32_t* pCount, ///< [in,out] Pointer to the number of VF engine stats descriptors. + ///< - if count is zero, the driver shall update the value with the total + ///< number of engine stats available. + ///< - if count is greater than the total number of engine stats + ///< available, the driver shall update the value with the correct number + ///< of engine stats available. + ///< - The count returned is the sum of number of VF instances currently + ///< available and the PF instance. + zes_engine_stats_t* pStats ///< [in,out][optional][range(0, *pCount)] array of engine group activity counters. + ///< - if count is less than the total number of engine stats available, + ///< then driver shall only retrieve that number of stats. + ///< - the implementation shall populate the vector with engine stat for + ///< PF at index 0 of the vector followed by user provided pCount-1 number + ///< of VF engine stats. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hEngine )->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_7) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetActivityExt = dditable->Engine->pfnGetActivityExt; + if( nullptr == pfnGetActivityExt ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetActivityExt( hEngine, pCount, pStats ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesRasGetStateExp + __zedlllocal ze_result_t ZE_APICALL + zesRasGetStateExp( + zes_ras_handle_t hRas, ///< [in] Handle for the component. + uint32_t* pCount, ///< [in,out] pointer to the number of RAS state structures that can be retrieved. + ///< if count is zero, then the driver shall update the value with the + ///< total number of error categories for which state can be retrieved. + ///< if count is greater than the number of RAS states available, then the + ///< driver shall update the value with the correct number of RAS states available. + zes_ras_state_exp_t* pState ///< [in,out][optional][range(0, *pCount)] array of query results for RAS + ///< error states for different categories. + ///< if count is less than the number of RAS states available, then driver + ///< shall only retrieve that number of RAS states. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hRas )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetStateExp = dditable->RasExp->pfnGetStateExp; + if( nullptr == pfnGetStateExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetStateExp( hRas, pCount, pState ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesRasClearStateExp + __zedlllocal ze_result_t ZE_APICALL + zesRasClearStateExp( + zes_ras_handle_t hRas, ///< [in] Handle for the component. + zes_ras_error_category_exp_t category ///< [in] category for which error counter is to be cleared. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hRas )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnClearStateExp = dditable->RasExp->pfnClearStateExp; + if( nullptr == pfnClearStateExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnClearStateExp( hRas, category ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesFirmwareGetSecurityVersionExp + __zedlllocal ze_result_t ZE_APICALL + zesFirmwareGetSecurityVersionExp( + zes_firmware_handle_t hFirmware, ///< [in] Handle for the component. + char* pVersion ///< [in,out] NULL terminated string value. The string "unknown" will be + ///< returned if this property cannot be determined. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hFirmware )->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_9) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetSecurityVersionExp = dditable->FirmwareExp->pfnGetSecurityVersionExp; + if( nullptr == pfnGetSecurityVersionExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetSecurityVersionExp( hFirmware, pVersion ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesFirmwareSetSecurityVersionExp + __zedlllocal ze_result_t ZE_APICALL + zesFirmwareSetSecurityVersionExp( + zes_firmware_handle_t hFirmware ///< [in] Handle for the component. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hFirmware )->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_9) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnSetSecurityVersionExp = dditable->FirmwareExp->pfnSetSecurityVersionExp; + if( nullptr == pfnSetSecurityVersionExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnSetSecurityVersionExp( hFirmware ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesDeviceGetSubDevicePropertiesExp + __zedlllocal ze_result_t ZE_APICALL + zesDeviceGetSubDevicePropertiesExp( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + 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 currently attached to the device. + ///< if count is greater than the number of sub devices currently attached + ///< to the device, then the driver shall update the value with the correct + ///< number of sub devices. + zes_subdevice_exp_properties_t* pSubdeviceProps ///< [in,out][optional][range(0, *pCount)] array of sub device property structures. + ///< if count is less than the number of sysman sub devices available, then + ///< the driver shall only retrieve that number of sub device property structures. + ) + { + 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_9) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetSubDevicePropertiesExp = dditable->DeviceExp->pfnGetSubDevicePropertiesExp; + if( nullptr == pfnGetSubDevicePropertiesExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetSubDevicePropertiesExp( hDevice, pCount, pSubdeviceProps ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesDriverGetDeviceByUuidExp + __zedlllocal ze_result_t ZE_APICALL + zesDriverGetDeviceByUuidExp( + zes_driver_handle_t hDriver, ///< [in] handle of the sysman driver instance + zes_uuid_t uuid, ///< [in] universal unique identifier. + zes_device_handle_t* phDevice, ///< [out] Sysman handle of the device. + ze_bool_t* onSubdevice, ///< [out] True if the UUID belongs to the sub-device; false means that + ///< UUID belongs to the root device. + uint32_t* subdeviceId ///< [out] If onSubdevice is true, this gives the ID of the sub-device + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hDriver )->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_9) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetDeviceByUuidExp = dditable->DriverExp->pfnGetDeviceByUuidExp; + if( nullptr == pfnGetDeviceByUuidExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetDeviceByUuidExp( hDriver, uuid, phDevice, onSubdevice, subdeviceId ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesDeviceEnumActiveVFExp + __zedlllocal ze_result_t ZE_APICALL + zesDeviceEnumActiveVFExp( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + uint32_t* pCount, ///< [in,out] pointer to the number of components of this type. + ///< if count is zero, then the driver shall update the value with the + ///< total number of components of this type that are available. + ///< if count is greater than the number of components of this type that + ///< are available, then the driver shall update the value with the correct + ///< number of components. + zes_vf_handle_t* phVFhandle ///< [in,out][optional][range(0, *pCount)] array of handle of components of + ///< this type. + ///< if count is less than the number of components of this type that are + ///< available, then the driver shall only retrieve that number of + ///< component handles. + ) + { + 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_9) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnEnumActiveVFExp = dditable->DeviceExp->pfnEnumActiveVFExp; + if( nullptr == pfnEnumActiveVFExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnEnumActiveVFExp( hDevice, pCount, phVFhandle ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesVFManagementGetVFPropertiesExp + __zedlllocal ze_result_t ZE_APICALL + zesVFManagementGetVFPropertiesExp( + zes_vf_handle_t hVFhandle, ///< [in] Sysman handle for the VF component. + zes_vf_exp_properties_t* pProperties ///< [in,out] Will contain VF properties. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hVFhandle )->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_9) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetVFPropertiesExp = dditable->VFManagementExp->pfnGetVFPropertiesExp; + if( nullptr == pfnGetVFPropertiesExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetVFPropertiesExp( hVFhandle, pProperties ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesVFManagementGetVFMemoryUtilizationExp + __zedlllocal ze_result_t ZE_APICALL + zesVFManagementGetVFMemoryUtilizationExp( + zes_vf_handle_t hVFhandle, ///< [in] Sysman handle for the component. + uint32_t* pCount, ///< [in,out] Pointer to the number of VF memory stats descriptors. + ///< - if count is zero, the driver shall update the value with the total + ///< number of memory stats available. + ///< - if count is greater than the total number of memory stats + ///< available, the driver shall update the value with the correct number + ///< of memory stats available. + ///< - The count returned is the sum of number of VF instances currently + ///< available and the PF instance. + zes_vf_util_mem_exp_t* pMemUtil ///< [in,out][optional][range(0, *pCount)] array of memory group activity counters. + ///< - if count is less than the total number of memory stats available, + ///< then driver shall only retrieve that number of stats. + ///< - the implementation shall populate the vector pCount-1 number of VF + ///< memory stats. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hVFhandle )->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_9) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetVFMemoryUtilizationExp = dditable->VFManagementExp->pfnGetVFMemoryUtilizationExp; + if( nullptr == pfnGetVFMemoryUtilizationExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetVFMemoryUtilizationExp( hVFhandle, pCount, pMemUtil ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesVFManagementGetVFEngineUtilizationExp + __zedlllocal ze_result_t ZE_APICALL + zesVFManagementGetVFEngineUtilizationExp( + zes_vf_handle_t hVFhandle, ///< [in] Sysman handle for the component. + uint32_t* pCount, ///< [in,out] Pointer to the number of VF engine stats descriptors. + ///< - if count is zero, the driver shall update the value with the total + ///< number of engine stats available. + ///< - if count is greater than the total number of engine stats + ///< available, the driver shall update the value with the correct number + ///< of engine stats available. + ///< - The count returned is the sum of number of VF instances currently + ///< available and the PF instance. + zes_vf_util_engine_exp_t* pEngineUtil ///< [in,out][optional][range(0, *pCount)] array of engine group activity counters. + ///< - if count is less than the total number of engine stats available, + ///< then driver shall only retrieve that number of stats. + ///< - the implementation shall populate the vector pCount-1 number of VF + ///< engine stats. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hVFhandle )->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_9) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetVFEngineUtilizationExp = dditable->VFManagementExp->pfnGetVFEngineUtilizationExp; + if( nullptr == pfnGetVFEngineUtilizationExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetVFEngineUtilizationExp( hVFhandle, pCount, pEngineUtil ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesVFManagementSetVFTelemetryModeExp + __zedlllocal ze_result_t ZE_APICALL + zesVFManagementSetVFTelemetryModeExp( + zes_vf_handle_t hVFhandle, ///< [in] Sysman handle for the component. + zes_vf_info_util_exp_flags_t flags, ///< [in] utilization flags to enable or disable. May be 0 or a valid + ///< combination of ::zes_vf_info_util_exp_flag_t. + ze_bool_t enable ///< [in] Enable utilization telemetry. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hVFhandle )->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_9) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnSetVFTelemetryModeExp = dditable->VFManagementExp->pfnSetVFTelemetryModeExp; + if( nullptr == pfnSetVFTelemetryModeExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnSetVFTelemetryModeExp( hVFhandle, flags, enable ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesVFManagementSetVFTelemetrySamplingIntervalExp + __zedlllocal ze_result_t ZE_APICALL + zesVFManagementSetVFTelemetrySamplingIntervalExp( + zes_vf_handle_t hVFhandle, ///< [in] Sysman handle for the component. + zes_vf_info_util_exp_flags_t flag, ///< [in] utilization flags to set sampling interval. May be 0 or a valid + ///< combination of ::zes_vf_info_util_exp_flag_t. + uint64_t samplingInterval ///< [in] Sampling interval value. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hVFhandle )->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_9) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnSetVFTelemetrySamplingIntervalExp = dditable->VFManagementExp->pfnSetVFTelemetrySamplingIntervalExp; + if( nullptr == pfnSetVFTelemetrySamplingIntervalExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnSetVFTelemetrySamplingIntervalExp( hVFhandle, flag, samplingInterval ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesDeviceEnumEnabledVFExp + __zedlllocal ze_result_t ZE_APICALL + zesDeviceEnumEnabledVFExp( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + uint32_t* pCount, ///< [in,out] pointer to the number of components of this type. + ///< if count is zero, then the driver shall update the value with the + ///< total number of components of this type that are available. + ///< if count is greater than the number of components of this type that + ///< are available, then the driver shall update the value with the correct + ///< number of components. + zes_vf_handle_t* phVFhandle ///< [in,out][optional][range(0, *pCount)] array of handle of components of + ///< this type. + ///< if count is less than the number of components of this type that are + ///< available, then the driver shall only retrieve that number of + ///< component handles. + ) + { + 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_10) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnEnumEnabledVFExp = dditable->DeviceExp->pfnEnumEnabledVFExp; + if( nullptr == pfnEnumEnabledVFExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnEnumEnabledVFExp( hDevice, pCount, phVFhandle ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesVFManagementGetVFCapabilitiesExp + __zedlllocal ze_result_t ZE_APICALL + zesVFManagementGetVFCapabilitiesExp( + zes_vf_handle_t hVFhandle, ///< [in] Sysman handle for the VF component. + zes_vf_exp_capabilities_t* pCapability ///< [in,out] Will contain VF capability. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hVFhandle )->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_10) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetVFCapabilitiesExp = dditable->VFManagementExp->pfnGetVFCapabilitiesExp; + if( nullptr == pfnGetVFCapabilitiesExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetVFCapabilitiesExp( hVFhandle, pCapability ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesVFManagementGetVFMemoryUtilizationExp2 + __zedlllocal ze_result_t ZE_APICALL + zesVFManagementGetVFMemoryUtilizationExp2( + zes_vf_handle_t hVFhandle, ///< [in] Sysman handle for the component. + uint32_t* pCount, ///< [in,out] Pointer to the number of VF memory stats descriptors. + ///< - if count is zero, the driver shall update the value with the total + ///< number of memory stats available. + ///< - if count is greater than the total number of memory stats + ///< available, the driver shall update the value with the correct number + ///< of memory stats available. + zes_vf_util_mem_exp2_t* pMemUtil ///< [in,out][optional][range(0, *pCount)] array of memory group activity counters. + ///< - if count is less than the total number of memory stats available, + ///< then driver shall only retrieve that number of stats. + ///< - the implementation shall populate the vector pCount-1 number of VF + ///< memory stats. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hVFhandle )->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_10) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetVFMemoryUtilizationExp2 = dditable->VFManagementExp->pfnGetVFMemoryUtilizationExp2; + if( nullptr == pfnGetVFMemoryUtilizationExp2 ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetVFMemoryUtilizationExp2( hVFhandle, pCount, pMemUtil ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesVFManagementGetVFEngineUtilizationExp2 + __zedlllocal ze_result_t ZE_APICALL + zesVFManagementGetVFEngineUtilizationExp2( + zes_vf_handle_t hVFhandle, ///< [in] Sysman handle for the component. + uint32_t* pCount, ///< [in,out] Pointer to the number of VF engine stats descriptors. + ///< - if count is zero, the driver shall update the value with the total + ///< number of engine stats available. + ///< - if count is greater than the total number of engine stats + ///< available, the driver shall update the value with the correct number + ///< of engine stats available. + zes_vf_util_engine_exp2_t* pEngineUtil ///< [in,out][optional][range(0, *pCount)] array of engine group activity counters. + ///< - if count is less than the total number of engine stats available, + ///< then driver shall only retrieve that number of stats. + ///< - the implementation shall populate the vector pCount-1 number of VF + ///< engine stats. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hVFhandle )->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_10) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetVFEngineUtilizationExp2 = dditable->VFManagementExp->pfnGetVFEngineUtilizationExp2; + if( nullptr == pfnGetVFEngineUtilizationExp2 ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetVFEngineUtilizationExp2( hVFhandle, pCount, pEngineUtil ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesVFManagementGetVFCapabilitiesExp2 + __zedlllocal ze_result_t ZE_APICALL + zesVFManagementGetVFCapabilitiesExp2( + zes_vf_handle_t hVFhandle, ///< [in] Sysman handle for the VF component. + zes_vf_exp2_capabilities_t* pCapability ///< [in,out] Will contain VF capability. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hVFhandle )->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_12) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetVFCapabilitiesExp2 = dditable->VFManagementExp->pfnGetVFCapabilitiesExp2; + if( nullptr == pfnGetVFCapabilitiesExp2 ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetVFCapabilitiesExp2( hVFhandle, pCapability ); + return result; + } + + + /////////////////////////////////////////////////////////////////////////////// + /// @brief function for removing the ddi driver tables for zes + __zedlllocal void ZE_APICALL + zesDestroyDDiDriverTables(zes_dditable_driver_t* pDdiTable) + { + // Delete ddi tables + delete pDdiTable->Global; + delete pDdiTable->Device; + delete pDdiTable->DeviceExp; + delete pDdiTable->Driver; + delete pDdiTable->DriverExp; + delete pDdiTable->Diagnostics; + delete pDdiTable->Engine; + delete pDdiTable->FabricPort; + delete pDdiTable->Fan; + delete pDdiTable->Firmware; + delete pDdiTable->FirmwareExp; + delete pDdiTable->Frequency; + delete pDdiTable->Led; + delete pDdiTable->Memory; + delete pDdiTable->Overclock; + delete pDdiTable->PerformanceFactor; + delete pDdiTable->Power; + delete pDdiTable->Psu; + delete pDdiTable->Ras; + delete pDdiTable->RasExp; + delete pDdiTable->Scheduler; + delete pDdiTable->Standby; + delete pDdiTable->Temperature; + delete pDdiTable->VFManagementExp; + delete pDdiTable; + } + +} // namespace loader_driver_ddi \ No newline at end of file diff --git a/source/loader/zet_ldrddi.cpp b/source/loader/zet_ldrddi.cpp index 3077950e..35dd7fd8 100644 --- a/source/loader/zet_ldrddi.cpp +++ b/source/loader/zet_ldrddi.cpp @@ -1,6 +1,6 @@ /* * - * Copyright (C) 2019-2024 Intel Corporation + * Copyright (C) 2019-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -9,6 +9,8 @@ */ #include "ze_loader_internal.h" +using namespace loader_driver_ddi; + namespace loader { /////////////////////////////////////////////////////////////////////////////// @@ -2377,6 +2379,228 @@ namespace loader extern "C" { #endif +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for MetricDecoderExp table +__zedlllocal void ZE_APICALL +zetGetMetricDecoderExpProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pTools->MetricDecoderExp->pfnCreateExp = loader::zetMetricDecoderCreateExp; + loader::loaderDispatch->pTools->MetricDecoderExp->pfnDestroyExp = loader::zetMetricDecoderDestroyExp; + loader::loaderDispatch->pTools->MetricDecoderExp->pfnGetDecodableMetricsExp = loader::zetMetricDecoderGetDecodableMetricsExp; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for MetricProgrammableExp table +__zedlllocal void ZE_APICALL +zetGetMetricProgrammableExpProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pTools->MetricProgrammableExp->pfnGetExp = loader::zetMetricProgrammableGetExp; + loader::loaderDispatch->pTools->MetricProgrammableExp->pfnGetPropertiesExp = loader::zetMetricProgrammableGetPropertiesExp; + loader::loaderDispatch->pTools->MetricProgrammableExp->pfnGetParamInfoExp = loader::zetMetricProgrammableGetParamInfoExp; + loader::loaderDispatch->pTools->MetricProgrammableExp->pfnGetParamValueInfoExp = loader::zetMetricProgrammableGetParamValueInfoExp; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for MetricTracerExp table +__zedlllocal void ZE_APICALL +zetGetMetricTracerExpProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pTools->MetricTracerExp->pfnCreateExp = loader::zetMetricTracerCreateExp; + loader::loaderDispatch->pTools->MetricTracerExp->pfnDestroyExp = loader::zetMetricTracerDestroyExp; + loader::loaderDispatch->pTools->MetricTracerExp->pfnEnableExp = loader::zetMetricTracerEnableExp; + loader::loaderDispatch->pTools->MetricTracerExp->pfnDisableExp = loader::zetMetricTracerDisableExp; + loader::loaderDispatch->pTools->MetricTracerExp->pfnReadDataExp = loader::zetMetricTracerReadDataExp; + loader::loaderDispatch->pTools->MetricTracerExp->pfnDecodeExp = loader::zetMetricTracerDecodeExp; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for Device table +__zedlllocal void ZE_APICALL +zetGetDeviceProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pTools->Device->pfnGetDebugProperties = loader::zetDeviceGetDebugProperties; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for DeviceExp table +__zedlllocal void ZE_APICALL +zetGetDeviceExpProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pTools->DeviceExp->pfnGetConcurrentMetricGroupsExp = loader::zetDeviceGetConcurrentMetricGroupsExp; + loader::loaderDispatch->pTools->DeviceExp->pfnCreateMetricGroupsFromMetricsExp = loader::zetDeviceCreateMetricGroupsFromMetricsExp; + loader::loaderDispatch->pTools->DeviceExp->pfnEnableMetricsExp = loader::zetDeviceEnableMetricsExp; + loader::loaderDispatch->pTools->DeviceExp->pfnDisableMetricsExp = loader::zetDeviceDisableMetricsExp; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for Context table +__zedlllocal void ZE_APICALL +zetGetContextProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pTools->Context->pfnActivateMetricGroups = loader::zetContextActivateMetricGroups; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for CommandList table +__zedlllocal void ZE_APICALL +zetGetCommandListProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pTools->CommandList->pfnAppendMetricStreamerMarker = loader::zetCommandListAppendMetricStreamerMarker; + loader::loaderDispatch->pTools->CommandList->pfnAppendMetricQueryBegin = loader::zetCommandListAppendMetricQueryBegin; + loader::loaderDispatch->pTools->CommandList->pfnAppendMetricQueryEnd = loader::zetCommandListAppendMetricQueryEnd; + loader::loaderDispatch->pTools->CommandList->pfnAppendMetricMemoryBarrier = loader::zetCommandListAppendMetricMemoryBarrier; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for CommandListExp table +__zedlllocal void ZE_APICALL +zetGetCommandListExpProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pTools->CommandListExp->pfnAppendMarkerExp = loader::zetCommandListAppendMarkerExp; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for Kernel table +__zedlllocal void ZE_APICALL +zetGetKernelProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pTools->Kernel->pfnGetProfileInfo = loader::zetKernelGetProfileInfo; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for Module table +__zedlllocal void ZE_APICALL +zetGetModuleProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pTools->Module->pfnGetDebugInfo = loader::zetModuleGetDebugInfo; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for Debug table +__zedlllocal void ZE_APICALL +zetGetDebugProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pTools->Debug->pfnAttach = loader::zetDebugAttach; + loader::loaderDispatch->pTools->Debug->pfnDetach = loader::zetDebugDetach; + loader::loaderDispatch->pTools->Debug->pfnReadEvent = loader::zetDebugReadEvent; + loader::loaderDispatch->pTools->Debug->pfnAcknowledgeEvent = loader::zetDebugAcknowledgeEvent; + loader::loaderDispatch->pTools->Debug->pfnInterrupt = loader::zetDebugInterrupt; + loader::loaderDispatch->pTools->Debug->pfnResume = loader::zetDebugResume; + loader::loaderDispatch->pTools->Debug->pfnReadMemory = loader::zetDebugReadMemory; + loader::loaderDispatch->pTools->Debug->pfnWriteMemory = loader::zetDebugWriteMemory; + loader::loaderDispatch->pTools->Debug->pfnGetRegisterSetProperties = loader::zetDebugGetRegisterSetProperties; + loader::loaderDispatch->pTools->Debug->pfnReadRegisters = loader::zetDebugReadRegisters; + loader::loaderDispatch->pTools->Debug->pfnWriteRegisters = loader::zetDebugWriteRegisters; + loader::loaderDispatch->pTools->Debug->pfnGetThreadRegisterSetProperties = loader::zetDebugGetThreadRegisterSetProperties; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for Metric table +__zedlllocal void ZE_APICALL +zetGetMetricProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pTools->Metric->pfnGet = loader::zetMetricGet; + loader::loaderDispatch->pTools->Metric->pfnGetProperties = loader::zetMetricGetProperties; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for MetricExp table +__zedlllocal void ZE_APICALL +zetGetMetricExpProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pTools->MetricExp->pfnCreateFromProgrammableExp2 = loader::zetMetricCreateFromProgrammableExp2; + loader::loaderDispatch->pTools->MetricExp->pfnCreateFromProgrammableExp = loader::zetMetricCreateFromProgrammableExp; + loader::loaderDispatch->pTools->MetricExp->pfnDestroyExp = loader::zetMetricDestroyExp; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for MetricGroup table +__zedlllocal void ZE_APICALL +zetGetMetricGroupProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pTools->MetricGroup->pfnGet = loader::zetMetricGroupGet; + loader::loaderDispatch->pTools->MetricGroup->pfnGetProperties = loader::zetMetricGroupGetProperties; + loader::loaderDispatch->pTools->MetricGroup->pfnCalculateMetricValues = loader::zetMetricGroupCalculateMetricValues; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for MetricGroupExp table +__zedlllocal void ZE_APICALL +zetGetMetricGroupExpProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pTools->MetricGroupExp->pfnCalculateMultipleMetricValuesExp = loader::zetMetricGroupCalculateMultipleMetricValuesExp; + loader::loaderDispatch->pTools->MetricGroupExp->pfnGetGlobalTimestampsExp = loader::zetMetricGroupGetGlobalTimestampsExp; + loader::loaderDispatch->pTools->MetricGroupExp->pfnGetExportDataExp = loader::zetMetricGroupGetExportDataExp; + loader::loaderDispatch->pTools->MetricGroupExp->pfnCalculateMetricExportDataExp = loader::zetMetricGroupCalculateMetricExportDataExp; + loader::loaderDispatch->pTools->MetricGroupExp->pfnCreateExp = loader::zetMetricGroupCreateExp; + loader::loaderDispatch->pTools->MetricGroupExp->pfnAddMetricExp = loader::zetMetricGroupAddMetricExp; + loader::loaderDispatch->pTools->MetricGroupExp->pfnRemoveMetricExp = loader::zetMetricGroupRemoveMetricExp; + loader::loaderDispatch->pTools->MetricGroupExp->pfnCloseExp = loader::zetMetricGroupCloseExp; + loader::loaderDispatch->pTools->MetricGroupExp->pfnDestroyExp = loader::zetMetricGroupDestroyExp; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for MetricQuery table +__zedlllocal void ZE_APICALL +zetGetMetricQueryProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pTools->MetricQuery->pfnCreate = loader::zetMetricQueryCreate; + loader::loaderDispatch->pTools->MetricQuery->pfnDestroy = loader::zetMetricQueryDestroy; + loader::loaderDispatch->pTools->MetricQuery->pfnReset = loader::zetMetricQueryReset; + loader::loaderDispatch->pTools->MetricQuery->pfnGetData = loader::zetMetricQueryGetData; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for MetricQueryPool table +__zedlllocal void ZE_APICALL +zetGetMetricQueryPoolProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pTools->MetricQueryPool->pfnCreate = loader::zetMetricQueryPoolCreate; + loader::loaderDispatch->pTools->MetricQueryPool->pfnDestroy = loader::zetMetricQueryPoolDestroy; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for MetricStreamer table +__zedlllocal void ZE_APICALL +zetGetMetricStreamerProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pTools->MetricStreamer->pfnOpen = loader::zetMetricStreamerOpen; + loader::loaderDispatch->pTools->MetricStreamer->pfnClose = loader::zetMetricStreamerClose; + loader::loaderDispatch->pTools->MetricStreamer->pfnReadData = loader::zetMetricStreamerReadData; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for TracerExp table +__zedlllocal void ZE_APICALL +zetGetTracerExpProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pTools->TracerExp->pfnCreate = loader::zetTracerExpCreate; + loader::loaderDispatch->pTools->TracerExp->pfnDestroy = loader::zetTracerExpDestroy; + loader::loaderDispatch->pTools->TracerExp->pfnSetPrologues = loader::zetTracerExpSetPrologues; + loader::loaderDispatch->pTools->TracerExp->pfnSetEpilogues = loader::zetTracerExpSetEpilogues; + loader::loaderDispatch->pTools->TracerExp->pfnSetEnabled = loader::zetTracerExpSetEnabled; +} + + /////////////////////////////////////////////////////////////////////////////// /// @brief Exported function for filling application's MetricDecoderExp table /// with current process' addresses @@ -2422,15 +2646,29 @@ zetGetMetricDecoderExpProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pTools->MetricDecoderExp = new zet_metric_decoder_exp_dditable_t; if (version >= ZE_API_VERSION_1_10) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnCreateExp = loader_driver_ddi::zetMetricDecoderCreateExp; + } else { pDdiTable->pfnCreateExp = loader::zetMetricDecoderCreateExp; } + } if (version >= ZE_API_VERSION_1_10) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnDestroyExp = loader_driver_ddi::zetMetricDecoderDestroyExp; + } else { pDdiTable->pfnDestroyExp = loader::zetMetricDecoderDestroyExp; } + } if (version >= ZE_API_VERSION_1_10) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetDecodableMetricsExp = loader_driver_ddi::zetMetricDecoderGetDecodableMetricsExp; + } else { pDdiTable->pfnGetDecodableMetricsExp = loader::zetMetricDecoderGetDecodableMetricsExp; } + } + zetGetMetricDecoderExpProcAddrTableLegacy(); } else { @@ -2497,18 +2735,36 @@ zetGetMetricProgrammableExpProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pTools->MetricProgrammableExp = new zet_metric_programmable_exp_dditable_t; if (version >= ZE_API_VERSION_1_9) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetExp = loader_driver_ddi::zetMetricProgrammableGetExp; + } else { pDdiTable->pfnGetExp = loader::zetMetricProgrammableGetExp; } + } if (version >= ZE_API_VERSION_1_9) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetPropertiesExp = loader_driver_ddi::zetMetricProgrammableGetPropertiesExp; + } else { pDdiTable->pfnGetPropertiesExp = loader::zetMetricProgrammableGetPropertiesExp; } + } if (version >= ZE_API_VERSION_1_9) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetParamInfoExp = loader_driver_ddi::zetMetricProgrammableGetParamInfoExp; + } else { pDdiTable->pfnGetParamInfoExp = loader::zetMetricProgrammableGetParamInfoExp; } + } if (version >= ZE_API_VERSION_1_9) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetParamValueInfoExp = loader_driver_ddi::zetMetricProgrammableGetParamValueInfoExp; + } else { pDdiTable->pfnGetParamValueInfoExp = loader::zetMetricProgrammableGetParamValueInfoExp; } + } + zetGetMetricProgrammableExpProcAddrTableLegacy(); } else { @@ -2575,24 +2831,50 @@ zetGetMetricTracerExpProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pTools->MetricTracerExp = new zet_metric_tracer_exp_dditable_t; if (version >= ZE_API_VERSION_1_10) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnCreateExp = loader_driver_ddi::zetMetricTracerCreateExp; + } else { pDdiTable->pfnCreateExp = loader::zetMetricTracerCreateExp; } + } if (version >= ZE_API_VERSION_1_10) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnDestroyExp = loader_driver_ddi::zetMetricTracerDestroyExp; + } else { pDdiTable->pfnDestroyExp = loader::zetMetricTracerDestroyExp; } + } if (version >= ZE_API_VERSION_1_10) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnEnableExp = loader_driver_ddi::zetMetricTracerEnableExp; + } else { pDdiTable->pfnEnableExp = loader::zetMetricTracerEnableExp; } + } if (version >= ZE_API_VERSION_1_10) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnDisableExp = loader_driver_ddi::zetMetricTracerDisableExp; + } else { pDdiTable->pfnDisableExp = loader::zetMetricTracerDisableExp; } + } if (version >= ZE_API_VERSION_1_10) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnReadDataExp = loader_driver_ddi::zetMetricTracerReadDataExp; + } else { pDdiTable->pfnReadDataExp = loader::zetMetricTracerReadDataExp; } + } if (version >= ZE_API_VERSION_1_10) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnDecodeExp = loader_driver_ddi::zetMetricTracerDecodeExp; + } else { pDdiTable->pfnDecodeExp = loader::zetMetricTracerDecodeExp; } + } + zetGetMetricTracerExpProcAddrTableLegacy(); } else { @@ -2669,9 +2951,15 @@ zetGetDeviceProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pTools->Device = new zet_device_dditable_t; if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetDebugProperties = loader_driver_ddi::zetDeviceGetDebugProperties; + } else { pDdiTable->pfnGetDebugProperties = loader::zetDeviceGetDebugProperties; } + } + zetGetDeviceProcAddrTableLegacy(); } else { @@ -2738,18 +3026,36 @@ zetGetDeviceExpProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pTools->DeviceExp = new zet_device_exp_dditable_t; if (version >= ZE_API_VERSION_1_10) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetConcurrentMetricGroupsExp = loader_driver_ddi::zetDeviceGetConcurrentMetricGroupsExp; + } else { pDdiTable->pfnGetConcurrentMetricGroupsExp = loader::zetDeviceGetConcurrentMetricGroupsExp; } + } if (version >= ZE_API_VERSION_1_10) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnCreateMetricGroupsFromMetricsExp = loader_driver_ddi::zetDeviceCreateMetricGroupsFromMetricsExp; + } else { pDdiTable->pfnCreateMetricGroupsFromMetricsExp = loader::zetDeviceCreateMetricGroupsFromMetricsExp; } + } if (version >= ZE_API_VERSION_1_13) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnEnableMetricsExp = loader_driver_ddi::zetDeviceEnableMetricsExp; + } else { pDdiTable->pfnEnableMetricsExp = loader::zetDeviceEnableMetricsExp; } + } if (version >= ZE_API_VERSION_1_13) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnDisableMetricsExp = loader_driver_ddi::zetDeviceDisableMetricsExp; + } else { pDdiTable->pfnDisableMetricsExp = loader::zetDeviceDisableMetricsExp; } + } + zetGetDeviceExpProcAddrTableLegacy(); } else { @@ -2826,9 +3132,15 @@ zetGetContextProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pTools->Context = new zet_context_dditable_t; if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnActivateMetricGroups = loader_driver_ddi::zetContextActivateMetricGroups; + } else { pDdiTable->pfnActivateMetricGroups = loader::zetContextActivateMetricGroups; } + } + zetGetContextProcAddrTableLegacy(); } else { @@ -2905,18 +3217,36 @@ zetGetCommandListProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pTools->CommandList = new zet_command_list_dditable_t; if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnAppendMetricStreamerMarker = loader_driver_ddi::zetCommandListAppendMetricStreamerMarker; + } else { pDdiTable->pfnAppendMetricStreamerMarker = loader::zetCommandListAppendMetricStreamerMarker; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnAppendMetricQueryBegin = loader_driver_ddi::zetCommandListAppendMetricQueryBegin; + } else { pDdiTable->pfnAppendMetricQueryBegin = loader::zetCommandListAppendMetricQueryBegin; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnAppendMetricQueryEnd = loader_driver_ddi::zetCommandListAppendMetricQueryEnd; + } else { pDdiTable->pfnAppendMetricQueryEnd = loader::zetCommandListAppendMetricQueryEnd; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnAppendMetricMemoryBarrier = loader_driver_ddi::zetCommandListAppendMetricMemoryBarrier; + } else { pDdiTable->pfnAppendMetricMemoryBarrier = loader::zetCommandListAppendMetricMemoryBarrier; } + } + zetGetCommandListProcAddrTableLegacy(); } else { @@ -2983,9 +3313,15 @@ zetGetCommandListExpProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pTools->CommandListExp = new zet_command_list_exp_dditable_t; if (version >= ZE_API_VERSION_1_13) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnAppendMarkerExp = loader_driver_ddi::zetCommandListAppendMarkerExp; + } else { pDdiTable->pfnAppendMarkerExp = loader::zetCommandListAppendMarkerExp; } + } + zetGetCommandListExpProcAddrTableLegacy(); } else { @@ -3062,9 +3398,15 @@ zetGetKernelProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pTools->Kernel = new zet_kernel_dditable_t; if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetProfileInfo = loader_driver_ddi::zetKernelGetProfileInfo; + } else { pDdiTable->pfnGetProfileInfo = loader::zetKernelGetProfileInfo; } + } + zetGetKernelProcAddrTableLegacy(); } else { @@ -3141,9 +3483,15 @@ zetGetModuleProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pTools->Module = new zet_module_dditable_t; if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetDebugInfo = loader_driver_ddi::zetModuleGetDebugInfo; + } else { pDdiTable->pfnGetDebugInfo = loader::zetModuleGetDebugInfo; } + } + zetGetModuleProcAddrTableLegacy(); } else { @@ -3220,42 +3568,92 @@ zetGetDebugProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pTools->Debug = new zet_debug_dditable_t; if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnAttach = loader_driver_ddi::zetDebugAttach; + } else { pDdiTable->pfnAttach = loader::zetDebugAttach; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnDetach = loader_driver_ddi::zetDebugDetach; + } else { pDdiTable->pfnDetach = loader::zetDebugDetach; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnReadEvent = loader_driver_ddi::zetDebugReadEvent; + } else { pDdiTable->pfnReadEvent = loader::zetDebugReadEvent; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnAcknowledgeEvent = loader_driver_ddi::zetDebugAcknowledgeEvent; + } else { pDdiTable->pfnAcknowledgeEvent = loader::zetDebugAcknowledgeEvent; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnInterrupt = loader_driver_ddi::zetDebugInterrupt; + } else { pDdiTable->pfnInterrupt = loader::zetDebugInterrupt; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnResume = loader_driver_ddi::zetDebugResume; + } else { pDdiTable->pfnResume = loader::zetDebugResume; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnReadMemory = loader_driver_ddi::zetDebugReadMemory; + } else { pDdiTable->pfnReadMemory = loader::zetDebugReadMemory; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnWriteMemory = loader_driver_ddi::zetDebugWriteMemory; + } else { pDdiTable->pfnWriteMemory = loader::zetDebugWriteMemory; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetRegisterSetProperties = loader_driver_ddi::zetDebugGetRegisterSetProperties; + } else { pDdiTable->pfnGetRegisterSetProperties = loader::zetDebugGetRegisterSetProperties; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnReadRegisters = loader_driver_ddi::zetDebugReadRegisters; + } else { pDdiTable->pfnReadRegisters = loader::zetDebugReadRegisters; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnWriteRegisters = loader_driver_ddi::zetDebugWriteRegisters; + } else { pDdiTable->pfnWriteRegisters = loader::zetDebugWriteRegisters; } + } if (version >= ZE_API_VERSION_1_5) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetThreadRegisterSetProperties = loader_driver_ddi::zetDebugGetThreadRegisterSetProperties; + } else { pDdiTable->pfnGetThreadRegisterSetProperties = loader::zetDebugGetThreadRegisterSetProperties; } + } + zetGetDebugProcAddrTableLegacy(); } else { @@ -3332,12 +3730,22 @@ zetGetMetricProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pTools->Metric = new zet_metric_dditable_t; if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGet = loader_driver_ddi::zetMetricGet; + } else { pDdiTable->pfnGet = loader::zetMetricGet; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetProperties = loader_driver_ddi::zetMetricGetProperties; + } else { pDdiTable->pfnGetProperties = loader::zetMetricGetProperties; } + } + zetGetMetricProcAddrTableLegacy(); } else { @@ -3404,15 +3812,29 @@ zetGetMetricExpProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pTools->MetricExp = new zet_metric_exp_dditable_t; if (version >= ZE_API_VERSION_1_11) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnCreateFromProgrammableExp2 = loader_driver_ddi::zetMetricCreateFromProgrammableExp2; + } else { pDdiTable->pfnCreateFromProgrammableExp2 = loader::zetMetricCreateFromProgrammableExp2; } + } if (version >= ZE_API_VERSION_1_9) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnCreateFromProgrammableExp = loader_driver_ddi::zetMetricCreateFromProgrammableExp; + } else { pDdiTable->pfnCreateFromProgrammableExp = loader::zetMetricCreateFromProgrammableExp; } + } if (version >= ZE_API_VERSION_1_9) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnDestroyExp = loader_driver_ddi::zetMetricDestroyExp; + } else { pDdiTable->pfnDestroyExp = loader::zetMetricDestroyExp; } + } + zetGetMetricExpProcAddrTableLegacy(); } else { @@ -3489,15 +3911,29 @@ zetGetMetricGroupProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pTools->MetricGroup = new zet_metric_group_dditable_t; if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGet = loader_driver_ddi::zetMetricGroupGet; + } else { pDdiTable->pfnGet = loader::zetMetricGroupGet; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetProperties = loader_driver_ddi::zetMetricGroupGetProperties; + } else { pDdiTable->pfnGetProperties = loader::zetMetricGroupGetProperties; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnCalculateMetricValues = loader_driver_ddi::zetMetricGroupCalculateMetricValues; + } else { pDdiTable->pfnCalculateMetricValues = loader::zetMetricGroupCalculateMetricValues; } + } + zetGetMetricGroupProcAddrTableLegacy(); } else { @@ -3564,33 +4000,71 @@ zetGetMetricGroupExpProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pTools->MetricGroupExp = new zet_metric_group_exp_dditable_t; if (version >= ZE_API_VERSION_1_2) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnCalculateMultipleMetricValuesExp = loader_driver_ddi::zetMetricGroupCalculateMultipleMetricValuesExp; + } else { pDdiTable->pfnCalculateMultipleMetricValuesExp = loader::zetMetricGroupCalculateMultipleMetricValuesExp; } + } if (version >= ZE_API_VERSION_1_5) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetGlobalTimestampsExp = loader_driver_ddi::zetMetricGroupGetGlobalTimestampsExp; + } else { pDdiTable->pfnGetGlobalTimestampsExp = loader::zetMetricGroupGetGlobalTimestampsExp; } + } if (version >= ZE_API_VERSION_1_6) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetExportDataExp = loader_driver_ddi::zetMetricGroupGetExportDataExp; + } else { pDdiTable->pfnGetExportDataExp = loader::zetMetricGroupGetExportDataExp; } + } if (version >= ZE_API_VERSION_1_6) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnCalculateMetricExportDataExp = loader_driver_ddi::zetMetricGroupCalculateMetricExportDataExp; + } else { pDdiTable->pfnCalculateMetricExportDataExp = loader::zetMetricGroupCalculateMetricExportDataExp; } + } if (version >= ZE_API_VERSION_1_9) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnCreateExp = loader_driver_ddi::zetMetricGroupCreateExp; + } else { pDdiTable->pfnCreateExp = loader::zetMetricGroupCreateExp; } + } if (version >= ZE_API_VERSION_1_9) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnAddMetricExp = loader_driver_ddi::zetMetricGroupAddMetricExp; + } else { pDdiTable->pfnAddMetricExp = loader::zetMetricGroupAddMetricExp; } + } if (version >= ZE_API_VERSION_1_9) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnRemoveMetricExp = loader_driver_ddi::zetMetricGroupRemoveMetricExp; + } else { pDdiTable->pfnRemoveMetricExp = loader::zetMetricGroupRemoveMetricExp; } + } if (version >= ZE_API_VERSION_1_9) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnCloseExp = loader_driver_ddi::zetMetricGroupCloseExp; + } else { pDdiTable->pfnCloseExp = loader::zetMetricGroupCloseExp; } + } if (version >= ZE_API_VERSION_1_9) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnDestroyExp = loader_driver_ddi::zetMetricGroupDestroyExp; + } else { pDdiTable->pfnDestroyExp = loader::zetMetricGroupDestroyExp; } + } + zetGetMetricGroupExpProcAddrTableLegacy(); } else { @@ -3667,18 +4141,36 @@ zetGetMetricQueryProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pTools->MetricQuery = new zet_metric_query_dditable_t; if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnCreate = loader_driver_ddi::zetMetricQueryCreate; + } else { pDdiTable->pfnCreate = loader::zetMetricQueryCreate; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnDestroy = loader_driver_ddi::zetMetricQueryDestroy; + } else { pDdiTable->pfnDestroy = loader::zetMetricQueryDestroy; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnReset = loader_driver_ddi::zetMetricQueryReset; + } else { pDdiTable->pfnReset = loader::zetMetricQueryReset; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetData = loader_driver_ddi::zetMetricQueryGetData; + } else { pDdiTable->pfnGetData = loader::zetMetricQueryGetData; } + } + zetGetMetricQueryProcAddrTableLegacy(); } else { @@ -3755,12 +4247,22 @@ zetGetMetricQueryPoolProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pTools->MetricQueryPool = new zet_metric_query_pool_dditable_t; if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnCreate = loader_driver_ddi::zetMetricQueryPoolCreate; + } else { pDdiTable->pfnCreate = loader::zetMetricQueryPoolCreate; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnDestroy = loader_driver_ddi::zetMetricQueryPoolDestroy; + } else { pDdiTable->pfnDestroy = loader::zetMetricQueryPoolDestroy; } + } + zetGetMetricQueryPoolProcAddrTableLegacy(); } else { @@ -3837,15 +4339,29 @@ zetGetMetricStreamerProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pTools->MetricStreamer = new zet_metric_streamer_dditable_t; if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnOpen = loader_driver_ddi::zetMetricStreamerOpen; + } else { pDdiTable->pfnOpen = loader::zetMetricStreamerOpen; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnClose = loader_driver_ddi::zetMetricStreamerClose; + } else { pDdiTable->pfnClose = loader::zetMetricStreamerClose; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnReadData = loader_driver_ddi::zetMetricStreamerReadData; + } else { pDdiTable->pfnReadData = loader::zetMetricStreamerReadData; } + } + zetGetMetricStreamerProcAddrTableLegacy(); } else { @@ -3922,21 +4438,43 @@ zetGetTracerExpProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs + loader::loaderDispatch->pTools->TracerExp = new zet_tracer_exp_dditable_t; if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnCreate = loader_driver_ddi::zetTracerExpCreate; + } else { pDdiTable->pfnCreate = loader::zetTracerExpCreate; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnDestroy = loader_driver_ddi::zetTracerExpDestroy; + } else { pDdiTable->pfnDestroy = loader::zetTracerExpDestroy; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnSetPrologues = loader_driver_ddi::zetTracerExpSetPrologues; + } else { pDdiTable->pfnSetPrologues = loader::zetTracerExpSetPrologues; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnSetEpilogues = loader_driver_ddi::zetTracerExpSetEpilogues; + } else { pDdiTable->pfnSetEpilogues = loader::zetTracerExpSetEpilogues; } + } if (version >= ZE_API_VERSION_1_0) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnSetEnabled = loader_driver_ddi::zetTracerExpSetEnabled; + } else { pDdiTable->pfnSetEnabled = loader::zetTracerExpSetEnabled; } + } + zetGetTracerExpProcAddrTableLegacy(); } else { @@ -3961,4 +4499,4 @@ zetGetTracerExpProcAddrTable( #if defined(__cplusplus) }; -#endif +#endif \ No newline at end of file diff --git a/source/loader/zet_ldrddi.h b/source/loader/zet_ldrddi.h index 548dfbc9..c65bc97f 100644 --- a/source/loader/zet_ldrddi.h +++ b/source/loader/zet_ldrddi.h @@ -1,6 +1,6 @@ /* * - * Copyright (C) 2019-2024 Intel Corporation + * Copyright (C) 2019-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -61,3 +61,720 @@ namespace loader using zet_metric_programmable_exp_factory_t = singleton_factory_t < zet_metric_programmable_exp_object_t, zet_metric_programmable_exp_handle_t >; } + +namespace loader_driver_ddi +{ + __zedlllocal void ZE_APICALL + zetDestroyDDiDriverTables(zet_dditable_driver_t* pDdiTable); + __zedlllocal ze_result_t ZE_APICALL + zetModuleGetDebugInfo( + zet_module_handle_t hModule, ///< [in] handle of the module + zet_module_debug_info_format_t format, ///< [in] debug info format requested + size_t* pSize, ///< [in,out] size of debug info in bytes + uint8_t* pDebugInfo ///< [in,out][optional] byte pointer to debug info + ); + __zedlllocal ze_result_t ZE_APICALL + zetDeviceGetDebugProperties( + zet_device_handle_t hDevice, ///< [in] device handle + zet_device_debug_properties_t* pDebugProperties ///< [in,out] query result for debug properties + ); + __zedlllocal ze_result_t ZE_APICALL + zetDebugAttach( + zet_device_handle_t hDevice, ///< [in] device handle + const zet_debug_config_t* config, ///< [in] the debug configuration + zet_debug_session_handle_t* phDebug ///< [out] debug session handle + ); + __zedlllocal ze_result_t ZE_APICALL + zetDebugDetach( + zet_debug_session_handle_t hDebug ///< [in][release] debug session handle + ); + __zedlllocal ze_result_t ZE_APICALL + zetDebugReadEvent( + zet_debug_session_handle_t hDebug, ///< [in] debug session handle + uint64_t timeout, ///< [in] if non-zero, then indicates the maximum time (in milliseconds) to + ///< yield before returning ::ZE_RESULT_SUCCESS or ::ZE_RESULT_NOT_READY; + ///< if zero, then immediately returns the status of the event; + ///< 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. + zet_debug_event_t* event ///< [in,out] a pointer to a ::zet_debug_event_t. + ); + __zedlllocal ze_result_t ZE_APICALL + zetDebugAcknowledgeEvent( + zet_debug_session_handle_t hDebug, ///< [in] debug session handle + const zet_debug_event_t* event ///< [in] a pointer to a ::zet_debug_event_t. + ); + __zedlllocal ze_result_t ZE_APICALL + zetDebugInterrupt( + zet_debug_session_handle_t hDebug, ///< [in] debug session handle + ze_device_thread_t thread ///< [in] the thread to interrupt + ); + __zedlllocal ze_result_t ZE_APICALL + zetDebugResume( + zet_debug_session_handle_t hDebug, ///< [in] debug session handle + ze_device_thread_t thread ///< [in] the thread to resume + ); + __zedlllocal ze_result_t ZE_APICALL + zetDebugReadMemory( + zet_debug_session_handle_t hDebug, ///< [in] debug session handle + ze_device_thread_t thread, ///< [in] the thread identifier. + const zet_debug_memory_space_desc_t* desc, ///< [in] memory space descriptor + size_t size, ///< [in] the number of bytes to read + void* buffer ///< [in,out] a buffer to hold a copy of the memory + ); + __zedlllocal ze_result_t ZE_APICALL + zetDebugWriteMemory( + zet_debug_session_handle_t hDebug, ///< [in] debug session handle + ze_device_thread_t thread, ///< [in] the thread identifier. + const zet_debug_memory_space_desc_t* desc, ///< [in] memory space descriptor + size_t size, ///< [in] the number of bytes to write + const void* buffer ///< [in] a buffer holding the pattern to write + ); + __zedlllocal ze_result_t ZE_APICALL + zetDebugGetRegisterSetProperties( + zet_device_handle_t hDevice, ///< [in] device handle + uint32_t* pCount, ///< [in,out] pointer to the number of register set properties. + ///< if count is zero, then the driver shall update the value with the + ///< total number of register set properties available. + ///< if count is greater than the number of register set properties + ///< available, then the driver shall update the value with the correct + ///< number of registry set properties available. + zet_debug_regset_properties_t* pRegisterSetProperties ///< [in,out][optional][range(0, *pCount)] array of query results for + ///< register set properties. + ///< if count is less than the number of register set properties available, + ///< then driver shall only retrieve that number of register set properties. + ); + __zedlllocal ze_result_t ZE_APICALL + zetDebugGetThreadRegisterSetProperties( + zet_debug_session_handle_t hDebug, ///< [in] debug session handle + ze_device_thread_t thread, ///< [in] the thread identifier specifying a single stopped thread + uint32_t* pCount, ///< [in,out] pointer to the number of register set properties. + ///< if count is zero, then the driver shall update the value with the + ///< total number of register set properties available. + ///< if count is greater than the number of register set properties + ///< available, then the driver shall update the value with the correct + ///< number of registry set properties available. + zet_debug_regset_properties_t* pRegisterSetProperties ///< [in,out][optional][range(0, *pCount)] array of query results for + ///< register set properties. + ///< if count is less than the number of register set properties available, + ///< then driver shall only retrieve that number of register set properties. + ); + __zedlllocal ze_result_t ZE_APICALL + zetDebugReadRegisters( + zet_debug_session_handle_t hDebug, ///< [in] debug session handle + ze_device_thread_t thread, ///< [in] the thread identifier + uint32_t type, ///< [in] register set type + uint32_t start, ///< [in] the starting offset into the register state area; must be less + ///< than the `count` member of ::zet_debug_regset_properties_t for the + ///< type + uint32_t count, ///< [in] the number of registers to read; start+count must be less than or + ///< equal to the `count` member of ::zet_debug_regset_properties_t for the + ///< type + void* pRegisterValues ///< [in,out][optional][range(0, count)] buffer of register values + ); + __zedlllocal ze_result_t ZE_APICALL + zetDebugWriteRegisters( + zet_debug_session_handle_t hDebug, ///< [in] debug session handle + ze_device_thread_t thread, ///< [in] the thread identifier + uint32_t type, ///< [in] register set type + uint32_t start, ///< [in] the starting offset into the register state area; must be less + ///< than the `count` member of ::zet_debug_regset_properties_t for the + ///< type + uint32_t count, ///< [in] the number of registers to write; start+count must be less than + ///< or equal to the `count` member of ::zet_debug_regset_properties_t for + ///< the type + void* pRegisterValues ///< [in,out][optional][range(0, count)] buffer of register values + ); + __zedlllocal ze_result_t ZE_APICALL + zetMetricGroupGet( + zet_device_handle_t hDevice, ///< [in] handle of the device + uint32_t* pCount, ///< [in,out] pointer to the number of metric groups. + ///< if count is zero, then the driver shall update the value with the + ///< total number of metric groups available. + ///< if count is greater than the number of metric groups available, then + ///< the driver shall update the value with the correct number of metric + ///< groups available. + zet_metric_group_handle_t* phMetricGroups ///< [in,out][optional][range(0, *pCount)] array of handle of metric groups. + ///< if count is less than the number of metric groups available, then + ///< driver shall only retrieve that number of metric groups. + ); + __zedlllocal ze_result_t ZE_APICALL + zetMetricGroupGetProperties( + zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group + zet_metric_group_properties_t* pProperties ///< [in,out] metric group properties + ); + __zedlllocal ze_result_t ZE_APICALL + zetMetricGroupCalculateMetricValues( + 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* pMetricValueCount, ///< [in,out] pointer to number of metric values calculated. + ///< 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. + zet_typed_value_t* pMetricValues ///< [in,out][optional][range(0, *pMetricValueCount)] 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. + ); + __zedlllocal ze_result_t ZE_APICALL + zetMetricGet( + zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group + uint32_t* pCount, ///< [in,out] pointer to the number of metrics. + ///< if count is zero, then the driver shall update the value with the + ///< total number of metrics available. + ///< if count is greater than the number of metrics available, then the + ///< driver shall update the value with the correct number of metrics available. + zet_metric_handle_t* phMetrics ///< [in,out][optional][range(0, *pCount)] array of handle of metrics. + ///< if count is less than the number of metrics available, then driver + ///< shall only retrieve that number of metrics. + ); + __zedlllocal ze_result_t ZE_APICALL + zetMetricGetProperties( + zet_metric_handle_t hMetric, ///< [in] handle of the metric + zet_metric_properties_t* pProperties ///< [in,out] metric properties + ); + __zedlllocal ze_result_t ZE_APICALL + zetContextActivateMetricGroups( + zet_context_handle_t hContext, ///< [in] handle of the context object + zet_device_handle_t hDevice, ///< [in] handle of the device + uint32_t count, ///< [in] metric group count to activate; must be 0 if `nullptr == + ///< phMetricGroups` + zet_metric_group_handle_t* phMetricGroups ///< [in][optional][range(0, count)] handles of the metric groups to activate. + ///< nullptr deactivates all previously used metric groups. + ///< all metrics groups must come from a different domains. + ///< metric query and metric stream must use activated metric groups. + ); + __zedlllocal ze_result_t ZE_APICALL + zetMetricStreamerOpen( + zet_context_handle_t hContext, ///< [in] handle of the context object + zet_device_handle_t hDevice, ///< [in] handle of the device + zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group + zet_metric_streamer_desc_t* desc, ///< [in,out] metric streamer descriptor + ze_event_handle_t hNotificationEvent, ///< [in][optional] event used for report availability notification + zet_metric_streamer_handle_t* phMetricStreamer ///< [out] handle of metric streamer + ); + __zedlllocal ze_result_t ZE_APICALL + zetCommandListAppendMetricStreamerMarker( + zet_command_list_handle_t hCommandList, ///< [in] handle of the command list + zet_metric_streamer_handle_t hMetricStreamer, ///< [in] handle of the metric streamer + uint32_t value ///< [in] streamer marker value + ); + __zedlllocal ze_result_t ZE_APICALL + zetMetricStreamerClose( + zet_metric_streamer_handle_t hMetricStreamer ///< [in][release] handle of the metric streamer + ); + __zedlllocal ze_result_t ZE_APICALL + zetMetricStreamerReadData( + zet_metric_streamer_handle_t hMetricStreamer, ///< [in] handle of the metric streamer + uint32_t maxReportCount, ///< [in] the maximum number of reports the application wants to receive. + ///< if `UINT32_MAX`, then function will retrieve all reports available + size_t* pRawDataSize, ///< [in,out] pointer to size in bytes of raw data requested to read. + ///< if size is zero, then the driver will update the value with the total + ///< size in bytes needed for all reports available. + ///< if size is non-zero, then driver will only retrieve the number of + ///< reports that fit into the buffer. + ///< if size is larger than size needed for all reports, then driver will + ///< update the value with the actual size needed. + uint8_t* pRawData ///< [in,out][optional][range(0, *pRawDataSize)] buffer containing streamer + ///< reports in raw format + ); + __zedlllocal ze_result_t ZE_APICALL + zetMetricQueryPoolCreate( + zet_context_handle_t hContext, ///< [in] handle of the context object + zet_device_handle_t hDevice, ///< [in] handle of the device + zet_metric_group_handle_t hMetricGroup, ///< [in] metric group associated with the query object. + const zet_metric_query_pool_desc_t* desc, ///< [in] metric query pool descriptor + zet_metric_query_pool_handle_t* phMetricQueryPool ///< [out] handle of metric query pool + ); + __zedlllocal ze_result_t ZE_APICALL + zetMetricQueryPoolDestroy( + zet_metric_query_pool_handle_t hMetricQueryPool ///< [in][release] handle of the metric query pool + ); + __zedlllocal ze_result_t ZE_APICALL + zetMetricQueryCreate( + zet_metric_query_pool_handle_t hMetricQueryPool,///< [in] handle of the metric query pool + uint32_t index, ///< [in] index of the query within the pool + zet_metric_query_handle_t* phMetricQuery ///< [out] handle of metric query + ); + __zedlllocal ze_result_t ZE_APICALL + zetMetricQueryDestroy( + zet_metric_query_handle_t hMetricQuery ///< [in][release] handle of metric query + ); + __zedlllocal ze_result_t ZE_APICALL + zetMetricQueryReset( + zet_metric_query_handle_t hMetricQuery ///< [in] handle of metric query + ); + __zedlllocal ze_result_t ZE_APICALL + zetCommandListAppendMetricQueryBegin( + zet_command_list_handle_t hCommandList, ///< [in] handle of the command list + zet_metric_query_handle_t hMetricQuery ///< [in] handle of the metric query + ); + __zedlllocal ze_result_t ZE_APICALL + zetCommandListAppendMetricQueryEnd( + zet_command_list_handle_t hCommandList, ///< [in] handle of the command list + zet_metric_query_handle_t hMetricQuery, ///< [in] handle of the metric query + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in] must be zero + ze_event_handle_t* phWaitEvents ///< [in][mbz] must be nullptr + ); + __zedlllocal ze_result_t ZE_APICALL + zetCommandListAppendMetricMemoryBarrier( + zet_command_list_handle_t hCommandList ///< [in] handle of the command list + ); + __zedlllocal ze_result_t ZE_APICALL + zetMetricQueryGetData( + zet_metric_query_handle_t hMetricQuery, ///< [in] handle of the metric query + size_t* pRawDataSize, ///< [in,out] pointer to size in bytes of raw data requested to read. + ///< if size is zero, then the driver will update the value with the total + ///< size in bytes needed for all reports available. + ///< if size is non-zero, then driver will only retrieve the number of + ///< reports that fit into the buffer. + ///< if size is larger than size needed for all reports, then driver will + ///< update the value with the actual size needed. + uint8_t* pRawData ///< [in,out][optional][range(0, *pRawDataSize)] buffer containing query + ///< reports in raw format + ); + __zedlllocal ze_result_t ZE_APICALL + zetKernelGetProfileInfo( + zet_kernel_handle_t hKernel, ///< [in] handle to kernel + zet_profile_properties_t* pProfileProperties ///< [out] pointer to profile properties + ); + __zedlllocal ze_result_t ZE_APICALL + zetTracerExpCreate( + zet_context_handle_t hContext, ///< [in] handle of the context object + const zet_tracer_exp_desc_t* desc, ///< [in] pointer to tracer descriptor + zet_tracer_exp_handle_t* phTracer ///< [out] pointer to handle of tracer object created + ); + __zedlllocal ze_result_t ZE_APICALL + zetTracerExpDestroy( + zet_tracer_exp_handle_t hTracer ///< [in][release] handle of tracer object to destroy + ); + __zedlllocal ze_result_t ZE_APICALL + zetTracerExpSetPrologues( + zet_tracer_exp_handle_t hTracer, ///< [in] handle of the tracer + zet_core_callbacks_t* pCoreCbs ///< [in] pointer to table of 'core' callback function pointers + ); + __zedlllocal ze_result_t ZE_APICALL + zetTracerExpSetEpilogues( + zet_tracer_exp_handle_t hTracer, ///< [in] handle of the tracer + zet_core_callbacks_t* pCoreCbs ///< [in] pointer to table of 'core' callback function pointers + ); + __zedlllocal ze_result_t ZE_APICALL + zetTracerExpSetEnabled( + zet_tracer_exp_handle_t hTracer, ///< [in] handle of the tracer + 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 size in bytes of raw data requested to read. + ///< if size is zero, then the driver will update the value with the total + ///< size in bytes needed for all data available. + ///< if size is non-zero, then driver will only retrieve that amount of + ///< data. + ///< if size is larger than size needed for all data, then driver will + ///< update the value with the actual size needed. + 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 + 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. + ); + __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. + ); + __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. + ); + __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. + ); + __zedlllocal ze_result_t ZE_APICALL + 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. + ); + __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 + ); + __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. + ); + __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. + ); + __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. + ); + __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. + ); + __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. + ); + __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 + ); + __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. + ); + __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. + ); + __zedlllocal ze_result_t ZE_APICALL + zetMetricGroupCloseExp( + zet_metric_group_handle_t hMetricGroup ///< [in] Handle of the metric group + ); + __zedlllocal ze_result_t ZE_APICALL + zetMetricGroupDestroyExp( + zet_metric_group_handle_t hMetricGroup ///< [in] Handle of the metric group to destroy + ); + __zedlllocal ze_result_t ZE_APICALL + zetMetricDestroyExp( + zet_metric_handle_t hMetric ///< [in] Handle of the metric to destroy + ); +} + +#if defined(__cplusplus) +extern "C" { +#endif + +__zedlllocal void ZE_APICALL +zetGetMetricDecoderExpProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zetGetMetricProgrammableExpProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zetGetMetricTracerExpProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zetGetDeviceProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zetGetDeviceExpProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zetGetContextProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zetGetCommandListProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zetGetCommandListExpProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zetGetKernelProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zetGetModuleProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zetGetDebugProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zetGetMetricProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zetGetMetricExpProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zetGetMetricGroupProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zetGetMetricGroupExpProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zetGetMetricQueryProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zetGetMetricQueryPoolProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zetGetMetricStreamerProcAddrTableLegacy(); +__zedlllocal void ZE_APICALL +zetGetTracerExpProcAddrTableLegacy(); + +#if defined(__cplusplus) +}; +#endif diff --git a/source/loader/zet_ldrddi_driver_ddi.cpp b/source/loader/zet_ldrddi_driver_ddi.cpp new file mode 100644 index 00000000..65c57b78 --- /dev/null +++ b/source/loader/zet_ldrddi_driver_ddi.cpp @@ -0,0 +1,2156 @@ +/* + * + * Copyright (C) 2019-2025 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + * @file zet_ldrddi_driver_ddi.cpp + * + */ +#include "ze_loader_internal.h" + +namespace loader_driver_ddi +{ + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetModuleGetDebugInfo + __zedlllocal ze_result_t ZE_APICALL + zetModuleGetDebugInfo( + zet_module_handle_t hModule, ///< [in] handle of the module + zet_module_debug_info_format_t format, ///< [in] debug info format requested + size_t* pSize, ///< [in,out] size of debug info in bytes + uint8_t* pDebugInfo ///< [in,out][optional] byte pointer to debug info + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hModule )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetDebugInfo = dditable->Module->pfnGetDebugInfo; + if( nullptr == pfnGetDebugInfo ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetDebugInfo( hModule, format, pSize, pDebugInfo ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetDeviceGetDebugProperties + __zedlllocal ze_result_t ZE_APICALL + zetDeviceGetDebugProperties( + zet_device_handle_t hDevice, ///< [in] device handle + zet_device_debug_properties_t* pDebugProperties ///< [in,out] query result for debug properties + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetDebugProperties = dditable->Device->pfnGetDebugProperties; + if( nullptr == pfnGetDebugProperties ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetDebugProperties( hDevice, pDebugProperties ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetDebugAttach + __zedlllocal ze_result_t ZE_APICALL + zetDebugAttach( + zet_device_handle_t hDevice, ///< [in] device handle + const zet_debug_config_t* config, ///< [in] the debug configuration + zet_debug_session_handle_t* phDebug ///< [out] debug session handle + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnAttach = dditable->Debug->pfnAttach; + if( nullptr == pfnAttach ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnAttach( hDevice, config, phDebug ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetDebugDetach + __zedlllocal ze_result_t ZE_APICALL + zetDebugDetach( + zet_debug_session_handle_t hDebug ///< [in][release] debug session handle + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hDebug )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnDetach = dditable->Debug->pfnDetach; + if( nullptr == pfnDetach ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnDetach( hDebug ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetDebugReadEvent + __zedlllocal ze_result_t ZE_APICALL + zetDebugReadEvent( + zet_debug_session_handle_t hDebug, ///< [in] debug session handle + uint64_t timeout, ///< [in] if non-zero, then indicates the maximum time (in milliseconds) to + ///< yield before returning ::ZE_RESULT_SUCCESS or ::ZE_RESULT_NOT_READY; + ///< if zero, then immediately returns the status of the event; + ///< 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. + zet_debug_event_t* event ///< [in,out] a pointer to a ::zet_debug_event_t. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hDebug )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnReadEvent = dditable->Debug->pfnReadEvent; + if( nullptr == pfnReadEvent ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnReadEvent( hDebug, timeout, event ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetDebugAcknowledgeEvent + __zedlllocal ze_result_t ZE_APICALL + zetDebugAcknowledgeEvent( + zet_debug_session_handle_t hDebug, ///< [in] debug session handle + const zet_debug_event_t* event ///< [in] a pointer to a ::zet_debug_event_t. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hDebug )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnAcknowledgeEvent = dditable->Debug->pfnAcknowledgeEvent; + if( nullptr == pfnAcknowledgeEvent ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnAcknowledgeEvent( hDebug, event ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetDebugInterrupt + __zedlllocal ze_result_t ZE_APICALL + zetDebugInterrupt( + zet_debug_session_handle_t hDebug, ///< [in] debug session handle + ze_device_thread_t thread ///< [in] the thread to interrupt + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hDebug )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnInterrupt = dditable->Debug->pfnInterrupt; + if( nullptr == pfnInterrupt ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnInterrupt( hDebug, thread ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetDebugResume + __zedlllocal ze_result_t ZE_APICALL + zetDebugResume( + zet_debug_session_handle_t hDebug, ///< [in] debug session handle + ze_device_thread_t thread ///< [in] the thread to resume + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hDebug )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnResume = dditable->Debug->pfnResume; + if( nullptr == pfnResume ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnResume( hDebug, thread ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetDebugReadMemory + __zedlllocal ze_result_t ZE_APICALL + zetDebugReadMemory( + zet_debug_session_handle_t hDebug, ///< [in] debug session handle + ze_device_thread_t thread, ///< [in] the thread identifier. + const zet_debug_memory_space_desc_t* desc, ///< [in] memory space descriptor + size_t size, ///< [in] the number of bytes to read + void* buffer ///< [in,out] a buffer to hold a copy of the memory + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hDebug )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnReadMemory = dditable->Debug->pfnReadMemory; + if( nullptr == pfnReadMemory ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnReadMemory( hDebug, thread, desc, size, buffer ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetDebugWriteMemory + __zedlllocal ze_result_t ZE_APICALL + zetDebugWriteMemory( + zet_debug_session_handle_t hDebug, ///< [in] debug session handle + ze_device_thread_t thread, ///< [in] the thread identifier. + const zet_debug_memory_space_desc_t* desc, ///< [in] memory space descriptor + size_t size, ///< [in] the number of bytes to write + const void* buffer ///< [in] a buffer holding the pattern to write + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hDebug )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnWriteMemory = dditable->Debug->pfnWriteMemory; + if( nullptr == pfnWriteMemory ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnWriteMemory( hDebug, thread, desc, size, buffer ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetDebugGetRegisterSetProperties + __zedlllocal ze_result_t ZE_APICALL + zetDebugGetRegisterSetProperties( + zet_device_handle_t hDevice, ///< [in] device handle + uint32_t* pCount, ///< [in,out] pointer to the number of register set properties. + ///< if count is zero, then the driver shall update the value with the + ///< total number of register set properties available. + ///< if count is greater than the number of register set properties + ///< available, then the driver shall update the value with the correct + ///< number of registry set properties available. + zet_debug_regset_properties_t* pRegisterSetProperties ///< [in,out][optional][range(0, *pCount)] array of query results for + ///< register set properties. + ///< if count is less than the number of register set properties available, + ///< then driver shall only retrieve that number of register set properties. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetRegisterSetProperties = dditable->Debug->pfnGetRegisterSetProperties; + if( nullptr == pfnGetRegisterSetProperties ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetRegisterSetProperties( hDevice, pCount, pRegisterSetProperties ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetDebugGetThreadRegisterSetProperties + __zedlllocal ze_result_t ZE_APICALL + zetDebugGetThreadRegisterSetProperties( + zet_debug_session_handle_t hDebug, ///< [in] debug session handle + ze_device_thread_t thread, ///< [in] the thread identifier specifying a single stopped thread + uint32_t* pCount, ///< [in,out] pointer to the number of register set properties. + ///< if count is zero, then the driver shall update the value with the + ///< total number of register set properties available. + ///< if count is greater than the number of register set properties + ///< available, then the driver shall update the value with the correct + ///< number of registry set properties available. + zet_debug_regset_properties_t* pRegisterSetProperties ///< [in,out][optional][range(0, *pCount)] array of query results for + ///< register set properties. + ///< if count is less than the number of register set properties available, + ///< then driver shall only retrieve that number of register set properties. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hDebug )->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_5) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetThreadRegisterSetProperties = dditable->Debug->pfnGetThreadRegisterSetProperties; + if( nullptr == pfnGetThreadRegisterSetProperties ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetThreadRegisterSetProperties( hDebug, thread, pCount, pRegisterSetProperties ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetDebugReadRegisters + __zedlllocal ze_result_t ZE_APICALL + zetDebugReadRegisters( + zet_debug_session_handle_t hDebug, ///< [in] debug session handle + ze_device_thread_t thread, ///< [in] the thread identifier + uint32_t type, ///< [in] register set type + uint32_t start, ///< [in] the starting offset into the register state area; must be less + ///< than the `count` member of ::zet_debug_regset_properties_t for the + ///< type + uint32_t count, ///< [in] the number of registers to read; start+count must be less than or + ///< equal to the `count` member of ::zet_debug_regset_properties_t for the + ///< type + void* pRegisterValues ///< [in,out][optional][range(0, count)] buffer of register values + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hDebug )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnReadRegisters = dditable->Debug->pfnReadRegisters; + if( nullptr == pfnReadRegisters ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnReadRegisters( hDebug, thread, type, start, count, pRegisterValues ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetDebugWriteRegisters + __zedlllocal ze_result_t ZE_APICALL + zetDebugWriteRegisters( + zet_debug_session_handle_t hDebug, ///< [in] debug session handle + ze_device_thread_t thread, ///< [in] the thread identifier + uint32_t type, ///< [in] register set type + uint32_t start, ///< [in] the starting offset into the register state area; must be less + ///< than the `count` member of ::zet_debug_regset_properties_t for the + ///< type + uint32_t count, ///< [in] the number of registers to write; start+count must be less than + ///< or equal to the `count` member of ::zet_debug_regset_properties_t for + ///< the type + void* pRegisterValues ///< [in,out][optional][range(0, count)] buffer of register values + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hDebug )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnWriteRegisters = dditable->Debug->pfnWriteRegisters; + if( nullptr == pfnWriteRegisters ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnWriteRegisters( hDebug, thread, type, start, count, pRegisterValues ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetMetricGroupGet + __zedlllocal ze_result_t ZE_APICALL + zetMetricGroupGet( + zet_device_handle_t hDevice, ///< [in] handle of the device + uint32_t* pCount, ///< [in,out] pointer to the number of metric groups. + ///< if count is zero, then the driver shall update the value with the + ///< total number of metric groups available. + ///< if count is greater than the number of metric groups available, then + ///< the driver shall update the value with the correct number of metric + ///< groups available. + zet_metric_group_handle_t* phMetricGroups ///< [in,out][optional][range(0, *pCount)] array of handle of metric groups. + ///< if count is less than the number of metric groups available, then + ///< driver shall only retrieve that number of metric groups. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGet = dditable->MetricGroup->pfnGet; + if( nullptr == pfnGet ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGet( hDevice, pCount, phMetricGroups ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetMetricGroupGetProperties + __zedlllocal ze_result_t ZE_APICALL + zetMetricGroupGetProperties( + zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group + zet_metric_group_properties_t* pProperties ///< [in,out] metric group properties + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetProperties = dditable->MetricGroup->pfnGetProperties; + if( nullptr == pfnGetProperties ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetProperties( hMetricGroup, pProperties ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetMetricGroupCalculateMetricValues + __zedlllocal ze_result_t ZE_APICALL + zetMetricGroupCalculateMetricValues( + 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* pMetricValueCount, ///< [in,out] pointer to number of metric values calculated. + ///< 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. + zet_typed_value_t* pMetricValues ///< [in,out][optional][range(0, *pMetricValueCount)] 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( 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnCalculateMetricValues = dditable->MetricGroup->pfnCalculateMetricValues; + if( nullptr == pfnCalculateMetricValues ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnCalculateMetricValues( hMetricGroup, type, rawDataSize, pRawData, pMetricValueCount, pMetricValues ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetMetricGet + __zedlllocal ze_result_t ZE_APICALL + zetMetricGet( + zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group + uint32_t* pCount, ///< [in,out] pointer to the number of metrics. + ///< if count is zero, then the driver shall update the value with the + ///< total number of metrics available. + ///< if count is greater than the number of metrics available, then the + ///< driver shall update the value with the correct number of metrics available. + zet_metric_handle_t* phMetrics ///< [in,out][optional][range(0, *pCount)] array of handle of metrics. + ///< if count is less than the number of metrics available, then driver + ///< shall only retrieve that number of metrics. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGet = dditable->Metric->pfnGet; + if( nullptr == pfnGet ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGet( hMetricGroup, pCount, phMetrics ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetMetricGetProperties + __zedlllocal ze_result_t ZE_APICALL + zetMetricGetProperties( + zet_metric_handle_t hMetric, ///< [in] handle of the metric + zet_metric_properties_t* pProperties ///< [in,out] metric properties + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetProperties = dditable->Metric->pfnGetProperties; + if( nullptr == pfnGetProperties ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetProperties( hMetric, pProperties ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetContextActivateMetricGroups + __zedlllocal ze_result_t ZE_APICALL + zetContextActivateMetricGroups( + zet_context_handle_t hContext, ///< [in] handle of the context object + zet_device_handle_t hDevice, ///< [in] handle of the device + uint32_t count, ///< [in] metric group count to activate; must be 0 if `nullptr == + ///< phMetricGroups` + zet_metric_group_handle_t* phMetricGroups ///< [in][optional][range(0, count)] handles of the metric groups to activate. + ///< nullptr deactivates all previously used metric groups. + ///< all metrics groups must come from a different domains. + ///< metric query and metric stream must use activated metric groups. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnActivateMetricGroups = dditable->Context->pfnActivateMetricGroups; + if( nullptr == pfnActivateMetricGroups ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnActivateMetricGroups( hContext, hDevice, count, phMetricGroups ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetMetricStreamerOpen + __zedlllocal ze_result_t ZE_APICALL + zetMetricStreamerOpen( + zet_context_handle_t hContext, ///< [in] handle of the context object + zet_device_handle_t hDevice, ///< [in] handle of the device + zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group + zet_metric_streamer_desc_t* desc, ///< [in,out] metric streamer descriptor + ze_event_handle_t hNotificationEvent, ///< [in][optional] event used for report availability notification + zet_metric_streamer_handle_t* phMetricStreamer ///< [out] handle of metric streamer + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnOpen = dditable->MetricStreamer->pfnOpen; + if( nullptr == pfnOpen ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnOpen( hContext, hDevice, hMetricGroup, desc, hNotificationEvent, phMetricStreamer ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetCommandListAppendMetricStreamerMarker + __zedlllocal ze_result_t ZE_APICALL + zetCommandListAppendMetricStreamerMarker( + zet_command_list_handle_t hCommandList, ///< [in] handle of the command list + zet_metric_streamer_handle_t hMetricStreamer, ///< [in] handle of the metric streamer + uint32_t value ///< [in] streamer marker value + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnAppendMetricStreamerMarker = dditable->CommandList->pfnAppendMetricStreamerMarker; + if( nullptr == pfnAppendMetricStreamerMarker ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnAppendMetricStreamerMarker( hCommandList, hMetricStreamer, value ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetMetricStreamerClose + __zedlllocal ze_result_t ZE_APICALL + zetMetricStreamerClose( + zet_metric_streamer_handle_t hMetricStreamer ///< [in][release] handle of the metric streamer + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hMetricStreamer )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnClose = dditable->MetricStreamer->pfnClose; + if( nullptr == pfnClose ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnClose( hMetricStreamer ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetMetricStreamerReadData + __zedlllocal ze_result_t ZE_APICALL + zetMetricStreamerReadData( + zet_metric_streamer_handle_t hMetricStreamer, ///< [in] handle of the metric streamer + uint32_t maxReportCount, ///< [in] the maximum number of reports the application wants to receive. + ///< if `UINT32_MAX`, then function will retrieve all reports available + size_t* pRawDataSize, ///< [in,out] pointer to size in bytes of raw data requested to read. + ///< if size is zero, then the driver will update the value with the total + ///< size in bytes needed for all reports available. + ///< if size is non-zero, then driver will only retrieve the number of + ///< reports that fit into the buffer. + ///< if size is larger than size needed for all reports, then driver will + ///< update the value with the actual size needed. + uint8_t* pRawData ///< [in,out][optional][range(0, *pRawDataSize)] buffer containing streamer + ///< reports in raw format + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hMetricStreamer )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnReadData = dditable->MetricStreamer->pfnReadData; + if( nullptr == pfnReadData ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnReadData( hMetricStreamer, maxReportCount, pRawDataSize, pRawData ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetMetricQueryPoolCreate + __zedlllocal ze_result_t ZE_APICALL + zetMetricQueryPoolCreate( + zet_context_handle_t hContext, ///< [in] handle of the context object + zet_device_handle_t hDevice, ///< [in] handle of the device + zet_metric_group_handle_t hMetricGroup, ///< [in] metric group associated with the query object. + const zet_metric_query_pool_desc_t* desc, ///< [in] metric query pool descriptor + zet_metric_query_pool_handle_t* phMetricQueryPool ///< [out] handle of metric query pool + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnCreate = dditable->MetricQueryPool->pfnCreate; + if( nullptr == pfnCreate ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnCreate( hContext, hDevice, hMetricGroup, desc, phMetricQueryPool ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetMetricQueryPoolDestroy + __zedlllocal ze_result_t ZE_APICALL + zetMetricQueryPoolDestroy( + zet_metric_query_pool_handle_t hMetricQueryPool ///< [in][release] handle of the metric query pool + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hMetricQueryPool )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnDestroy = dditable->MetricQueryPool->pfnDestroy; + if( nullptr == pfnDestroy ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnDestroy( hMetricQueryPool ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetMetricQueryCreate + __zedlllocal ze_result_t ZE_APICALL + zetMetricQueryCreate( + zet_metric_query_pool_handle_t hMetricQueryPool,///< [in] handle of the metric query pool + uint32_t index, ///< [in] index of the query within the pool + zet_metric_query_handle_t* phMetricQuery ///< [out] handle of metric query + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hMetricQueryPool )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnCreate = dditable->MetricQuery->pfnCreate; + if( nullptr == pfnCreate ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnCreate( hMetricQueryPool, index, phMetricQuery ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetMetricQueryDestroy + __zedlllocal ze_result_t ZE_APICALL + zetMetricQueryDestroy( + zet_metric_query_handle_t hMetricQuery ///< [in][release] handle of metric query + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hMetricQuery )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnDestroy = dditable->MetricQuery->pfnDestroy; + if( nullptr == pfnDestroy ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnDestroy( hMetricQuery ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetMetricQueryReset + __zedlllocal ze_result_t ZE_APICALL + zetMetricQueryReset( + zet_metric_query_handle_t hMetricQuery ///< [in] handle of metric query + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hMetricQuery )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnReset = dditable->MetricQuery->pfnReset; + if( nullptr == pfnReset ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnReset( hMetricQuery ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetCommandListAppendMetricQueryBegin + __zedlllocal ze_result_t ZE_APICALL + zetCommandListAppendMetricQueryBegin( + zet_command_list_handle_t hCommandList, ///< [in] handle of the command list + zet_metric_query_handle_t hMetricQuery ///< [in] handle of the metric query + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnAppendMetricQueryBegin = dditable->CommandList->pfnAppendMetricQueryBegin; + if( nullptr == pfnAppendMetricQueryBegin ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnAppendMetricQueryBegin( hCommandList, hMetricQuery ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetCommandListAppendMetricQueryEnd + __zedlllocal ze_result_t ZE_APICALL + zetCommandListAppendMetricQueryEnd( + zet_command_list_handle_t hCommandList, ///< [in] handle of the command list + zet_metric_query_handle_t hMetricQuery, ///< [in] handle of the metric query + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in] must be zero + ze_event_handle_t* phWaitEvents ///< [in][mbz] must be nullptr + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnAppendMetricQueryEnd = dditable->CommandList->pfnAppendMetricQueryEnd; + if( nullptr == pfnAppendMetricQueryEnd ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnAppendMetricQueryEnd( hCommandList, hMetricQuery, hSignalEvent, numWaitEvents, phWaitEvents ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetCommandListAppendMetricMemoryBarrier + __zedlllocal ze_result_t ZE_APICALL + zetCommandListAppendMetricMemoryBarrier( + zet_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 )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnAppendMetricMemoryBarrier = dditable->CommandList->pfnAppendMetricMemoryBarrier; + if( nullptr == pfnAppendMetricMemoryBarrier ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnAppendMetricMemoryBarrier( hCommandList ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetMetricQueryGetData + __zedlllocal ze_result_t ZE_APICALL + zetMetricQueryGetData( + zet_metric_query_handle_t hMetricQuery, ///< [in] handle of the metric query + size_t* pRawDataSize, ///< [in,out] pointer to size in bytes of raw data requested to read. + ///< if size is zero, then the driver will update the value with the total + ///< size in bytes needed for all reports available. + ///< if size is non-zero, then driver will only retrieve the number of + ///< reports that fit into the buffer. + ///< if size is larger than size needed for all reports, then driver will + ///< update the value with the actual size needed. + uint8_t* pRawData ///< [in,out][optional][range(0, *pRawDataSize)] buffer containing query + ///< reports in raw format + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hMetricQuery )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetData = dditable->MetricQuery->pfnGetData; + if( nullptr == pfnGetData ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetData( hMetricQuery, pRawDataSize, pRawData ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetKernelGetProfileInfo + __zedlllocal ze_result_t ZE_APICALL + zetKernelGetProfileInfo( + zet_kernel_handle_t hKernel, ///< [in] handle to kernel + zet_profile_properties_t* pProfileProperties ///< [out] pointer to profile properties + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hKernel )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetProfileInfo = dditable->Kernel->pfnGetProfileInfo; + if( nullptr == pfnGetProfileInfo ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetProfileInfo( hKernel, pProfileProperties ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetTracerExpCreate + __zedlllocal ze_result_t ZE_APICALL + zetTracerExpCreate( + zet_context_handle_t hContext, ///< [in] handle of the context object + const zet_tracer_exp_desc_t* desc, ///< [in] pointer to tracer descriptor + zet_tracer_exp_handle_t* phTracer ///< [out] pointer to handle of tracer object created + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnCreate = dditable->TracerExp->pfnCreate; + if( nullptr == pfnCreate ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnCreate( hContext, desc, phTracer ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetTracerExpDestroy + __zedlllocal ze_result_t ZE_APICALL + zetTracerExpDestroy( + zet_tracer_exp_handle_t hTracer ///< [in][release] handle of tracer object to destroy + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hTracer )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnDestroy = dditable->TracerExp->pfnDestroy; + if( nullptr == pfnDestroy ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnDestroy( hTracer ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetTracerExpSetPrologues + __zedlllocal ze_result_t ZE_APICALL + zetTracerExpSetPrologues( + zet_tracer_exp_handle_t hTracer, ///< [in] handle of the tracer + zet_core_callbacks_t* pCoreCbs ///< [in] pointer to table of 'core' callback function pointers + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hTracer )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnSetPrologues = dditable->TracerExp->pfnSetPrologues; + if( nullptr == pfnSetPrologues ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnSetPrologues( hTracer, pCoreCbs ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetTracerExpSetEpilogues + __zedlllocal ze_result_t ZE_APICALL + zetTracerExpSetEpilogues( + zet_tracer_exp_handle_t hTracer, ///< [in] handle of the tracer + zet_core_callbacks_t* pCoreCbs ///< [in] pointer to table of 'core' callback function pointers + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hTracer )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnSetEpilogues = dditable->TracerExp->pfnSetEpilogues; + if( nullptr == pfnSetEpilogues ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnSetEpilogues( hTracer, pCoreCbs ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetTracerExpSetEnabled + __zedlllocal ze_result_t ZE_APICALL + zetTracerExpSetEnabled( + zet_tracer_exp_handle_t hTracer, ///< [in] handle of the tracer + ze_bool_t enable ///< [in] enable the tracer if true; disable if false + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hTracer )->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_0) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnSetEnabled = dditable->TracerExp->pfnSetEnabled; + if( nullptr == pfnSetEnabled ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnSetEnabled( hTracer, enable ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetDeviceGetConcurrentMetricGroupsExp + __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. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetConcurrentMetricGroupsExp = dditable->DeviceExp->pfnGetConcurrentMetricGroupsExp; + if( nullptr == pfnGetConcurrentMetricGroupsExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetConcurrentMetricGroupsExp( hDevice, metricGroupCount, phMetricGroups, pMetricGroupsCountPerConcurrentGroup, pConcurrentGroupCount ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetMetricTracerCreateExp + __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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_10) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnCreateExp = dditable->MetricTracerExp->pfnCreateExp; + if( nullptr == pfnCreateExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnCreateExp( hContext, hDevice, metricGroupCount, phMetricGroups, desc, hNotificationEvent, phMetricTracer ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetMetricTracerDestroyExp + __zedlllocal ze_result_t ZE_APICALL + 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( 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_10) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnDestroyExp = dditable->MetricTracerExp->pfnDestroyExp; + if( nullptr == pfnDestroyExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnDestroyExp( hMetricTracer ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetMetricTracerEnableExp + __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. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_10) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnEnableExp = dditable->MetricTracerExp->pfnEnableExp; + if( nullptr == pfnEnableExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnEnableExp( hMetricTracer, synchronous ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @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. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_10) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnDisableExp = dditable->MetricTracerExp->pfnDisableExp; + if( nullptr == pfnDisableExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnDisableExp( hMetricTracer, synchronous ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetMetricTracerReadDataExp + __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 size in bytes of raw data requested to read. + ///< if size is zero, then the driver will update the value with the total + ///< size in bytes needed for all data available. + ///< if size is non-zero, then driver will only retrieve that amount of + ///< data. + ///< if size is larger than size needed for all data, then driver will + ///< update the value with the actual size needed. + 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( 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_10) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnReadDataExp = dditable->MetricTracerExp->pfnReadDataExp; + if( nullptr == pfnReadDataExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnReadDataExp( hMetricTracer, pRawDataSize, pRawData ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetMetricDecoderCreateExp + __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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_10) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnCreateExp = dditable->MetricDecoderExp->pfnCreateExp; + if( nullptr == pfnCreateExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnCreateExp( hMetricTracer, phMetricDecoder ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetMetricDecoderDestroyExp + __zedlllocal ze_result_t ZE_APICALL + 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( 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_10) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnDestroyExp = dditable->MetricDecoderExp->pfnDestroyExp; + if( nullptr == pfnDestroyExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnDestroyExp( phMetricDecoder ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetMetricDecoderGetDecodableMetricsExp + __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. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_10) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetDecodableMetricsExp = dditable->MetricDecoderExp->pfnGetDecodableMetricsExp; + if( nullptr == pfnGetDecodableMetricsExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetDecodableMetricsExp( hMetricDecoder, pCount, phMetrics ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetMetricTracerDecodeExp + __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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_10) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnDecodeExp = dditable->MetricTracerExp->pfnDecodeExp; + if( nullptr == pfnDecodeExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnDecodeExp( phMetricDecoder, pRawDataSize, pRawData, metricsCount, phMetrics, pSetCount, pMetricEntriesCountPerSet, pMetricEntriesCount, pMetricEntries ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetCommandListAppendMarkerExp + __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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_13) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnAppendMarkerExp = dditable->CommandListExp->pfnAppendMarkerExp; + if( nullptr == pfnAppendMarkerExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnAppendMarkerExp( hCommandList, hMetricGroup, value ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetDeviceEnableMetricsExp + __zedlllocal ze_result_t ZE_APICALL + 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( 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) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnEnableMetricsExp = dditable->DeviceExp->pfnEnableMetricsExp; + if( nullptr == pfnEnableMetricsExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // 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 handle's function pointer table + 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) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnDisableMetricsExp = dditable->DeviceExp->pfnDisableMetricsExp; + if( nullptr == pfnDisableMetricsExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnDisableMetricsExp( hDevice ); + 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. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_2) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnCalculateMultipleMetricValuesExp = dditable->MetricGroupExp->pfnCalculateMultipleMetricValuesExp; + if( nullptr == pfnCalculateMultipleMetricValuesExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnCalculateMultipleMetricValuesExp( hMetricGroup, type, rawDataSize, pRawData, pSetCount, pTotalMetricValueCount, pMetricCounts, pMetricValues ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetMetricGroupGetGlobalTimestampsExp + __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_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_5) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetGlobalTimestampsExp = dditable->MetricGroupExp->pfnGetGlobalTimestampsExp; + if( nullptr == pfnGetGlobalTimestampsExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetGlobalTimestampsExp( hMetricGroup, synchronizedWithHost, globalTimestamp, metricTimestamp ); + 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 handle's function pointer table + 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_6) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetExportDataExp = dditable->MetricGroupExp->pfnGetExportDataExp; + if( nullptr == pfnGetExportDataExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetExportDataExp( hMetricGroup, pRawData, rawDataSize, pExportDataSize, pExportData ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @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 handle's function pointer table + 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_6) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnCalculateMetricExportDataExp = dditable->MetricGroupExp->pfnCalculateMetricExportDataExp; + if( nullptr == pfnCalculateMetricExportDataExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnCalculateMetricExportDataExp( hDriver, type, exportDataSize, pExportData, pCalculateDescriptor, pSetCount, pTotalMetricValueCount, pMetricCounts, pMetricValues ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetMetricProgrammableGetExp + __zedlllocal ze_result_t ZE_APICALL + 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( 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) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetExp = dditable->MetricProgrammableExp->pfnGetExp; + if( nullptr == pfnGetExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetExp( hDevice, pCount, phMetricProgrammables ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetMetricProgrammableGetPropertiesExp + __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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_9) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetPropertiesExp = dditable->MetricProgrammableExp->pfnGetPropertiesExp; + if( nullptr == pfnGetPropertiesExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetPropertiesExp( hMetricProgrammable, pProperties ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetMetricProgrammableGetParamInfoExp + __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. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_9) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetParamInfoExp = dditable->MetricProgrammableExp->pfnGetParamInfoExp; + if( nullptr == pfnGetParamInfoExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetParamInfoExp( hMetricProgrammable, pParameterCount, pParameterInfo ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetMetricProgrammableGetParamValueInfoExp + __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. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_9) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnGetParamValueInfoExp = dditable->MetricProgrammableExp->pfnGetParamValueInfoExp; + if( nullptr == pfnGetParamValueInfoExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnGetParamValueInfoExp( hMetricProgrammable, parameterOrdinal, pValueInfoCount, pValueInfo ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetMetricCreateFromProgrammableExp2 + __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. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_11) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnCreateFromProgrammableExp2 = dditable->MetricExp->pfnCreateFromProgrammableExp2; + if( nullptr == pfnCreateFromProgrammableExp2 ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnCreateFromProgrammableExp2( hMetricProgrammable, parameterCount, pParameterValues, pName, pDescription, pMetricHandleCount, phMetricHandles ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetMetricCreateFromProgrammableExp + __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. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_9) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnCreateFromProgrammableExp = dditable->MetricExp->pfnCreateFromProgrammableExp; + if( nullptr == pfnCreateFromProgrammableExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnCreateFromProgrammableExp( hMetricProgrammable, pParameterValues, parameterCount, pName, pDescription, pMetricHandleCount, phMetricHandles ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetDeviceCreateMetricGroupsFromMetricsExp + __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. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnCreateMetricGroupsFromMetricsExp = dditable->DeviceExp->pfnCreateMetricGroupsFromMetricsExp; + if( nullptr == pfnCreateMetricGroupsFromMetricsExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnCreateMetricGroupsFromMetricsExp( hDevice, metricCount, phMetrics, pMetricGroupNamePrefix, pDescription, pMetricGroupCount, phMetricGroup ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetMetricGroupCreateExp + __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 + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnCreateExp = dditable->MetricGroupExp->pfnCreateExp; + if( nullptr == pfnCreateExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnCreateExp( hDevice, pName, pDescription, samplingType, phMetricGroup ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetMetricGroupAddMetricExp + __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. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_9) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnAddMetricExp = dditable->MetricGroupExp->pfnAddMetricExp; + if( nullptr == pfnAddMetricExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnAddMetricExp( hMetricGroup, hMetric, pErrorStringSize, pErrorString ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @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; + + // extract handle's function pointer table + 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_9) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnRemoveMetricExp = dditable->MetricGroupExp->pfnRemoveMetricExp; + if( nullptr == pfnRemoveMetricExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // 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 handle's function pointer table + 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_9) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnCloseExp = dditable->MetricGroupExp->pfnCloseExp; + if( nullptr == pfnCloseExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnCloseExp( hMetricGroup ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetMetricGroupDestroyExp + __zedlllocal ze_result_t ZE_APICALL + zetMetricGroupDestroyExp( + zet_metric_group_handle_t hMetricGroup ///< [in] Handle of the metric group to destroy + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + 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_9) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnDestroyExp = dditable->MetricGroupExp->pfnDestroyExp; + if( nullptr == pfnDestroyExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnDestroyExp( hMetricGroup ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zetMetricDestroyExp + __zedlllocal ze_result_t ZE_APICALL + 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( 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_9) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + auto pfnDestroyExp = dditable->MetricExp->pfnDestroyExp; + if( nullptr == pfnDestroyExp ) + return ZE_RESULT_ERROR_UNINITIALIZED; + // forward to device-driver + result = pfnDestroyExp( hMetric ); + return result; + } + + + /////////////////////////////////////////////////////////////////////////////// + /// @brief function for removing the ddi driver tables for zet + __zedlllocal void ZE_APICALL + zetDestroyDDiDriverTables(zet_dditable_driver_t* pDdiTable) + { + // Delete ddi tables + delete pDdiTable->MetricDecoderExp; + delete pDdiTable->MetricProgrammableExp; + delete pDdiTable->MetricTracerExp; + delete pDdiTable->Device; + delete pDdiTable->DeviceExp; + delete pDdiTable->Context; + delete pDdiTable->CommandList; + delete pDdiTable->CommandListExp; + delete pDdiTable->Kernel; + delete pDdiTable->Module; + delete pDdiTable->Debug; + delete pDdiTable->Metric; + delete pDdiTable->MetricExp; + delete pDdiTable->MetricGroup; + delete pDdiTable->MetricGroupExp; + delete pDdiTable->MetricQuery; + delete pDdiTable->MetricQueryPool; + delete pDdiTable->MetricStreamer; + delete pDdiTable->TracerExp; + delete pDdiTable; + } + +} // namespace loader_driver_ddi \ No newline at end of file diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 3238a24d..73c9fb93 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2024 Intel Corporation +# Copyright (C) 2024-2025 Intel Corporation # SPDX-License-Identifier: MIT add_executable( @@ -128,6 +128,208 @@ endif() add_test(NAME tests_sigle_driver_stdout COMMAND tests --gtest_filter=*GivenZeInitDriverWhenCalledThenNoOutputIsPrintedToStdout) set_property(TEST tests_sigle_driver_stdout PROPERTY ENVIRONMENT "ZE_ENABLE_NULL_DRIVER=1") +add_test(NAME tests_multi_driver_drivergetproperties_sort COMMAND tests --gtest_filter=*GivenLevelZeroLoaderPresentWithMultipleDriversWhenCallingDriverGetPropertiesThenExpectSuccess) +if (MSVC) + set_property(TEST tests_multi_driver_drivergetproperties_sort APPEND PROPERTY ENVIRONMENT "ZE_ENABLE_LOADER_DEBUG_TRACE=1;ZE_ENABLE_ALT_DRIVERS=${CMAKE_BINARY_DIR}/bin/$/ze_null_test1.dll,${CMAKE_BINARY_DIR}/bin/$/ze_null_test2.dll") +else() + set_property(TEST tests_multi_driver_drivergetproperties_sort APPEND PROPERTY ENVIRONMENT "ZE_ENABLE_LOADER_DEBUG_TRACE=1;ZE_ENABLE_ALT_DRIVERS=${CMAKE_BINARY_DIR}/lib/libze_null_test1.so,${CMAKE_BINARY_DIR}/lib/libze_null_test2.so") +endif() + +# Run with multiple drivers with one driver using legacy mode +add_test(NAME tests_multi_driver_missing_initDrivers_onelegacy COMMAND tests --gtest_filter=*GivenLevelZeroLoaderPresentWithMultipleDriversMissingInitDriversWhenCallingZeInitDriversThenExpectSuccessForZeInit) +if (MSVC) + set_property(TEST tests_multi_driver_missing_initDrivers_onelegacy PROPERTY ENVIRONMENT "ZE_ENABLE_LOADER_DRIVER_DDI_PATH=1;ZEL_TEST_NULL_DRIVER_DISABLE_DDI_EXT=1;ZE_ENABLE_LOADER_DEBUG_TRACE=1;ZE_ENABLE_ALT_DRIVERS=${CMAKE_BINARY_DIR}/bin/$/ze_null_test1.dll,${CMAKE_BINARY_DIR}/bin/$/ze_null_test2.dll") +else() + set_property(TEST tests_multi_driver_missing_initDrivers_onelegacy PROPERTY ENVIRONMENT "ZE_ENABLE_LOADER_DRIVER_DDI_PATH=1;ZEL_TEST_NULL_DRIVER_DISABLE_DDI_EXT=1;ZE_ENABLE_LOADER_DEBUG_TRACE=1;ZE_ENABLE_ALT_DRIVERS=${CMAKE_BINARY_DIR}/lib/libze_null_test1.so,${CMAKE_BINARY_DIR}/lib/libze_null_test2.so") +endif() + +add_test(NAME tests_multi_driver_missing_initDrivers_sort_after_error_onelegacy COMMAND tests --gtest_filter=*GivenLevelZeroLoaderPresentWithMultipleDriversMissingInitDriversWhenCallingZeInitDriversThenExpectSuccessForZeInitWithDriverGetAfterInitDrivers) +if (MSVC) + set_property(TEST tests_multi_driver_missing_initDrivers_sort_after_error_onelegacy APPEND PROPERTY ENVIRONMENT "ZE_ENABLE_LOADER_DRIVER_DDI_PATH=1;ZEL_TEST_NULL_DRIVER_DISABLE_DDI_EXT=1;ZE_ENABLE_LOADER_DEBUG_TRACE=1;ZE_ENABLE_ALT_DRIVERS=${CMAKE_BINARY_DIR}/bin/$/ze_null_test1.dll,${CMAKE_BINARY_DIR}/bin/$/ze_null_test2.dll") +else() + set_property(TEST tests_multi_driver_missing_initDrivers_sort_after_error_onelegacy APPEND PROPERTY ENVIRONMENT "ZE_ENABLE_LOADER_DRIVER_DDI_PATH=1;ZEL_TEST_NULL_DRIVER_DISABLE_DDI_EXT=1;ZE_ENABLE_LOADER_DEBUG_TRACE=1;ZE_ENABLE_ALT_DRIVERS=${CMAKE_BINARY_DIR}/lib/libze_null_test1.so,${CMAKE_BINARY_DIR}/lib/libze_null_test2.so") +endif() + +add_test(NAME tests_multi_driver_sort_onelegacy COMMAND tests --gtest_filter=*GivenLevelZeroLoaderPresentWithMultipleDriversWhenCallingZeInitDriversThenExpectSuccessForZeInit) +if (MSVC) + set_property(TEST tests_multi_driver_sort_onelegacy PROPERTY ENVIRONMENT "ZE_ENABLE_LOADER_DRIVER_DDI_PATH=1;ZEL_TEST_NULL_DRIVER_DISABLE_DDI_EXT=1;ZE_ENABLE_LOADER_DEBUG_TRACE=1;ZE_ENABLE_ALT_DRIVERS=${CMAKE_BINARY_DIR}/bin/$/ze_null_test1.dll,${CMAKE_BINARY_DIR}/bin/$/ze_null_test2.dll") +else() + set_property(TEST tests_multi_driver_sort_onelegacy PROPERTY ENVIRONMENT "ZE_ENABLE_LOADER_DRIVER_DDI_PATH=1;ZEL_TEST_NULL_DRIVER_DISABLE_DDI_EXT=1;ZE_ENABLE_LOADER_DEBUG_TRACE=1;ZE_ENABLE_ALT_DRIVERS=${CMAKE_BINARY_DIR}/lib/libze_null_test1.so,${CMAKE_BINARY_DIR}/lib/libze_null_test2.so") +endif() + +add_test(NAME tests_multi_driver_driverget_sort_onelegacy COMMAND tests --gtest_filter=*GivenLevelZeroLoaderPresentWithMultipleDriversWhenCallingZeInitThenZeInitDriversThenExpectSuccessForZeInitWithDriverGetAfterInitDrivers) +if (MSVC) + set_property(TEST tests_multi_driver_driverget_sort_onelegacy APPEND PROPERTY ENVIRONMENT "ZE_ENABLE_LOADER_DRIVER_DDI_PATH=1;ZEL_TEST_NULL_DRIVER_DISABLE_DDI_EXT=1;ZE_ENABLE_LOADER_DEBUG_TRACE=1;ZE_ENABLE_ALT_DRIVERS=${CMAKE_BINARY_DIR}/bin/$/ze_null_test1.dll,${CMAKE_BINARY_DIR}/bin/$/ze_null_test2.dll") +else() + set_property(TEST tests_multi_driver_driverget_sort_onelegacy APPEND PROPERTY ENVIRONMENT "ZE_ENABLE_LOADER_DRIVER_DDI_PATH=1;ZEL_TEST_NULL_DRIVER_DISABLE_DDI_EXT=1;ZE_ENABLE_LOADER_DEBUG_TRACE=1;ZE_ENABLE_ALT_DRIVERS=${CMAKE_BINARY_DIR}/lib/libze_null_test1.so,${CMAKE_BINARY_DIR}/lib/libze_null_test2.so") +endif() + +add_test(NAME tests_multi_driver_drivergetproperties_sort_onelegacy COMMAND tests --gtest_filter=*GivenLevelZeroLoaderPresentWithMultipleDriversWhenCallingDriverGetPropertiesThenExpectSuccess) +if (MSVC) + set_property(TEST tests_multi_driver_drivergetproperties_sort_onelegacy APPEND PROPERTY ENVIRONMENT "ZE_ENABLE_LOADER_DRIVER_DDI_PATH=1;ZEL_TEST_NULL_DRIVER_DISABLE_DDI_EXT=1;ZE_ENABLE_LOADER_DEBUG_TRACE=1;ZE_ENABLE_ALT_DRIVERS=${CMAKE_BINARY_DIR}/bin/$/ze_null_test1.dll,${CMAKE_BINARY_DIR}/bin/$/ze_null_test2.dll") +else() + set_property(TEST tests_multi_driver_drivergetproperties_sort_onelegacy APPEND PROPERTY ENVIRONMENT "ZE_ENABLE_LOADER_DRIVER_DDI_PATH=1;ZEL_TEST_NULL_DRIVER_DISABLE_DDI_EXT=1;ZE_ENABLE_LOADER_DEBUG_TRACE=1;ZE_ENABLE_ALT_DRIVERS=${CMAKE_BINARY_DIR}/lib/libze_null_test1.so,${CMAKE_BINARY_DIR}/lib/libze_null_test2.so") +endif() + +# Run with multiple drivers with both drivers using legacy mode +add_test(NAME tests_multi_driver_missing_initDrivers_legacy COMMAND tests --gtest_filter=*GivenLevelZeroLoaderPresentWithMultipleDriversMissingInitDriversWhenCallingZeInitDriversThenExpectSuccessForZeInit) +if (MSVC) + set_property(TEST tests_multi_driver_missing_initDrivers_legacy PROPERTY ENVIRONMENT "ZE_ENABLE_LOADER_DRIVER_DDI_PATH=1;ZEL_TEST_NULL_DRIVER_DISABLE_DDI_EXT=3;ZE_ENABLE_LOADER_DEBUG_TRACE=1;ZE_ENABLE_ALT_DRIVERS=${CMAKE_BINARY_DIR}/bin/$/ze_null_test1.dll,${CMAKE_BINARY_DIR}/bin/$/ze_null_test2.dll") +else() + set_property(TEST tests_multi_driver_missing_initDrivers_legacy PROPERTY ENVIRONMENT "ZE_ENABLE_LOADER_DRIVER_DDI_PATH=1;ZEL_TEST_NULL_DRIVER_DISABLE_DDI_EXT=3;ZE_ENABLE_LOADER_DEBUG_TRACE=1;ZE_ENABLE_ALT_DRIVERS=${CMAKE_BINARY_DIR}/lib/libze_null_test1.so,${CMAKE_BINARY_DIR}/lib/libze_null_test2.so") +endif() + +add_test(NAME tests_multi_driver_missing_initDrivers_sort_after_error_legacy COMMAND tests --gtest_filter=*GivenLevelZeroLoaderPresentWithMultipleDriversMissingInitDriversWhenCallingZeInitDriversThenExpectSuccessForZeInitWithDriverGetAfterInitDrivers) +if (MSVC) + set_property(TEST tests_multi_driver_missing_initDrivers_sort_after_error_legacy APPEND PROPERTY ENVIRONMENT "ZE_ENABLE_LOADER_DRIVER_DDI_PATH=1;ZEL_TEST_NULL_DRIVER_DISABLE_DDI_EXT=3;ZE_ENABLE_LOADER_DEBUG_TRACE=1;ZE_ENABLE_ALT_DRIVERS=${CMAKE_BINARY_DIR}/bin/$/ze_null_test1.dll,${CMAKE_BINARY_DIR}/bin/$/ze_null_test2.dll") +else() + set_property(TEST tests_multi_driver_missing_initDrivers_sort_after_error_legacy APPEND PROPERTY ENVIRONMENT "ZE_ENABLE_LOADER_DRIVER_DDI_PATH=1;ZEL_TEST_NULL_DRIVER_DISABLE_DDI_EXT=3;ZE_ENABLE_LOADER_DEBUG_TRACE=1;ZE_ENABLE_ALT_DRIVERS=${CMAKE_BINARY_DIR}/lib/libze_null_test1.so,${CMAKE_BINARY_DIR}/lib/libze_null_test2.so") +endif() + +add_test(NAME tests_multi_driver_sort_legacy COMMAND tests --gtest_filter=*GivenLevelZeroLoaderPresentWithMultipleDriversWhenCallingZeInitDriversThenExpectSuccessForZeInit) +if (MSVC) + set_property(TEST tests_multi_driver_sort_legacy PROPERTY ENVIRONMENT "ZE_ENABLE_LOADER_DRIVER_DDI_PATH=1;ZEL_TEST_NULL_DRIVER_DISABLE_DDI_EXT=3;ZE_ENABLE_LOADER_DEBUG_TRACE=1;ZE_ENABLE_ALT_DRIVERS=${CMAKE_BINARY_DIR}/bin/$/ze_null_test1.dll,${CMAKE_BINARY_DIR}/bin/$/ze_null_test2.dll") +else() + set_property(TEST tests_multi_driver_sort_legacy PROPERTY ENVIRONMENT "ZE_ENABLE_LOADER_DRIVER_DDI_PATH=1;ZEL_TEST_NULL_DRIVER_DISABLE_DDI_EXT=3;ZE_ENABLE_LOADER_DEBUG_TRACE=1;ZE_ENABLE_ALT_DRIVERS=${CMAKE_BINARY_DIR}/lib/libze_null_test1.so,${CMAKE_BINARY_DIR}/lib/libze_null_test2.so") +endif() + +add_test(NAME tests_multi_driver_driverget_sort_legacy COMMAND tests --gtest_filter=*GivenLevelZeroLoaderPresentWithMultipleDriversWhenCallingZeInitThenZeInitDriversThenExpectSuccessForZeInitWithDriverGetAfterInitDrivers) +if (MSVC) + set_property(TEST tests_multi_driver_driverget_sort_legacy APPEND PROPERTY ENVIRONMENT "ZE_ENABLE_LOADER_DRIVER_DDI_PATH=1;ZEL_TEST_NULL_DRIVER_DISABLE_DDI_EXT=3;ZE_ENABLE_LOADER_DEBUG_TRACE=1;ZE_ENABLE_ALT_DRIVERS=${CMAKE_BINARY_DIR}/bin/$/ze_null_test1.dll,${CMAKE_BINARY_DIR}/bin/$/ze_null_test2.dll") +else() + set_property(TEST tests_multi_driver_driverget_sort_legacy APPEND PROPERTY ENVIRONMENT "ZE_ENABLE_LOADER_DRIVER_DDI_PATH=1;ZEL_TEST_NULL_DRIVER_DISABLE_DDI_EXT=3;ZE_ENABLE_LOADER_DEBUG_TRACE=1;ZE_ENABLE_ALT_DRIVERS=${CMAKE_BINARY_DIR}/lib/libze_null_test1.so,${CMAKE_BINARY_DIR}/lib/libze_null_test2.so") +endif() + +add_test(NAME tests_multi_driver_drivergetproperties_sort_legacy COMMAND tests --gtest_filter=*GivenLevelZeroLoaderPresentWithMultipleDriversWhenCallingDriverGetPropertiesThenExpectSuccess) +if (MSVC) + set_property(TEST tests_multi_driver_drivergetproperties_sort_legacy APPEND PROPERTY ENVIRONMENT "ZE_ENABLE_LOADER_DRIVER_DDI_PATH=1;ZEL_TEST_NULL_DRIVER_DISABLE_DDI_EXT=3;ZE_ENABLE_LOADER_DEBUG_TRACE=1;ZE_ENABLE_ALT_DRIVERS=${CMAKE_BINARY_DIR}/bin/$/ze_null_test1.dll,${CMAKE_BINARY_DIR}/bin/$/ze_null_test2.dll") +else() + set_property(TEST tests_multi_driver_drivergetproperties_sort_legacy APPEND PROPERTY ENVIRONMENT "ZE_ENABLE_LOADER_DRIVER_DDI_PATH=1;ZEL_TEST_NULL_DRIVER_DISABLE_DDI_EXT=3;ZE_ENABLE_LOADER_DEBUG_TRACE=1;ZE_ENABLE_ALT_DRIVERS=${CMAKE_BINARY_DIR}/lib/libze_null_test1.so,${CMAKE_BINARY_DIR}/lib/libze_null_test2.so") +endif() + +add_test(NAME tests_loader_translate_handles_module COMMAND tests --gtest_filter=*LoaderTranslateHandles.GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportDisabledThenExpectHandleTranslationForModule) +set_property(TEST tests_loader_translate_handles_module PROPERTY ENVIRONMENT "ZE_ENABLE_LOADER_DRIVER_DDI_PATH=1;ZE_ENABLE_LOADER_DEBUG_TRACE=1;ZE_ENABLE_NULL_DRIVER=1") + +add_test(NAME tests_loader_translate_handles_module_ddi_enabled COMMAND tests --gtest_filter=*LoaderTranslateHandles.GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportEnabledThenExpectNoHandleTranslationForModule) +set_property(TEST tests_loader_translate_handles_module_ddi_enabled PROPERTY ENVIRONMENT "ZE_ENABLE_LOADER_DRIVER_DDI_PATH=1;ZE_ENABLE_LOADER_DEBUG_TRACE=1;ZE_ENABLE_NULL_DRIVER=1") + +add_test(NAME tests_loader_translate_handles_module_build_log COMMAND tests --gtest_filter=*LoaderTranslateHandles.GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportDisabledThenExpectHandleTranslationForModuleBuildLog) +set_property(TEST tests_loader_translate_handles_module_build_log PROPERTY ENVIRONMENT "ZE_ENABLE_LOADER_DRIVER_DDI_PATH=1;ZE_ENABLE_LOADER_DEBUG_TRACE=1;ZE_ENABLE_NULL_DRIVER=1") + +add_test(NAME tests_loader_translate_handles_module_build_log_ddi_enabled COMMAND tests --gtest_filter=*LoaderTranslateHandles.GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportEnabledThenExpectNoHandleTranslationForModuleBuildLog) +set_property(TEST tests_loader_translate_handles_module_build_log_ddi_enabled PROPERTY ENVIRONMENT "ZE_ENABLE_LOADER_DRIVER_DDI_PATH=1;ZE_ENABLE_LOADER_DEBUG_TRACE=1;ZE_ENABLE_NULL_DRIVER=1") + +add_test(NAME tests_loader_translate_handles_kernel COMMAND tests --gtest_filter=*LoaderTranslateHandles.GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportDisabledThenExpectHandleTranslationForKernel) +set_property(TEST tests_loader_translate_handles_kernel PROPERTY ENVIRONMENT "ZE_ENABLE_LOADER_DRIVER_DDI_PATH=1;ZE_ENABLE_LOADER_DEBUG_TRACE=1;ZE_ENABLE_NULL_DRIVER=1") + +add_test(NAME tests_loader_translate_handles_kernel_ddi_enabled COMMAND tests --gtest_filter=*LoaderTranslateHandles.GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportEnabledThenExpectNoHandleTranslationForKernel) +set_property(TEST tests_loader_translate_handles_kernel_ddi_enabled PROPERTY ENVIRONMENT "ZE_ENABLE_LOADER_DRIVER_DDI_PATH=1;ZE_ENABLE_LOADER_DEBUG_TRACE=1;ZE_ENABLE_NULL_DRIVER=1") + +add_test(NAME tests_loader_translate_handles_sampler COMMAND tests --gtest_filter=*LoaderTranslateHandles.GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportDisabledThenExpectHandleTranslationForSampler) +set_property(TEST tests_loader_translate_handles_sampler PROPERTY ENVIRONMENT "ZE_ENABLE_LOADER_DRIVER_DDI_PATH=1;ZE_ENABLE_LOADER_DEBUG_TRACE=1;ZE_ENABLE_NULL_DRIVER=1") + +add_test(NAME tests_loader_translate_handles_sampler_ddi_enabled COMMAND tests --gtest_filter=*LoaderTranslateHandles.GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportEnabledThenExpectNoHandleTranslationForSampler) +set_property(TEST tests_loader_translate_handles_sampler_ddi_enabled PROPERTY ENVIRONMENT "ZE_ENABLE_LOADER_DRIVER_DDI_PATH=1;ZE_ENABLE_LOADER_DEBUG_TRACE=1;ZE_ENABLE_NULL_DRIVER=1") + +add_test(NAME tests_loader_translate_handles_physical_mem COMMAND tests --gtest_filter=*LoaderTranslateHandles.GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportDisabledThenExpectHandleTranslationForPhysicalMem) +set_property(TEST tests_loader_translate_handles_physical_mem PROPERTY ENVIRONMENT "ZE_ENABLE_LOADER_DRIVER_DDI_PATH=1;ZE_ENABLE_LOADER_DEBUG_TRACE=1;ZE_ENABLE_NULL_DRIVER=1") + +add_test(NAME tests_loader_translate_handles_physical_mem_ddi_enabled COMMAND tests --gtest_filter=*LoaderTranslateHandles.GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportEnabledThenExpectNoHandleTranslationForPhysicalMem) +set_property(TEST tests_loader_translate_handles_physical_mem_ddi_enabled PROPERTY ENVIRONMENT "ZE_ENABLE_LOADER_DRIVER_DDI_PATH=1;ZE_ENABLE_LOADER_DEBUG_TRACE=1;ZE_ENABLE_NULL_DRIVER=1") + +add_test(NAME tests_loader_translate_handles_fence COMMAND tests --gtest_filter=*LoaderTranslateHandles.GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportDisabledThenExpectHandleTranslationForFence) +set_property(TEST tests_loader_translate_handles_fence PROPERTY ENVIRONMENT "ZE_ENABLE_LOADER_DRIVER_DDI_PATH=1;ZE_ENABLE_LOADER_DEBUG_TRACE=1;ZE_ENABLE_NULL_DRIVER=1") + +add_test(NAME tests_loader_translate_handles_fence_ddi_enabled COMMAND tests --gtest_filter=*LoaderTranslateHandles.GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportEnabledThenExpectNoHandleTranslationForFence) +set_property(TEST tests_loader_translate_handles_fence_ddi_enabled PROPERTY ENVIRONMENT "ZE_ENABLE_LOADER_DRIVER_DDI_PATH=1;ZE_ENABLE_LOADER_DEBUG_TRACE=1;ZE_ENABLE_NULL_DRIVER=1") + +add_test(NAME tests_loader_translate_handles_event_pool COMMAND tests --gtest_filter=*LoaderTranslateHandles.GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportDisabledThenExpectHandleTranslationForEventPool) +set_property(TEST tests_loader_translate_handles_event_pool PROPERTY ENVIRONMENT "ZE_ENABLE_LOADER_DRIVER_DDI_PATH=1;ZE_ENABLE_LOADER_DEBUG_TRACE=1;ZE_ENABLE_NULL_DRIVER=1") + +add_test(NAME tests_loader_translate_handles_event_pool_ddi_enabled COMMAND tests --gtest_filter=*LoaderTranslateHandles.GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportEnabledThenExpectNoHandleTranslationForEventPool) +set_property(TEST tests_loader_translate_handles_event_pool_ddi_enabled PROPERTY ENVIRONMENT "ZE_ENABLE_LOADER_DRIVER_DDI_PATH=1;ZE_ENABLE_LOADER_DEBUG_TRACE=1;ZE_ENABLE_NULL_DRIVER=1") + +add_test(NAME tests_loader_translate_handles_image COMMAND tests --gtest_filter=*LoaderTranslateHandles.GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportDisabledThenExpectHandleTranslationForImage) +set_property(TEST tests_loader_translate_handles_image PROPERTY ENVIRONMENT "ZE_ENABLE_LOADER_DRIVER_DDI_PATH=1;ZE_ENABLE_LOADER_DEBUG_TRACE=1;ZE_ENABLE_NULL_DRIVER=1") + +add_test(NAME tests_loader_translate_handles_image_ddi_enabled COMMAND tests --gtest_filter=*LoaderTranslateHandles.GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportEnabledThenExpectNoHandleTranslationForImage) +set_property(TEST tests_loader_translate_handles_image_ddi_enabled PROPERTY ENVIRONMENT "ZE_ENABLE_LOADER_DRIVER_DDI_PATH=1;ZE_ENABLE_LOADER_DEBUG_TRACE=1;ZE_ENABLE_NULL_DRIVER=1") + +add_test(NAME tests_loader_translate_handles_context COMMAND tests --gtest_filter=*LoaderTranslateHandles.GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportDisabledThenExpectHandleTranslationForContext) +set_property(TEST tests_loader_translate_handles_context PROPERTY ENVIRONMENT "ZE_ENABLE_LOADER_DRIVER_DDI_PATH=1;ZE_ENABLE_LOADER_DEBUG_TRACE=1;ZE_ENABLE_NULL_DRIVER=1") + +add_test(NAME tests_loader_translate_handles_context_ddi_enabled COMMAND tests --gtest_filter=*LoaderTranslateHandles.GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportEnabledThenExpectNoHandleTranslationForContext) +set_property(TEST tests_loader_translate_handles_context_ddi_enabled PROPERTY ENVIRONMENT "ZE_ENABLE_LOADER_DRIVER_DDI_PATH=1;ZE_ENABLE_LOADER_DEBUG_TRACE=1;ZE_ENABLE_NULL_DRIVER=1") + +add_test(NAME tests_loader_translate_handles_command_queue COMMAND tests --gtest_filter=*LoaderTranslateHandles.GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportDisabledThenExpectHandleTranslationForCommandQueue) +set_property(TEST tests_loader_translate_handles_command_queue PROPERTY ENVIRONMENT "ZE_ENABLE_LOADER_DRIVER_DDI_PATH=1;ZE_ENABLE_LOADER_DEBUG_TRACE=1;ZE_ENABLE_NULL_DRIVER=1") + +add_test(NAME tests_loader_translate_handles_command_queue_ddi_enabled COMMAND tests --gtest_filter=*LoaderTranslateHandles.GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportEnabledThenExpectNoHandleTranslationForCommandQueue) +set_property(TEST tests_loader_translate_handles_command_queue_ddi_enabled PROPERTY ENVIRONMENT "ZE_ENABLE_LOADER_DRIVER_DDI_PATH=1;ZE_ENABLE_LOADER_DEBUG_TRACE=1;ZE_ENABLE_NULL_DRIVER=1") + +add_test(NAME tests_loader_translate_handles_command_list COMMAND tests --gtest_filter=*LoaderTranslateHandles.GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportDisabledThenExpectHandleTranslationForCommandList) +set_property(TEST tests_loader_translate_handles_command_list PROPERTY ENVIRONMENT "ZE_ENABLE_LOADER_DRIVER_DDI_PATH=1;ZE_ENABLE_LOADER_DEBUG_TRACE=1;ZE_ENABLE_NULL_DRIVER=1") + +add_test(NAME tests_loader_translate_handles_command_list_ddi_enabled COMMAND tests --gtest_filter=*LoaderTranslateHandles.GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportEnabledThenExpectNoHandleTranslationForCommandList) +set_property(TEST tests_loader_translate_handles_command_list_ddi_enabled PROPERTY ENVIRONMENT "ZE_ENABLE_LOADER_DRIVER_DDI_PATH=1;ZE_ENABLE_LOADER_DEBUG_TRACE=1;ZE_ENABLE_NULL_DRIVER=1") + +add_test(NAME tests_loader_translate_handles_event COMMAND tests --gtest_filter=*LoaderTranslateHandles.GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportDisabledThenExpectHandleTranslationForEvent) +set_property(TEST tests_loader_translate_handles_event PROPERTY ENVIRONMENT "ZE_ENABLE_LOADER_DRIVER_DDI_PATH=1;ZE_ENABLE_LOADER_DEBUG_TRACE=1;ZE_ENABLE_NULL_DRIVER=1") + +add_test(NAME tests_loader_translate_handles_event_ddi_enabled COMMAND tests --gtest_filter=*LoaderTranslateHandles.GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportEnabledThenExpectNoHandleTranslationForEvent) +set_property(TEST tests_loader_translate_handles_event_ddi_enabled PROPERTY ENVIRONMENT "ZE_ENABLE_LOADER_DRIVER_DDI_PATH=1;ZE_ENABLE_LOADER_DEBUG_TRACE=1;ZE_ENABLE_NULL_DRIVER=1") + +add_test(NAME tests_loader_translate_handles_driver COMMAND tests --gtest_filter=*LoaderTranslateHandles.GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportDisabledThenExpectHandleTranslationForDriver) +set_property(TEST tests_loader_translate_handles_driver PROPERTY ENVIRONMENT "ZE_ENABLE_LOADER_DRIVER_DDI_PATH=1;ZE_ENABLE_LOADER_DEBUG_TRACE=1;ZE_ENABLE_NULL_DRIVER=1") + +add_test(NAME tests_loader_translate_handles_driver_ddi_enabled COMMAND tests --gtest_filter=*LoaderTranslateHandles.GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportEnabledThenExpectNoHandleTranslationForDriver) +set_property(TEST tests_loader_translate_handles_driver_ddi_enabled PROPERTY ENVIRONMENT "ZE_ENABLE_LOADER_DRIVER_DDI_PATH=1;ZE_ENABLE_LOADER_DEBUG_TRACE=1;ZE_ENABLE_NULL_DRIVER=1") + +add_test(NAME tests_loader_translate_handles_device COMMAND tests --gtest_filter=*LoaderTranslateHandles.GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportDisabledThenExpectHandleTranslationForDevice) +set_property(TEST tests_loader_translate_handles_device PROPERTY ENVIRONMENT "ZE_ENABLE_LOADER_DRIVER_DDI_PATH=1;ZE_ENABLE_LOADER_DEBUG_TRACE=1;ZE_ENABLE_NULL_DRIVER=1") + +add_test(NAME tests_loader_translate_handles_device_ddi_enabled COMMAND tests --gtest_filter=*LoaderTranslateHandles.GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportEnabledThenExpectNoHandleTranslationForDevice) +set_property(TEST tests_loader_translate_handles_device_ddi_enabled PROPERTY ENVIRONMENT "ZE_ENABLE_LOADER_DRIVER_DDI_PATH=1;ZE_ENABLE_LOADER_DEBUG_TRACE=1;ZE_ENABLE_NULL_DRIVER=1") + +# Add new versions of the tests with ZE_ENABLE_ALT_DRIVERS for Linux and Windows with both null drivers +if (MSVC) + set(ALT_DRIVERS_ENV "ZE_ENABLE_LOADER_DRIVER_DDI_PATH=1;ZE_ENABLE_ALT_DRIVERS=${CMAKE_BINARY_DIR}/bin/$/ze_null_test1.dll,${CMAKE_BINARY_DIR}/bin/$/ze_null_test2.dll") +else() + set(ALT_DRIVERS_ENV "ZE_ENABLE_LOADER_DRIVER_DDI_PATH=1;ZE_ENABLE_ALT_DRIVERS=${CMAKE_BINARY_DIR}/lib/libze_null_test1.so,${CMAKE_BINARY_DIR}/lib/libze_null_test2.so") +endif() + +foreach(test_name IN ITEMS + LoaderTranslateHandles.GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportDisabledThenExpectHandleTranslationForModule + LoaderTranslateHandles.GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportEnabledThenExpectNoHandleTranslationForModule + LoaderTranslateHandles.GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportDisabledThenExpectHandleTranslationForModuleBuildLog + LoaderTranslateHandles.GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportEnabledThenExpectNoHandleTranslationForModuleBuildLog + LoaderTranslateHandles.GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportDisabledThenExpectHandleTranslationForKernel + LoaderTranslateHandles.GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportEnabledThenExpectNoHandleTranslationForKernel + LoaderTranslateHandles.GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportDisabledThenExpectHandleTranslationForSampler + LoaderTranslateHandles.GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportEnabledThenExpectNoHandleTranslationForSampler + LoaderTranslateHandles.GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportDisabledThenExpectHandleTranslationForPhysicalMem + LoaderTranslateHandles.GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportEnabledThenExpectNoHandleTranslationForPhysicalMem + LoaderTranslateHandles.GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportDisabledThenExpectHandleTranslationForFence + LoaderTranslateHandles.GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportEnabledThenExpectNoHandleTranslationForFence + LoaderTranslateHandles.GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportDisabledThenExpectHandleTranslationForEventPool + LoaderTranslateHandles.GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportEnabledThenExpectNoHandleTranslationForEventPool + LoaderTranslateHandles.GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportDisabledThenExpectHandleTranslationForImage + LoaderTranslateHandles.GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportEnabledThenExpectNoHandleTranslationForImage + LoaderTranslateHandles.GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportDisabledThenExpectHandleTranslationForContext + LoaderTranslateHandles.GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportEnabledThenExpectNoHandleTranslationForContext + LoaderTranslateHandles.GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportDisabledThenExpectHandleTranslationForCommandQueue + LoaderTranslateHandles.GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportEnabledThenExpectNoHandleTranslationForCommandQueue + LoaderTranslateHandles.GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportDisabledThenExpectHandleTranslationForCommandList + LoaderTranslateHandles.GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportEnabledThenExpectNoHandleTranslationForCommandList + LoaderTranslateHandles.GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportDisabledThenExpectHandleTranslationForEvent + LoaderTranslateHandles.GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportEnabledThenExpectNoHandleTranslationForEvent + LoaderTranslateHandles.GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportDisabledThenExpectHandleTranslationForDriver + LoaderTranslateHandles.GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportEnabledThenExpectNoHandleTranslationForDriver + LoaderTranslateHandles.GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportDisabledThenExpectHandleTranslationForDevice + LoaderTranslateHandles.GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportEnabledThenExpectNoHandleTranslationForDevice) + add_test(NAME ${test_name}_alt_drivers COMMAND tests --gtest_filter=*${test_name}) + set_property(TEST ${test_name}_alt_drivers APPEND PROPERTY ENVIRONMENT "ZE_ENABLE_LOADER_DEBUG_TRACE=1;ZE_ENABLE_NULL_DRIVER=1;${ALT_DRIVERS_ENV}") +endforeach() # These tests are currently not supported on Windows. The reason is that the std::cerr is not being redirected to a pipe in Windows to be then checked against the expected output. if(NOT MSVC) add_test(NAME tests_event_deadlock COMMAND tests --gtest_filter=*GivenLevelZeroLoaderPresentWhenCallingzeCommandListAppendMemoryCopyWithCircularDependencyOnEventsThenValidationLayerPrintsWarningOfDeadlock*) diff --git a/test/loader_api.cpp b/test/loader_api.cpp index 5ed18f0f..fe9835f5 100644 --- a/test/loader_api.cpp +++ b/test/loader_api.cpp @@ -1,6 +1,6 @@ /* * - * Copyright (C) 2024 Intel Corporation + * Copyright (C) 2024-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -443,4 +443,1140 @@ TEST( EXPECT_TRUE(output.empty()); } +TEST( + LoaderInit, + GivenLevelZeroLoaderPresentWithMultipleDriversWhenCallingDriverGetPropertiesThenExpectSuccess) { + + uint32_t pInitDriversCount = 0; + uint32_t pDriverGetCount = 0; + ze_init_driver_type_desc_t desc = {ZE_STRUCTURE_TYPE_INIT_DRIVER_TYPE_DESC}; + desc.flags = UINT32_MAX; + desc.pNext = nullptr; + EXPECT_EQ(ZE_RESULT_SUCCESS, zeInit(0)); + EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, nullptr, &desc)); + EXPECT_GT(pInitDriversCount, 0); + EXPECT_EQ(ZE_RESULT_SUCCESS, zeDriverGet(&pDriverGetCount, nullptr)); + EXPECT_GT(pDriverGetCount, 0); + std::vector drivers(pInitDriversCount); + EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, drivers.data(), &desc)); + for (uint32_t i = 0; i < pDriverGetCount; ++i) { + ze_driver_properties_t driverProperties = {ZE_STRUCTURE_TYPE_DRIVER_PROPERTIES}; + EXPECT_EQ(ZE_RESULT_SUCCESS, zeDriverGetProperties(drivers[i], &driverProperties)); + std::cout << "Driver " << i << " properties:" << std::endl; + std::cout << " Driver version: " << driverProperties.driverVersion << std::endl; + std::cout << " UUID: "; + for (auto byte : driverProperties.uuid.id) { + std::cout << std::hex << static_cast(byte); + } + std::cout << std::dec << std::endl; + } +} + +TEST( + LoaderTranslateHandles, + GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportDisabledThenExpectHandleTranslationForModule) { + +uint32_t pInitDriversCount = 0; +ze_init_driver_type_desc_t desc = {ZE_STRUCTURE_TYPE_INIT_DRIVER_TYPE_DESC}; +desc.flags = UINT32_MAX; +desc.pNext = nullptr; +putenv_safe( const_cast( "ZE_ENABLE_LOADER_INTERCEPT=1" ) ); +putenv_safe( const_cast( "ZEL_TEST_NULL_DRIVER_DISABLE_DDI_EXT=1" ) ); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, nullptr, &desc)); +EXPECT_GT(pInitDriversCount, 0); +std::vector drivers(pInitDriversCount); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, drivers.data(), &desc)); +ze_driver_ddi_handles_ext_properties_t driverDdiHandlesExtProperties = {}; +driverDdiHandlesExtProperties.stype = ZE_STRUCTURE_TYPE_DRIVER_DDI_HANDLES_EXT_PROPERTIES; +driverDdiHandlesExtProperties.pNext = nullptr; +ze_driver_properties_t properties = {}; +properties.stype = ZE_STRUCTURE_TYPE_DRIVER_PROPERTIES; +properties.pNext = &driverDdiHandlesExtProperties; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDriverGetProperties(drivers[0], &properties)); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, drivers.data(), &desc)); +ze_context_handle_t context; +ze_context_desc_t contextDesc = {ZE_STRUCTURE_TYPE_CONTEXT_DESC}; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeContextCreate(drivers[0], &contextDesc, &context)); +uint32_t deviceCount = 0; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDeviceGet(drivers[0], &deviceCount, nullptr)); +std::vector devices(deviceCount); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDeviceGet(drivers[0], &deviceCount, devices.data())); +ze_module_handle_t module; +ze_module_desc_t moduleDesc = {ZE_STRUCTURE_TYPE_MODULE_DESC}; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeModuleCreate(context, devices[0], &moduleDesc, &module, nullptr)); +ze_module_handle_t translatedHandle = module; +EXPECT_EQ(ZE_RESULT_SUCCESS, zelLoaderTranslateHandle(ZEL_HANDLE_MODULE, module, reinterpret_cast(&translatedHandle))); +EXPECT_NE(translatedHandle, module); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeModuleDestroy(module)); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeContextDestroy(context)); + +} + +TEST( + LoaderTranslateHandles, + GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportEnabledThenExpectNoHandleTranslationForModule) { + +uint32_t pInitDriversCount = 0; +ze_init_driver_type_desc_t desc = {ZE_STRUCTURE_TYPE_INIT_DRIVER_TYPE_DESC}; +desc.flags = UINT32_MAX; +desc.pNext = nullptr; +putenv_safe( const_cast( "ZE_ENABLE_LOADER_INTERCEPT=1" ) ); +putenv_safe( const_cast( "ZEL_TEST_NULL_DRIVER_DISABLE_DDI_EXT=0" ) ); +std::vector drivers; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, nullptr, &desc)); +drivers.resize(pInitDriversCount); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, drivers.data(), &desc)); +EXPECT_GT(pInitDriversCount, 0); +ze_driver_ddi_handles_ext_properties_t driverDdiHandlesExtProperties = {}; +driverDdiHandlesExtProperties.stype = ZE_STRUCTURE_TYPE_DRIVER_DDI_HANDLES_EXT_PROPERTIES; +driverDdiHandlesExtProperties.pNext = nullptr; +ze_driver_properties_t properties = {}; +properties.stype = ZE_STRUCTURE_TYPE_DRIVER_PROPERTIES; +properties.pNext = &driverDdiHandlesExtProperties; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDriverGetProperties(drivers[0], &properties)); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, drivers.data(), &desc)); +ze_context_handle_t context; +ze_context_desc_t contextDesc = {ZE_STRUCTURE_TYPE_CONTEXT_DESC}; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeContextCreate(drivers[0], &contextDesc, &context)); +uint32_t deviceCount = 0; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDeviceGet(drivers[0], &deviceCount, nullptr)); +std::vector devices(deviceCount); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDeviceGet(drivers[0], &deviceCount, devices.data())); +ze_module_handle_t module; +ze_module_desc_t moduleDesc = {ZE_STRUCTURE_TYPE_MODULE_DESC}; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeModuleCreate(context, devices[0], &moduleDesc, &module, nullptr)); +ze_module_handle_t translatedHandle = module; +EXPECT_EQ(ZE_RESULT_SUCCESS, zelLoaderTranslateHandle(ZEL_HANDLE_MODULE, module, reinterpret_cast(&translatedHandle))); +EXPECT_EQ(translatedHandle, module); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeModuleDestroy(module)); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeContextDestroy(context)); + +} + +TEST( + LoaderTranslateHandles, + GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportDisabledThenExpectHandleTranslationForModuleBuildLog) { + +uint32_t pInitDriversCount = 0; +ze_init_driver_type_desc_t desc = {ZE_STRUCTURE_TYPE_INIT_DRIVER_TYPE_DESC}; +desc.flags = UINT32_MAX; +desc.pNext = nullptr; +putenv_safe( const_cast( "ZE_ENABLE_LOADER_INTERCEPT=1" ) ); +putenv_safe( const_cast( "ZEL_TEST_NULL_DRIVER_DISABLE_DDI_EXT=1" ) ); +std::vector drivers; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, nullptr, &desc)); +drivers.resize(pInitDriversCount); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, drivers.data(), &desc)); +EXPECT_GT(pInitDriversCount, 0); +ze_driver_ddi_handles_ext_properties_t driverDdiHandlesExtProperties = {}; +driverDdiHandlesExtProperties.stype = ZE_STRUCTURE_TYPE_DRIVER_DDI_HANDLES_EXT_PROPERTIES; +driverDdiHandlesExtProperties.pNext = nullptr; +ze_driver_properties_t properties = {}; +properties.stype = ZE_STRUCTURE_TYPE_DRIVER_PROPERTIES; +properties.pNext = &driverDdiHandlesExtProperties; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDriverGetProperties(drivers[0], &properties)); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, drivers.data(), &desc)); +ze_context_handle_t context; +ze_context_desc_t contextDesc = {ZE_STRUCTURE_TYPE_CONTEXT_DESC}; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeContextCreate(drivers[0], &contextDesc, &context)); +uint32_t deviceCount = 0; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDeviceGet(drivers[0], &deviceCount, nullptr)); +std::vector devices(deviceCount); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDeviceGet(drivers[0], &deviceCount, devices.data())); +ze_module_handle_t module; +ze_module_desc_t moduleDesc = {ZE_STRUCTURE_TYPE_MODULE_DESC}; +ze_module_build_log_handle_t buildLog; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeModuleCreate(context, devices[0], &moduleDesc, &module, &buildLog)); +ze_module_build_log_handle_t translatedHandle = buildLog; +EXPECT_EQ(ZE_RESULT_SUCCESS, zelLoaderTranslateHandle(ZEL_HANDLE_MODULE_BUILD_LOG, buildLog, reinterpret_cast(&translatedHandle))); +EXPECT_NE(translatedHandle, buildLog); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeModuleBuildLogDestroy(buildLog)); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeModuleDestroy(module)); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeContextDestroy(context)); + +} + +TEST( + LoaderTranslateHandles, + GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportEnabledThenExpectNoHandleTranslationForModuleBuildLog) { + +uint32_t pInitDriversCount = 0; +ze_init_driver_type_desc_t desc = {ZE_STRUCTURE_TYPE_INIT_DRIVER_TYPE_DESC}; +desc.flags = UINT32_MAX; +desc.pNext = nullptr; +putenv_safe( const_cast( "ZE_ENABLE_LOADER_INTERCEPT=1" ) ); +putenv_safe( const_cast( "ZEL_TEST_NULL_DRIVER_DISABLE_DDI_EXT=0" ) ); +std::vector drivers; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, nullptr, &desc)); +drivers.resize(pInitDriversCount); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, drivers.data(), &desc)); +EXPECT_GT(pInitDriversCount, 0); +ze_driver_ddi_handles_ext_properties_t driverDdiHandlesExtProperties = {}; +driverDdiHandlesExtProperties.stype = ZE_STRUCTURE_TYPE_DRIVER_DDI_HANDLES_EXT_PROPERTIES; +driverDdiHandlesExtProperties.pNext = nullptr; +ze_driver_properties_t properties = {}; +properties.stype = ZE_STRUCTURE_TYPE_DRIVER_PROPERTIES; +properties.pNext = &driverDdiHandlesExtProperties; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDriverGetProperties(drivers[0], &properties)); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, drivers.data(), &desc)); +ze_context_handle_t context; +ze_context_desc_t contextDesc = {ZE_STRUCTURE_TYPE_CONTEXT_DESC}; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeContextCreate(drivers[0], &contextDesc, &context)); +uint32_t deviceCount = 0; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDeviceGet(drivers[0], &deviceCount, nullptr)); +std::vector devices(deviceCount); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDeviceGet(drivers[0], &deviceCount, devices.data())); +ze_module_handle_t module; +ze_module_desc_t moduleDesc = {ZE_STRUCTURE_TYPE_MODULE_DESC}; +ze_module_build_log_handle_t buildLog; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeModuleCreate(context, devices[0], &moduleDesc, &module, &buildLog)); +ze_module_build_log_handle_t translatedHandle = buildLog; +EXPECT_EQ(ZE_RESULT_SUCCESS, zelLoaderTranslateHandle(ZEL_HANDLE_MODULE_BUILD_LOG, buildLog, reinterpret_cast(&translatedHandle))); +EXPECT_EQ(translatedHandle, buildLog); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeModuleBuildLogDestroy(buildLog)); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeModuleDestroy(module)); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeContextDestroy(context)); + +} + +TEST( + LoaderTranslateHandles, + GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportDisabledThenExpectHandleTranslationForKernel) { + +uint32_t pInitDriversCount = 0; +ze_init_driver_type_desc_t desc = {ZE_STRUCTURE_TYPE_INIT_DRIVER_TYPE_DESC}; +desc.flags = UINT32_MAX; +desc.pNext = nullptr; +putenv_safe( const_cast( "ZE_ENABLE_LOADER_INTERCEPT=1" ) ); +putenv_safe( const_cast( "ZEL_TEST_NULL_DRIVER_DISABLE_DDI_EXT=1" ) ); +std::vector drivers; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, nullptr, &desc)); +drivers.resize(pInitDriversCount); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, drivers.data(), &desc)); +EXPECT_GT(pInitDriversCount, 0); +ze_driver_ddi_handles_ext_properties_t driverDdiHandlesExtProperties = {}; +driverDdiHandlesExtProperties.stype = ZE_STRUCTURE_TYPE_DRIVER_DDI_HANDLES_EXT_PROPERTIES; +driverDdiHandlesExtProperties.pNext = nullptr; +ze_driver_properties_t properties = {}; +properties.stype = ZE_STRUCTURE_TYPE_DRIVER_PROPERTIES; +properties.pNext = &driverDdiHandlesExtProperties; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDriverGetProperties(drivers[0], &properties)); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, drivers.data(), &desc)); +ze_context_handle_t context; +ze_context_desc_t contextDesc = {ZE_STRUCTURE_TYPE_CONTEXT_DESC}; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeContextCreate(drivers[0], &contextDesc, &context)); +uint32_t deviceCount = 0; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDeviceGet(drivers[0], &deviceCount, nullptr)); +std::vector devices(deviceCount); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDeviceGet(drivers[0], &deviceCount, devices.data())); +ze_module_handle_t module; +ze_module_desc_t moduleDesc = {ZE_STRUCTURE_TYPE_MODULE_DESC}; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeModuleCreate(context, devices[0], &moduleDesc, &module, nullptr)); +ze_kernel_handle_t kernel; +ze_kernel_desc_t kernelDesc = {ZE_STRUCTURE_TYPE_KERNEL_DESC}; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeKernelCreate(module, &kernelDesc, &kernel)); +ze_kernel_handle_t translatedHandle = kernel; +EXPECT_EQ(ZE_RESULT_SUCCESS, zelLoaderTranslateHandle(ZEL_HANDLE_KERNEL, kernel, reinterpret_cast(&translatedHandle))); +EXPECT_NE(translatedHandle, kernel); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeKernelDestroy(kernel)); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeModuleDestroy(module)); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeContextDestroy(context)); + +} + +TEST( + LoaderTranslateHandles, + GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportEnabledThenExpectNoHandleTranslationForKernel) { + +uint32_t pInitDriversCount = 0; +ze_init_driver_type_desc_t desc = {ZE_STRUCTURE_TYPE_INIT_DRIVER_TYPE_DESC}; +desc.flags = UINT32_MAX; +desc.pNext = nullptr; +putenv_safe( const_cast( "ZE_ENABLE_LOADER_INTERCEPT=1" ) ); +putenv_safe( const_cast( "ZEL_TEST_NULL_DRIVER_DISABLE_DDI_EXT=0" ) ); +std::vector drivers; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, nullptr, &desc)); +drivers.resize(pInitDriversCount); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, drivers.data(), &desc)); +EXPECT_GT(pInitDriversCount, 0); +ze_driver_ddi_handles_ext_properties_t driverDdiHandlesExtProperties = {}; +driverDdiHandlesExtProperties.stype = ZE_STRUCTURE_TYPE_DRIVER_DDI_HANDLES_EXT_PROPERTIES; +driverDdiHandlesExtProperties.pNext = nullptr; +ze_driver_properties_t properties = {}; +properties.stype = ZE_STRUCTURE_TYPE_DRIVER_PROPERTIES; +properties.pNext = &driverDdiHandlesExtProperties; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDriverGetProperties(drivers[0], &properties)); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, drivers.data(), &desc)); +ze_context_handle_t context; +ze_context_desc_t contextDesc = {ZE_STRUCTURE_TYPE_CONTEXT_DESC}; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeContextCreate(drivers[0], &contextDesc, &context)); +uint32_t deviceCount = 0; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDeviceGet(drivers[0], &deviceCount, nullptr)); +std::vector devices(deviceCount); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDeviceGet(drivers[0], &deviceCount, devices.data())); +ze_module_handle_t module; +ze_module_desc_t moduleDesc = {ZE_STRUCTURE_TYPE_MODULE_DESC}; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeModuleCreate(context, devices[0], &moduleDesc, &module, nullptr)); +ze_kernel_handle_t kernel; +ze_kernel_desc_t kernelDesc = {ZE_STRUCTURE_TYPE_KERNEL_DESC}; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeKernelCreate(module, &kernelDesc, &kernel)); +ze_kernel_handle_t translatedHandle = kernel; +EXPECT_EQ(ZE_RESULT_SUCCESS, zelLoaderTranslateHandle(ZEL_HANDLE_KERNEL, kernel, reinterpret_cast(&translatedHandle))); +EXPECT_EQ(translatedHandle, kernel); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeKernelDestroy(kernel)); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeModuleDestroy(module)); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeContextDestroy(context)); + +} + +TEST( + LoaderTranslateHandles, + GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportDisabledThenExpectHandleTranslationForSampler) { + +uint32_t pInitDriversCount = 0; +ze_init_driver_type_desc_t desc = {ZE_STRUCTURE_TYPE_INIT_DRIVER_TYPE_DESC}; +desc.flags = UINT32_MAX; +desc.pNext = nullptr; +putenv_safe( const_cast( "ZE_ENABLE_LOADER_INTERCEPT=1" ) ); +putenv_safe( const_cast( "ZEL_TEST_NULL_DRIVER_DISABLE_DDI_EXT=1" ) ); +std::vector drivers; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, nullptr, &desc)); +drivers.resize(pInitDriversCount); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, drivers.data(), &desc)); +EXPECT_GT(pInitDriversCount, 0); +ze_driver_ddi_handles_ext_properties_t driverDdiHandlesExtProperties = {}; +driverDdiHandlesExtProperties.stype = ZE_STRUCTURE_TYPE_DRIVER_DDI_HANDLES_EXT_PROPERTIES; +driverDdiHandlesExtProperties.pNext = nullptr; +ze_driver_properties_t properties = {}; +properties.stype = ZE_STRUCTURE_TYPE_DRIVER_PROPERTIES; +properties.pNext = &driverDdiHandlesExtProperties; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDriverGetProperties(drivers[0], &properties)); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, drivers.data(), &desc)); +ze_context_handle_t context; +ze_context_desc_t contextDesc = {ZE_STRUCTURE_TYPE_CONTEXT_DESC}; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeContextCreate(drivers[0], &contextDesc, &context)); +uint32_t deviceCount = 0; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDeviceGet(drivers[0], &deviceCount, nullptr)); +std::vector devices(deviceCount); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDeviceGet(drivers[0], &deviceCount, devices.data())); +ze_sampler_handle_t sampler; +ze_sampler_desc_t samplerDesc = {ZE_STRUCTURE_TYPE_SAMPLER_DESC}; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeSamplerCreate(context, devices[0], &samplerDesc, &sampler)); +ze_sampler_handle_t translatedHandle = sampler; +EXPECT_EQ(ZE_RESULT_SUCCESS, zelLoaderTranslateHandle(ZEL_HANDLE_SAMPLER, sampler, reinterpret_cast(&translatedHandle))); +EXPECT_NE(translatedHandle, sampler); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeSamplerDestroy(sampler)); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeContextDestroy(context)); + +} + +TEST( + LoaderTranslateHandles, + GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportEnabledThenExpectNoHandleTranslationForSampler) { + +uint32_t pInitDriversCount = 0; +ze_init_driver_type_desc_t desc = {ZE_STRUCTURE_TYPE_INIT_DRIVER_TYPE_DESC}; +desc.flags = UINT32_MAX; +desc.pNext = nullptr; +putenv_safe( const_cast( "ZE_ENABLE_LOADER_INTERCEPT=1" ) ); +putenv_safe( const_cast( "ZEL_TEST_NULL_DRIVER_DISABLE_DDI_EXT=0" ) ); +std::vector drivers; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, nullptr, &desc)); +drivers.resize(pInitDriversCount); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, drivers.data(), &desc)); +EXPECT_GT(pInitDriversCount, 0); +ze_driver_ddi_handles_ext_properties_t driverDdiHandlesExtProperties = {}; +driverDdiHandlesExtProperties.stype = ZE_STRUCTURE_TYPE_DRIVER_DDI_HANDLES_EXT_PROPERTIES; +driverDdiHandlesExtProperties.pNext = nullptr; +ze_driver_properties_t properties = {}; +properties.stype = ZE_STRUCTURE_TYPE_DRIVER_PROPERTIES; +properties.pNext = &driverDdiHandlesExtProperties; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDriverGetProperties(drivers[0], &properties)); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, drivers.data(), &desc)); +ze_context_handle_t context; +ze_context_desc_t contextDesc = {ZE_STRUCTURE_TYPE_CONTEXT_DESC}; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeContextCreate(drivers[0], &contextDesc, &context)); +uint32_t deviceCount = 0; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDeviceGet(drivers[0], &deviceCount, nullptr)); +std::vector devices(deviceCount); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDeviceGet(drivers[0], &deviceCount, devices.data())); +ze_sampler_handle_t sampler; +ze_sampler_desc_t samplerDesc = {ZE_STRUCTURE_TYPE_SAMPLER_DESC}; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeSamplerCreate(context, devices[0], &samplerDesc, &sampler)); +ze_sampler_handle_t translatedHandle = sampler; +EXPECT_EQ(ZE_RESULT_SUCCESS, zelLoaderTranslateHandle(ZEL_HANDLE_SAMPLER, sampler, reinterpret_cast(&translatedHandle))); +EXPECT_EQ(translatedHandle, sampler); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeSamplerDestroy(sampler)); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeContextDestroy(context)); + +} + +TEST( + LoaderTranslateHandles, + GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportDisabledThenExpectHandleTranslationForPhysicalMem) { + +uint32_t pInitDriversCount = 0; +ze_init_driver_type_desc_t desc = {ZE_STRUCTURE_TYPE_INIT_DRIVER_TYPE_DESC}; +desc.flags = UINT32_MAX; +desc.pNext = nullptr; +putenv_safe( const_cast( "ZE_ENABLE_LOADER_INTERCEPT=1" ) ); +putenv_safe( const_cast( "ZEL_TEST_NULL_DRIVER_DISABLE_DDI_EXT=1" ) ); +std::vector drivers; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, nullptr, &desc)); +drivers.resize(pInitDriversCount); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, drivers.data(), &desc)); +EXPECT_GT(pInitDriversCount, 0); +ze_driver_ddi_handles_ext_properties_t driverDdiHandlesExtProperties = {}; +driverDdiHandlesExtProperties.stype = ZE_STRUCTURE_TYPE_DRIVER_DDI_HANDLES_EXT_PROPERTIES; +driverDdiHandlesExtProperties.pNext = nullptr; +ze_driver_properties_t properties = {}; +properties.stype = ZE_STRUCTURE_TYPE_DRIVER_PROPERTIES; +properties.pNext = &driverDdiHandlesExtProperties; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDriverGetProperties(drivers[0], &properties)); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, drivers.data(), &desc)); +ze_context_handle_t context; +ze_context_desc_t contextDesc = {ZE_STRUCTURE_TYPE_CONTEXT_DESC}; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeContextCreate(drivers[0], &contextDesc, &context)); +uint32_t deviceCount = 0; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDeviceGet(drivers[0], &deviceCount, nullptr)); +std::vector devices(deviceCount); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDeviceGet(drivers[0], &deviceCount, devices.data())); +ze_physical_mem_handle_t physicalMem; +ze_physical_mem_desc_t physicalMemDesc = {ZE_STRUCTURE_TYPE_PHYSICAL_MEM_DESC}; +EXPECT_EQ(ZE_RESULT_SUCCESS, zePhysicalMemCreate(context, devices[0], &physicalMemDesc, &physicalMem)); +ze_physical_mem_handle_t translatedHandle = physicalMem; +EXPECT_EQ(ZE_RESULT_SUCCESS, zelLoaderTranslateHandle(ZEL_HANDLE_PHYSICAL_MEM, physicalMem, reinterpret_cast(&translatedHandle))); +EXPECT_NE(translatedHandle, physicalMem); +EXPECT_EQ(ZE_RESULT_SUCCESS, zePhysicalMemDestroy(context, physicalMem)); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeContextDestroy(context)); + +} + +TEST( + LoaderTranslateHandles, + GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportEnabledThenExpectNoHandleTranslationForPhysicalMem) { + +uint32_t pInitDriversCount = 0; +ze_init_driver_type_desc_t desc = {ZE_STRUCTURE_TYPE_INIT_DRIVER_TYPE_DESC}; +desc.flags = UINT32_MAX; +desc.pNext = nullptr; +putenv_safe( const_cast( "ZE_ENABLE_LOADER_INTERCEPT=1" ) ); +putenv_safe( const_cast( "ZEL_TEST_NULL_DRIVER_DISABLE_DDI_EXT=0" ) ); +std::vector drivers; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, nullptr, &desc)); +drivers.resize(pInitDriversCount); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, drivers.data(), &desc)); +EXPECT_GT(pInitDriversCount, 0); +ze_driver_ddi_handles_ext_properties_t driverDdiHandlesExtProperties = {}; +driverDdiHandlesExtProperties.stype = ZE_STRUCTURE_TYPE_DRIVER_DDI_HANDLES_EXT_PROPERTIES; +driverDdiHandlesExtProperties.pNext = nullptr; +ze_driver_properties_t properties = {}; +properties.stype = ZE_STRUCTURE_TYPE_DRIVER_PROPERTIES; +properties.pNext = &driverDdiHandlesExtProperties; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDriverGetProperties(drivers[0], &properties)); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, drivers.data(), &desc)); +ze_context_handle_t context; +ze_context_desc_t contextDesc = {ZE_STRUCTURE_TYPE_CONTEXT_DESC}; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeContextCreate(drivers[0], &contextDesc, &context)); +uint32_t deviceCount = 0; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDeviceGet(drivers[0], &deviceCount, nullptr)); +std::vector devices(deviceCount); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDeviceGet(drivers[0], &deviceCount, devices.data())); +ze_physical_mem_handle_t physicalMem; +ze_physical_mem_desc_t physicalMemDesc = {ZE_STRUCTURE_TYPE_PHYSICAL_MEM_DESC}; +EXPECT_EQ(ZE_RESULT_SUCCESS, zePhysicalMemCreate(context, devices[0], &physicalMemDesc, &physicalMem)); +ze_physical_mem_handle_t translatedHandle = physicalMem; +EXPECT_EQ(ZE_RESULT_SUCCESS, zelLoaderTranslateHandle(ZEL_HANDLE_PHYSICAL_MEM, physicalMem, reinterpret_cast(&translatedHandle))); +EXPECT_EQ(translatedHandle, physicalMem); +EXPECT_EQ(ZE_RESULT_SUCCESS, zePhysicalMemDestroy(context, physicalMem)); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeContextDestroy(context)); + +} + +TEST( + LoaderTranslateHandles, + GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportDisabledThenExpectHandleTranslationForFence) { + +uint32_t pInitDriversCount = 0; +ze_init_driver_type_desc_t desc = {ZE_STRUCTURE_TYPE_INIT_DRIVER_TYPE_DESC}; +desc.flags = UINT32_MAX; +desc.pNext = nullptr; +putenv_safe( const_cast( "ZE_ENABLE_LOADER_INTERCEPT=1" ) ); +putenv_safe( const_cast( "ZEL_TEST_NULL_DRIVER_DISABLE_DDI_EXT=1" ) ); +std::vector drivers; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, nullptr, &desc)); +drivers.resize(pInitDriversCount); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, drivers.data(), &desc)); +EXPECT_GT(pInitDriversCount, 0); +ze_driver_ddi_handles_ext_properties_t driverDdiHandlesExtProperties = {}; +driverDdiHandlesExtProperties.stype = ZE_STRUCTURE_TYPE_DRIVER_DDI_HANDLES_EXT_PROPERTIES; +driverDdiHandlesExtProperties.pNext = nullptr; +ze_driver_properties_t properties = {}; +properties.stype = ZE_STRUCTURE_TYPE_DRIVER_PROPERTIES; +properties.pNext = &driverDdiHandlesExtProperties; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDriverGetProperties(drivers[0], &properties)); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, drivers.data(), &desc)); +ze_context_handle_t context; +ze_context_desc_t contextDesc = {ZE_STRUCTURE_TYPE_CONTEXT_DESC}; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeContextCreate(drivers[0], &contextDesc, &context)); +ze_command_queue_handle_t commandQueue; +ze_command_queue_desc_t commandQueueDesc = {ZE_STRUCTURE_TYPE_COMMAND_QUEUE_DESC}; +uint32_t deviceCount = 0; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDeviceGet(drivers[0], &deviceCount, nullptr)); +std::vector devices(deviceCount); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDeviceGet(drivers[0], &deviceCount, devices.data())); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeCommandQueueCreate(context, devices[0], &commandQueueDesc, &commandQueue)); +ze_fence_handle_t fence; +ze_fence_desc_t fenceDesc = {ZE_STRUCTURE_TYPE_FENCE_DESC}; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeFenceCreate(commandQueue, &fenceDesc, &fence)); +ze_fence_handle_t translatedHandle = fence; +EXPECT_EQ(ZE_RESULT_SUCCESS, zelLoaderTranslateHandle(ZEL_HANDLE_FENCE, fence, reinterpret_cast(&translatedHandle))); +EXPECT_NE(translatedHandle, fence); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeFenceDestroy(fence)); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeCommandQueueDestroy(commandQueue)); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeContextDestroy(context)); + +} + +TEST( + LoaderTranslateHandles, + GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportEnabledThenExpectNoHandleTranslationForFence) { + +uint32_t pInitDriversCount = 0; +ze_init_driver_type_desc_t desc = {ZE_STRUCTURE_TYPE_INIT_DRIVER_TYPE_DESC}; +desc.flags = UINT32_MAX; +desc.pNext = nullptr; +putenv_safe( const_cast( "ZE_ENABLE_LOADER_INTERCEPT=1" ) ); +putenv_safe( const_cast( "ZEL_TEST_NULL_DRIVER_DISABLE_DDI_EXT=0" ) ); +std::vector drivers; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, nullptr, &desc)); +drivers.resize(pInitDriversCount); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, drivers.data(), &desc)); +EXPECT_GT(pInitDriversCount, 0); +ze_driver_ddi_handles_ext_properties_t driverDdiHandlesExtProperties = {}; +driverDdiHandlesExtProperties.stype = ZE_STRUCTURE_TYPE_DRIVER_DDI_HANDLES_EXT_PROPERTIES; +driverDdiHandlesExtProperties.pNext = nullptr; +ze_driver_properties_t properties = {}; +properties.stype = ZE_STRUCTURE_TYPE_DRIVER_PROPERTIES; +properties.pNext = &driverDdiHandlesExtProperties; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDriverGetProperties(drivers[0], &properties)); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, drivers.data(), &desc)); +ze_context_handle_t context; +ze_context_desc_t contextDesc = {ZE_STRUCTURE_TYPE_CONTEXT_DESC}; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeContextCreate(drivers[0], &contextDesc, &context)); +ze_command_queue_handle_t commandQueue; +ze_command_queue_desc_t commandQueueDesc = {ZE_STRUCTURE_TYPE_COMMAND_QUEUE_DESC}; +uint32_t deviceCount = 0; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDeviceGet(drivers[0], &deviceCount, nullptr)); +std::vector devices(deviceCount); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDeviceGet(drivers[0], &deviceCount, devices.data())); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeCommandQueueCreate(context, devices[0], &commandQueueDesc, &commandQueue)); +ze_fence_handle_t fence; +ze_fence_desc_t fenceDesc = {ZE_STRUCTURE_TYPE_FENCE_DESC}; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeFenceCreate(commandQueue, &fenceDesc, &fence)); +ze_fence_handle_t translatedHandle = fence; +EXPECT_EQ(ZE_RESULT_SUCCESS, zelLoaderTranslateHandle(ZEL_HANDLE_FENCE, fence, reinterpret_cast(&translatedHandle))); +EXPECT_EQ(translatedHandle, fence); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeFenceDestroy(fence)); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeCommandQueueDestroy(commandQueue)); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeContextDestroy(context)); + +} + +TEST( + LoaderTranslateHandles, + GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportDisabledThenExpectHandleTranslationForEventPool) { + +uint32_t pInitDriversCount = 0; +ze_init_driver_type_desc_t desc = {ZE_STRUCTURE_TYPE_INIT_DRIVER_TYPE_DESC}; +desc.flags = UINT32_MAX; +desc.pNext = nullptr; +putenv_safe( const_cast( "ZE_ENABLE_LOADER_INTERCEPT=1" ) ); +putenv_safe( const_cast( "ZEL_TEST_NULL_DRIVER_DISABLE_DDI_EXT=1" ) ); +std::vector drivers; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, nullptr, &desc)); +drivers.resize(pInitDriversCount); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, drivers.data(), &desc)); +EXPECT_GT(pInitDriversCount, 0); +ze_driver_ddi_handles_ext_properties_t driverDdiHandlesExtProperties = {}; +driverDdiHandlesExtProperties.stype = ZE_STRUCTURE_TYPE_DRIVER_DDI_HANDLES_EXT_PROPERTIES; +driverDdiHandlesExtProperties.pNext = nullptr; +ze_driver_properties_t properties = {}; +properties.stype = ZE_STRUCTURE_TYPE_DRIVER_PROPERTIES; +properties.pNext = &driverDdiHandlesExtProperties; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDriverGetProperties(drivers[0], &properties)); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, drivers.data(), &desc)); +ze_context_handle_t context; +ze_context_desc_t contextDesc = {ZE_STRUCTURE_TYPE_CONTEXT_DESC}; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeContextCreate(drivers[0], &contextDesc, &context)); +ze_event_pool_handle_t eventPool; +ze_event_pool_desc_t eventPoolDesc = {ZE_STRUCTURE_TYPE_EVENT_POOL_DESC}; +eventPoolDesc.count = 1; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeEventPoolCreate(context, &eventPoolDesc, 0, nullptr, &eventPool)); +ze_event_pool_handle_t translatedHandle = eventPool; +EXPECT_EQ(ZE_RESULT_SUCCESS, zelLoaderTranslateHandle(ZEL_HANDLE_EVENT_POOL, eventPool, reinterpret_cast(&translatedHandle))); +EXPECT_NE(translatedHandle, eventPool); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeEventPoolDestroy(eventPool)); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeContextDestroy(context)); + +} + +TEST( + LoaderTranslateHandles, + GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportEnabledThenExpectNoHandleTranslationForEventPool) { + +uint32_t pInitDriversCount = 0; +ze_init_driver_type_desc_t desc = {ZE_STRUCTURE_TYPE_INIT_DRIVER_TYPE_DESC}; +desc.flags = UINT32_MAX; +desc.pNext = nullptr; +putenv_safe( const_cast( "ZE_ENABLE_LOADER_INTERCEPT=1" ) ); +putenv_safe( const_cast( "ZEL_TEST_NULL_DRIVER_DISABLE_DDI_EXT=0" ) ); +std::vector drivers; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, nullptr, &desc)); +drivers.resize(pInitDriversCount); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, drivers.data(), &desc)); +EXPECT_GT(pInitDriversCount, 0); +ze_driver_ddi_handles_ext_properties_t driverDdiHandlesExtProperties = {}; +driverDdiHandlesExtProperties.stype = ZE_STRUCTURE_TYPE_DRIVER_DDI_HANDLES_EXT_PROPERTIES; +driverDdiHandlesExtProperties.pNext = nullptr; +ze_driver_properties_t properties = {}; +properties.stype = ZE_STRUCTURE_TYPE_DRIVER_PROPERTIES; +properties.pNext = &driverDdiHandlesExtProperties; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDriverGetProperties(drivers[0], &properties)); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, drivers.data(), &desc)); +ze_context_handle_t context; +ze_context_desc_t contextDesc = {ZE_STRUCTURE_TYPE_CONTEXT_DESC}; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeContextCreate(drivers[0], &contextDesc, &context)); +ze_event_pool_handle_t eventPool; +ze_event_pool_desc_t eventPoolDesc = {ZE_STRUCTURE_TYPE_EVENT_POOL_DESC}; +eventPoolDesc.count = 1; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeEventPoolCreate(context, &eventPoolDesc, 0, nullptr, &eventPool)); +ze_event_pool_handle_t translatedHandle = eventPool; +EXPECT_EQ(ZE_RESULT_SUCCESS, zelLoaderTranslateHandle(ZEL_HANDLE_EVENT_POOL, eventPool, reinterpret_cast(&translatedHandle))); +EXPECT_EQ(translatedHandle, eventPool); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeEventPoolDestroy(eventPool)); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeContextDestroy(context)); + +} + +TEST( + LoaderTranslateHandles, + GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportDisabledThenExpectHandleTranslationForImage) { + +uint32_t pInitDriversCount = 0; +ze_init_driver_type_desc_t desc = {ZE_STRUCTURE_TYPE_INIT_DRIVER_TYPE_DESC}; +desc.flags = UINT32_MAX; +desc.pNext = nullptr; +putenv_safe( const_cast( "ZE_ENABLE_LOADER_INTERCEPT=1" ) ); +putenv_safe( const_cast( "ZEL_TEST_NULL_DRIVER_DISABLE_DDI_EXT=1" ) ); +std::vector drivers; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, nullptr, &desc)); +drivers.resize(pInitDriversCount); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, drivers.data(), &desc)); +EXPECT_GT(pInitDriversCount, 0); +ze_driver_ddi_handles_ext_properties_t driverDdiHandlesExtProperties = {}; +driverDdiHandlesExtProperties.stype = ZE_STRUCTURE_TYPE_DRIVER_DDI_HANDLES_EXT_PROPERTIES; +driverDdiHandlesExtProperties.pNext = nullptr; +ze_driver_properties_t properties = {}; +properties.stype = ZE_STRUCTURE_TYPE_DRIVER_PROPERTIES; +properties.pNext = &driverDdiHandlesExtProperties; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDriverGetProperties(drivers[0], &properties)); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, drivers.data(), &desc)); +ze_context_handle_t context; +ze_context_desc_t contextDesc = {ZE_STRUCTURE_TYPE_CONTEXT_DESC}; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeContextCreate(drivers[0], &contextDesc, &context)); +uint32_t deviceCount = 0; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDeviceGet(drivers[0], &deviceCount, nullptr)); +std::vector devices(deviceCount); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDeviceGet(drivers[0], &deviceCount, devices.data())); +ze_image_handle_t image; +ze_image_desc_t imageDesc = {ZE_STRUCTURE_TYPE_IMAGE_DESC}; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeImageCreate(context, devices[0], &imageDesc, &image)); +ze_image_handle_t translatedHandle = image; +EXPECT_EQ(ZE_RESULT_SUCCESS, zelLoaderTranslateHandle(ZEL_HANDLE_IMAGE, image, reinterpret_cast(&translatedHandle))); +EXPECT_NE(translatedHandle, image); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeImageDestroy(image)); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeContextDestroy(context)); + +} + +TEST( + LoaderTranslateHandles, + GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportEnabledThenExpectNoHandleTranslationForImage) { + +uint32_t pInitDriversCount = 0; +ze_init_driver_type_desc_t desc = {ZE_STRUCTURE_TYPE_INIT_DRIVER_TYPE_DESC}; +desc.flags = UINT32_MAX; +desc.pNext = nullptr; +putenv_safe( const_cast( "ZE_ENABLE_LOADER_INTERCEPT=1" ) ); +putenv_safe( const_cast( "ZEL_TEST_NULL_DRIVER_DISABLE_DDI_EXT=0" ) ); +std::vector drivers; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, nullptr, &desc)); +drivers.resize(pInitDriversCount); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, drivers.data(), &desc)); +EXPECT_GT(pInitDriversCount, 0); +ze_driver_ddi_handles_ext_properties_t driverDdiHandlesExtProperties = {}; +driverDdiHandlesExtProperties.stype = ZE_STRUCTURE_TYPE_DRIVER_DDI_HANDLES_EXT_PROPERTIES; +driverDdiHandlesExtProperties.pNext = nullptr; +ze_driver_properties_t properties = {}; +properties.stype = ZE_STRUCTURE_TYPE_DRIVER_PROPERTIES; +properties.pNext = &driverDdiHandlesExtProperties; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDriverGetProperties(drivers[0], &properties)); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, drivers.data(), &desc)); +ze_context_handle_t context; +ze_context_desc_t contextDesc = {ZE_STRUCTURE_TYPE_CONTEXT_DESC}; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeContextCreate(drivers[0], &contextDesc, &context)); +uint32_t deviceCount = 0; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDeviceGet(drivers[0], &deviceCount, nullptr)); +std::vector devices(deviceCount); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDeviceGet(drivers[0], &deviceCount, devices.data())); +ze_image_handle_t image; +ze_image_desc_t imageDesc = {ZE_STRUCTURE_TYPE_IMAGE_DESC}; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeImageCreate(context, devices[0], &imageDesc, &image)); +ze_image_handle_t translatedHandle = image; +EXPECT_EQ(ZE_RESULT_SUCCESS, zelLoaderTranslateHandle(ZEL_HANDLE_IMAGE, image, reinterpret_cast(&translatedHandle))); +EXPECT_EQ(translatedHandle, image); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeImageDestroy(image)); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeContextDestroy(context)); + +} + +TEST( + LoaderTranslateHandles, + GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportDisabledThenExpectHandleTranslationForContext) { + +uint32_t pInitDriversCount = 0; +ze_init_driver_type_desc_t desc = {ZE_STRUCTURE_TYPE_INIT_DRIVER_TYPE_DESC}; +desc.flags = UINT32_MAX; +desc.pNext = nullptr; +putenv_safe( const_cast( "ZE_ENABLE_LOADER_INTERCEPT=1" ) ); +putenv_safe( const_cast( "ZEL_TEST_NULL_DRIVER_DISABLE_DDI_EXT=1" ) ); +std::vector drivers; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, nullptr, &desc)); +drivers.resize(pInitDriversCount); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, drivers.data(), &desc)); +EXPECT_GT(pInitDriversCount, 0); +ze_driver_ddi_handles_ext_properties_t driverDdiHandlesExtProperties = {}; +driverDdiHandlesExtProperties.stype = ZE_STRUCTURE_TYPE_DRIVER_DDI_HANDLES_EXT_PROPERTIES; +driverDdiHandlesExtProperties.pNext = nullptr; +ze_driver_properties_t properties = {}; +properties.stype = ZE_STRUCTURE_TYPE_DRIVER_PROPERTIES; +properties.pNext = &driverDdiHandlesExtProperties; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDriverGetProperties(drivers[0], &properties)); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, drivers.data(), &desc)); +ze_context_handle_t context; +ze_context_desc_t contextDesc = {ZE_STRUCTURE_TYPE_CONTEXT_DESC}; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeContextCreate(drivers[0], &contextDesc, &context)); +ze_context_handle_t translatedHandle = context; +EXPECT_EQ(ZE_RESULT_SUCCESS, zelLoaderTranslateHandle(ZEL_HANDLE_CONTEXT, context, reinterpret_cast(&translatedHandle))); +EXPECT_NE(translatedHandle, context); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeContextDestroy(context)); + +} + +TEST( + LoaderTranslateHandles, + GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportEnabledThenExpectNoHandleTranslationForContext) { + +uint32_t pInitDriversCount = 0; +ze_init_driver_type_desc_t desc = {ZE_STRUCTURE_TYPE_INIT_DRIVER_TYPE_DESC}; +desc.flags = UINT32_MAX; +desc.pNext = nullptr; +putenv_safe( const_cast( "ZE_ENABLE_LOADER_INTERCEPT=1" ) ); +putenv_safe( const_cast( "ZEL_TEST_NULL_DRIVER_DISABLE_DDI_EXT=0" ) ); +std::vector drivers; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, nullptr, &desc)); +drivers.resize(pInitDriversCount); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, drivers.data(), &desc)); +EXPECT_GT(pInitDriversCount, 0); +ze_driver_ddi_handles_ext_properties_t driverDdiHandlesExtProperties = {}; +driverDdiHandlesExtProperties.stype = ZE_STRUCTURE_TYPE_DRIVER_DDI_HANDLES_EXT_PROPERTIES; +driverDdiHandlesExtProperties.pNext = nullptr; +ze_driver_properties_t properties = {}; +properties.stype = ZE_STRUCTURE_TYPE_DRIVER_PROPERTIES; +properties.pNext = &driverDdiHandlesExtProperties; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDriverGetProperties(drivers[0], &properties)); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, drivers.data(), &desc)); +ze_context_handle_t context; +ze_context_desc_t contextDesc = {ZE_STRUCTURE_TYPE_CONTEXT_DESC}; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeContextCreate(drivers[0], &contextDesc, &context)); +ze_context_handle_t translatedHandle = context; +EXPECT_EQ(ZE_RESULT_SUCCESS, zelLoaderTranslateHandle(ZEL_HANDLE_CONTEXT, context, reinterpret_cast(&translatedHandle))); +EXPECT_EQ(translatedHandle, context); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeContextDestroy(context)); + +} + +TEST( + LoaderTranslateHandles, + GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportDisabledThenExpectHandleTranslationForCommandQueue) { + +uint32_t pInitDriversCount = 0; +ze_init_driver_type_desc_t desc = {ZE_STRUCTURE_TYPE_INIT_DRIVER_TYPE_DESC}; +desc.flags = UINT32_MAX; +desc.pNext = nullptr; +putenv_safe( const_cast( "ZE_ENABLE_LOADER_INTERCEPT=1" ) ); +putenv_safe( const_cast( "ZEL_TEST_NULL_DRIVER_DISABLE_DDI_EXT=1" ) ); +std::vector drivers; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, nullptr, &desc)); +drivers.resize(pInitDriversCount); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, drivers.data(), &desc)); +EXPECT_GT(pInitDriversCount, 0); +ze_driver_ddi_handles_ext_properties_t driverDdiHandlesExtProperties = {}; +driverDdiHandlesExtProperties.stype = ZE_STRUCTURE_TYPE_DRIVER_DDI_HANDLES_EXT_PROPERTIES; +driverDdiHandlesExtProperties.pNext = nullptr; +ze_driver_properties_t properties = {}; +properties.stype = ZE_STRUCTURE_TYPE_DRIVER_PROPERTIES; +properties.pNext = &driverDdiHandlesExtProperties; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDriverGetProperties(drivers[0], &properties)); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, drivers.data(), &desc)); +ze_context_handle_t context; +ze_context_desc_t contextDesc = {ZE_STRUCTURE_TYPE_CONTEXT_DESC}; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeContextCreate(drivers[0], &contextDesc, &context)); +ze_command_queue_handle_t commandQueue; +ze_command_queue_desc_t commandQueueDesc = {ZE_STRUCTURE_TYPE_COMMAND_QUEUE_DESC}; +uint32_t deviceCount = 0; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDeviceGet(drivers[0], &deviceCount, nullptr)); +std::vector devices(deviceCount); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDeviceGet(drivers[0], &deviceCount, devices.data())); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeCommandQueueCreate(context, devices[0], &commandQueueDesc, &commandQueue)); +ze_command_queue_handle_t translatedHandle = commandQueue; +EXPECT_EQ(ZE_RESULT_SUCCESS, zelLoaderTranslateHandle(ZEL_HANDLE_COMMAND_QUEUE, commandQueue, reinterpret_cast(&translatedHandle))); +EXPECT_NE(translatedHandle, commandQueue); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeCommandQueueDestroy(commandQueue)); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeContextDestroy(context)); + +} + +TEST( + LoaderTranslateHandles, + GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportEnabledThenExpectNoHandleTranslationForCommandQueue) { + +uint32_t pInitDriversCount = 0; +ze_init_driver_type_desc_t desc = {ZE_STRUCTURE_TYPE_INIT_DRIVER_TYPE_DESC}; +desc.flags = UINT32_MAX; +desc.pNext = nullptr; +putenv_safe( const_cast( "ZE_ENABLE_LOADER_INTERCEPT=1" ) ); +putenv_safe( const_cast( "ZEL_TEST_NULL_DRIVER_DISABLE_DDI_EXT=0" ) ); +std::vector drivers; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, nullptr, &desc)); +drivers.resize(pInitDriversCount); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, drivers.data(), &desc)); +EXPECT_GT(pInitDriversCount, 0); +ze_driver_ddi_handles_ext_properties_t driverDdiHandlesExtProperties = {}; +driverDdiHandlesExtProperties.stype = ZE_STRUCTURE_TYPE_DRIVER_DDI_HANDLES_EXT_PROPERTIES; +driverDdiHandlesExtProperties.pNext = nullptr; +ze_driver_properties_t properties = {}; +properties.stype = ZE_STRUCTURE_TYPE_DRIVER_PROPERTIES; +properties.pNext = &driverDdiHandlesExtProperties; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDriverGetProperties(drivers[0], &properties)); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, drivers.data(), &desc)); +ze_context_handle_t context; +ze_context_desc_t contextDesc = {ZE_STRUCTURE_TYPE_CONTEXT_DESC}; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeContextCreate(drivers[0], &contextDesc, &context)); +ze_command_queue_handle_t commandQueue; +ze_command_queue_desc_t commandQueueDesc = {ZE_STRUCTURE_TYPE_COMMAND_QUEUE_DESC}; +uint32_t deviceCount = 0; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDeviceGet(drivers[0], &deviceCount, nullptr)); +std::vector devices(deviceCount); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDeviceGet(drivers[0], &deviceCount, devices.data())); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeCommandQueueCreate(context, devices[0], &commandQueueDesc, &commandQueue)); +ze_command_queue_handle_t translatedHandle = commandQueue; +EXPECT_EQ(ZE_RESULT_SUCCESS, zelLoaderTranslateHandle(ZEL_HANDLE_COMMAND_QUEUE, commandQueue, reinterpret_cast(&translatedHandle))); +EXPECT_EQ(translatedHandle, commandQueue); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeCommandQueueDestroy(commandQueue)); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeContextDestroy(context)); + +} + +TEST( + LoaderTranslateHandles, + GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportDisabledThenExpectHandleTranslationForCommandList) { + +uint32_t pInitDriversCount = 0; +ze_init_driver_type_desc_t desc = {ZE_STRUCTURE_TYPE_INIT_DRIVER_TYPE_DESC}; +desc.flags = UINT32_MAX; +desc.pNext = nullptr; +putenv_safe( const_cast( "ZE_ENABLE_LOADER_INTERCEPT=1" ) ); +putenv_safe( const_cast( "ZEL_TEST_NULL_DRIVER_DISABLE_DDI_EXT=1" ) ); +std::vector drivers; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, nullptr, &desc)); +drivers.resize(pInitDriversCount); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, drivers.data(), &desc)); +EXPECT_GT(pInitDriversCount, 0); +ze_driver_ddi_handles_ext_properties_t driverDdiHandlesExtProperties = {}; +driverDdiHandlesExtProperties.stype = ZE_STRUCTURE_TYPE_DRIVER_DDI_HANDLES_EXT_PROPERTIES; +driverDdiHandlesExtProperties.pNext = nullptr; +ze_driver_properties_t properties = {}; +properties.stype = ZE_STRUCTURE_TYPE_DRIVER_PROPERTIES; +properties.pNext = &driverDdiHandlesExtProperties; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDriverGetProperties(drivers[0], &properties)); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, drivers.data(), &desc)); +ze_context_handle_t context; +ze_context_desc_t contextDesc = {ZE_STRUCTURE_TYPE_CONTEXT_DESC}; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeContextCreate(drivers[0], &contextDesc, &context)); +ze_command_list_handle_t commandList; +ze_command_list_desc_t commandListDesc = {ZE_STRUCTURE_TYPE_COMMAND_LIST_DESC}; +uint32_t deviceCount = 0; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDeviceGet(drivers[0], &deviceCount, nullptr)); +std::vector devices(deviceCount); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDeviceGet(drivers[0], &deviceCount, devices.data())); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeCommandListCreate(context, devices[0], &commandListDesc, &commandList)); +ze_command_list_handle_t translatedHandle = commandList; +EXPECT_EQ(ZE_RESULT_SUCCESS, zelLoaderTranslateHandle(ZEL_HANDLE_COMMAND_LIST, commandList, reinterpret_cast(&translatedHandle))); +EXPECT_NE(translatedHandle, commandList); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeCommandListDestroy(commandList)); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeContextDestroy(context)); + +} + +TEST( + LoaderTranslateHandles, + GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportEnabledThenExpectNoHandleTranslationForCommandList) { + +uint32_t pInitDriversCount = 0; +ze_init_driver_type_desc_t desc = {ZE_STRUCTURE_TYPE_INIT_DRIVER_TYPE_DESC}; +desc.flags = UINT32_MAX; +desc.pNext = nullptr; +putenv_safe( const_cast( "ZE_ENABLE_LOADER_INTERCEPT=1" ) ); +putenv_safe( const_cast( "ZEL_TEST_NULL_DRIVER_DISABLE_DDI_EXT=0" ) ); +std::vector drivers; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, nullptr, &desc)); +drivers.resize(pInitDriversCount); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, drivers.data(), &desc)); +EXPECT_GT(pInitDriversCount, 0); +ze_driver_ddi_handles_ext_properties_t driverDdiHandlesExtProperties = {}; +driverDdiHandlesExtProperties.stype = ZE_STRUCTURE_TYPE_DRIVER_DDI_HANDLES_EXT_PROPERTIES; +driverDdiHandlesExtProperties.pNext = nullptr; +ze_driver_properties_t properties = {}; +properties.stype = ZE_STRUCTURE_TYPE_DRIVER_PROPERTIES; +properties.pNext = &driverDdiHandlesExtProperties; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDriverGetProperties(drivers[0], &properties)); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, drivers.data(), &desc)); +ze_context_handle_t context; +ze_context_desc_t contextDesc = {ZE_STRUCTURE_TYPE_CONTEXT_DESC}; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeContextCreate(drivers[0], &contextDesc, &context)); +ze_command_list_handle_t commandList; +ze_command_list_desc_t commandListDesc = {ZE_STRUCTURE_TYPE_COMMAND_LIST_DESC}; +uint32_t deviceCount = 0; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDeviceGet(drivers[0], &deviceCount, nullptr)); +std::vector devices(deviceCount); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDeviceGet(drivers[0], &deviceCount, devices.data())); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeCommandListCreate(context, devices[0], &commandListDesc, &commandList)); +ze_command_list_handle_t translatedHandle = commandList; +EXPECT_EQ(ZE_RESULT_SUCCESS, zelLoaderTranslateHandle(ZEL_HANDLE_COMMAND_LIST, commandList, reinterpret_cast(&translatedHandle))); +EXPECT_EQ(translatedHandle, commandList); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeCommandListDestroy(commandList)); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeContextDestroy(context)); + +} + +TEST( + LoaderTranslateHandles, + GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportDisabledThenExpectHandleTranslationForEvent) { + +uint32_t pInitDriversCount = 0; +ze_init_driver_type_desc_t desc = {ZE_STRUCTURE_TYPE_INIT_DRIVER_TYPE_DESC}; +desc.flags = UINT32_MAX; +desc.pNext = nullptr; +putenv_safe( const_cast( "ZE_ENABLE_LOADER_INTERCEPT=1" ) ); +putenv_safe( const_cast( "ZEL_TEST_NULL_DRIVER_DISABLE_DDI_EXT=1" ) ); +std::vector drivers; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, nullptr, &desc)); +drivers.resize(pInitDriversCount); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, drivers.data(), &desc)); +EXPECT_GT(pInitDriversCount, 0); +ze_driver_ddi_handles_ext_properties_t driverDdiHandlesExtProperties = {}; +driverDdiHandlesExtProperties.stype = ZE_STRUCTURE_TYPE_DRIVER_DDI_HANDLES_EXT_PROPERTIES; +driverDdiHandlesExtProperties.pNext = nullptr; +ze_driver_properties_t properties = {}; +properties.stype = ZE_STRUCTURE_TYPE_DRIVER_PROPERTIES; +properties.pNext = &driverDdiHandlesExtProperties; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDriverGetProperties(drivers[0], &properties)); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, drivers.data(), &desc)); +ze_context_handle_t context; +ze_context_desc_t contextDesc = {ZE_STRUCTURE_TYPE_CONTEXT_DESC}; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeContextCreate(drivers[0], &contextDesc, &context)); +ze_event_pool_handle_t eventPool; +ze_event_pool_desc_t eventPoolDesc = {ZE_STRUCTURE_TYPE_EVENT_POOL_DESC}; +eventPoolDesc.count = 1; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeEventPoolCreate(context, &eventPoolDesc, 0, nullptr, &eventPool)); +ze_event_handle_t event; +ze_event_desc_t eventDesc = {ZE_STRUCTURE_TYPE_EVENT_DESC}; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeEventCreate(eventPool, &eventDesc, &event)); +ze_event_handle_t translatedHandle = event; +EXPECT_EQ(ZE_RESULT_SUCCESS, zelLoaderTranslateHandle(ZEL_HANDLE_EVENT, event, reinterpret_cast(&translatedHandle))); +EXPECT_NE(translatedHandle, event); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeEventDestroy(event)); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeEventPoolDestroy(eventPool)); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeContextDestroy(context)); + +} + +TEST( + LoaderTranslateHandles, + GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportEnabledThenExpectNoHandleTranslationForEvent) { + +uint32_t pInitDriversCount = 0; +ze_init_driver_type_desc_t desc = {ZE_STRUCTURE_TYPE_INIT_DRIVER_TYPE_DESC}; +desc.flags = UINT32_MAX; +desc.pNext = nullptr; +putenv_safe( const_cast( "ZE_ENABLE_LOADER_INTERCEPT=1" ) ); +putenv_safe( const_cast( "ZEL_TEST_NULL_DRIVER_DISABLE_DDI_EXT=0" ) ); +std::vector drivers; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, nullptr, &desc)); +drivers.resize(pInitDriversCount); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, drivers.data(), &desc)); +EXPECT_GT(pInitDriversCount, 0); +ze_driver_ddi_handles_ext_properties_t driverDdiHandlesExtProperties = {}; +driverDdiHandlesExtProperties.stype = ZE_STRUCTURE_TYPE_DRIVER_DDI_HANDLES_EXT_PROPERTIES; +driverDdiHandlesExtProperties.pNext = nullptr; +ze_driver_properties_t properties = {}; +properties.stype = ZE_STRUCTURE_TYPE_DRIVER_PROPERTIES; +properties.pNext = &driverDdiHandlesExtProperties; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDriverGetProperties(drivers[0], &properties)); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, drivers.data(), &desc)); +ze_context_handle_t context; +ze_context_desc_t contextDesc = {ZE_STRUCTURE_TYPE_CONTEXT_DESC}; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeContextCreate(drivers[0], &contextDesc, &context)); +ze_event_pool_handle_t eventPool; +ze_event_pool_desc_t eventPoolDesc = {ZE_STRUCTURE_TYPE_EVENT_POOL_DESC}; +eventPoolDesc.count = 1; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeEventPoolCreate(context, &eventPoolDesc, 0, nullptr, &eventPool)); +ze_event_handle_t event; +ze_event_desc_t eventDesc = {ZE_STRUCTURE_TYPE_EVENT_DESC}; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeEventCreate(eventPool, &eventDesc, &event)); +ze_event_handle_t translatedHandle = event; +EXPECT_EQ(ZE_RESULT_SUCCESS, zelLoaderTranslateHandle(ZEL_HANDLE_EVENT, event, reinterpret_cast(&translatedHandle))); +EXPECT_EQ(translatedHandle, event); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeEventDestroy(event)); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeEventPoolDestroy(eventPool)); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeContextDestroy(context)); + +} + +TEST( + LoaderTranslateHandles, + GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportDisabledThenExpectHandleTranslationForDriver) { + +uint32_t pInitDriversCount = 0; +ze_init_driver_type_desc_t desc = {ZE_STRUCTURE_TYPE_INIT_DRIVER_TYPE_DESC}; +desc.flags = UINT32_MAX; +desc.pNext = nullptr; +putenv_safe( const_cast( "ZE_ENABLE_LOADER_INTERCEPT=1" ) ); +putenv_safe( const_cast( "ZEL_TEST_NULL_DRIVER_DISABLE_DDI_EXT=1" ) ); +std::vector drivers; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, nullptr, &desc)); +drivers.resize(pInitDriversCount); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, drivers.data(), &desc)); +EXPECT_GT(pInitDriversCount, 0); +ze_driver_ddi_handles_ext_properties_t driverDdiHandlesExtProperties = {}; +driverDdiHandlesExtProperties.stype = ZE_STRUCTURE_TYPE_DRIVER_DDI_HANDLES_EXT_PROPERTIES; +driverDdiHandlesExtProperties.pNext = nullptr; +ze_driver_properties_t properties = {}; +properties.stype = ZE_STRUCTURE_TYPE_DRIVER_PROPERTIES; +properties.pNext = &driverDdiHandlesExtProperties; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDriverGetProperties(drivers[0], &properties)); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, drivers.data(), &desc)); +ze_driver_handle_t translatedHandle = drivers[0]; +EXPECT_EQ(ZE_RESULT_SUCCESS, zelLoaderTranslateHandle(ZEL_HANDLE_DRIVER, drivers[0], reinterpret_cast(&translatedHandle))); +EXPECT_NE(translatedHandle, drivers[0]); + +} + +TEST( + LoaderTranslateHandles, + GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportEnabledThenExpectNoHandleTranslationForDriver) { + +uint32_t pInitDriversCount = 0; +ze_init_driver_type_desc_t desc = {ZE_STRUCTURE_TYPE_INIT_DRIVER_TYPE_DESC}; +desc.flags = UINT32_MAX; +desc.pNext = nullptr; +putenv_safe( const_cast( "ZE_ENABLE_LOADER_INTERCEPT=1" ) ); +putenv_safe( const_cast( "ZEL_TEST_NULL_DRIVER_DISABLE_DDI_EXT=0" ) ); +std::vector drivers; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, nullptr, &desc)); +drivers.resize(pInitDriversCount); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, drivers.data(), &desc)); +EXPECT_GT(pInitDriversCount, 0); +ze_driver_ddi_handles_ext_properties_t driverDdiHandlesExtProperties = {}; +driverDdiHandlesExtProperties.stype = ZE_STRUCTURE_TYPE_DRIVER_DDI_HANDLES_EXT_PROPERTIES; +driverDdiHandlesExtProperties.pNext = nullptr; +ze_driver_properties_t properties = {}; +properties.stype = ZE_STRUCTURE_TYPE_DRIVER_PROPERTIES; +properties.pNext = &driverDdiHandlesExtProperties; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDriverGetProperties(drivers[0], &properties)); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, drivers.data(), &desc)); +ze_driver_handle_t translatedHandle = drivers[0]; +EXPECT_EQ(ZE_RESULT_SUCCESS, zelLoaderTranslateHandle(ZEL_HANDLE_DRIVER, drivers[0], reinterpret_cast(&translatedHandle))); +EXPECT_EQ(translatedHandle, drivers[0]); + +} + +TEST( + LoaderTranslateHandles, + GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportDisabledThenExpectHandleTranslationForDevice) { + +uint32_t pInitDriversCount = 0; +ze_init_driver_type_desc_t desc = {ZE_STRUCTURE_TYPE_INIT_DRIVER_TYPE_DESC}; +desc.flags = UINT32_MAX; +desc.pNext = nullptr; +putenv_safe( const_cast( "ZE_ENABLE_LOADER_INTERCEPT=1" ) ); +putenv_safe( const_cast( "ZEL_TEST_NULL_DRIVER_DISABLE_DDI_EXT=1" ) ); +std::vector drivers; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, nullptr, &desc)); +drivers.resize(pInitDriversCount); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, drivers.data(), &desc)); +EXPECT_GT(pInitDriversCount, 0); +ze_driver_ddi_handles_ext_properties_t driverDdiHandlesExtProperties = {}; +driverDdiHandlesExtProperties.stype = ZE_STRUCTURE_TYPE_DRIVER_DDI_HANDLES_EXT_PROPERTIES; +driverDdiHandlesExtProperties.pNext = nullptr; +ze_driver_properties_t properties = {}; +properties.stype = ZE_STRUCTURE_TYPE_DRIVER_PROPERTIES; +properties.pNext = &driverDdiHandlesExtProperties; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDriverGetProperties(drivers[0], &properties)); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, drivers.data(), &desc)); +uint32_t deviceCount = 0; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDeviceGet(drivers[0], &deviceCount, nullptr)); +std::vector devices(deviceCount); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDeviceGet(drivers[0], &deviceCount, devices.data())); +ze_device_handle_t translatedHandle = devices[0]; +EXPECT_EQ(ZE_RESULT_SUCCESS, zelLoaderTranslateHandle(ZEL_HANDLE_DEVICE, devices[0], reinterpret_cast(&translatedHandle))); +EXPECT_NE(translatedHandle, devices[0]); + +} + +TEST( + LoaderTranslateHandles, + GivenLevelZeroLoaderPresentWhenCallingZelLoaderTranslateHandleInternalWithInterceptEnabledAndDDiSupportEnabledThenExpectNoHandleTranslationForDevice) { + +uint32_t pInitDriversCount = 0; +ze_init_driver_type_desc_t desc = {ZE_STRUCTURE_TYPE_INIT_DRIVER_TYPE_DESC}; +desc.flags = UINT32_MAX; +desc.pNext = nullptr; +putenv_safe( const_cast( "ZE_ENABLE_LOADER_INTERCEPT=1" ) ); +putenv_safe( const_cast( "ZEL_TEST_NULL_DRIVER_DISABLE_DDI_EXT=0" ) ); +std::vector drivers; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, nullptr, &desc)); +drivers.resize(pInitDriversCount); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, drivers.data(), &desc)); +EXPECT_GT(pInitDriversCount, 0); +ze_driver_ddi_handles_ext_properties_t driverDdiHandlesExtProperties = {}; +driverDdiHandlesExtProperties.stype = ZE_STRUCTURE_TYPE_DRIVER_DDI_HANDLES_EXT_PROPERTIES; +driverDdiHandlesExtProperties.pNext = nullptr; +ze_driver_properties_t properties = {}; +properties.stype = ZE_STRUCTURE_TYPE_DRIVER_PROPERTIES; +properties.pNext = &driverDdiHandlesExtProperties; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDriverGetProperties(drivers[0], &properties)); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeInitDrivers(&pInitDriversCount, drivers.data(), &desc)); +uint32_t deviceCount = 0; +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDeviceGet(drivers[0], &deviceCount, nullptr)); +std::vector devices(deviceCount); +EXPECT_EQ(ZE_RESULT_SUCCESS, zeDeviceGet(drivers[0], &deviceCount, devices.data())); +ze_device_handle_t translatedHandle = devices[0]; +EXPECT_EQ(ZE_RESULT_SUCCESS, zelLoaderTranslateHandle(ZEL_HANDLE_DEVICE, devices[0], reinterpret_cast(&translatedHandle))); +EXPECT_EQ(translatedHandle, devices[0]); + +} + } // namespace From bcff54b90ddad3a504dd7331cb5bde565967922a Mon Sep 17 00:00:00 2001 From: "Neil R. Spruit" Date: Fri, 20 Jun 2025 11:10:27 -0700 Subject: [PATCH 22/28] Fix gtest build to work for windows static or dynamic Signed-off-by: Neil R. Spruit --- .github/workflows/build-quick-static.yml | 12 +++++++++--- CMakeLists.txt | 9 ++------- test/CMakeLists.txt | 6 ------ 3 files changed, 11 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build-quick-static.yml b/.github/workflows/build-quick-static.yml index 0634a74d..409c536a 100644 --- a/.github/workflows/build-quick-static.yml +++ b/.github/workflows/build-quick-static.yml @@ -35,7 +35,6 @@ jobs: -D CMAKE_C_COMPILER_LAUNCHER=ccache \ -D CMAKE_CXX_COMPILER_LAUNCHER=ccache \ -D CMAKE_BUILD_TYPE=Release \ - -D BUILD_L0_LOADER_TESTS=1 \ -D BUILD_STATIC=0 \ .. make -j$(nproc) @@ -49,13 +48,20 @@ jobs: runs-on: [windows-latest] steps: - uses: actions/checkout@v3 - - name: Build Loader on Latest Windows + - name: Build Static Loader on Latest Windows run: | mkdir build cd build cmake -D BUILD_L0_LOADER_TESTS=1 -D BUILD_STATIC=1 .. cmake --build . --config Release + - name: Build Dynamic Loader on Latest Windows + run: | + cd ${{ github.workspace }} + mkdir dynamic_build + cd dynamic_build + cmake -D BUILD_L0_LOADER_TESTS=0 -D BUILD_STATIC=0 .. + cmake --build . --config Release - env: - ZEL_LIBRARY_PATH: '${{ github.workspace }}/build/bin/Release' + ZEL_LIBRARY_PATH: '${{ github.workspace }}/dynamic_build/bin/Release' working-directory: build run: ctest -C Release -V diff --git a/CMakeLists.txt b/CMakeLists.txt index 2b397c98..eeed9cd7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -52,7 +52,7 @@ endif() include(FetchContent) -if(BUILD_L0_LOADER_TESTS AND (NOT MSVC OR (MSVC AND NOT BUILD_STATIC))) +if(BUILD_L0_LOADER_TESTS) FetchContent_Declare( googletest GIT_REPOSITORY https://github.com/google/googletest.git @@ -61,11 +61,6 @@ if(BUILD_L0_LOADER_TESTS AND (NOT MSVC OR (MSVC AND NOT BUILD_STATIC))) add_library(GTest::GTest INTERFACE IMPORTED) target_link_libraries(GTest::GTest INTERFACE gtest_main) - # For Windows: Prevent overriding the parent project's compiler/linker settings - if(MSVC) - set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) - endif() - FetchContent_MakeAvailable(googletest) enable_testing() @@ -229,7 +224,7 @@ set(TARGET_LOADER_NAME ze_loader) add_subdirectory(source) add_subdirectory(samples) -if(BUILD_L0_LOADER_TESTS AND (NOT MSVC OR (MSVC AND NOT BUILD_STATIC))) +if(BUILD_L0_LOADER_TESTS) include(CTest) add_subdirectory(test) endif() diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 73c9fb93..3f3c3084 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -13,12 +13,6 @@ target_link_libraries( ${TARGET_LOADER_NAME} ) -# For some reason the MSVC runtime libraries used by googletest and test -# binaries don't match, so force the test binary to use the dynamic runtime. -if(MSVC) - target_compile_options(tests PRIVATE "/MD$<$:d>") -endif() - add_test(NAME tests_api COMMAND tests --gtest_filter=*GivenLevelZeroLoaderPresentWhenCallingzeGetLoaderVersionsAPIThenValidVersionIsReturned*) set_property(TEST tests_api PROPERTY ENVIRONMENT "ZE_ENABLE_LOADER_DEBUG_TRACE=1;ZE_ENABLE_NULL_DRIVER=1") add_test(NAME tests_init_gpu_all COMMAND tests --gtest_filter=*GivenLevelZeroLoaderPresentWhenCallingZeInitDriversWithGPUTypeThenExpectPassWithGPUorAllOnly*) From 88a9e8cb0ba8bdd42d9132626372bf8a417b5c2d Mon Sep 17 00:00:00 2001 From: "Neil R. Spruit" Date: Fri, 20 Jun 2025 12:41:13 -0700 Subject: [PATCH 23/28] Fix missing code gen and add check in sysman device get for context Signed-off-by: Neil R. Spruit --- scripts/templates/libapi.cpp.mako | 2 +- source/lib/zes_libapi.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/templates/libapi.cpp.mako b/scripts/templates/libapi.cpp.mako index c36c9618..95844696 100644 --- a/scripts/templates/libapi.cpp.mako +++ b/scripts/templates/libapi.cpp.mako @@ -166,7 +166,7 @@ ${th.make_func_name(n, tags, obj)}( return ${X}_RESULT_ERROR_UNINITIALIZED; } %if re.match(r"\w+DriverGet$", th.make_func_name(n, tags, obj)): - if (${x}_lib::context->${n}DdiTable == nullptr) { + if (!${x}_lib::context || ${x}_lib::context->${n}DdiTable == nullptr) { return ${X}_RESULT_ERROR_UNINITIALIZED; } %endif diff --git a/source/lib/zes_libapi.cpp b/source/lib/zes_libapi.cpp index 5c0cb2e5..435dca99 100644 --- a/source/lib/zes_libapi.cpp +++ b/source/lib/zes_libapi.cpp @@ -115,7 +115,7 @@ zesDriverGet( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - if (ze_lib::context->zesDdiTable == nullptr) { + if (!ze_lib::context || ze_lib::context->zesDdiTable == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } static const zes_pfnDriverGet_t pfnGet = [&result] { From ebb387b725ac3690e7a554d44de94e0746992029 Mon Sep 17 00:00:00 2001 From: "Neil R. Spruit" Date: Fri, 20 Jun 2025 09:54:30 -0700 Subject: [PATCH 24/28] fix destroy of loader dispatch given invalid init Signed-off-by: Neil R. Spruit --- source/loader/ze_loader.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/source/loader/ze_loader.cpp b/source/loader/ze_loader.cpp index b3ef06ad..d89b5b29 100644 --- a/source/loader/ze_loader.cpp +++ b/source/loader/ze_loader.cpp @@ -682,10 +682,13 @@ namespace loader } } } - loader_driver_ddi::zeDestroyDDiDriverTables(loader::loaderDispatch->pCore); - loader_driver_ddi::zetDestroyDDiDriverTables(loader::loaderDispatch->pTools); - loader_driver_ddi::zesDestroyDDiDriverTables(loader::loaderDispatch->pSysman); - delete loader::loaderDispatch; + if (loader::loaderDispatch) { + loader_driver_ddi::zeDestroyDDiDriverTables(loader::loaderDispatch->pCore); + loader_driver_ddi::zetDestroyDDiDriverTables(loader::loaderDispatch->pTools); + loader_driver_ddi::zesDestroyDDiDriverTables(loader::loaderDispatch->pSysman); + delete loader::loaderDispatch; + loader::loaderDispatch = nullptr; + } }; void context_t::add_loader_version(){ From 9efecf4ae0b612c4a625ed3240390725c2b6c5e9 Mon Sep 17 00:00:00 2001 From: "Neil R. Spruit" Date: Fri, 20 Jun 2025 12:45:04 -0700 Subject: [PATCH 25/28] Double check the dditable is checked even if the driver reports the api version Signed-off-by: Neil R. Spruit --- scripts/templates/ldrddi_driver_ddi.cpp.mako | 4 + source/loader/ze_ldrddi_driver_ddi.cpp | 800 +++++++++++++++++++ source/loader/zes_ldrddi_driver_ddi.cpp | 588 ++++++++++++++ source/loader/zet_ldrddi_driver_ddi.cpp | 276 +++++++ 4 files changed, 1668 insertions(+) diff --git a/scripts/templates/ldrddi_driver_ddi.cpp.mako b/scripts/templates/ldrddi_driver_ddi.cpp.mako index b279a635..96a9ba9c 100644 --- a/scripts/templates/ldrddi_driver_ddi.cpp.mako +++ b/scripts/templates/ldrddi_driver_ddi.cpp.mako @@ -65,6 +65,10 @@ namespace loader_driver_ddi if (dditable->version < ${th.get_version(obj)}) { return ${X}_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->${th.get_table_name(n, tags, obj)} == nullptr) { + return ${X}_RESULT_ERROR_UNINITIALIZED; + } auto ${th.make_pfn_name(n, tags, obj)} = dditable->${th.get_table_name(n, tags, obj)}->${th.make_pfn_name(n, tags, obj)}; if( nullptr == ${th.make_pfn_name(n, tags, obj)} ) return ${X}_RESULT_ERROR_UNINITIALIZED; diff --git a/source/loader/ze_ldrddi_driver_ddi.cpp b/source/loader/ze_ldrddi_driver_ddi.cpp index 452ab5b6..22f275ca 100644 --- a/source/loader/ze_ldrddi_driver_ddi.cpp +++ b/source/loader/ze_ldrddi_driver_ddi.cpp @@ -29,6 +29,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Driver == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetApiVersion = dditable->Driver->pfnGetApiVersion; if( nullptr == pfnGetApiVersion ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -55,6 +59,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Driver == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetProperties = dditable->Driver->pfnGetProperties; if( nullptr == pfnGetProperties ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -81,6 +89,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Driver == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetIpcProperties = dditable->Driver->pfnGetIpcProperties; if( nullptr == pfnGetIpcProperties ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -116,6 +128,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Driver == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetExtensionProperties = dditable->Driver->pfnGetExtensionProperties; if( nullptr == pfnGetExtensionProperties ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -143,6 +159,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_1) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Driver == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetExtensionFunctionAddress = dditable->Driver->pfnGetExtensionFunctionAddress; if( nullptr == pfnGetExtensionFunctionAddress ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -170,6 +190,10 @@ namespace loader_driver_ddi 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->Driver == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetLastErrorDescription = dditable->Driver->pfnGetLastErrorDescription; if( nullptr == pfnGetLastErrorDescription ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -203,6 +227,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnGet = dditable->Device->pfnGet; if( nullptr == pfnGet ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -229,6 +257,10 @@ namespace loader_driver_ddi 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->Device == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetRootDevice = dditable->Device->pfnGetRootDevice; if( nullptr == pfnGetRootDevice ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -262,6 +294,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnGetSubDevices = dditable->Device->pfnGetSubDevices; if( nullptr == pfnGetSubDevices ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -288,6 +324,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnGetProperties = dditable->Device->pfnGetProperties; if( nullptr == pfnGetProperties ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -314,6 +354,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnGetComputeProperties = dditable->Device->pfnGetComputeProperties; if( nullptr == pfnGetComputeProperties ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -340,6 +384,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnGetModuleProperties = dditable->Device->pfnGetModuleProperties; if( nullptr == pfnGetModuleProperties ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -376,6 +424,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnGetCommandQueueGroupProperties = dditable->Device->pfnGetCommandQueueGroupProperties; if( nullptr == pfnGetCommandQueueGroupProperties ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -411,6 +463,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnGetMemoryProperties = dditable->Device->pfnGetMemoryProperties; if( nullptr == pfnGetMemoryProperties ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -437,6 +493,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnGetMemoryAccessProperties = dditable->Device->pfnGetMemoryAccessProperties; if( nullptr == pfnGetMemoryAccessProperties ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -471,6 +531,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnGetCacheProperties = dditable->Device->pfnGetCacheProperties; if( nullptr == pfnGetCacheProperties ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -497,6 +561,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnGetImageProperties = dditable->Device->pfnGetImageProperties; if( nullptr == pfnGetImageProperties ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -523,6 +591,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnGetExternalMemoryProperties = dditable->Device->pfnGetExternalMemoryProperties; if( nullptr == pfnGetExternalMemoryProperties ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -550,6 +622,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnGetP2PProperties = dditable->Device->pfnGetP2PProperties; if( nullptr == pfnGetP2PProperties ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -577,6 +653,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnCanAccessPeer = dditable->Device->pfnCanAccessPeer; if( nullptr == pfnCanAccessPeer ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -602,6 +682,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnGetStatus = dditable->Device->pfnGetStatus; if( nullptr == pfnGetStatus ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -631,6 +715,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_1) { 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 pfnGetGlobalTimestamps = dditable->Device->pfnGetGlobalTimestamps; if( nullptr == pfnGetGlobalTimestamps ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -658,6 +746,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Context == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnCreate = dditable->Context->pfnCreate; if( nullptr == pfnCreate ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -695,6 +787,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_1) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Context == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnCreateEx = dditable->Context->pfnCreateEx; if( nullptr == pfnCreateEx ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -720,6 +816,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Context == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnDestroy = dditable->Context->pfnDestroy; if( nullptr == pfnDestroy ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -745,6 +845,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Context == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetStatus = dditable->Context->pfnGetStatus; if( nullptr == pfnGetStatus ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -773,6 +877,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnCreate = dditable->CommandQueue->pfnCreate; if( nullptr == pfnCreate ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -798,6 +906,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnDestroy = dditable->CommandQueue->pfnDestroy; if( nullptr == pfnDestroy ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -827,6 +939,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnExecuteCommandLists = dditable->CommandQueue->pfnExecuteCommandLists; if( nullptr == pfnExecuteCommandLists ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -859,6 +975,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnSynchronize = dditable->CommandQueue->pfnSynchronize; if( nullptr == pfnSynchronize ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -885,6 +1005,10 @@ namespace loader_driver_ddi 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->CommandQueue == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetOrdinal = dditable->CommandQueue->pfnGetOrdinal; if( nullptr == pfnGetOrdinal ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -911,6 +1035,10 @@ namespace loader_driver_ddi 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->CommandQueue == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetIndex = dditable->CommandQueue->pfnGetIndex; if( nullptr == pfnGetIndex ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -939,6 +1067,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnCreate = dditable->CommandList->pfnCreate; if( nullptr == pfnCreate ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -967,6 +1099,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnCreateImmediate = dditable->CommandList->pfnCreateImmediate; if( nullptr == pfnCreateImmediate ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -992,6 +1128,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnDestroy = dditable->CommandList->pfnDestroy; if( nullptr == pfnDestroy ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1017,6 +1157,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnClose = dditable->CommandList->pfnClose; if( nullptr == pfnClose ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1042,6 +1186,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnReset = dditable->CommandList->pfnReset; if( nullptr == pfnReset ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1074,6 +1222,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnAppendWriteGlobalTimestamp = dditable->CommandList->pfnAppendWriteGlobalTimestamp; if( nullptr == pfnAppendWriteGlobalTimestamp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1106,6 +1258,10 @@ namespace loader_driver_ddi 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) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnHostSynchronize = dditable->CommandList->pfnHostSynchronize; if( nullptr == pfnHostSynchronize ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1132,6 +1288,10 @@ namespace loader_driver_ddi 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) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetDeviceHandle = dditable->CommandList->pfnGetDeviceHandle; if( nullptr == pfnGetDeviceHandle ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1158,6 +1318,10 @@ namespace loader_driver_ddi 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) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetContextHandle = dditable->CommandList->pfnGetContextHandle; if( nullptr == pfnGetContextHandle ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1184,6 +1348,10 @@ namespace loader_driver_ddi 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) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetOrdinal = dditable->CommandList->pfnGetOrdinal; if( nullptr == pfnGetOrdinal ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1211,6 +1379,10 @@ namespace loader_driver_ddi 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) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnImmediateGetIndex = dditable->CommandList->pfnImmediateGetIndex; if( nullptr == pfnImmediateGetIndex ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1238,6 +1410,10 @@ namespace loader_driver_ddi 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) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnIsImmediate = dditable->CommandList->pfnIsImmediate; if( nullptr == pfnIsImmediate ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1268,6 +1444,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnAppendBarrier = dditable->CommandList->pfnAppendBarrier; if( nullptr == pfnAppendBarrier ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1301,6 +1481,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnAppendMemoryRangesBarrier = dditable->CommandList->pfnAppendMemoryRangesBarrier; if( nullptr == pfnAppendMemoryRangesBarrier ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1327,6 +1511,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Context == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnSystemBarrier = dditable->Context->pfnSystemBarrier; if( nullptr == pfnSystemBarrier ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1360,6 +1548,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnAppendMemoryCopy = dditable->CommandList->pfnAppendMemoryCopy; if( nullptr == pfnAppendMemoryCopy ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1394,6 +1586,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnAppendMemoryFill = dditable->CommandList->pfnAppendMemoryFill; if( nullptr == pfnAppendMemoryFill ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1436,6 +1632,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnAppendMemoryCopyRegion = dditable->CommandList->pfnAppendMemoryCopyRegion; if( nullptr == pfnAppendMemoryCopyRegion ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1470,6 +1670,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnAppendMemoryCopyFromContext = dditable->CommandList->pfnAppendMemoryCopyFromContext; if( nullptr == pfnAppendMemoryCopyFromContext ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1502,6 +1706,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnAppendImageCopy = dditable->CommandList->pfnAppendImageCopy; if( nullptr == pfnAppendImageCopy ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1536,6 +1744,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnAppendImageCopyRegion = dditable->CommandList->pfnAppendImageCopyRegion; if( nullptr == pfnAppendImageCopyRegion ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1569,6 +1781,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnAppendImageCopyToMemory = dditable->CommandList->pfnAppendImageCopyToMemory; if( nullptr == pfnAppendImageCopyToMemory ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1602,6 +1818,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnAppendImageCopyFromMemory = dditable->CommandList->pfnAppendImageCopyFromMemory; if( nullptr == pfnAppendImageCopyFromMemory ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1629,6 +1849,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnAppendMemoryPrefetch = dditable->CommandList->pfnAppendMemoryPrefetch; if( nullptr == pfnAppendMemoryPrefetch ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1658,6 +1882,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnAppendMemAdvise = dditable->CommandList->pfnAppendMemAdvise; if( nullptr == pfnAppendMemAdvise ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1691,6 +1919,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->EventPool == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnCreate = dditable->EventPool->pfnCreate; if( nullptr == pfnCreate ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1716,6 +1948,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->EventPool == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnDestroy = dditable->EventPool->pfnDestroy; if( nullptr == pfnDestroy ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1743,6 +1979,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnCreate = dditable->Event->pfnCreate; if( nullptr == pfnCreate ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1768,6 +2008,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnDestroy = dditable->Event->pfnDestroy; if( nullptr == pfnDestroy ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1794,6 +2038,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->EventPool == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetIpcHandle = dditable->EventPool->pfnGetIpcHandle; if( nullptr == pfnGetIpcHandle ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1821,6 +2069,10 @@ namespace loader_driver_ddi 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->EventPool == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnPutIpcHandle = dditable->EventPool->pfnPutIpcHandle; if( nullptr == pfnPutIpcHandle ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1849,6 +2101,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->EventPool == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnOpenIpcHandle = dditable->EventPool->pfnOpenIpcHandle; if( nullptr == pfnOpenIpcHandle ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1874,6 +2130,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->EventPool == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnCloseIpcHandle = dditable->EventPool->pfnCloseIpcHandle; if( nullptr == pfnCloseIpcHandle ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1900,6 +2160,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnAppendSignalEvent = dditable->CommandList->pfnAppendSignalEvent; if( nullptr == pfnAppendSignalEvent ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1928,6 +2192,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnAppendWaitOnEvents = dditable->CommandList->pfnAppendWaitOnEvents; if( nullptr == pfnAppendWaitOnEvents ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1953,6 +2221,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnHostSignal = dditable->Event->pfnHostSignal; if( nullptr == pfnHostSignal ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1985,6 +2257,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnHostSynchronize = dditable->Event->pfnHostSynchronize; if( nullptr == pfnHostSynchronize ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2010,6 +2286,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnQueryStatus = dditable->Event->pfnQueryStatus; if( nullptr == pfnQueryStatus ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2036,6 +2316,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnAppendEventReset = dditable->CommandList->pfnAppendEventReset; if( nullptr == pfnAppendEventReset ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2061,6 +2345,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnHostReset = dditable->Event->pfnHostReset; if( nullptr == pfnHostReset ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2087,6 +2375,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnQueryKernelTimestamp = dditable->Event->pfnQueryKernelTimestamp; if( nullptr == pfnQueryKernelTimestamp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2124,6 +2416,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnAppendQueryKernelTimestamps = dditable->CommandList->pfnAppendQueryKernelTimestamps; if( nullptr == pfnAppendQueryKernelTimestamps ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2150,6 +2446,10 @@ namespace loader_driver_ddi 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->Event == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetEventPool = dditable->Event->pfnGetEventPool; if( nullptr == pfnGetEventPool ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2178,6 +2478,10 @@ namespace loader_driver_ddi 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->Event == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetSignalScope = dditable->Event->pfnGetSignalScope; if( nullptr == pfnGetSignalScope ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2206,6 +2510,10 @@ namespace loader_driver_ddi 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->Event == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetWaitScope = dditable->Event->pfnGetWaitScope; if( nullptr == pfnGetWaitScope ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2232,6 +2540,10 @@ namespace loader_driver_ddi 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->EventPool == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetContextHandle = dditable->EventPool->pfnGetContextHandle; if( nullptr == pfnGetContextHandle ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2259,6 +2571,10 @@ namespace loader_driver_ddi 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->EventPool == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetFlags = dditable->EventPool->pfnGetFlags; if( nullptr == pfnGetFlags ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2286,6 +2602,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Fence == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnCreate = dditable->Fence->pfnCreate; if( nullptr == pfnCreate ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2311,6 +2631,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Fence == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnDestroy = dditable->Fence->pfnDestroy; if( nullptr == pfnDestroy ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2343,6 +2667,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Fence == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnHostSynchronize = dditable->Fence->pfnHostSynchronize; if( nullptr == pfnHostSynchronize ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2368,6 +2696,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Fence == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnQueryStatus = dditable->Fence->pfnQueryStatus; if( nullptr == pfnQueryStatus ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2393,6 +2725,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Fence == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnReset = dditable->Fence->pfnReset; if( nullptr == pfnReset ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2420,6 +2756,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Image == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetProperties = dditable->Image->pfnGetProperties; if( nullptr == pfnGetProperties ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2448,6 +2788,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Image == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnCreate = dditable->Image->pfnCreate; if( nullptr == pfnCreate ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2473,6 +2817,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Image == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnDestroy = dditable->Image->pfnDestroy; if( nullptr == pfnDestroy ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2506,6 +2854,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Mem == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnAllocShared = dditable->Mem->pfnAllocShared; if( nullptr == pfnAllocShared ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2538,6 +2890,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Mem == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnAllocDevice = dditable->Mem->pfnAllocDevice; if( nullptr == pfnAllocDevice ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2569,6 +2925,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Mem == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnAllocHost = dditable->Mem->pfnAllocHost; if( nullptr == pfnAllocHost ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2595,6 +2955,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Mem == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnFree = dditable->Mem->pfnFree; if( nullptr == pfnFree ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2623,6 +2987,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Mem == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetAllocProperties = dditable->Mem->pfnGetAllocProperties; if( nullptr == pfnGetAllocProperties ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2651,6 +3019,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Mem == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetAddressRange = dditable->Mem->pfnGetAddressRange; if( nullptr == pfnGetAddressRange ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2678,6 +3050,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Mem == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetIpcHandle = dditable->Mem->pfnGetIpcHandle; if( nullptr == pfnGetIpcHandle ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2705,6 +3081,10 @@ namespace loader_driver_ddi 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->MemExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetIpcHandleFromFileDescriptorExp = dditable->MemExp->pfnGetIpcHandleFromFileDescriptorExp; if( nullptr == pfnGetIpcHandleFromFileDescriptorExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2732,6 +3112,10 @@ namespace loader_driver_ddi 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->MemExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetFileDescriptorFromIpcHandleExp = dditable->MemExp->pfnGetFileDescriptorFromIpcHandleExp; if( nullptr == pfnGetFileDescriptorFromIpcHandleExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2758,6 +3142,10 @@ namespace loader_driver_ddi 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->Mem == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnPutIpcHandle = dditable->Mem->pfnPutIpcHandle; if( nullptr == pfnPutIpcHandle ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2788,6 +3176,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Mem == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnOpenIpcHandle = dditable->Mem->pfnOpenIpcHandle; if( nullptr == pfnOpenIpcHandle ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2814,6 +3206,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Mem == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnCloseIpcHandle = dditable->Mem->pfnCloseIpcHandle; if( nullptr == pfnCloseIpcHandle ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2844,6 +3240,10 @@ namespace loader_driver_ddi 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->MemExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnSetAtomicAccessAttributeExp = dditable->MemExp->pfnSetAtomicAccessAttributeExp; if( nullptr == pfnSetAtomicAccessAttributeExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2873,6 +3273,10 @@ namespace loader_driver_ddi 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->MemExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetAtomicAccessAttributeExp = dditable->MemExp->pfnGetAtomicAccessAttributeExp; if( nullptr == pfnGetAtomicAccessAttributeExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2902,6 +3306,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Module == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnCreate = dditable->Module->pfnCreate; if( nullptr == pfnCreate ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2927,6 +3335,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Module == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnDestroy = dditable->Module->pfnDestroy; if( nullptr == pfnDestroy ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2955,6 +3367,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Module == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnDynamicLink = dditable->Module->pfnDynamicLink; if( nullptr == pfnDynamicLink ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2980,6 +3396,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->ModuleBuildLog == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnDestroy = dditable->ModuleBuildLog->pfnDestroy; if( nullptr == pfnDestroy ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3007,6 +3427,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->ModuleBuildLog == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetString = dditable->ModuleBuildLog->pfnGetString; if( nullptr == pfnGetString ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3034,6 +3458,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Module == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetNativeBinary = dditable->Module->pfnGetNativeBinary; if( nullptr == pfnGetNativeBinary ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3062,6 +3490,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Module == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetGlobalPointer = dditable->Module->pfnGetGlobalPointer; if( nullptr == pfnGetGlobalPointer ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3095,6 +3527,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Module == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetKernelNames = dditable->Module->pfnGetKernelNames; if( nullptr == pfnGetKernelNames ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3121,6 +3557,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Module == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetProperties = dditable->Module->pfnGetProperties; if( nullptr == pfnGetProperties ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3148,6 +3588,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Kernel == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnCreate = dditable->Kernel->pfnCreate; if( nullptr == pfnCreate ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3173,6 +3617,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Kernel == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnDestroy = dditable->Kernel->pfnDestroy; if( nullptr == pfnDestroy ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3200,6 +3648,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Module == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetFunctionPointer = dditable->Module->pfnGetFunctionPointer; if( nullptr == pfnGetFunctionPointer ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3228,6 +3680,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Kernel == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnSetGroupSize = dditable->Kernel->pfnSetGroupSize; if( nullptr == pfnSetGroupSize ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3259,6 +3715,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Kernel == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnSuggestGroupSize = dditable->Kernel->pfnSuggestGroupSize; if( nullptr == pfnSuggestGroupSize ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3285,6 +3745,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Kernel == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnSuggestMaxCooperativeGroupCount = dditable->Kernel->pfnSuggestMaxCooperativeGroupCount; if( nullptr == pfnSuggestMaxCooperativeGroupCount ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3314,6 +3778,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Kernel == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnSetArgumentValue = dditable->Kernel->pfnSetArgumentValue; if( nullptr == pfnSetArgumentValue ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3340,6 +3808,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Kernel == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnSetIndirectAccess = dditable->Kernel->pfnSetIndirectAccess; if( nullptr == pfnSetIndirectAccess ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3366,6 +3838,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Kernel == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetIndirectAccess = dditable->Kernel->pfnGetIndirectAccess; if( nullptr == pfnGetIndirectAccess ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3404,6 +3880,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Kernel == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetSourceAttributes = dditable->Kernel->pfnGetSourceAttributes; if( nullptr == pfnGetSourceAttributes ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3431,6 +3911,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Kernel == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnSetCacheConfig = dditable->Kernel->pfnSetCacheConfig; if( nullptr == pfnSetCacheConfig ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3457,6 +3941,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Kernel == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetProperties = dditable->Kernel->pfnGetProperties; if( nullptr == pfnGetProperties ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3485,6 +3973,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Kernel == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetName = dditable->Kernel->pfnGetName; if( nullptr == pfnGetName ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3517,6 +4009,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnAppendLaunchKernel = dditable->CommandList->pfnAppendLaunchKernel; if( nullptr == pfnAppendLaunchKernel ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3549,6 +4045,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnAppendLaunchCooperativeKernel = dditable->CommandList->pfnAppendLaunchCooperativeKernel; if( nullptr == pfnAppendLaunchCooperativeKernel ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3582,6 +4082,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnAppendLaunchKernelIndirect = dditable->CommandList->pfnAppendLaunchKernelIndirect; if( nullptr == pfnAppendLaunchKernelIndirect ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3619,6 +4123,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnAppendLaunchMultipleKernelsIndirect = dditable->CommandList->pfnAppendLaunchMultipleKernelsIndirect; if( nullptr == pfnAppendLaunchMultipleKernelsIndirect ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3647,6 +4155,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Context == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnMakeMemoryResident = dditable->Context->pfnMakeMemoryResident; if( nullptr == pfnMakeMemoryResident ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3675,6 +4187,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Context == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnEvictMemory = dditable->Context->pfnEvictMemory; if( nullptr == pfnEvictMemory ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3702,6 +4218,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Context == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnMakeImageResident = dditable->Context->pfnMakeImageResident; if( nullptr == pfnMakeImageResident ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3729,6 +4249,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Context == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnEvictImage = dditable->Context->pfnEvictImage; if( nullptr == pfnEvictImage ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3757,6 +4281,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Sampler == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnCreate = dditable->Sampler->pfnCreate; if( nullptr == pfnCreate ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3782,6 +4310,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Sampler == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnDestroy = dditable->Sampler->pfnDestroy; if( nullptr == pfnDestroy ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3811,6 +4343,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->VirtualMem == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnReserve = dditable->VirtualMem->pfnReserve; if( nullptr == pfnReserve ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3838,6 +4374,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->VirtualMem == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnFree = dditable->VirtualMem->pfnFree; if( nullptr == pfnFree ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3867,6 +4407,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->VirtualMem == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnQueryPageSize = dditable->VirtualMem->pfnQueryPageSize; if( nullptr == pfnQueryPageSize ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3896,6 +4440,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->PhysicalMem == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnCreate = dditable->PhysicalMem->pfnCreate; if( nullptr == pfnCreate ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3922,6 +4470,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->PhysicalMem == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnDestroy = dditable->PhysicalMem->pfnDestroy; if( nullptr == pfnDestroy ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3955,6 +4507,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->VirtualMem == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnMap = dditable->VirtualMem->pfnMap; if( nullptr == pfnMap ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3982,6 +4538,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->VirtualMem == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnUnmap = dditable->VirtualMem->pfnUnmap; if( nullptr == pfnUnmap ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4011,6 +4571,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->VirtualMem == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnSetAccessAttribute = dditable->VirtualMem->pfnSetAccessAttribute; if( nullptr == pfnSetAccessAttribute ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4041,6 +4605,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->VirtualMem == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetAccessAttribute = dditable->VirtualMem->pfnGetAccessAttribute; if( nullptr == pfnGetAccessAttribute ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4069,6 +4637,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_1) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->KernelExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnSetGlobalOffsetExp = dditable->KernelExp->pfnSetGlobalOffsetExp; if( nullptr == pfnSetGlobalOffsetExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4096,6 +4668,10 @@ namespace loader_driver_ddi 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->KernelExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetBinaryExp = dditable->KernelExp->pfnGetBinaryExp; if( nullptr == pfnGetBinaryExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4123,6 +4699,10 @@ namespace loader_driver_ddi 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->Device == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnImportExternalSemaphoreExt = dditable->Device->pfnImportExternalSemaphoreExt; if( nullptr == pfnImportExternalSemaphoreExt ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4148,6 +4728,10 @@ namespace loader_driver_ddi 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->Device == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnReleaseExternalSemaphoreExt = dditable->Device->pfnReleaseExternalSemaphoreExt; if( nullptr == pfnReleaseExternalSemaphoreExt ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4182,6 +4766,10 @@ namespace loader_driver_ddi 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->CommandList == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnAppendSignalExternalSemaphoreExt = dditable->CommandList->pfnAppendSignalExternalSemaphoreExt; if( nullptr == pfnAppendSignalExternalSemaphoreExt ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4216,6 +4804,10 @@ namespace loader_driver_ddi 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->CommandList == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnAppendWaitExternalSemaphoreExt = dditable->CommandList->pfnAppendWaitExternalSemaphoreExt; if( nullptr == pfnAppendWaitExternalSemaphoreExt ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4243,6 +4835,10 @@ namespace loader_driver_ddi 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->RTASBuilder == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnCreateExt = dditable->RTASBuilder->pfnCreateExt; if( nullptr == pfnCreateExt ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4270,6 +4866,10 @@ namespace loader_driver_ddi 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->RTASBuilder == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetBuildPropertiesExt = dditable->RTASBuilder->pfnGetBuildPropertiesExt; if( nullptr == pfnGetBuildPropertiesExt ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4297,6 +4897,10 @@ namespace loader_driver_ddi 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->Driver == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnRTASFormatCompatibilityCheckExt = dditable->Driver->pfnRTASFormatCompatibilityCheckExt; if( nullptr == pfnRTASFormatCompatibilityCheckExt ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4334,6 +4938,10 @@ namespace loader_driver_ddi 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->RTASBuilder == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnBuildExt = dditable->RTASBuilder->pfnBuildExt; if( nullptr == pfnBuildExt ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4369,6 +4977,10 @@ namespace loader_driver_ddi 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->RTASBuilder == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnCommandListAppendCopyExt = dditable->RTASBuilder->pfnCommandListAppendCopyExt; if( nullptr == pfnCommandListAppendCopyExt ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4394,6 +5006,10 @@ namespace loader_driver_ddi 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->RTASBuilder == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnDestroyExt = dditable->RTASBuilder->pfnDestroyExt; if( nullptr == pfnDestroyExt ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4420,6 +5036,10 @@ namespace loader_driver_ddi 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->RTASParallelOperation == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnCreateExt = dditable->RTASParallelOperation->pfnCreateExt; if( nullptr == pfnCreateExt ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4446,6 +5066,10 @@ namespace loader_driver_ddi 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->RTASParallelOperation == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetPropertiesExt = dditable->RTASParallelOperation->pfnGetPropertiesExt; if( nullptr == pfnGetPropertiesExt ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4471,6 +5095,10 @@ namespace loader_driver_ddi 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->RTASParallelOperation == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnJoinExt = dditable->RTASParallelOperation->pfnJoinExt; if( nullptr == pfnJoinExt ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4496,6 +5124,10 @@ namespace loader_driver_ddi 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->RTASParallelOperation == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnDestroyExt = dditable->RTASParallelOperation->pfnDestroyExt; if( nullptr == pfnDestroyExt ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4530,6 +5162,10 @@ namespace loader_driver_ddi 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->Device == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetVectorWidthPropertiesExt = dditable->Device->pfnGetVectorWidthPropertiesExt; if( nullptr == pfnGetVectorWidthPropertiesExt ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4560,6 +5196,10 @@ namespace loader_driver_ddi 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; @@ -4588,6 +5228,10 @@ namespace loader_driver_ddi 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; @@ -4622,6 +5266,10 @@ namespace loader_driver_ddi 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->EventExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnQueryTimestampsExp = dditable->EventExp->pfnQueryTimestampsExp; if( nullptr == pfnQueryTimestampsExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4648,6 +5296,10 @@ namespace loader_driver_ddi 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->ImageExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetMemoryPropertiesExp = dditable->ImageExp->pfnGetMemoryPropertiesExp; if( nullptr == pfnGetMemoryPropertiesExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4677,6 +5329,10 @@ namespace loader_driver_ddi 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->Image == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnViewCreateExt = dditable->Image->pfnViewCreateExt; if( nullptr == pfnViewCreateExt ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4706,6 +5362,10 @@ namespace loader_driver_ddi 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->ImageExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnViewCreateExp = dditable->ImageExp->pfnViewCreateExp; if( nullptr == pfnViewCreateExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4732,6 +5392,10 @@ namespace loader_driver_ddi 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) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnSchedulingHintExp = dditable->KernelExp->pfnSchedulingHintExp; if( nullptr == pfnSchedulingHintExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4758,6 +5422,10 @@ namespace loader_driver_ddi 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->Device == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnPciGetPropertiesExt = dditable->Device->pfnPciGetPropertiesExt; if( nullptr == pfnPciGetPropertiesExt ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4795,6 +5463,10 @@ namespace loader_driver_ddi 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->CommandList == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnAppendImageCopyToMemoryExt = dditable->CommandList->pfnAppendImageCopyToMemoryExt; if( nullptr == pfnAppendImageCopyToMemoryExt ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4832,6 +5504,10 @@ namespace loader_driver_ddi 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->CommandList == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnAppendImageCopyFromMemoryExt = dditable->CommandList->pfnAppendImageCopyFromMemoryExt; if( nullptr == pfnAppendImageCopyFromMemoryExt ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4859,6 +5535,10 @@ namespace loader_driver_ddi 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->Image == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetAllocPropertiesExt = dditable->Image->pfnGetAllocPropertiesExt; if( nullptr == pfnGetAllocPropertiesExt ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4889,6 +5569,10 @@ namespace loader_driver_ddi 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->Module == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnInspectLinkageExt = dditable->Module->pfnInspectLinkageExt; if( nullptr == pfnInspectLinkageExt ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4916,6 +5600,10 @@ namespace loader_driver_ddi 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->Mem == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnFreeExt = dditable->Mem->pfnFreeExt; if( nullptr == pfnFreeExt ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4950,6 +5638,10 @@ namespace loader_driver_ddi 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->FabricVertexExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetExp = dditable->FabricVertexExp->pfnGetExp; if( nullptr == pfnGetExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4984,6 +5676,10 @@ namespace loader_driver_ddi 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->FabricVertexExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetSubVerticesExp = dditable->FabricVertexExp->pfnGetSubVerticesExp; if( nullptr == pfnGetSubVerticesExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -5010,6 +5706,10 @@ namespace loader_driver_ddi 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->FabricVertexExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetPropertiesExp = dditable->FabricVertexExp->pfnGetPropertiesExp; if( nullptr == pfnGetPropertiesExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -5036,6 +5736,10 @@ namespace loader_driver_ddi 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->FabricVertexExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetDeviceExp = dditable->FabricVertexExp->pfnGetDeviceExp; if( nullptr == pfnGetDeviceExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -5062,6 +5766,10 @@ namespace loader_driver_ddi 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->DeviceExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetFabricVertexExp = dditable->DeviceExp->pfnGetFabricVertexExp; if( nullptr == pfnGetFabricVertexExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -5097,6 +5805,10 @@ namespace loader_driver_ddi 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->FabricEdgeExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetExp = dditable->FabricEdgeExp->pfnGetExp; if( nullptr == pfnGetExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -5124,6 +5836,10 @@ namespace loader_driver_ddi 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->FabricEdgeExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetVerticesExp = dditable->FabricEdgeExp->pfnGetVerticesExp; if( nullptr == pfnGetVerticesExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -5150,6 +5866,10 @@ namespace loader_driver_ddi 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->FabricEdgeExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetPropertiesExp = dditable->FabricEdgeExp->pfnGetPropertiesExp; if( nullptr == pfnGetPropertiesExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -5191,6 +5911,10 @@ namespace loader_driver_ddi 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->Event == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnQueryKernelTimestampsExt = dditable->Event->pfnQueryKernelTimestampsExt; if( nullptr == pfnQueryKernelTimestampsExt ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -5218,6 +5942,10 @@ namespace loader_driver_ddi 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->RTASBuilderExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnCreateExp = dditable->RTASBuilderExp->pfnCreateExp; if( nullptr == pfnCreateExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -5245,6 +5973,10 @@ namespace loader_driver_ddi 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->RTASBuilderExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetBuildPropertiesExp = dditable->RTASBuilderExp->pfnGetBuildPropertiesExp; if( nullptr == pfnGetBuildPropertiesExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -5272,6 +6004,10 @@ namespace loader_driver_ddi 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->DriverExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnRTASFormatCompatibilityCheckExp = dditable->DriverExp->pfnRTASFormatCompatibilityCheckExp; if( nullptr == pfnRTASFormatCompatibilityCheckExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -5309,6 +6045,10 @@ namespace loader_driver_ddi 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->RTASBuilderExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnBuildExp = dditable->RTASBuilderExp->pfnBuildExp; if( nullptr == pfnBuildExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -5334,6 +6074,10 @@ namespace loader_driver_ddi 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->RTASBuilderExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnDestroyExp = dditable->RTASBuilderExp->pfnDestroyExp; if( nullptr == pfnDestroyExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -5360,6 +6104,10 @@ namespace loader_driver_ddi 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->RTASParallelOperationExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnCreateExp = dditable->RTASParallelOperationExp->pfnCreateExp; if( nullptr == pfnCreateExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -5386,6 +6134,10 @@ namespace loader_driver_ddi 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->RTASParallelOperationExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetPropertiesExp = dditable->RTASParallelOperationExp->pfnGetPropertiesExp; if( nullptr == pfnGetPropertiesExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -5411,6 +6163,10 @@ namespace loader_driver_ddi 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->RTASParallelOperationExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnJoinExp = dditable->RTASParallelOperationExp->pfnJoinExp; if( nullptr == pfnJoinExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -5436,6 +6192,10 @@ namespace loader_driver_ddi 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->RTASParallelOperationExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnDestroyExp = dditable->RTASParallelOperationExp->pfnDestroyExp; if( nullptr == pfnDestroyExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -5466,6 +6226,10 @@ namespace loader_driver_ddi 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->Mem == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetPitchFor2dImage = dditable->Mem->pfnGetPitchFor2dImage; if( nullptr == pfnGetPitchFor2dImage ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -5492,6 +6256,10 @@ namespace loader_driver_ddi 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->ImageExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetDeviceOffsetExp = dditable->ImageExp->pfnGetDeviceOffsetExp; if( nullptr == pfnGetDeviceOffsetExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -5518,6 +6286,10 @@ namespace loader_driver_ddi 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->CommandListExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnCreateCloneExp = dditable->CommandListExp->pfnCreateCloneExp; if( nullptr == pfnCreateCloneExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -5554,6 +6326,10 @@ namespace loader_driver_ddi 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->CommandListExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnImmediateAppendCommandListsExp = dditable->CommandListExp->pfnImmediateAppendCommandListsExp; if( nullptr == pfnImmediateAppendCommandListsExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -5581,6 +6357,10 @@ namespace loader_driver_ddi 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->CommandListExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetNextCommandIdExp = dditable->CommandListExp->pfnGetNextCommandIdExp; if( nullptr == pfnGetNextCommandIdExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -5612,6 +6392,10 @@ namespace loader_driver_ddi 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) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetNextCommandIdWithKernelsExp = dditable->CommandListExp->pfnGetNextCommandIdWithKernelsExp; if( nullptr == pfnGetNextCommandIdWithKernelsExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -5639,6 +6423,10 @@ namespace loader_driver_ddi 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->CommandListExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnUpdateMutableCommandsExp = dditable->CommandListExp->pfnUpdateMutableCommandsExp; if( nullptr == pfnUpdateMutableCommandsExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -5666,6 +6454,10 @@ namespace loader_driver_ddi 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->CommandListExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnUpdateMutableCommandSignalEventExp = dditable->CommandListExp->pfnUpdateMutableCommandSignalEventExp; if( nullptr == pfnUpdateMutableCommandSignalEventExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -5695,6 +6487,10 @@ namespace loader_driver_ddi 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->CommandListExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnUpdateMutableCommandWaitEventsExp = dditable->CommandListExp->pfnUpdateMutableCommandWaitEventsExp; if( nullptr == pfnUpdateMutableCommandWaitEventsExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -5724,6 +6520,10 @@ namespace loader_driver_ddi 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) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnUpdateMutableCommandKernelsExp = dditable->CommandListExp->pfnUpdateMutableCommandKernelsExp; if( nullptr == pfnUpdateMutableCommandKernelsExp ) return ZE_RESULT_ERROR_UNINITIALIZED; diff --git a/source/loader/zes_ldrddi_driver_ddi.cpp b/source/loader/zes_ldrddi_driver_ddi.cpp index 55a39b08..4935c856 100644 --- a/source/loader/zes_ldrddi_driver_ddi.cpp +++ b/source/loader/zes_ldrddi_driver_ddi.cpp @@ -38,6 +38,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_8) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Driver == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetExtensionProperties = dditable->Driver->pfnGetExtensionProperties; if( nullptr == pfnGetExtensionProperties ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -65,6 +69,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_8) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Driver == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetExtensionFunctionAddress = dditable->Driver->pfnGetExtensionFunctionAddress; if( nullptr == pfnGetExtensionFunctionAddress ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -99,6 +107,10 @@ namespace loader_driver_ddi 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->Device == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGet = dditable->Device->pfnGet; if( nullptr == pfnGet ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -125,6 +137,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnGetProperties = dditable->Device->pfnGetProperties; if( nullptr == pfnGetProperties ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -151,6 +167,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnGetState = dditable->Device->pfnGetState; if( nullptr == pfnGetState ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -178,6 +198,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnReset = dditable->Device->pfnReset; if( nullptr == pfnReset ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -204,6 +228,10 @@ namespace loader_driver_ddi 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->Device == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnResetExt = dditable->Device->pfnResetExt; if( nullptr == pfnResetExt ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -239,6 +267,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnProcessesGetState = dditable->Device->pfnProcessesGetState; if( nullptr == pfnProcessesGetState ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -265,6 +297,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnPciGetProperties = dditable->Device->pfnPciGetProperties; if( nullptr == pfnPciGetProperties ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -291,6 +327,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnPciGetState = dditable->Device->pfnPciGetState; if( nullptr == pfnPciGetState ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -325,6 +365,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnPciGetBars = dditable->Device->pfnPciGetBars; if( nullptr == pfnPciGetBars ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -351,6 +395,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnPciGetStats = dditable->Device->pfnPciGetStats; if( nullptr == pfnPciGetStats ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -376,6 +424,10 @@ namespace loader_driver_ddi 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->Device == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnSetOverclockWaiver = dditable->Device->pfnSetOverclockWaiver; if( nullptr == pfnSetOverclockWaiver ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -404,6 +456,10 @@ namespace loader_driver_ddi 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->Device == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetOverclockDomains = dditable->Device->pfnGetOverclockDomains; if( nullptr == pfnGetOverclockDomains ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -433,6 +489,10 @@ namespace loader_driver_ddi 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->Device == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetOverclockControls = dditable->Device->pfnGetOverclockControls; if( nullptr == pfnGetOverclockControls ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -460,6 +520,10 @@ namespace loader_driver_ddi 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->Device == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnResetOverclockSettings = dditable->Device->pfnResetOverclockSettings; if( nullptr == pfnResetOverclockSettings ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -491,6 +555,10 @@ namespace loader_driver_ddi 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->Device == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnReadOverclockState = dditable->Device->pfnReadOverclockState; if( nullptr == pfnReadOverclockState ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -527,6 +595,10 @@ namespace loader_driver_ddi 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->Device == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnEnumOverclockDomains = dditable->Device->pfnEnumOverclockDomains; if( nullptr == pfnEnumOverclockDomains ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -553,6 +625,10 @@ namespace loader_driver_ddi 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->Overclock == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetDomainProperties = dditable->Overclock->pfnGetDomainProperties; if( nullptr == pfnGetDomainProperties ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -579,6 +655,10 @@ namespace loader_driver_ddi 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->Overclock == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetDomainVFProperties = dditable->Overclock->pfnGetDomainVFProperties; if( nullptr == pfnGetDomainVFProperties ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -606,6 +686,10 @@ namespace loader_driver_ddi 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->Overclock == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetDomainControlProperties = dditable->Overclock->pfnGetDomainControlProperties; if( nullptr == pfnGetDomainControlProperties ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -633,6 +717,10 @@ namespace loader_driver_ddi 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->Overclock == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetControlCurrentValue = dditable->Overclock->pfnGetControlCurrentValue; if( nullptr == pfnGetControlCurrentValue ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -661,6 +749,10 @@ namespace loader_driver_ddi 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->Overclock == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetControlPendingValue = dditable->Overclock->pfnGetControlPendingValue; if( nullptr == pfnGetControlPendingValue ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -690,6 +782,10 @@ namespace loader_driver_ddi 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->Overclock == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnSetControlUserValue = dditable->Overclock->pfnSetControlUserValue; if( nullptr == pfnSetControlUserValue ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -718,6 +814,10 @@ namespace loader_driver_ddi 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->Overclock == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetControlState = dditable->Overclock->pfnGetControlState; if( nullptr == pfnGetControlState ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -748,6 +848,10 @@ namespace loader_driver_ddi 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->Overclock == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetVFPointValues = dditable->Overclock->pfnGetVFPointValues; if( nullptr == pfnGetVFPointValues ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -777,6 +881,10 @@ namespace loader_driver_ddi 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->Overclock == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnSetVFPointValues = dditable->Overclock->pfnSetVFPointValues; if( nullptr == pfnSetVFPointValues ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -813,6 +921,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnEnumDiagnosticTestSuites = dditable->Device->pfnEnumDiagnosticTestSuites; if( nullptr == pfnEnumDiagnosticTestSuites ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -840,6 +952,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Diagnostics == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetProperties = dditable->Diagnostics->pfnGetProperties; if( nullptr == pfnGetProperties ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -874,6 +990,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Diagnostics == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetTests = dditable->Diagnostics->pfnGetTests; if( nullptr == pfnGetTests ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -904,6 +1024,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Diagnostics == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnRunTests = dditable->Diagnostics->pfnRunTests; if( nullptr == pfnRunTests ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -930,6 +1054,10 @@ namespace loader_driver_ddi 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) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnEccAvailable = dditable->Device->pfnEccAvailable; if( nullptr == pfnEccAvailable ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -956,6 +1084,10 @@ namespace loader_driver_ddi 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) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnEccConfigurable = dditable->Device->pfnEccConfigurable; if( nullptr == pfnEccConfigurable ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -982,6 +1114,10 @@ namespace loader_driver_ddi 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) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetEccState = dditable->Device->pfnGetEccState; if( nullptr == pfnGetEccState ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1009,6 +1145,10 @@ namespace loader_driver_ddi 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) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnSetEccState = dditable->Device->pfnSetEccState; if( nullptr == pfnSetEccState ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1045,6 +1185,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnEnumEngineGroups = dditable->Device->pfnEnumEngineGroups; if( nullptr == pfnEnumEngineGroups ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1071,6 +1215,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Engine == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetProperties = dditable->Engine->pfnGetProperties; if( nullptr == pfnGetProperties ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1098,6 +1246,10 @@ namespace loader_driver_ddi 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->Engine == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetActivity = dditable->Engine->pfnGetActivity; if( nullptr == pfnGetActivity ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1124,6 +1276,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnEventRegister = dditable->Device->pfnEventRegister; if( nullptr == pfnEventRegister ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1166,6 +1322,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Driver == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnEventListen = dditable->Driver->pfnEventListen; if( nullptr == pfnEventListen ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1208,6 +1368,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_1) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Driver == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnEventListenEx = dditable->Driver->pfnEventListenEx; if( nullptr == pfnEventListenEx ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1244,6 +1408,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnEnumFabricPorts = dditable->Device->pfnEnumFabricPorts; if( nullptr == pfnEnumFabricPorts ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1270,6 +1438,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->FabricPort == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetProperties = dditable->FabricPort->pfnGetProperties; if( nullptr == pfnGetProperties ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1297,6 +1469,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->FabricPort == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetLinkType = dditable->FabricPort->pfnGetLinkType; if( nullptr == pfnGetLinkType ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1323,6 +1499,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->FabricPort == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetConfig = dditable->FabricPort->pfnGetConfig; if( nullptr == pfnGetConfig ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1349,6 +1529,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->FabricPort == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnSetConfig = dditable->FabricPort->pfnSetConfig; if( nullptr == pfnSetConfig ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1375,6 +1559,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->FabricPort == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetState = dditable->FabricPort->pfnGetState; if( nullptr == pfnGetState ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1401,6 +1589,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->FabricPort == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetThroughput = dditable->FabricPort->pfnGetThroughput; if( nullptr == pfnGetThroughput ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1427,6 +1619,10 @@ namespace loader_driver_ddi 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->FabricPort == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetFabricErrorCounters = dditable->FabricPort->pfnGetFabricErrorCounters; if( nullptr == pfnGetFabricErrorCounters ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1457,6 +1653,10 @@ namespace loader_driver_ddi 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->FabricPort == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetMultiPortThroughput = dditable->FabricPort->pfnGetMultiPortThroughput; if( nullptr == pfnGetMultiPortThroughput ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1493,6 +1693,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnEnumFans = dditable->Device->pfnEnumFans; if( nullptr == pfnEnumFans ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1519,6 +1723,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Fan == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetProperties = dditable->Fan->pfnGetProperties; if( nullptr == pfnGetProperties ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1545,6 +1753,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Fan == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetConfig = dditable->Fan->pfnGetConfig; if( nullptr == pfnGetConfig ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1570,6 +1782,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Fan == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnSetDefaultMode = dditable->Fan->pfnSetDefaultMode; if( nullptr == pfnSetDefaultMode ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1596,6 +1812,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Fan == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnSetFixedSpeedMode = dditable->Fan->pfnSetFixedSpeedMode; if( nullptr == pfnSetFixedSpeedMode ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1622,6 +1842,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Fan == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnSetSpeedTableMode = dditable->Fan->pfnSetSpeedTableMode; if( nullptr == pfnSetSpeedTableMode ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1651,6 +1875,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Fan == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetState = dditable->Fan->pfnGetState; if( nullptr == pfnGetState ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1687,6 +1915,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnEnumFirmwares = dditable->Device->pfnEnumFirmwares; if( nullptr == pfnEnumFirmwares ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1714,6 +1946,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Firmware == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetProperties = dditable->Firmware->pfnGetProperties; if( nullptr == pfnGetProperties ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1741,6 +1977,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Firmware == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnFlash = dditable->Firmware->pfnFlash; if( nullptr == pfnFlash ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1767,6 +2007,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_8) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Firmware == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetFlashProgress = dditable->Firmware->pfnGetFlashProgress; if( nullptr == pfnGetFlashProgress ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1794,6 +2038,10 @@ namespace loader_driver_ddi 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->Firmware == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetConsoleLogs = dditable->Firmware->pfnGetConsoleLogs; if( nullptr == pfnGetConsoleLogs ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1830,6 +2078,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnEnumFrequencyDomains = dditable->Device->pfnEnumFrequencyDomains; if( nullptr == pfnEnumFrequencyDomains ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1856,6 +2108,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Frequency == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetProperties = dditable->Frequency->pfnGetProperties; if( nullptr == pfnGetProperties ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1890,6 +2146,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Frequency == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetAvailableClocks = dditable->Frequency->pfnGetAvailableClocks; if( nullptr == pfnGetAvailableClocks ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1917,6 +2177,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Frequency == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetRange = dditable->Frequency->pfnGetRange; if( nullptr == pfnGetRange ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1944,6 +2208,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Frequency == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnSetRange = dditable->Frequency->pfnSetRange; if( nullptr == pfnSetRange ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1970,6 +2238,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Frequency == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetState = dditable->Frequency->pfnGetState; if( nullptr == pfnGetState ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1997,6 +2269,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Frequency == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetThrottleTime = dditable->Frequency->pfnGetThrottleTime; if( nullptr == pfnGetThrottleTime ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2023,6 +2299,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Frequency == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnOcGetCapabilities = dditable->Frequency->pfnOcGetCapabilities; if( nullptr == pfnOcGetCapabilities ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2052,6 +2332,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Frequency == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnOcGetFrequencyTarget = dditable->Frequency->pfnOcGetFrequencyTarget; if( nullptr == pfnOcGetFrequencyTarget ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2081,6 +2365,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Frequency == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnOcSetFrequencyTarget = dditable->Frequency->pfnOcSetFrequencyTarget; if( nullptr == pfnOcSetFrequencyTarget ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2112,6 +2400,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Frequency == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnOcGetVoltageTarget = dditable->Frequency->pfnOcGetVoltageTarget; if( nullptr == pfnOcGetVoltageTarget ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2143,6 +2435,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Frequency == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnOcSetVoltageTarget = dditable->Frequency->pfnOcSetVoltageTarget; if( nullptr == pfnOcSetVoltageTarget ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2169,6 +2465,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Frequency == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnOcSetMode = dditable->Frequency->pfnOcSetMode; if( nullptr == pfnOcSetMode ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2195,6 +2495,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Frequency == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnOcGetMode = dditable->Frequency->pfnOcGetMode; if( nullptr == pfnOcGetMode ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2222,6 +2526,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Frequency == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnOcGetIccMax = dditable->Frequency->pfnOcGetIccMax; if( nullptr == pfnOcGetIccMax ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2248,6 +2556,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Frequency == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnOcSetIccMax = dditable->Frequency->pfnOcSetIccMax; if( nullptr == pfnOcSetIccMax ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2275,6 +2587,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Frequency == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnOcGetTjMax = dditable->Frequency->pfnOcGetTjMax; if( nullptr == pfnOcGetTjMax ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2301,6 +2617,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Frequency == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnOcSetTjMax = dditable->Frequency->pfnOcSetTjMax; if( nullptr == pfnOcSetTjMax ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2337,6 +2657,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnEnumLeds = dditable->Device->pfnEnumLeds; if( nullptr == pfnEnumLeds ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2363,6 +2687,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Led == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetProperties = dditable->Led->pfnGetProperties; if( nullptr == pfnGetProperties ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2389,6 +2717,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Led == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetState = dditable->Led->pfnGetState; if( nullptr == pfnGetState ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2415,6 +2747,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Led == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnSetState = dditable->Led->pfnSetState; if( nullptr == pfnSetState ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2441,6 +2777,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Led == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnSetColor = dditable->Led->pfnSetColor; if( nullptr == pfnSetColor ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2477,6 +2817,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnEnumMemoryModules = dditable->Device->pfnEnumMemoryModules; if( nullptr == pfnEnumMemoryModules ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2503,6 +2847,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Memory == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetProperties = dditable->Memory->pfnGetProperties; if( nullptr == pfnGetProperties ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2529,6 +2877,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Memory == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetState = dditable->Memory->pfnGetState; if( nullptr == pfnGetState ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2556,6 +2908,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Memory == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetBandwidth = dditable->Memory->pfnGetBandwidth; if( nullptr == pfnGetBandwidth ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2592,6 +2948,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnEnumPerformanceFactorDomains = dditable->Device->pfnEnumPerformanceFactorDomains; if( nullptr == pfnEnumPerformanceFactorDomains ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2619,6 +2979,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->PerformanceFactor == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetProperties = dditable->PerformanceFactor->pfnGetProperties; if( nullptr == pfnGetProperties ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2646,6 +3010,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->PerformanceFactor == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetConfig = dditable->PerformanceFactor->pfnGetConfig; if( nullptr == pfnGetConfig ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2672,6 +3040,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->PerformanceFactor == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnSetConfig = dditable->PerformanceFactor->pfnSetConfig; if( nullptr == pfnSetConfig ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2708,6 +3080,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnEnumPowerDomains = dditable->Device->pfnEnumPowerDomains; if( nullptr == pfnEnumPowerDomains ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2734,6 +3110,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnGetCardPowerDomain = dditable->Device->pfnGetCardPowerDomain; if( nullptr == pfnGetCardPowerDomain ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2760,6 +3140,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Power == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetProperties = dditable->Power->pfnGetProperties; if( nullptr == pfnGetProperties ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2787,6 +3171,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Power == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetEnergyCounter = dditable->Power->pfnGetEnergyCounter; if( nullptr == pfnGetEnergyCounter ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2818,6 +3206,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Power == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetLimits = dditable->Power->pfnGetLimits; if( nullptr == pfnGetLimits ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2849,6 +3241,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Power == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnSetLimits = dditable->Power->pfnSetLimits; if( nullptr == pfnSetLimits ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2876,6 +3272,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Power == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetEnergyThreshold = dditable->Power->pfnGetEnergyThreshold; if( nullptr == pfnGetEnergyThreshold ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2902,6 +3302,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Power == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnSetEnergyThreshold = dditable->Power->pfnSetEnergyThreshold; if( nullptr == pfnSetEnergyThreshold ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2938,6 +3342,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnEnumPsus = dditable->Device->pfnEnumPsus; if( nullptr == pfnEnumPsus ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2964,6 +3372,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Psu == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetProperties = dditable->Psu->pfnGetProperties; if( nullptr == pfnGetProperties ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2990,6 +3402,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Psu == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetState = dditable->Psu->pfnGetState; if( nullptr == pfnGetState ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3026,6 +3442,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnEnumRasErrorSets = dditable->Device->pfnEnumRasErrorSets; if( nullptr == pfnEnumRasErrorSets ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3052,6 +3472,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Ras == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetProperties = dditable->Ras->pfnGetProperties; if( nullptr == pfnGetProperties ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3079,6 +3503,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Ras == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetConfig = dditable->Ras->pfnGetConfig; if( nullptr == pfnGetConfig ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3105,6 +3533,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Ras == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnSetConfig = dditable->Ras->pfnSetConfig; if( nullptr == pfnSetConfig ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3132,6 +3564,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Ras == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetState = dditable->Ras->pfnGetState; if( nullptr == pfnGetState ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3168,6 +3604,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnEnumSchedulers = dditable->Device->pfnEnumSchedulers; if( nullptr == pfnEnumSchedulers ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3194,6 +3634,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Scheduler == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetProperties = dditable->Scheduler->pfnGetProperties; if( nullptr == pfnGetProperties ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3220,6 +3664,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Scheduler == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetCurrentMode = dditable->Scheduler->pfnGetCurrentMode; if( nullptr == pfnGetCurrentMode ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3248,6 +3696,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Scheduler == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetTimeoutModeProperties = dditable->Scheduler->pfnGetTimeoutModeProperties; if( nullptr == pfnGetTimeoutModeProperties ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3276,6 +3728,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Scheduler == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetTimesliceModeProperties = dditable->Scheduler->pfnGetTimesliceModeProperties; if( nullptr == pfnGetTimesliceModeProperties ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3304,6 +3760,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Scheduler == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnSetTimeoutMode = dditable->Scheduler->pfnSetTimeoutMode; if( nullptr == pfnSetTimeoutMode ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3332,6 +3792,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Scheduler == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnSetTimesliceMode = dditable->Scheduler->pfnSetTimesliceMode; if( nullptr == pfnSetTimesliceMode ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3359,6 +3823,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Scheduler == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnSetExclusiveMode = dditable->Scheduler->pfnSetExclusiveMode; if( nullptr == pfnSetExclusiveMode ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3386,6 +3854,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Scheduler == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnSetComputeUnitDebugMode = dditable->Scheduler->pfnSetComputeUnitDebugMode; if( nullptr == pfnSetComputeUnitDebugMode ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3422,6 +3894,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnEnumStandbyDomains = dditable->Device->pfnEnumStandbyDomains; if( nullptr == pfnEnumStandbyDomains ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3448,6 +3924,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Standby == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetProperties = dditable->Standby->pfnGetProperties; if( nullptr == pfnGetProperties ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3474,6 +3954,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Standby == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetMode = dditable->Standby->pfnGetMode; if( nullptr == pfnGetMode ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3500,6 +3984,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Standby == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnSetMode = dditable->Standby->pfnSetMode; if( nullptr == pfnSetMode ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3536,6 +4024,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnEnumTemperatureSensors = dditable->Device->pfnEnumTemperatureSensors; if( nullptr == pfnEnumTemperatureSensors ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3562,6 +4054,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Temperature == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetProperties = dditable->Temperature->pfnGetProperties; if( nullptr == pfnGetProperties ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3588,6 +4084,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Temperature == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetConfig = dditable->Temperature->pfnGetConfig; if( nullptr == pfnGetConfig ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3614,6 +4114,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Temperature == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnSetConfig = dditable->Temperature->pfnSetConfig; if( nullptr == pfnSetConfig ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3641,6 +4145,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Temperature == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetState = dditable->Temperature->pfnGetState; if( nullptr == pfnGetState ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3675,6 +4183,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Power == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetLimitsExt = dditable->Power->pfnGetLimitsExt; if( nullptr == pfnGetLimitsExt ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3702,6 +4214,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Power == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnSetLimitsExt = dditable->Power->pfnSetLimitsExt; if( nullptr == pfnSetLimitsExt ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3741,6 +4257,10 @@ namespace loader_driver_ddi 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->Engine == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetActivityExt = dditable->Engine->pfnGetActivityExt; if( nullptr == pfnGetActivityExt ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3775,6 +4295,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->RasExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetStateExp = dditable->RasExp->pfnGetStateExp; if( nullptr == pfnGetStateExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3801,6 +4325,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->RasExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnClearStateExp = dditable->RasExp->pfnClearStateExp; if( nullptr == pfnClearStateExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3828,6 +4356,10 @@ namespace loader_driver_ddi 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->FirmwareExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetSecurityVersionExp = dditable->FirmwareExp->pfnGetSecurityVersionExp; if( nullptr == pfnGetSecurityVersionExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3853,6 +4385,10 @@ namespace loader_driver_ddi 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->FirmwareExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnSetSecurityVersionExp = dditable->FirmwareExp->pfnSetSecurityVersionExp; if( nullptr == pfnSetSecurityVersionExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3887,6 +4423,10 @@ namespace loader_driver_ddi 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) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetSubDevicePropertiesExp = dditable->DeviceExp->pfnGetSubDevicePropertiesExp; if( nullptr == pfnGetSubDevicePropertiesExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3917,6 +4457,10 @@ namespace loader_driver_ddi 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->DriverExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetDeviceByUuidExp = dditable->DriverExp->pfnGetDeviceByUuidExp; if( nullptr == pfnGetDeviceByUuidExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3953,6 +4497,10 @@ namespace loader_driver_ddi 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) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnEnumActiveVFExp = dditable->DeviceExp->pfnEnumActiveVFExp; if( nullptr == pfnEnumActiveVFExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -3979,6 +4527,10 @@ namespace loader_driver_ddi 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->VFManagementExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetVFPropertiesExp = dditable->VFManagementExp->pfnGetVFPropertiesExp; if( nullptr == pfnGetVFPropertiesExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4017,6 +4569,10 @@ namespace loader_driver_ddi 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->VFManagementExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetVFMemoryUtilizationExp = dditable->VFManagementExp->pfnGetVFMemoryUtilizationExp; if( nullptr == pfnGetVFMemoryUtilizationExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4055,6 +4611,10 @@ namespace loader_driver_ddi 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->VFManagementExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetVFEngineUtilizationExp = dditable->VFManagementExp->pfnGetVFEngineUtilizationExp; if( nullptr == pfnGetVFEngineUtilizationExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4083,6 +4643,10 @@ namespace loader_driver_ddi 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->VFManagementExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnSetVFTelemetryModeExp = dditable->VFManagementExp->pfnSetVFTelemetryModeExp; if( nullptr == pfnSetVFTelemetryModeExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4111,6 +4675,10 @@ namespace loader_driver_ddi 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->VFManagementExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnSetVFTelemetrySamplingIntervalExp = dditable->VFManagementExp->pfnSetVFTelemetrySamplingIntervalExp; if( nullptr == pfnSetVFTelemetrySamplingIntervalExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4147,6 +4715,10 @@ namespace loader_driver_ddi 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->DeviceExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnEnumEnabledVFExp = dditable->DeviceExp->pfnEnumEnabledVFExp; if( nullptr == pfnEnumEnabledVFExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4173,6 +4745,10 @@ namespace loader_driver_ddi 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->VFManagementExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetVFCapabilitiesExp = dditable->VFManagementExp->pfnGetVFCapabilitiesExp; if( nullptr == pfnGetVFCapabilitiesExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4209,6 +4785,10 @@ namespace loader_driver_ddi 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->VFManagementExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetVFMemoryUtilizationExp2 = dditable->VFManagementExp->pfnGetVFMemoryUtilizationExp2; if( nullptr == pfnGetVFMemoryUtilizationExp2 ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4245,6 +4825,10 @@ namespace loader_driver_ddi 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->VFManagementExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetVFEngineUtilizationExp2 = dditable->VFManagementExp->pfnGetVFEngineUtilizationExp2; if( nullptr == pfnGetVFEngineUtilizationExp2 ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -4271,6 +4855,10 @@ namespace loader_driver_ddi 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->VFManagementExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetVFCapabilitiesExp2 = dditable->VFManagementExp->pfnGetVFCapabilitiesExp2; if( nullptr == pfnGetVFCapabilitiesExp2 ) return ZE_RESULT_ERROR_UNINITIALIZED; diff --git a/source/loader/zet_ldrddi_driver_ddi.cpp b/source/loader/zet_ldrddi_driver_ddi.cpp index 65c57b78..0f6bdefb 100644 --- a/source/loader/zet_ldrddi_driver_ddi.cpp +++ b/source/loader/zet_ldrddi_driver_ddi.cpp @@ -31,6 +31,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Module == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetDebugInfo = dditable->Module->pfnGetDebugInfo; if( nullptr == pfnGetDebugInfo ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -57,6 +61,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnGetDebugProperties = dditable->Device->pfnGetDebugProperties; if( nullptr == pfnGetDebugProperties ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -84,6 +92,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Debug == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnAttach = dditable->Debug->pfnAttach; if( nullptr == pfnAttach ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -109,6 +121,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Debug == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnDetach = dditable->Debug->pfnDetach; if( nullptr == pfnDetach ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -142,6 +158,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Debug == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnReadEvent = dditable->Debug->pfnReadEvent; if( nullptr == pfnReadEvent ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -168,6 +188,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Debug == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnAcknowledgeEvent = dditable->Debug->pfnAcknowledgeEvent; if( nullptr == pfnAcknowledgeEvent ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -194,6 +218,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Debug == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnInterrupt = dditable->Debug->pfnInterrupt; if( nullptr == pfnInterrupt ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -220,6 +248,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Debug == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnResume = dditable->Debug->pfnResume; if( nullptr == pfnResume ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -249,6 +281,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Debug == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnReadMemory = dditable->Debug->pfnReadMemory; if( nullptr == pfnReadMemory ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -278,6 +314,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Debug == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnWriteMemory = dditable->Debug->pfnWriteMemory; if( nullptr == pfnWriteMemory ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -313,6 +353,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Debug == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetRegisterSetProperties = dditable->Debug->pfnGetRegisterSetProperties; if( nullptr == pfnGetRegisterSetProperties ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -349,6 +393,10 @@ namespace loader_driver_ddi 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->Debug == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetThreadRegisterSetProperties = dditable->Debug->pfnGetThreadRegisterSetProperties; if( nullptr == pfnGetThreadRegisterSetProperties ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -383,6 +431,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Debug == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnReadRegisters = dditable->Debug->pfnReadRegisters; if( nullptr == pfnReadRegisters ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -417,6 +469,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Debug == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnWriteRegisters = dditable->Debug->pfnWriteRegisters; if( nullptr == pfnWriteRegisters ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -451,6 +507,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->MetricGroup == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGet = dditable->MetricGroup->pfnGet; if( nullptr == pfnGet ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -477,6 +537,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->MetricGroup == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetProperties = dditable->MetricGroup->pfnGetProperties; if( nullptr == pfnGetProperties ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -514,6 +578,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->MetricGroup == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnCalculateMetricValues = dditable->MetricGroup->pfnCalculateMetricValues; if( nullptr == pfnCalculateMetricValues ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -547,6 +615,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Metric == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGet = dditable->Metric->pfnGet; if( nullptr == pfnGet ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -573,6 +645,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Metric == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetProperties = dditable->Metric->pfnGetProperties; if( nullptr == pfnGetProperties ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -605,6 +681,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Context == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnActivateMetricGroups = dditable->Context->pfnActivateMetricGroups; if( nullptr == pfnActivateMetricGroups ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -635,6 +715,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->MetricStreamer == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnOpen = dditable->MetricStreamer->pfnOpen; if( nullptr == pfnOpen ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -662,6 +746,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnAppendMetricStreamerMarker = dditable->CommandList->pfnAppendMetricStreamerMarker; if( nullptr == pfnAppendMetricStreamerMarker ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -687,6 +775,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->MetricStreamer == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnClose = dditable->MetricStreamer->pfnClose; if( nullptr == pfnClose ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -723,6 +815,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->MetricStreamer == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnReadData = dditable->MetricStreamer->pfnReadData; if( nullptr == pfnReadData ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -752,6 +848,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->MetricQueryPool == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnCreate = dditable->MetricQueryPool->pfnCreate; if( nullptr == pfnCreate ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -777,6 +877,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->MetricQueryPool == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnDestroy = dditable->MetricQueryPool->pfnDestroy; if( nullptr == pfnDestroy ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -804,6 +908,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->MetricQuery == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnCreate = dditable->MetricQuery->pfnCreate; if( nullptr == pfnCreate ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -829,6 +937,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->MetricQuery == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnDestroy = dditable->MetricQuery->pfnDestroy; if( nullptr == pfnDestroy ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -854,6 +966,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->MetricQuery == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnReset = dditable->MetricQuery->pfnReset; if( nullptr == pfnReset ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -880,6 +996,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnAppendMetricQueryBegin = dditable->CommandList->pfnAppendMetricQueryBegin; if( nullptr == pfnAppendMetricQueryBegin ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -909,6 +1029,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnAppendMetricQueryEnd = dditable->CommandList->pfnAppendMetricQueryEnd; if( nullptr == pfnAppendMetricQueryEnd ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -934,6 +1058,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { 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 pfnAppendMetricMemoryBarrier = dditable->CommandList->pfnAppendMetricMemoryBarrier; if( nullptr == pfnAppendMetricMemoryBarrier ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -968,6 +1096,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->MetricQuery == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetData = dditable->MetricQuery->pfnGetData; if( nullptr == pfnGetData ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -994,6 +1126,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->Kernel == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetProfileInfo = dditable->Kernel->pfnGetProfileInfo; if( nullptr == pfnGetProfileInfo ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1021,6 +1157,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->TracerExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnCreate = dditable->TracerExp->pfnCreate; if( nullptr == pfnCreate ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1046,6 +1186,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->TracerExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnDestroy = dditable->TracerExp->pfnDestroy; if( nullptr == pfnDestroy ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1072,6 +1216,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->TracerExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnSetPrologues = dditable->TracerExp->pfnSetPrologues; if( nullptr == pfnSetPrologues ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1098,6 +1246,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->TracerExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnSetEpilogues = dditable->TracerExp->pfnSetEpilogues; if( nullptr == pfnSetEpilogues ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1124,6 +1276,10 @@ namespace loader_driver_ddi if (dditable->version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } + // Check that the driver has the function pointer table init + if (dditable->TracerExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnSetEnabled = dditable->TracerExp->pfnSetEnabled; if( nullptr == pfnSetEnabled ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1157,6 +1313,10 @@ namespace loader_driver_ddi 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->DeviceExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetConcurrentMetricGroupsExp = dditable->DeviceExp->pfnGetConcurrentMetricGroupsExp; if( nullptr == pfnGetConcurrentMetricGroupsExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1191,6 +1351,10 @@ namespace loader_driver_ddi 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->MetricTracerExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnCreateExp = dditable->MetricTracerExp->pfnCreateExp; if( nullptr == pfnCreateExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1216,6 +1380,10 @@ namespace loader_driver_ddi 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->MetricTracerExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnDestroyExp = dditable->MetricTracerExp->pfnDestroyExp; if( nullptr == pfnDestroyExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1246,6 +1414,10 @@ namespace loader_driver_ddi 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->MetricTracerExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnEnableExp = dditable->MetricTracerExp->pfnEnableExp; if( nullptr == pfnEnableExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1277,6 +1449,10 @@ namespace loader_driver_ddi 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->MetricTracerExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnDisableExp = dditable->MetricTracerExp->pfnDisableExp; if( nullptr == pfnDisableExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1311,6 +1487,10 @@ namespace loader_driver_ddi 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->MetricTracerExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnReadDataExp = dditable->MetricTracerExp->pfnReadDataExp; if( nullptr == pfnReadDataExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1337,6 +1517,10 @@ namespace loader_driver_ddi 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->MetricDecoderExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnCreateExp = dditable->MetricDecoderExp->pfnCreateExp; if( nullptr == pfnCreateExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1362,6 +1546,10 @@ namespace loader_driver_ddi 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->MetricDecoderExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnDestroyExp = dditable->MetricDecoderExp->pfnDestroyExp; if( nullptr == pfnDestroyExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1398,6 +1586,10 @@ namespace loader_driver_ddi 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->MetricDecoderExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetDecodableMetricsExp = dditable->MetricDecoderExp->pfnGetDecodableMetricsExp; if( nullptr == pfnGetDecodableMetricsExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1462,6 +1654,10 @@ namespace loader_driver_ddi 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->MetricTracerExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnDecodeExp = dditable->MetricTracerExp->pfnDecodeExp; if( nullptr == pfnDecodeExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1491,6 +1687,10 @@ namespace loader_driver_ddi 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->CommandListExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnAppendMarkerExp = dditable->CommandListExp->pfnAppendMarkerExp; if( nullptr == pfnAppendMarkerExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1516,6 +1716,10 @@ namespace loader_driver_ddi 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) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnEnableMetricsExp = dditable->DeviceExp->pfnEnableMetricsExp; if( nullptr == pfnEnableMetricsExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1541,6 +1745,10 @@ namespace loader_driver_ddi 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) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnDisableMetricsExp = dditable->DeviceExp->pfnDisableMetricsExp; if( nullptr == pfnDisableMetricsExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1588,6 +1796,10 @@ namespace loader_driver_ddi 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->MetricGroupExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnCalculateMultipleMetricValuesExp = dditable->MetricGroupExp->pfnCalculateMultipleMetricValuesExp; if( nullptr == pfnCalculateMultipleMetricValuesExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1616,6 +1828,10 @@ namespace loader_driver_ddi 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->MetricGroupExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetGlobalTimestampsExp = dditable->MetricGroupExp->pfnGetGlobalTimestampsExp; if( nullptr == pfnGetGlobalTimestampsExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1649,6 +1865,10 @@ namespace loader_driver_ddi 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->MetricGroupExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetExportDataExp = dditable->MetricGroupExp->pfnGetExportDataExp; if( nullptr == pfnGetExportDataExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1697,6 +1917,10 @@ namespace loader_driver_ddi 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->MetricGroupExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnCalculateMetricExportDataExp = dditable->MetricGroupExp->pfnCalculateMetricExportDataExp; if( nullptr == pfnCalculateMetricExportDataExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1731,6 +1955,10 @@ namespace loader_driver_ddi 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->MetricProgrammableExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetExp = dditable->MetricProgrammableExp->pfnGetExp; if( nullptr == pfnGetExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1757,6 +1985,10 @@ namespace loader_driver_ddi 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->MetricProgrammableExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetPropertiesExp = dditable->MetricProgrammableExp->pfnGetPropertiesExp; if( nullptr == pfnGetPropertiesExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1790,6 +2022,10 @@ namespace loader_driver_ddi 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->MetricProgrammableExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetParamInfoExp = dditable->MetricProgrammableExp->pfnGetParamInfoExp; if( nullptr == pfnGetParamInfoExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1824,6 +2060,10 @@ namespace loader_driver_ddi 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->MetricProgrammableExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnGetParamValueInfoExp = dditable->MetricProgrammableExp->pfnGetParamValueInfoExp; if( nullptr == pfnGetParamValueInfoExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1865,6 +2105,10 @@ namespace loader_driver_ddi 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->MetricExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnCreateFromProgrammableExp2 = dditable->MetricExp->pfnCreateFromProgrammableExp2; if( nullptr == pfnCreateFromProgrammableExp2 ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1906,6 +2150,10 @@ namespace loader_driver_ddi 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->MetricExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnCreateFromProgrammableExp = dditable->MetricExp->pfnCreateFromProgrammableExp; if( nullptr == pfnCreateFromProgrammableExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1950,6 +2198,10 @@ namespace loader_driver_ddi 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->DeviceExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnCreateMetricGroupsFromMetricsExp = dditable->DeviceExp->pfnCreateMetricGroupsFromMetricsExp; if( nullptr == pfnCreateMetricGroupsFromMetricsExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -1982,6 +2234,10 @@ namespace loader_driver_ddi 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 pfnCreateExp = dditable->MetricGroupExp->pfnCreateExp; if( nullptr == pfnCreateExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2015,6 +2271,10 @@ namespace loader_driver_ddi 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 pfnAddMetricExp = dditable->MetricGroupExp->pfnAddMetricExp; if( nullptr == pfnAddMetricExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2041,6 +2301,10 @@ namespace loader_driver_ddi 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 pfnRemoveMetricExp = dditable->MetricGroupExp->pfnRemoveMetricExp; if( nullptr == pfnRemoveMetricExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2066,6 +2330,10 @@ namespace loader_driver_ddi 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 pfnCloseExp = dditable->MetricGroupExp->pfnCloseExp; if( nullptr == pfnCloseExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2091,6 +2359,10 @@ namespace loader_driver_ddi 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 pfnDestroyExp = dditable->MetricGroupExp->pfnDestroyExp; if( nullptr == pfnDestroyExp ) return ZE_RESULT_ERROR_UNINITIALIZED; @@ -2116,6 +2388,10 @@ namespace loader_driver_ddi 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->MetricExp == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } auto pfnDestroyExp = dditable->MetricExp->pfnDestroyExp; if( nullptr == pfnDestroyExp ) return ZE_RESULT_ERROR_UNINITIALIZED; From 9a178ea90299289fcf8df43dca486b7cf333beae Mon Sep 17 00:00:00 2001 From: "Kozlowski, Marek" Date: Tue, 24 Jun 2025 14:35:25 +0000 Subject: [PATCH 26/28] fix: add missing subdirectory --- source/layers/validation/checkers/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/source/layers/validation/checkers/CMakeLists.txt b/source/layers/validation/checkers/CMakeLists.txt index 6ea6f9bb..9ecdaecd 100644 --- a/source/layers/validation/checkers/CMakeLists.txt +++ b/source/layers/validation/checkers/CMakeLists.txt @@ -1,4 +1,5 @@ add_subdirectory(basic_leak) +add_subdirectory(certification) add_subdirectory(events_checker) add_subdirectory(parameter_validation) add_subdirectory(template) From d8605f9881eaf1883bbf076066b649245d699dae Mon Sep 17 00:00:00 2001 From: "Neil R. Spruit" Date: Tue, 24 Jun 2025 09:43:00 -0700 Subject: [PATCH 27/28] Add changelog for v1.23.0 Signed-off-by: Neil R. Spruit --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6894fcc5..d7033c70 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Level zero loader changelog +## v1.23.0 +* fix build for certification checker +* Fix missing code gen and add check in sysman device get for context +* Fix gtest build to work for windows static or dynamic +* DDI extension support ## v1.22.5 * cmake/msvc: unify CRT model and add VTune-safe flags for RelWithDebInfo * Init certification checker in the Validation Layer From 1357333f9fbc023cebf0c14c3ee9fc3653799020 Mon Sep 17 00:00:00 2001 From: "Neil R. Spruit" Date: Mon, 7 Jul 2025 09:10:57 -0700 Subject: [PATCH 28/28] Fix Sysman only DDI Init for zesDriver compatibility - Remove sysman zesDrivers from the Driver Sorting and DDI Driver Extension since ze and zes drivers may be different internally and to remove possible undefined behavior. Signed-off-by: Neil R. Spruit --- CHANGELOG.md | 3 ++- CMakeLists.txt | 2 +- PRODUCT_GUID.txt | 4 ++-- scripts/templates/ldrddi.cpp.mako | 14 ++++++++++++++ source/loader/ze_ldrddi.cpp | 18 ++++++++++++++++++ source/loader/ze_loader.cpp | 25 +++---------------------- source/loader/zes_ldrddi.cpp | 24 ++---------------------- 7 files changed, 42 insertions(+), 48 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d7033c70..b72adba6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ # Level zero loader changelog - +## v1.23.1 +* Fix Sysman only DDI Init for zesDriver compatability ## v1.23.0 * fix build for certification checker * Fix missing code gen and add check in sysman device get for context diff --git a/CMakeLists.txt b/CMakeLists.txt index eeed9cd7..d1c14283 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.23.0) +project(level-zero VERSION 1.23.1) include(GNUInstallDirs) diff --git a/PRODUCT_GUID.txt b/PRODUCT_GUID.txt index 82243d87..3e2a2635 100644 --- a/PRODUCT_GUID.txt +++ b/PRODUCT_GUID.txt @@ -1,2 +1,2 @@ -1.23.0 -146652e2-0b5a-4461-b176-800135676a46 +1.23.1 +fd1c864d-4ba3-4321-bdfc-66f50cf6b6bf \ No newline at end of file diff --git a/scripts/templates/ldrddi.cpp.mako b/scripts/templates/ldrddi.cpp.mako index 12141e6f..b1a9c542 100644 --- a/scripts/templates/ldrddi.cpp.mako +++ b/scripts/templates/ldrddi.cpp.mako @@ -166,6 +166,7 @@ namespace loader { for( uint32_t i = 0; i < library_driver_handle_count; ++i ) { uint32_t driver_index = total_driver_handle_count + i; + %if namespace != "zes": if (drv.driverDDIHandleSupportQueried == false) { drv.properties = {}; drv.properties.stype = ZE_STRUCTURE_TYPE_DRIVER_DDI_HANDLES_EXT_PROPERTIES; @@ -185,9 +186,22 @@ namespace loader drv.driverDDIHandleSupportQueried = true; } if (!(drv.properties.flags & ZE_DRIVER_DDI_HANDLE_EXT_FLAG_DDI_HANDLE_EXT_SUPPORTED) || !loader::context->driverDDIPathDefault) { + if (loader::context->debugTraceEnabled) { + std::string message = "Driver DDI Handles Not Supported for " + drv.name; + loader::context->debug_trace_message(message, ""); + } ${obj['params'][1]['name']}[ driver_index ] = reinterpret_cast<${n}_driver_handle_t>( context->${n}_driver_factory.getInstance( ${obj['params'][1]['name']}[ driver_index ], &drv.dditable ) ); + } else if (drv.properties.flags & ZE_DRIVER_DDI_HANDLE_EXT_FLAG_DDI_HANDLE_EXT_SUPPORTED) { + if (loader::context->debugTraceEnabled) { + std::string message = "Driver DDI Handles Supported for " + drv.name; + loader::context->debug_trace_message(message, ""); + } } + %else: + ${obj['params'][1]['name']}[ driver_index ] = reinterpret_cast<${n}_driver_handle_t>( + context->${n}_driver_factory.getInstance( ${obj['params'][1]['name']}[ driver_index ], &drv.dditable ) ); + %endif } } catch( std::bad_alloc& ) diff --git a/source/loader/ze_ldrddi.cpp b/source/loader/ze_ldrddi.cpp index 882628fe..b4afb3d7 100644 --- a/source/loader/ze_ldrddi.cpp +++ b/source/loader/ze_ldrddi.cpp @@ -120,8 +120,17 @@ namespace loader drv.driverDDIHandleSupportQueried = true; } if (!(drv.properties.flags & ZE_DRIVER_DDI_HANDLE_EXT_FLAG_DDI_HANDLE_EXT_SUPPORTED) || !loader::context->driverDDIPathDefault) { + if (loader::context->debugTraceEnabled) { + std::string message = "Driver DDI Handles Not Supported for " + drv.name; + loader::context->debug_trace_message(message, ""); + } phDrivers[ driver_index ] = reinterpret_cast( context->ze_driver_factory.getInstance( phDrivers[ driver_index ], &drv.dditable ) ); + } else if (drv.properties.flags & ZE_DRIVER_DDI_HANDLE_EXT_FLAG_DDI_HANDLE_EXT_SUPPORTED) { + if (loader::context->debugTraceEnabled) { + std::string message = "Driver DDI Handles Supported for " + drv.name; + loader::context->debug_trace_message(message, ""); + } } } } @@ -228,8 +237,17 @@ namespace loader drv.driverDDIHandleSupportQueried = true; } if (!(drv.properties.flags & ZE_DRIVER_DDI_HANDLE_EXT_FLAG_DDI_HANDLE_EXT_SUPPORTED) || !loader::context->driverDDIPathDefault) { + if (loader::context->debugTraceEnabled) { + std::string message = "Driver DDI Handles Not Supported for " + drv.name; + loader::context->debug_trace_message(message, ""); + } phDrivers[ driver_index ] = reinterpret_cast( context->ze_driver_factory.getInstance( phDrivers[ driver_index ], &drv.dditable ) ); + } else if (drv.properties.flags & ZE_DRIVER_DDI_HANDLE_EXT_FLAG_DDI_HANDLE_EXT_SUPPORTED) { + if (loader::context->debugTraceEnabled) { + std::string message = "Driver DDI Handles Supported for " + drv.name; + loader::context->debug_trace_message(message, ""); + } } } } diff --git a/source/loader/ze_loader.cpp b/source/loader/ze_loader.cpp index d89b5b29..42cbce7a 100644 --- a/source/loader/ze_loader.cpp +++ b/source/loader/ze_loader.cpp @@ -77,29 +77,10 @@ namespace loader permissiveDesc.stype = ZE_STRUCTURE_TYPE_INIT_DRIVER_TYPE_DESC; permissiveDesc.pNext = nullptr; permissiveDesc.flags = UINT32_MAX; + if (sysmanOnly) { + return true; // Sorting not fully supported by the spec due to missing zesDriverGetProperties for sysman drivers. + } for (auto &driver : *drivers) { - if (sysmanOnly) { - for (auto &coreDriver : this->zeDrivers) { - if (coreDriver.name == driver.name) { - if (!driver.dditable.ze.Global.pfnInitDrivers) { - driver.dditable.ze.Global.pfnInitDrivers = coreDriver.dditable.ze.Global.pfnInitDrivers; - } - if (!driver.dditable.ze.Driver.pfnGet) { - driver.dditable.ze.Driver.pfnGet = coreDriver.dditable.ze.Driver.pfnGet; - } - if (!driver.dditable.ze.Driver.pfnGetProperties) { - driver.dditable.ze.Driver.pfnGetProperties = coreDriver.dditable.ze.Driver.pfnGetProperties; - } - if (!driver.dditable.ze.Device.pfnGet) { - driver.dditable.ze.Device.pfnGet = coreDriver.dditable.ze.Device.pfnGet; - } - if (!driver.dditable.ze.Device.pfnGetProperties) { - driver.dditable.ze.Device.pfnGetProperties = coreDriver.dditable.ze.Device.pfnGetProperties; - } - break; - } - } - } uint32_t pCount = 0; std::vector driverHandles; ze_result_t res = ZE_RESULT_SUCCESS; diff --git a/source/loader/zes_ldrddi.cpp b/source/loader/zes_ldrddi.cpp index 179e72f8..2219b03b 100644 --- a/source/loader/zes_ldrddi.cpp +++ b/source/loader/zes_ldrddi.cpp @@ -105,28 +105,8 @@ namespace loader { for( uint32_t i = 0; i < library_driver_handle_count; ++i ) { uint32_t driver_index = total_driver_handle_count + i; - if (drv.driverDDIHandleSupportQueried == false) { - drv.properties = {}; - drv.properties.stype = ZE_STRUCTURE_TYPE_DRIVER_DDI_HANDLES_EXT_PROPERTIES; - drv.properties.pNext = nullptr; - ze_driver_properties_t driverProperties = {}; - driverProperties.stype = ZE_STRUCTURE_TYPE_DRIVER_PROPERTIES; - driverProperties.pNext = nullptr; - driverProperties.pNext = &drv.properties; - ze_result_t res = drv.dditable.ze.Driver.pfnGetProperties(phDrivers[ driver_index ], &driverProperties); - if (res != ZE_RESULT_SUCCESS) { - if (loader::context->debugTraceEnabled) { - std::string message = drv.name + " failed zeDriverGetProperties query, returned "; - loader::context->debug_trace_message(message, loader::to_string(res)); - } - return res; - } - drv.driverDDIHandleSupportQueried = true; - } - if (!(drv.properties.flags & ZE_DRIVER_DDI_HANDLE_EXT_FLAG_DDI_HANDLE_EXT_SUPPORTED) || !loader::context->driverDDIPathDefault) { - phDrivers[ driver_index ] = reinterpret_cast( - context->zes_driver_factory.getInstance( phDrivers[ driver_index ], &drv.dditable ) ); - } + phDrivers[ driver_index ] = reinterpret_cast( + context->zes_driver_factory.getInstance( phDrivers[ driver_index ], &drv.dditable ) ); } } catch( std::bad_alloc& )