From 4765e48db39d6680a08a2e1692075352a9f9ce34 Mon Sep 17 00:00:00 2001 From: Alicja Lukaszewicz Date: Fri, 18 Apr 2025 02:35:21 +0200 Subject: [PATCH 1/8] 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 2/8] 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 3/8] 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 4/8] 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 5/8] 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 6/8] 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 7/8] 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 8/8] 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