diff --git a/CHANGELOG.md b/CHANGELOG.md index 3cbe1563..814475be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,8 @@ # Level zero loader changelog +## v1.36.0 +* Update to L0 Zero Spec v1.21.26: https://oneapi-src.github.io/level-zero-spec/releases/index.html#level-zero-v1-21-26 +* Fix: handle missing APIs on every static loader call (#555) +* Find googletest from system if available (#442) ## v1.35.0 * Update to L0 Zero Spec v1.20.41: https://oneapi-src.github.io/level-zero-spec/releases/index.html#level-zero-v1-20-41 * Feature: Add optional build-time-configured driver search directory for Linux (#541) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3f2e960b..5157b243 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.35.0) +project(level-zero VERSION 1.36.0) include(GNUInstallDirs) find_package(Git) diff --git a/PRODUCT_GUID.txt b/PRODUCT_GUID.txt index d51aa4d5..df3fd48a 100644 --- a/PRODUCT_GUID.txt +++ b/PRODUCT_GUID.txt @@ -1,2 +1,2 @@ -1.35.0 -ef31b8c8-692c-4f7e-b5ed-cf7922afb55b \ No newline at end of file +1.36.0 +32599add-e348-465a-9c19-5b46987a527b \ No newline at end of file diff --git a/include/ze.py b/include/ze.py index f0f4f96c..323b4fb3 100644 --- a/include/ze.py +++ b/include/ze.py @@ -4,7 +4,7 @@ SPDX-License-Identifier: MIT @file ze.py - @version v1.20-r1.20.41 + @version v1.21-r1.21.26 """ import platform @@ -590,7 +590,8 @@ class ze_api_version_v(IntEnum): _1_18 = ZE_MAKE_VERSION( 1, 18 ) ## version 1.18 _1_19 = ZE_MAKE_VERSION( 1, 19 ) ## version 1.19 _1_20 = ZE_MAKE_VERSION( 1, 20 ) ## version 1.20 - CURRENT = ZE_MAKE_VERSION( 1, 20 ) ## latest known version + _1_21 = ZE_MAKE_VERSION( 1, 21 ) ## version 1.21 + CURRENT = ZE_MAKE_VERSION( 1, 21 ) ## latest known version class ze_api_version_t(c_int): def __str__(self): @@ -599,7 +600,7 @@ def __str__(self): ############################################################################### ## @brief Current API version as a macro -ZE_API_VERSION_CURRENT_M = ZE_MAKE_VERSION( 1, 20 ) +ZE_API_VERSION_CURRENT_M = ZE_MAKE_VERSION( 1, 21 ) ############################################################################### ## @brief Maximum driver universal unique id (UUID) size in bytes @@ -792,16 +793,26 @@ class ze_device_compute_properties_t(Structure): ############################################################################### ## @brief Supported device compute dot product(dp) capability flags class ze_device_dp_capability_flags_v(IntEnum): - DEVICE_NON_SYSTOLIC_DPA4_SIMD_ALL = ZE_BIT(0) ## Supports vector dot product instruction. - DEVICE_SYSTOLIC_DPAS_SIMD8 = ZE_BIT(1) ## Supports sytolic dot product with 8 SIMD lanes. - DEVICE_SYSTOLIC_DPAS_SIMD16 = ZE_BIT(2) ## Supports sytolic dot product with 16 SIMD lanes. - DEVICE_SYSTOLIC_BDPAS_SIMD16 = ZE_BIT(3) ## Supports sytolic dot product with block scaling support with 16 SIMD - ## lanes. + DEVICE_NON_SYSTOLIC_DPA4_SIMD_ALL = ZE_BIT(0) ## Supports the non-systolic vector dot product instruction (DP4A). When + ## set, the dpv4_input_types and dpv4_output_types members of + ## ::ze_device_compute_dotproduct_ext_properties_t describe the legal + ## data types for this path. + DEVICE_SYSTOLIC_DPAS_SIMD8 = ZE_BIT(1) ## Supports systolic dot product (DPAS) with 8 SIMD lanes. + DEVICE_SYSTOLIC_DPAS_SIMD16 = ZE_BIT(2) ## Supports systolic dot product (DPAS) with 16 SIMD lanes. + DEVICE_SYSTOLIC_BDPAS_SIMD16 = ZE_BIT(3) ## Supports systolic dot product with block-scaling support (BDPAS) with + ## 16 SIMD lanes. DEVICE_SYSTOLIC_DPAS_DEPTH4 = ZE_BIT(4) ## Supports 4 deep systolic for DPAS dot product DEVICE_SYSTOLIC_DPAS_DEPTH8 = ZE_BIT(5) ## Supports 8 deep systolic for DPAS dot product DEVICE_SYSTOLIC_BDPAS_DEPTH8 = ZE_BIT(6) ## Supports 8 deep systolic for BDPAS dot product - DEVICE_SYSTOLIC_OUTPUT_MATRIX_ROWCOUNT_UPTO8 = ZE_BIT(7) ## Supports output matrix row count upto 8 - DEVICE_SYSTOLIC_OUTPUT_MATRIX_ROWCOUNT_FIXED8 = ZE_BIT(8) ## Restricts output matrix row count to 8 + DEVICE_SYSTOLIC_OUTPUT_MATRIX_ROWCOUNT_UPTO8 = ZE_BIT(7) ## Output-shape modifier for the systolic DPAS/BDPAS path: the output + ## matrix row count is variable, up to 8. Only meaningful when at least + ## one of the DEVICE_SYSTOLIC_DPAS_* or DEVICE_SYSTOLIC_BDPAS_* bits is + ## also set in dp_caps; this bit alone does not advertise DPAS or BDPAS + ## support. + DEVICE_SYSTOLIC_OUTPUT_MATRIX_ROWCOUNT_FIXED8 = ZE_BIT(8) ## Output-shape modifier for the systolic DPAS/BDPAS path: the output + ## matrix row count is fixed at 8. Only meaningful when at least one of + ## the DEVICE_SYSTOLIC_DPAS_* or DEVICE_SYSTOLIC_BDPAS_* bits is also set + ## in dp_caps; this bit alone does not advertise DPAS or BDPAS support. class ze_device_dp_capability_flags_t(c_int): def __str__(self): @@ -809,10 +820,25 @@ def __str__(self): ############################################################################### -## @brief Supported device dot product(dp) input data types flags +## @brief Supported device dot product (dp) input data type flags. A field value +## of 0 indicates no supported input data types for the associated +## dot-product path; non-zero values are the bitwise-OR of the supported +## type bits defined below. The containing *_input_types field +## (dpv4_input_types, dpas_input_types, or bdpas_input_types) determines +## which dot-product path this applies to. class ze_device_input_data_type_flags_v(IntEnum): - DEVICE_INPUT_DATA_TYPE_NONE = ZE_BIT(0) ## No data types available for the supported dot product operation - ZE_DEVICE_INPUT_DATA_INT8_PACK4_PER_SIMD_LANE = ZE_BIT(1) ## Supports int8 data type with 4 packed data elements per SIMD lane. + DEVICE_INPUT_DATA_TYPE_NONE = ZE_BIT(0) ## [DEPRECATED since 1.21] Indicates that no data types are supported. + ## This bit is semantically equivalent to all other field values being 0 + ## and must not be combined with any other bit of this enum. Retained for + ## ABI compatibility only. No replacement; a field value of 0 already + ## indicates that no data types are supported. + ZE_DEVICE_INPUT_DATA_INT8_PACK4_PER_SIMD_LANE = ZE_BIT(1) ## [DEPRECATED since 1.21] Supports int8 data type with 4 packed data + ## elements per SIMD lane. This enumerator carries a stray 'ZE_' prefix + ## in its name, producing the generated token + ## ::ZE_DEVICE_INPUT_DATA_TYPE_FLAG_ZE_DEVICE_INPUT_DATA_INT8_PACK4_PER_SIMD_LANE. + ## Retained for ABI compatibility only. Use + ## ::ZE_DEVICE_INPUT_DATA_TYPE_FLAG_DEVICE_INPUT_DATA_INT8_PACK4_PER_SIMD_LANE + ## instead. DEVICE_INPUT_DATA_INT4_PACK8_PER_SIMD_LANE = ZE_BIT(2) ## Supports int4 data type with 8 packed data elements per SIMD lane. DEVICE_INPUT_DATA_INT2_PACK8_PER_SIMD_LANE = ZE_BIT(3) ## Supports int2 data type with 8 packed data elements per SIMD lane. DEVICE_INPUT_DATA_TF32_PACK1_PER_SIMD_LANE = ZE_BIT(4) ## Supports tf32 data type with 1 packed data elements per SIMD lane. @@ -822,14 +848,17 @@ class ze_device_input_data_type_flags_v(IntEnum): DEVICE_INPUT_DATA_BF8_PACK4_PER_SIMD_LANE = ZE_BIT(8) ## Supports bf8 data type with 4 packed data elements per SIMD lane. DEVICE_INPUT_DATA_E2M1_PACK8_PER_SIMD_LANE = ZE_BIT(9) ## Supports e2m1 data type with 8 packed data elements per SIMD lane. DEVICE_INPUT_DATA_E3M0_PACK8_PER_SIMD_LANE = ZE_BIT(10) ## Supports e3m0 data type with 8 packed data elements per SIMD lane. - DEVICE_INPUT_DATA_INT8_PACK4_PER_SIMD_LANE = ZE_BIT(11) ## Supports 8bit integer data type with 4 packed data elements per SIMD - ## lane.This is exclusively for DP4V dot product support - DEVICE_INPUT_DATA_SCALING_UINT8 = ZE_BIT(12) ## Supports uint8 data type support for scaling, exclusive to BDPAS dot - ## product support. - DEVICE_INPUT_DATA_SCALING_UE5M3 = ZE_BIT(13) ## Supports ue5m3 data type support for scaling, exclusive to BDPAS dot - ## product support. - DEVICE_INPUT_DATA_SCALING_UE4M3 = ZE_BIT(14) ## Supports ue4m3 data type support for scaling, exclusive to BDPAS dot - ## product support. + DEVICE_INPUT_DATA_INT8_PACK4_PER_SIMD_LANE = ZE_BIT(11) ## Supports int8 (8-bit signed integer) data type with 4 packed data + ## elements per SIMD lane. + DEVICE_INPUT_DATA_SCALING_UINT8 = ZE_BIT(12) ## Supports uint8 (8-bit unsigned integer) scaling factor. Only + ## meaningful when set in bdpas_input_types; exclusive to the BDPAS + ## dot-product path. + DEVICE_INPUT_DATA_SCALING_UE5M3 = ZE_BIT(13) ## Supports ue5m3 (unsigned float, 5-bit exponent, 3-bit mantissa) + ## scaling factor. Only meaningful when set in bdpas_input_types; + ## exclusive to the BDPAS dot-product path. + DEVICE_INPUT_DATA_SCALING_UE4M3 = ZE_BIT(14) ## Supports ue4m3 (unsigned float, 4-bit exponent, 3-bit mantissa) + ## scaling factor. Only meaningful when set in bdpas_input_types; + ## exclusive to the BDPAS dot-product path. class ze_device_input_data_type_flags_t(c_int): def __str__(self): @@ -837,8 +866,10 @@ def __str__(self): ############################################################################### -## @brief Supported device dot product(dp) output data types or accumulator -## data types flags +## @brief Supported device dot product (dp) output / accumulator data type +## flags. A field value of 0 indicates no supported output data types for +## the associated dot-product path; non-zero values are the bitwise-OR of +## the supported type bits defined below. class ze_device_output_data_type_flags_v(IntEnum): DEVICE_OUTPUT_DATA_INT32 = ZE_BIT(0) ## Supports signed and unsigned 32bit integer data type for output DEVICE_OUTPUT_DATA_FP32 = ZE_BIT(1) ## Supports fp32 data type for output. @@ -874,18 +905,38 @@ class ze_device_compute_dotproduct_ext_properties_t(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). ("dp_caps", ze_device_dp_capability_flags_t), ## [out] indicates dot product capability of the device - ("dpv4_input_types", ze_device_input_data_type_flags_t), ## [out] Supported input data types when dp4v dot product capability is - ## supported. - ("dpv4_output_types", ze_device_output_data_type_flags_t), ## [out] Supported output data types when dp4v dot product capability is - ## supported. - ("dpas_input_types", ze_device_input_data_type_flags_t), ## [out] Supported input data types when dpas dot product capability is - ## supported. - ("dpas_output_types", ze_device_output_data_type_flags_t), ## [out] Supported output data types when dpas dot product capability is - ## supported. - ("bdpas_input_types", ze_device_input_data_type_flags_t), ## [out] Supported input data types when bdpas dot product capability is - ## supported. - ("bdpas_output_types", ze_device_output_data_type_flags_t) ## [out] Supported output data types when bdpas dot product capability is - ## supported. + ("dpv4_input_types", ze_device_input_data_type_flags_t), ## [out] Supported input data types for the non-systolic vector + ## dot-product path (DP4A). Valid only when + ## ::ZE_DEVICE_DP_CAPABILITY_FLAG_DEVICE_NON_SYSTOLIC_DPA4_SIMD_ALL is + ## set in dp_caps; a value of 0 indicates no supported input types for + ## this path. The member is named 'dpv4_*' for ABI compatibility; the + ## feature it describes is DP4A. + ("dpv4_output_types", ze_device_output_data_type_flags_t), ## [out] Supported output / accumulator data types for the non-systolic + ## vector dot-product path (DP4A). Valid only when + ## ::ZE_DEVICE_DP_CAPABILITY_FLAG_DEVICE_NON_SYSTOLIC_DPA4_SIMD_ALL is + ## set in dp_caps; a value of 0 indicates no supported output types for + ## this path. The member is named 'dpv4_*' for ABI compatibility; the + ## feature it describes is DP4A. + ("dpas_input_types", ze_device_input_data_type_flags_t), ## [out] Supported input data types for the systolic dot-product (DPAS) + ## path. Valid only when at least one of the DEVICE_SYSTOLIC_DPAS_* bits + ## in ::ze_device_dp_capability_flags_t is set in dp_caps; a value of 0 + ## indicates no supported input types for this path. + ("dpas_output_types", ze_device_output_data_type_flags_t), ## [out] Supported output / accumulator data types for the systolic + ## dot-product (DPAS) path. Valid only when at least one of the + ## DEVICE_SYSTOLIC_DPAS_* bits in ::ze_device_dp_capability_flags_t is + ## set in dp_caps; a value of 0 indicates no supported output types for + ## this path. + ("bdpas_input_types", ze_device_input_data_type_flags_t), ## [out] Supported input data types for the block-scaled systolic + ## dot-product (BDPAS) path. Valid only when at least one of the + ## DEVICE_SYSTOLIC_BDPAS_* bits in ::ze_device_dp_capability_flags_t is + ## set in dp_caps; a value of 0 indicates no supported input types for + ## this path. The DEVICE_INPUT_DATA_SCALING_* bits in + ## ::ze_device_input_data_type_flags_t only have meaning in this member. + ("bdpas_output_types", ze_device_output_data_type_flags_t) ## [out] Supported output / accumulator data types for the block-scaled + ## systolic dot-product (BDPAS) path. Valid only when at least one of the + ## DEVICE_SYSTOLIC_BDPAS_* bits in ::ze_device_dp_capability_flags_t is + ## set in dp_caps; a value of 0 indicates no supported output types for + ## this path. ] ############################################################################### @@ -1292,8 +1343,12 @@ def __str__(self): ## @brief Supported command queue priorities class ze_command_queue_priority_v(IntEnum): NORMAL = 0 ## [default] normal priority - PRIORITY_LOW = 1 ## lower priority than normal - PRIORITY_HIGH = 2 ## higher priority than normal + LOW = 1 ## lower priority than normal + HIGH = 2 ## higher priority than normal + PRIORITY_LOW = 1 ## [DEPRECATED since 1.21] lower priority than normal. Use + ## ::ZE_COMMAND_QUEUE_PRIORITY_LOW instead. + PRIORITY_HIGH = 2 ## [DEPRECATED since 1.21] higher priority than normal. Use + ## ::ZE_COMMAND_QUEUE_PRIORITY_HIGH instead. class ze_command_queue_priority_t(c_int): def __str__(self): @@ -1309,7 +1364,8 @@ class ze_command_queue_desc_t(Structure): ## structure (i.e. contains stype and pNext). ("ordinal", c_uint32), ## [in] command queue group ordinal ("index", c_uint32), ## [in] command queue index within the group; - ## must be zero. + ## zero-based, so it must be less than the `numQueues` member of + ## ::ze_command_queue_group_properties_t for the command queue group. ("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 @@ -2704,11 +2760,11 @@ class ze_cache_ext_region_v(IntEnum): ## ::ZE_CACHE_EXT_REGION_DEFAULT instead. ZE_CACHE_RESERVE_REGION = 1 ## [DEPRECATED since 1.7] utilize reserved region. Use ## ::ZE_CACHE_EXT_REGION_RESERVED instead. - ZE_CACHE_NON_RESERVED_REGION = 2 ## [DEPRECATED since 1.7] utilize non-reserverd region. Use + ZE_CACHE_NON_RESERVED_REGION = 2 ## [DEPRECATED since 1.7] utilize non-reserved region. Use ## ::ZE_CACHE_EXT_REGION_NON_RESERVED instead. DEFAULT = 0 ## utilize driver default scheme RESERVED = 1 ## utilize reserved region - NON_RESERVED = 2 ## utilize non-reserverd region + NON_RESERVED = 2 ## utilize non-reserved region class ze_cache_ext_region_t(c_int): def __str__(self): @@ -4368,7 +4424,10 @@ class ze_rtas_builder_instance_geometry_info_exp_t(Structure): ## bits representing the geometry flags for all primitives of this ## geometry ("geometryMask", c_uint8), ## [in] 8-bit geometry mask for ray masking - ("transformFormat", ze_rtas_builder_packed_input_data_format_exp_t),## [in] format of the specified transformation + ("transformFormat", ze_rtas_builder_packed_input_data_format_exp_t),## [in] format of the specified transformation, must be + ## ::ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_FLOAT3X4_COLUMN_MAJOR, + ## ::ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_FLOAT3X4_ALIGNED_COLUMN_MAJOR, + ## or ::ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_FLOAT3X4_ROW_MAJOR ("instanceUserID", c_uint32), ## [in] user-specified identifier for the instance ("pTransform", c_void_p), ## [in] object-to-world instance transformation in specified format ("pBounds", POINTER(ze_rtas_aabb_exp_t)), ## [in] object-space axis-aligned bounding-box of the instanced @@ -5513,7 +5572,10 @@ class ze_rtas_builder_instance_geometry_info_ext_t(Structure): ## bits representing the geometry flags for all primitives of this ## geometry ("geometryMask", c_uint8), ## [in] 8-bit geometry mask for ray masking - ("transformFormat", ze_rtas_builder_packed_input_data_format_ext_t),## [in] format of the specified transformation + ("transformFormat", ze_rtas_builder_packed_input_data_format_ext_t),## [in] format of the specified transformation, must be + ## ::ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_FLOAT3X4_COLUMN_MAJOR, + ## ::ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_FLOAT3X4_ALIGNED_COLUMN_MAJOR, + ## or ::ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_FLOAT3X4_ROW_MAJOR ("instanceUserID", c_uint32), ## [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 diff --git a/include/ze_api.h b/include/ze_api.h index 058c656d..cec44539 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.20-r1.20.41 + * @version v1.21-r1.21.26 * */ #ifndef _ZE_API_H @@ -1574,7 +1574,8 @@ typedef enum _ze_api_version_t ZE_API_VERSION_1_18 = ZE_MAKE_VERSION( 1, 18 ), ///< version 1.18 ZE_API_VERSION_1_19 = ZE_MAKE_VERSION( 1, 19 ), ///< version 1.19 ZE_API_VERSION_1_20 = ZE_MAKE_VERSION( 1, 20 ), ///< version 1.20 - ZE_API_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 20 ), ///< latest known version + ZE_API_VERSION_1_21 = ZE_MAKE_VERSION( 1, 21 ), ///< version 1.21 + ZE_API_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 21 ), ///< latest known version ZE_API_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_API_VERSION_* ENUMs } ze_api_version_t; @@ -1582,7 +1583,7 @@ typedef enum _ze_api_version_t /////////////////////////////////////////////////////////////////////////////// #ifndef ZE_API_VERSION_CURRENT_M /// @brief Current API version as a macro -#define ZE_API_VERSION_CURRENT_M ZE_MAKE_VERSION( 1, 20 ) +#define ZE_API_VERSION_CURRENT_M ZE_MAKE_VERSION( 1, 21 ) #endif // ZE_API_VERSION_CURRENT_M /////////////////////////////////////////////////////////////////////////////// @@ -2210,27 +2211,52 @@ typedef struct _ze_device_compute_properties_t typedef uint32_t ze_device_dp_capability_flags_t; typedef enum _ze_device_dp_capability_flag_t { - ZE_DEVICE_DP_CAPABILITY_FLAG_DEVICE_NON_SYSTOLIC_DPA4_SIMD_ALL = ZE_BIT(0), ///< Supports vector dot product instruction. - ZE_DEVICE_DP_CAPABILITY_FLAG_DEVICE_SYSTOLIC_DPAS_SIMD8 = ZE_BIT(1), ///< Supports sytolic dot product with 8 SIMD lanes. - ZE_DEVICE_DP_CAPABILITY_FLAG_DEVICE_SYSTOLIC_DPAS_SIMD16 = ZE_BIT(2), ///< Supports sytolic dot product with 16 SIMD lanes. - ZE_DEVICE_DP_CAPABILITY_FLAG_DEVICE_SYSTOLIC_BDPAS_SIMD16 = ZE_BIT(3), ///< Supports sytolic dot product with block scaling support with 16 SIMD - ///< lanes. + ZE_DEVICE_DP_CAPABILITY_FLAG_DEVICE_NON_SYSTOLIC_DPA4_SIMD_ALL = ZE_BIT(0), ///< Supports the non-systolic vector dot product instruction (DP4A). When + ///< set, the dpv4_input_types and dpv4_output_types members of + ///< ::ze_device_compute_dotproduct_ext_properties_t describe the legal + ///< data types for this path. + ZE_DEVICE_DP_CAPABILITY_FLAG_DEVICE_SYSTOLIC_DPAS_SIMD8 = ZE_BIT(1), ///< Supports systolic dot product (DPAS) with 8 SIMD lanes. + ZE_DEVICE_DP_CAPABILITY_FLAG_DEVICE_SYSTOLIC_DPAS_SIMD16 = ZE_BIT(2), ///< Supports systolic dot product (DPAS) with 16 SIMD lanes. + ZE_DEVICE_DP_CAPABILITY_FLAG_DEVICE_SYSTOLIC_BDPAS_SIMD16 = ZE_BIT(3), ///< Supports systolic dot product with block-scaling support (BDPAS) with + ///< 16 SIMD lanes. ZE_DEVICE_DP_CAPABILITY_FLAG_DEVICE_SYSTOLIC_DPAS_DEPTH4 = ZE_BIT(4), ///< Supports 4 deep systolic for DPAS dot product ZE_DEVICE_DP_CAPABILITY_FLAG_DEVICE_SYSTOLIC_DPAS_DEPTH8 = ZE_BIT(5), ///< Supports 8 deep systolic for DPAS dot product ZE_DEVICE_DP_CAPABILITY_FLAG_DEVICE_SYSTOLIC_BDPAS_DEPTH8 = ZE_BIT(6), ///< Supports 8 deep systolic for BDPAS dot product - ZE_DEVICE_DP_CAPABILITY_FLAG_DEVICE_SYSTOLIC_OUTPUT_MATRIX_ROWCOUNT_UPTO8 = ZE_BIT(7), ///< Supports output matrix row count upto 8 - ZE_DEVICE_DP_CAPABILITY_FLAG_DEVICE_SYSTOLIC_OUTPUT_MATRIX_ROWCOUNT_FIXED8 = ZE_BIT(8), ///< Restricts output matrix row count to 8 + ZE_DEVICE_DP_CAPABILITY_FLAG_DEVICE_SYSTOLIC_OUTPUT_MATRIX_ROWCOUNT_UPTO8 = ZE_BIT(7), ///< Output-shape modifier for the systolic DPAS/BDPAS path: the output + ///< matrix row count is variable, up to 8. Only meaningful when at least + ///< one of the DEVICE_SYSTOLIC_DPAS_* or DEVICE_SYSTOLIC_BDPAS_* bits is + ///< also set in dp_caps; this bit alone does not advertise DPAS or BDPAS + ///< support. + ZE_DEVICE_DP_CAPABILITY_FLAG_DEVICE_SYSTOLIC_OUTPUT_MATRIX_ROWCOUNT_FIXED8 = ZE_BIT(8), ///< Output-shape modifier for the systolic DPAS/BDPAS path: the output + ///< matrix row count is fixed at 8. Only meaningful when at least one of + ///< the DEVICE_SYSTOLIC_DPAS_* or DEVICE_SYSTOLIC_BDPAS_* bits is also set + ///< in dp_caps; this bit alone does not advertise DPAS or BDPAS support. ZE_DEVICE_DP_CAPABILITY_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_DEVICE_DP_CAPABILITY_FLAG_* ENUMs } ze_device_dp_capability_flag_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Supported device dot product(dp) input data types flags +/// @brief Supported device dot product (dp) input data type flags. A field value +/// of 0 indicates no supported input data types for the associated +/// dot-product path; non-zero values are the bitwise-OR of the supported +/// type bits defined below. The containing *_input_types field +/// (dpv4_input_types, dpas_input_types, or bdpas_input_types) determines +/// which dot-product path this applies to. typedef uint32_t ze_device_input_data_type_flags_t; typedef enum _ze_device_input_data_type_flag_t { - ZE_DEVICE_INPUT_DATA_TYPE_FLAG_DEVICE_INPUT_DATA_TYPE_NONE = ZE_BIT(0), ///< No data types available for the supported dot product operation - ZE_DEVICE_INPUT_DATA_TYPE_FLAG_ZE_DEVICE_INPUT_DATA_INT8_PACK4_PER_SIMD_LANE = ZE_BIT(1), ///< Supports int8 data type with 4 packed data elements per SIMD lane. + ZE_DEVICE_INPUT_DATA_TYPE_FLAG_DEVICE_INPUT_DATA_TYPE_NONE = ZE_BIT(0), ///< [DEPRECATED since 1.21] Indicates that no data types are supported. + ///< This bit is semantically equivalent to all other field values being 0 + ///< and must not be combined with any other bit of this enum. Retained for + ///< ABI compatibility only. No replacement; a field value of 0 already + ///< indicates that no data types are supported. + ZE_DEVICE_INPUT_DATA_TYPE_FLAG_ZE_DEVICE_INPUT_DATA_INT8_PACK4_PER_SIMD_LANE = ZE_BIT(1), ///< [DEPRECATED since 1.21] Supports int8 data type with 4 packed data + ///< elements per SIMD lane. This enumerator carries a stray 'ZE_' prefix + ///< in its name, producing the generated token + ///< ::ZE_DEVICE_INPUT_DATA_TYPE_FLAG_ZE_DEVICE_INPUT_DATA_INT8_PACK4_PER_SIMD_LANE. + ///< Retained for ABI compatibility only. Use + ///< ::ZE_DEVICE_INPUT_DATA_TYPE_FLAG_DEVICE_INPUT_DATA_INT8_PACK4_PER_SIMD_LANE + ///< instead. ZE_DEVICE_INPUT_DATA_TYPE_FLAG_DEVICE_INPUT_DATA_INT4_PACK8_PER_SIMD_LANE = ZE_BIT(2), ///< Supports int4 data type with 8 packed data elements per SIMD lane. ZE_DEVICE_INPUT_DATA_TYPE_FLAG_DEVICE_INPUT_DATA_INT2_PACK8_PER_SIMD_LANE = ZE_BIT(3), ///< Supports int2 data type with 8 packed data elements per SIMD lane. ZE_DEVICE_INPUT_DATA_TYPE_FLAG_DEVICE_INPUT_DATA_TF32_PACK1_PER_SIMD_LANE = ZE_BIT(4), ///< Supports tf32 data type with 1 packed data elements per SIMD lane. @@ -2240,21 +2266,26 @@ typedef enum _ze_device_input_data_type_flag_t ZE_DEVICE_INPUT_DATA_TYPE_FLAG_DEVICE_INPUT_DATA_BF8_PACK4_PER_SIMD_LANE = ZE_BIT(8), ///< Supports bf8 data type with 4 packed data elements per SIMD lane. ZE_DEVICE_INPUT_DATA_TYPE_FLAG_DEVICE_INPUT_DATA_E2M1_PACK8_PER_SIMD_LANE = ZE_BIT(9), ///< Supports e2m1 data type with 8 packed data elements per SIMD lane. ZE_DEVICE_INPUT_DATA_TYPE_FLAG_DEVICE_INPUT_DATA_E3M0_PACK8_PER_SIMD_LANE = ZE_BIT(10), ///< Supports e3m0 data type with 8 packed data elements per SIMD lane. - ZE_DEVICE_INPUT_DATA_TYPE_FLAG_DEVICE_INPUT_DATA_INT8_PACK4_PER_SIMD_LANE = ZE_BIT(11), ///< Supports 8bit integer data type with 4 packed data elements per SIMD - ///< lane.This is exclusively for DP4V dot product support - ZE_DEVICE_INPUT_DATA_TYPE_FLAG_DEVICE_INPUT_DATA_SCALING_UINT8 = ZE_BIT(12),///< Supports uint8 data type support for scaling, exclusive to BDPAS dot - ///< product support. - ZE_DEVICE_INPUT_DATA_TYPE_FLAG_DEVICE_INPUT_DATA_SCALING_UE5M3 = ZE_BIT(13),///< Supports ue5m3 data type support for scaling, exclusive to BDPAS dot - ///< product support. - ZE_DEVICE_INPUT_DATA_TYPE_FLAG_DEVICE_INPUT_DATA_SCALING_UE4M3 = ZE_BIT(14),///< Supports ue4m3 data type support for scaling, exclusive to BDPAS dot - ///< product support. + ZE_DEVICE_INPUT_DATA_TYPE_FLAG_DEVICE_INPUT_DATA_INT8_PACK4_PER_SIMD_LANE = ZE_BIT(11), ///< Supports int8 (8-bit signed integer) data type with 4 packed data + ///< elements per SIMD lane. + ZE_DEVICE_INPUT_DATA_TYPE_FLAG_DEVICE_INPUT_DATA_SCALING_UINT8 = ZE_BIT(12),///< Supports uint8 (8-bit unsigned integer) scaling factor. Only + ///< meaningful when set in bdpas_input_types; exclusive to the BDPAS + ///< dot-product path. + ZE_DEVICE_INPUT_DATA_TYPE_FLAG_DEVICE_INPUT_DATA_SCALING_UE5M3 = ZE_BIT(13),///< Supports ue5m3 (unsigned float, 5-bit exponent, 3-bit mantissa) + ///< scaling factor. Only meaningful when set in bdpas_input_types; + ///< exclusive to the BDPAS dot-product path. + ZE_DEVICE_INPUT_DATA_TYPE_FLAG_DEVICE_INPUT_DATA_SCALING_UE4M3 = ZE_BIT(14),///< Supports ue4m3 (unsigned float, 4-bit exponent, 3-bit mantissa) + ///< scaling factor. Only meaningful when set in bdpas_input_types; + ///< exclusive to the BDPAS dot-product path. ZE_DEVICE_INPUT_DATA_TYPE_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_DEVICE_INPUT_DATA_TYPE_FLAG_* ENUMs } ze_device_input_data_type_flag_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Supported device dot product(dp) output data types or accumulator -/// data types flags +/// @brief Supported device dot product (dp) output / accumulator data type +/// flags. A field value of 0 indicates no supported output data types for +/// the associated dot-product path; non-zero values are the bitwise-OR of +/// the supported type bits defined below. typedef uint32_t ze_device_output_data_type_flags_t; typedef enum _ze_device_output_data_type_flag_t { @@ -2291,18 +2322,38 @@ typedef struct _ze_device_compute_dotproduct_ext_properties_t void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific ///< structure (i.e. contains stype and pNext). ze_device_dp_capability_flags_t dp_caps; ///< [out] indicates dot product capability of the device - ze_device_input_data_type_flags_t dpv4_input_types; ///< [out] Supported input data types when dp4v dot product capability is - ///< supported. - ze_device_output_data_type_flags_t dpv4_output_types; ///< [out] Supported output data types when dp4v dot product capability is - ///< supported. - ze_device_input_data_type_flags_t dpas_input_types; ///< [out] Supported input data types when dpas dot product capability is - ///< supported. - ze_device_output_data_type_flags_t dpas_output_types; ///< [out] Supported output data types when dpas dot product capability is - ///< supported. - ze_device_input_data_type_flags_t bdpas_input_types; ///< [out] Supported input data types when bdpas dot product capability is - ///< supported. - ze_device_output_data_type_flags_t bdpas_output_types; ///< [out] Supported output data types when bdpas dot product capability is - ///< supported. + ze_device_input_data_type_flags_t dpv4_input_types; ///< [out] Supported input data types for the non-systolic vector + ///< dot-product path (DP4A). Valid only when + ///< ::ZE_DEVICE_DP_CAPABILITY_FLAG_DEVICE_NON_SYSTOLIC_DPA4_SIMD_ALL is + ///< set in dp_caps; a value of 0 indicates no supported input types for + ///< this path. The member is named 'dpv4_*' for ABI compatibility; the + ///< feature it describes is DP4A. + ze_device_output_data_type_flags_t dpv4_output_types; ///< [out] Supported output / accumulator data types for the non-systolic + ///< vector dot-product path (DP4A). Valid only when + ///< ::ZE_DEVICE_DP_CAPABILITY_FLAG_DEVICE_NON_SYSTOLIC_DPA4_SIMD_ALL is + ///< set in dp_caps; a value of 0 indicates no supported output types for + ///< this path. The member is named 'dpv4_*' for ABI compatibility; the + ///< feature it describes is DP4A. + ze_device_input_data_type_flags_t dpas_input_types; ///< [out] Supported input data types for the systolic dot-product (DPAS) + ///< path. Valid only when at least one of the DEVICE_SYSTOLIC_DPAS_* bits + ///< in ::ze_device_dp_capability_flags_t is set in dp_caps; a value of 0 + ///< indicates no supported input types for this path. + ze_device_output_data_type_flags_t dpas_output_types; ///< [out] Supported output / accumulator data types for the systolic + ///< dot-product (DPAS) path. Valid only when at least one of the + ///< DEVICE_SYSTOLIC_DPAS_* bits in ::ze_device_dp_capability_flags_t is + ///< set in dp_caps; a value of 0 indicates no supported output types for + ///< this path. + ze_device_input_data_type_flags_t bdpas_input_types; ///< [out] Supported input data types for the block-scaled systolic + ///< dot-product (BDPAS) path. Valid only when at least one of the + ///< DEVICE_SYSTOLIC_BDPAS_* bits in ::ze_device_dp_capability_flags_t is + ///< set in dp_caps; a value of 0 indicates no supported input types for + ///< this path. The DEVICE_INPUT_DATA_SCALING_* bits in + ///< ::ze_device_input_data_type_flags_t only have meaning in this member. + ze_device_output_data_type_flags_t bdpas_output_types; ///< [out] Supported output / accumulator data types for the block-scaled + ///< systolic dot-product (BDPAS) path. Valid only when at least one of the + ///< DEVICE_SYSTOLIC_BDPAS_* bits in ::ze_device_dp_capability_flags_t is + ///< set in dp_caps; a value of 0 indicates no supported output types for + ///< this path. } ze_device_compute_dotproduct_ext_properties_t; @@ -3608,8 +3659,12 @@ typedef enum _ze_command_queue_mode_t 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_LOW = 1, ///< lower priority than normal + ZE_COMMAND_QUEUE_PRIORITY_HIGH = 2, ///< higher priority than normal + ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_LOW = 1, ///< [DEPRECATED since 1.21] lower priority than normal. Use + ///< ::ZE_COMMAND_QUEUE_PRIORITY_LOW instead. + ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_HIGH = 2, ///< [DEPRECATED since 1.21] higher priority than normal. Use + ///< ::ZE_COMMAND_QUEUE_PRIORITY_HIGH instead. ZE_COMMAND_QUEUE_PRIORITY_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_COMMAND_QUEUE_PRIORITY_* ENUMs } ze_command_queue_priority_t; @@ -3623,7 +3678,8 @@ 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. + ///< zero-based, so it must be less than the `numQueues` member of + ///< ::ze_command_queue_group_properties_t for the command queue group. 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 @@ -3671,7 +3727,7 @@ typedef struct _ze_command_queue_desc_t /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION /// + `0x7 < desc->flags` /// + `::ZE_COMMAND_QUEUE_MODE_ASYNCHRONOUS < desc->mode` -/// + `::ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_HIGH < desc->priority` +/// + `::ZE_COMMAND_QUEUE_PRIORITY_HIGH < desc->priority` /// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandQueueCreate( @@ -4122,7 +4178,7 @@ zeCommandListCreate( /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION /// + `0x7 < altdesc->flags` /// + `::ZE_COMMAND_QUEUE_MODE_ASYNCHRONOUS < altdesc->mode` -/// + `::ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_HIGH < altdesc->priority` +/// + `::ZE_COMMAND_QUEUE_PRIORITY_HIGH < altdesc->priority` /// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandListCreateImmediate( @@ -4290,6 +4346,12 @@ zeCommandListAppendWriteGlobalTimestamp( /// execution of commands appended to other /// immediate command lists created with either a different ordinal or /// different index. +/// - Some implementations may associate immediate command lists created +/// with the same ordinal and index with the same hardware queue. +/// In that case, this function may also wait for commands appended to the +/// other immediate command lists before +/// the last command appended to this command list, and may return +/// ::ZE_RESULT_NOT_READY while those commands are not complete. /// - The application may call this function from simultaneous threads. /// - The implementation of this function should be lock-free. /// @@ -11017,11 +11079,11 @@ typedef enum _ze_cache_ext_region_t ///< ::ZE_CACHE_EXT_REGION_DEFAULT instead. ZE_CACHE_EXT_REGION_ZE_CACHE_RESERVE_REGION = 1, ///< [DEPRECATED since 1.7] utilize reserved region. Use ///< ::ZE_CACHE_EXT_REGION_RESERVED instead. - ZE_CACHE_EXT_REGION_ZE_CACHE_NON_RESERVED_REGION = 2, ///< [DEPRECATED since 1.7] utilize non-reserverd region. Use + ZE_CACHE_EXT_REGION_ZE_CACHE_NON_RESERVED_REGION = 2, ///< [DEPRECATED since 1.7] utilize non-reserved region. Use ///< ::ZE_CACHE_EXT_REGION_NON_RESERVED instead. 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_NON_RESERVED = 2, ///< utilize non-reserved region ZE_CACHE_EXT_REGION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_CACHE_EXT_REGION_* ENUMs } ze_cache_ext_region_t; @@ -13888,7 +13950,10 @@ typedef struct _ze_rtas_builder_instance_geometry_info_exp_t ///< bits representing the geometry flags for all primitives of this ///< geometry uint8_t geometryMask; ///< [in] 8-bit geometry mask for ray masking - ze_rtas_builder_packed_input_data_format_exp_t transformFormat; ///< [in] format of the specified transformation + ze_rtas_builder_packed_input_data_format_exp_t transformFormat; ///< [in] format of the specified transformation, must be + ///< ::ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_FLOAT3X4_COLUMN_MAJOR, + ///< ::ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_FLOAT3X4_ALIGNED_COLUMN_MAJOR, + ///< or ::ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_FLOAT3X4_ROW_MAJOR uint32_t instanceUserID; ///< [in] user-specified identifier for the instance void* pTransform; ///< [in] object-to-world instance transformation in specified format ze_rtas_aabb_exp_t* pBounds; ///< [in] object-space axis-aligned bounding-box of the instanced @@ -16413,7 +16478,10 @@ typedef struct _ze_rtas_builder_instance_geometry_info_ext_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 + ze_rtas_builder_packed_input_data_format_ext_t transformFormat; ///< [in] format of the specified transformation, must be + ///< ::ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_FLOAT3X4_COLUMN_MAJOR, + ///< ::ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_FLOAT3X4_ALIGNED_COLUMN_MAJOR, + ///< or ::ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_FLOAT3X4_ROW_MAJOR 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 @@ -18056,7 +18124,9 @@ zeGraphDestroyExt( /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hGraph` /// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT -/// + Graph is not in a recording state +/// + Capture into `hGraph` is already paused +/// - ::ZE_RESULT_ERROR_COMMAND_LIST_NOT_CAPTURING +/// + Capture into `hGraph` was never started or has already ended ZE_APIEXPORT ze_result_t ZE_APICALL zeGraphPauseCaptureExt( ze_graph_handle_t hGraph ///< [in] handle to the graph to pause capture @@ -18081,7 +18151,10 @@ zeGraphPauseCaptureExt( /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hGraph` /// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT -/// + Graph is not in a paused state +/// + Capture into `hGraph` is not paused +/// + The command list from which `hGraph` was recording is capturing into another graph +/// - ::ZE_RESULT_ERROR_COMMAND_LIST_NOT_CAPTURING +/// + Capture into `hGraph` was never started or has already ended ZE_APIEXPORT ze_result_t ZE_APICALL zeGraphResumeCaptureExt( ze_graph_handle_t hGraph ///< [in] handle to the graph to resume capture @@ -18294,7 +18367,7 @@ typedef enum _ze_command_queue_set_priority_ext_version_t /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hCommandQueue` /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `::ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_HIGH < priority` +/// + `::ZE_COMMAND_QUEUE_PRIORITY_HIGH < priority` /// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandQueueSetPriorityExt( diff --git a/include/ze_ddi.h b/include/ze_ddi.h index 449bd2f8..c0137322 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.20-r1.20.41 + * @version v1.21-r1.21.26 * */ #ifndef _ZE_DDI_H diff --git a/include/ze_ddi_common.h b/include/ze_ddi_common.h index a6d6e474..85f7a678 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.20-r1.20.41 + * @version v1.21-r1.21.26 * */ #ifndef _ZE_DDI_COMMON_H diff --git a/include/zer.py b/include/zer.py index 2b925ab1..b4c1d7f4 100644 --- a/include/zer.py +++ b/include/zer.py @@ -4,7 +4,7 @@ SPDX-License-Identifier: MIT @file zer.py - @version v1.20-r1.20.41 + @version v1.21-r1.21.26 """ import platform diff --git a/include/zer_api.h b/include/zer_api.h index 5f8dff15..633334eb 100644 --- a/include/zer_api.h +++ b/include/zer_api.h @@ -5,7 +5,7 @@ * SPDX-License-Identifier: MIT * * @file zer_api.h - * @version v1.20-r1.20.41 + * @version v1.21-r1.21.26 * */ #ifndef _ZER_API_H diff --git a/include/zer_ddi.h b/include/zer_ddi.h index 5d8ae68c..11ef1cee 100644 --- a/include/zer_ddi.h +++ b/include/zer_ddi.h @@ -5,7 +5,7 @@ * SPDX-License-Identifier: MIT * * @file zer_ddi.h - * @version v1.20-r1.20.41 + * @version v1.21-r1.21.26 * */ #ifndef _ZER_DDI_H diff --git a/include/zes.py b/include/zes.py index e55c8778..4b2305ae 100644 --- a/include/zes.py +++ b/include/zes.py @@ -4,7 +4,7 @@ SPDX-License-Identifier: MIT @file zes.py - @version v1.20-r1.20.41 + @version v1.21-r1.21.26 """ import platform @@ -16,6 +16,21 @@ ############################################################################### __version__ = "1.0" +############################################################################### +## @brief Generates generic 'oneAPI' Sysman API versions +def ZES_MAKE_VERSION( _major, _minor ): + return (( _major << 16 )|( _minor & 0x0000ffff)) + +############################################################################### +## @brief Extracts 'oneAPI' Sysman API major version +def ZES_MAJOR_VERSION( _ver ): + return ( _ver >> 16 ) + +############################################################################### +## @brief Extracts 'oneAPI' Sysman API minor version +def ZES_MINOR_VERSION( _ver ): + return ( _ver & 0x0000ffff ) + ############################################################################### ## @brief Handle to a driver instance class zes_driver_handle_t(c_void_p): @@ -188,6 +203,8 @@ class zes_structure_type_v(IntEnum): DRIVER_PCI_DEVICE_PROPERTIES = 0x00020025 ## ::zes_driver_pci_device_properties_t DEVICE_INDEX_EXT_PROPERTIES = 0x00020026 ## ::zes_device_index_ext_properties_t DEVICE_GPU_TOPOLOGY_EXT_PROPERTIES = 0x00020027 ## ::zes_device_gpu_topology_ext_properties_t + DEVICE_SOC_UID_EXT_PROPERTIES = 0x00020028 ## ::zes_device_soc_uid_ext_properties_t + INFO_LOG_DECODABLE_FIELD_INFO_EXT = 0x00020029 ## ::zes_info_log_decodable_field_info_ext_t class zes_structure_type_t(c_int): def __str__(self): @@ -281,6 +298,46 @@ class zes_driver_properties_t(Structure): ## value where higher values always indicate a more recent version. ] +############################################################################### +## @brief Supported sysman API versions +## +## @details +## - API versions contain major and minor attributes, use +## ::ZES_MAJOR_VERSION and ::ZES_MINOR_VERSION +class zes_api_version_v(IntEnum): + _1_0 = ZES_MAKE_VERSION( 1, 0 ) ## version 1.0 + _1_1 = ZES_MAKE_VERSION( 1, 1 ) ## version 1.1 + _1_2 = ZES_MAKE_VERSION( 1, 2 ) ## version 1.2 + _1_3 = ZES_MAKE_VERSION( 1, 3 ) ## version 1.3 + _1_4 = ZES_MAKE_VERSION( 1, 4 ) ## version 1.4 + _1_5 = ZES_MAKE_VERSION( 1, 5 ) ## version 1.5 + _1_6 = ZES_MAKE_VERSION( 1, 6 ) ## version 1.6 + _1_7 = ZES_MAKE_VERSION( 1, 7 ) ## version 1.7 + _1_8 = ZES_MAKE_VERSION( 1, 8 ) ## version 1.8 + _1_9 = ZES_MAKE_VERSION( 1, 9 ) ## version 1.9 + _1_10 = ZES_MAKE_VERSION( 1, 10 ) ## version 1.10 + _1_11 = ZES_MAKE_VERSION( 1, 11 ) ## version 1.11 + _1_12 = ZES_MAKE_VERSION( 1, 12 ) ## version 1.12 + _1_13 = ZES_MAKE_VERSION( 1, 13 ) ## version 1.13 + _1_14 = ZES_MAKE_VERSION( 1, 14 ) ## version 1.14 + _1_15 = ZES_MAKE_VERSION( 1, 15 ) ## version 1.15 + _1_16 = ZES_MAKE_VERSION( 1, 16 ) ## version 1.16 + _1_17 = ZES_MAKE_VERSION( 1, 17 ) ## version 1.17 + _1_18 = ZES_MAKE_VERSION( 1, 18 ) ## version 1.18 + _1_19 = ZES_MAKE_VERSION( 1, 19 ) ## version 1.19 + _1_20 = ZES_MAKE_VERSION( 1, 20 ) ## version 1.20 + _1_21 = ZES_MAKE_VERSION( 1, 21 ) ## version 1.21 + CURRENT = ZES_MAKE_VERSION( 1, 21 ) ## latest known version + +class zes_api_version_t(c_int): + def __str__(self): + return str(zes_api_version_v(self.value)) + + +############################################################################### +## @brief Current sysman API version as a macro +ZES_API_VERSION_CURRENT_M = ZES_MAKE_VERSION( 1, 21 ) + ############################################################################### ## @brief Maximum extension name string size ZES_MAX_EXTENSION_NAME = 256 @@ -411,13 +468,21 @@ def __str__(self): ## topology of the device, pNext member of this structure should point to ## an instance of ${s}_device_gpu_topology_ext_properties_t with its ## stype set to ::ZES_STRUCTURE_TYPE_DEVICE_GPU_TOPOLOGY_EXT_PROPERTIES. +## To get the SOC unique ID of the device, pNext member of this structure +## should point to an instance of ::zes_device_soc_uid_ext_properties_t +## with its stype set to +## ::ZES_STRUCTURE_TYPE_DEVICE_SOC_UID_EXT_PROPERTIES. To get the UUID, +## type and flags of the device, pNext member of this structure should +## point to an instance of ::zes_device_ext_properties_t with its stype +## set to ::ZES_STRUCTURE_TYPE_DEVICE_EXT_PROPERTIES. class zes_device_properties_t(Structure): _fields_ = [ ("stype", zes_structure_type_t), ## [in] type of this structure ("pNext", c_void_p), ## [in,out][optional] must be null or a pointer to an extension-specific ## structure (i.e. contains stype and pNext). - ("core", ze_device_properties_t), ## [out] [DEPRECATED since 1.7] Core device properties. Use - ## ::zes_device_ext_properties_t instead. + ("core", ze_device_properties_t), ## [out] [DEPRECATED since 1.7] Core device properties. Get the UUID, + ## type and flags through pNext. Use ::zes_device_ext_properties_t + ## instead. ("numSubdevices", c_uint32), ## [out] Number of sub-devices. A value of 0 indicates that this device ## doesn't have sub-devices. ("serialNumber", c_char * ZES_STRING_PROPERTY_SIZE), ## [out] Manufacturing serial number (NULL terminated string value). This @@ -2354,7 +2419,11 @@ class zes_power_ext_properties_t(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). ("domain", zes_power_domain_t), ## [out] domain that the power limit belongs to. - ("defaultLimit", POINTER(zes_power_limit_ext_desc_t)) ## [out] the factory default limit of the part. + ("defaultLimit", POINTER(zes_power_limit_ext_desc_t)) ## [in,out][optional] pointer to a caller-allocated ::zes_power_limit_ext_desc_t + ## that the driver fills with the factory default limit of the part. + ## The application must allocate and initialize (including `stype`) the pointed-to + ## structure and assign its address before calling ::zesPowerGetProperties. + ## If this is null, the factory default limit will not be returned. ] ############################################################################### @@ -2991,7 +3060,8 @@ class zes_memory_vendor_info_ext_properties_t(Structure): ## @brief Info Logs Extension Version(s) class zes_info_logs_ext_version_v(IntEnum): _1_0 = ZE_MAKE_VERSION( 1, 0 ) ## version 1.0 - CURRENT = ZE_MAKE_VERSION( 1, 0 ) ## latest known version + _1_1 = ZE_MAKE_VERSION( 1, 1 ) ## version 1.1 + CURRENT = ZE_MAKE_VERSION( 1, 1 ) ## latest known version class zes_info_logs_ext_version_t(c_int): def __str__(self): @@ -3177,6 +3247,62 @@ class zes_info_log_read_status_ext_t(Structure): ## ::zesInfoLogInstanceReadWithMetadataExt consumed, after this function returns. ] +############################################################################### +## @brief Maximum number of characters in the description of a decodable field, +## including the null terminator. +ZES_INFO_LOG_FIELD_DESC_SIZE = 256 + +############################################################################### +## @brief Handle for a Sysman info log decoder context +class zes_info_log_decoder_context_handle_t(c_void_p): + pass + +############################################################################### +## @brief Data types of a field decoded from an info log record +class zes_info_log_field_type_ext_v(IntEnum): + UINT32 = 0 ## The value of the field is a `uint32_t`. + INT64 = 1 ## The value of the field is an `int64_t`. + DOUBLE = 2 ## The value of the field is a `double`. + STRING = 3 ## The value of the field is a null terminated array of `char`. + RAW_BYTES = 4 ## The value of the field is an array of uninterpreted bytes. + +class zes_info_log_field_type_ext_t(c_int): + def __str__(self): + return str(zes_info_log_field_type_ext_v(self.value)) + + +############################################################################### +## @brief Description of one field that a decoder context can decode from an +## info log record +## +## @details +## - An array of these structures is returned by +## ::zesInfoLogDecoderContextGetFieldInfoExt, one element per field. +## - The fields that are reported are a property of the format of the info +## log, reported in infoLogFormat of ::zes_info_log_ext_properties_t, and +## not of a batch of records. Whether a given record carries a given +## field is reported per record by +## ::zesInfoLogDecoderContextReadFieldExt. +## - The application must locate a field by `name`, and must then use the +## `fieldId`, `type` and `requiredBytes` that are reported for that name. +class zes_info_log_decodable_field_info_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). + ("desc", c_char * ZES_INFO_LOG_FIELD_DESC_SIZE), ## [out] human readable description of the field (NULL terminated string + ## value). + ("name", c_char * ZES_STRING_PROPERTY_SIZE), ## [out] name of the field (NULL terminated string value). + ("fieldId", c_uint32), ## [out] identifier of the field, to be passed to + ## ::zesInfoLogDecoderContextReadFieldExt. + ("type", zes_info_log_field_type_ext_t), ## [out] data type of the value of the field. + ("requiredBytes", c_size_t), ## [out] number of bytes that the application must provide to + ## ::zesInfoLogDecoderContextReadFieldExt to read this field. + ## For ::ZES_INFO_LOG_FIELD_TYPE_EXT_STRING this value includes the null terminator. + ("elementCount", c_size_t), ## [out] number of elements of the data type that the field holds. + ("versionString", c_char * ZES_STRING_PROPERTY_SIZE) ## [out] version of this extension in which the field was first reported. + ] + ############################################################################### ## @brief Device GPU Topology Extension Name ZES_DEVICE_GPU_TOPOLOGY_EXT_NAME = "ZES_extension_device_gpu_topology" @@ -3276,6 +3402,38 @@ class zes_driver_pci_device_properties_t(Structure): ("status", zes_pci_link_status_t) ## [out] The link status of the device. ] +############################################################################### +## @brief Device SOC Unique ID Extension Name +ZES_DEVICE_SOC_UID_EXT_NAME = "ZES_extension_device_soc_uid" + +############################################################################### +## @brief Device SOC Unique ID Extension Version(s) +class zes_device_soc_uid_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_soc_uid_ext_version_t(c_int): + def __str__(self): + return str(zes_device_soc_uid_ext_version_v(self.value)) + + +############################################################################### +## @brief Device SOC Unique ID Extension structure +## +## @details +## - This structure can be passed as an extension structure to +## ::zesDeviceGetProperties via pNext member +## - Returns the unique ID of the SOC on which the device resides +## - Applications must treat an all-zero socUid as unavailable rather than +## as a valid identifier +class zes_device_soc_uid_ext_properties_t(Structure): + _fields_ = [ + ("stype", zes_structure_type_t), ## [in] type of this structure + ("pNext", c_void_p), ## [in,out][optional] must be null or a pointer to an extension-specific + ## structure (i.e. contains stype and pNext). + ("socUid", zes_uuid_t) ## [out] unique identifier of the SOC, most significant byte first. + ] + ############################################################################### __use_win_types = "Windows" == platform.uname()[0] @@ -3722,6 +3880,13 @@ class _zes_device_exp_dditable_t(Structure): else: _zesDriverGetPciDeviceProperties_t = CFUNCTYPE( ze_result_t, zes_driver_handle_t, POINTER(c_uint32), POINTER(zes_driver_pci_device_properties_t) ) +############################################################################### +## @brief Function-pointer for zesDriverGetApiVersion +if __use_win_types: + _zesDriverGetApiVersion_t = WINFUNCTYPE( ze_result_t, zes_driver_handle_t, POINTER(zes_api_version_t) ) +else: + _zesDriverGetApiVersion_t = CFUNCTYPE( ze_result_t, zes_driver_handle_t, POINTER(zes_api_version_t) ) + ############################################################################### ## @brief Table of Driver functions pointers @@ -3736,7 +3901,8 @@ class _zes_driver_dditable_t(Structure): ("pfnEventRegisterExt", c_void_p), ## _zesDriverEventRegisterExt_t ("pfnEventListenExt", c_void_p), ## _zesDriverEventListenExt_t ("pfnEnumInfoLogsExt", c_void_p), ## _zesDriverEnumInfoLogsExt_t - ("pfnGetPciDeviceProperties", c_void_p) ## _zesDriverGetPciDeviceProperties_t + ("pfnGetPciDeviceProperties", c_void_p), ## _zesDriverGetPciDeviceProperties_t + ("pfnGetApiVersion", c_void_p) ## _zesDriverGetApiVersion_t ] ############################################################################### @@ -4813,6 +4979,61 @@ class _zes_info_log_instance_dditable_t(Structure): ("pfnDeleteExt", c_void_p) ## _zesInfoLogInstanceDeleteExt_t ] +############################################################################### +## @brief Function-pointer for zesInfoLogDecoderContextCreateExt +if __use_win_types: + _zesInfoLogDecoderContextCreateExt_t = WINFUNCTYPE( ze_result_t, zes_info_log_handle_t, POINTER(zes_info_log_decoder_context_handle_t) ) +else: + _zesInfoLogDecoderContextCreateExt_t = CFUNCTYPE( ze_result_t, zes_info_log_handle_t, POINTER(zes_info_log_decoder_context_handle_t) ) + +############################################################################### +## @brief Function-pointer for zesInfoLogDecoderContextGetFieldInfoExt +if __use_win_types: + _zesInfoLogDecoderContextGetFieldInfoExt_t = WINFUNCTYPE( ze_result_t, zes_info_log_decoder_context_handle_t, POINTER(c_uint32), POINTER(zes_info_log_decodable_field_info_ext_t) ) +else: + _zesInfoLogDecoderContextGetFieldInfoExt_t = CFUNCTYPE( ze_result_t, zes_info_log_decoder_context_handle_t, POINTER(c_uint32), POINTER(zes_info_log_decodable_field_info_ext_t) ) + +############################################################################### +## @brief Function-pointer for zesInfoLogDecoderContextDecodeStartExt +if __use_win_types: + _zesInfoLogDecoderContextDecodeStartExt_t = WINFUNCTYPE( ze_result_t, zes_info_log_decoder_context_handle_t, c_uint32, POINTER(c_uint8), c_uint32, POINTER(zes_info_log_metadata_ext_t) ) +else: + _zesInfoLogDecoderContextDecodeStartExt_t = CFUNCTYPE( ze_result_t, zes_info_log_decoder_context_handle_t, c_uint32, POINTER(c_uint8), c_uint32, POINTER(zes_info_log_metadata_ext_t) ) + +############################################################################### +## @brief Function-pointer for zesInfoLogDecoderContextReadFieldExt +if __use_win_types: + _zesInfoLogDecoderContextReadFieldExt_t = WINFUNCTYPE( ze_result_t, zes_info_log_decoder_context_handle_t, c_uint32, c_uint32, c_void_p, c_size_t, POINTER(c_size_t) ) +else: + _zesInfoLogDecoderContextReadFieldExt_t = CFUNCTYPE( ze_result_t, zes_info_log_decoder_context_handle_t, c_uint32, c_uint32, c_void_p, c_size_t, POINTER(c_size_t) ) + +############################################################################### +## @brief Function-pointer for zesInfoLogDecoderContextDecodeStopExt +if __use_win_types: + _zesInfoLogDecoderContextDecodeStopExt_t = WINFUNCTYPE( ze_result_t, zes_info_log_decoder_context_handle_t ) +else: + _zesInfoLogDecoderContextDecodeStopExt_t = CFUNCTYPE( ze_result_t, zes_info_log_decoder_context_handle_t ) + +############################################################################### +## @brief Function-pointer for zesInfoLogDecoderContextDeleteExt +if __use_win_types: + _zesInfoLogDecoderContextDeleteExt_t = WINFUNCTYPE( ze_result_t, zes_info_log_handle_t, zes_info_log_decoder_context_handle_t ) +else: + _zesInfoLogDecoderContextDeleteExt_t = CFUNCTYPE( ze_result_t, zes_info_log_handle_t, zes_info_log_decoder_context_handle_t ) + + +############################################################################### +## @brief Table of InfoLogDecoderContext functions pointers +class _zes_info_log_decoder_context_dditable_t(Structure): + _fields_ = [ + ("pfnCreateExt", c_void_p), ## _zesInfoLogDecoderContextCreateExt_t + ("pfnGetFieldInfoExt", c_void_p), ## _zesInfoLogDecoderContextGetFieldInfoExt_t + ("pfnDecodeStartExt", c_void_p), ## _zesInfoLogDecoderContextDecodeStartExt_t + ("pfnReadFieldExt", c_void_p), ## _zesInfoLogDecoderContextReadFieldExt_t + ("pfnDecodeStopExt", c_void_p), ## _zesInfoLogDecoderContextDecodeStopExt_t + ("pfnDeleteExt", c_void_p) ## _zesInfoLogDecoderContextDeleteExt_t + ] + ############################################################################### class _zes_dditable_t(Structure): _fields_ = [ @@ -4841,7 +5062,8 @@ class _zes_dditable_t(Structure): ("Diagnostics", _zes_diagnostics_dditable_t), ("VFManagementExp", _zes_vf_management_exp_dditable_t), ("InfoLog", _zes_info_log_dditable_t), - ("InfoLogInstance", _zes_info_log_instance_dditable_t) + ("InfoLogInstance", _zes_info_log_instance_dditable_t), + ("InfoLogDecoderContext", _zes_info_log_decoder_context_dditable_t) ] ############################################################################### @@ -4946,6 +5168,7 @@ def __init__(self, version : ze_api_version_t): self.zesDriverEventListenExt = _zesDriverEventListenExt_t(self.__dditable.Driver.pfnEventListenExt) self.zesDriverEnumInfoLogsExt = _zesDriverEnumInfoLogsExt_t(self.__dditable.Driver.pfnEnumInfoLogsExt) self.zesDriverGetPciDeviceProperties = _zesDriverGetPciDeviceProperties_t(self.__dditable.Driver.pfnGetPciDeviceProperties) + self.zesDriverGetApiVersion = _zesDriverGetApiVersion_t(self.__dditable.Driver.pfnGetApiVersion) # call driver to get function pointers _DriverExp = _zes_driver_exp_dditable_t() @@ -5260,4 +5483,19 @@ def __init__(self, version : ze_api_version_t): self.zesInfoLogInstancePeekWithMetadataExt = _zesInfoLogInstancePeekWithMetadataExt_t(self.__dditable.InfoLogInstance.pfnPeekWithMetadataExt) self.zesInfoLogInstanceDeleteExt = _zesInfoLogInstanceDeleteExt_t(self.__dditable.InfoLogInstance.pfnDeleteExt) + # call driver to get function pointers + _InfoLogDecoderContext = _zes_info_log_decoder_context_dditable_t() + r = ze_result_v(self.__dll.zesGetInfoLogDecoderContextProcAddrTable(version, byref(_InfoLogDecoderContext))) + if r != ze_result_v.SUCCESS: + raise Exception(r) + self.__dditable.InfoLogDecoderContext = _InfoLogDecoderContext + + # attach function interface to function address + self.zesInfoLogDecoderContextCreateExt = _zesInfoLogDecoderContextCreateExt_t(self.__dditable.InfoLogDecoderContext.pfnCreateExt) + self.zesInfoLogDecoderContextGetFieldInfoExt = _zesInfoLogDecoderContextGetFieldInfoExt_t(self.__dditable.InfoLogDecoderContext.pfnGetFieldInfoExt) + self.zesInfoLogDecoderContextDecodeStartExt = _zesInfoLogDecoderContextDecodeStartExt_t(self.__dditable.InfoLogDecoderContext.pfnDecodeStartExt) + self.zesInfoLogDecoderContextReadFieldExt = _zesInfoLogDecoderContextReadFieldExt_t(self.__dditable.InfoLogDecoderContext.pfnReadFieldExt) + self.zesInfoLogDecoderContextDecodeStopExt = _zesInfoLogDecoderContextDecodeStopExt_t(self.__dditable.InfoLogDecoderContext.pfnDecodeStopExt) + self.zesInfoLogDecoderContextDeleteExt = _zesInfoLogDecoderContextDeleteExt_t(self.__dditable.InfoLogDecoderContext.pfnDeleteExt) + # success! diff --git a/include/zes_api.h b/include/zes_api.h index e77288cd..d589ed84 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.20-r1.20.41 + * @version v1.21-r1.21.26 * */ #ifndef _ZES_API_H @@ -25,6 +25,24 @@ extern "C" { #if !defined(__GNUC__) #pragma region common #endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZES_MAKE_VERSION +/// @brief Generates generic 'oneAPI' Sysman API versions +#define ZES_MAKE_VERSION( _major, _minor ) (( _major << 16 )|( _minor & 0x0000ffff)) +#endif // ZES_MAKE_VERSION + +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZES_MAJOR_VERSION +/// @brief Extracts 'oneAPI' Sysman API major version +#define ZES_MAJOR_VERSION( _ver ) ( _ver >> 16 ) +#endif // ZES_MAJOR_VERSION + +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZES_MINOR_VERSION +/// @brief Extracts 'oneAPI' Sysman API minor version +#define ZES_MINOR_VERSION( _ver ) ( _ver & 0x0000ffff ) +#endif // ZES_MINOR_VERSION + /////////////////////////////////////////////////////////////////////////////// /// @brief Handle to a driver instance typedef ze_driver_handle_t zes_driver_handle_t; @@ -179,6 +197,8 @@ typedef enum _zes_structure_type_t ZES_STRUCTURE_TYPE_DRIVER_PCI_DEVICE_PROPERTIES = 0x00020025, ///< ::zes_driver_pci_device_properties_t ZES_STRUCTURE_TYPE_DEVICE_INDEX_EXT_PROPERTIES = 0x00020026, ///< ::zes_device_index_ext_properties_t ZES_STRUCTURE_TYPE_DEVICE_GPU_TOPOLOGY_EXT_PROPERTIES = 0x00020027, ///< ::zes_device_gpu_topology_ext_properties_t + ZES_STRUCTURE_TYPE_DEVICE_SOC_UID_EXT_PROPERTIES = 0x00020028, ///< ::zes_device_soc_uid_ext_properties_t + ZES_STRUCTURE_TYPE_INFO_LOG_DECODABLE_FIELD_INFO_EXT = 0x00020029, ///< ::zes_info_log_decodable_field_info_ext_t ZES_STRUCTURE_TYPE_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZES_STRUCTURE_TYPE_* ENUMs } zes_structure_type_t; @@ -655,6 +675,10 @@ typedef struct _zes_info_log_metadata_ext_t zes_info_log_metadata_ext_t; /// @brief Forward-declare zes_info_log_read_status_ext_t typedef struct _zes_info_log_read_status_ext_t zes_info_log_read_status_ext_t; +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare zes_info_log_decodable_field_info_ext_t +typedef struct _zes_info_log_decodable_field_info_ext_t zes_info_log_decodable_field_info_ext_t; + /////////////////////////////////////////////////////////////////////////////// /// @brief Forward-declare zes_device_gpu_topology_ext_properties_t typedef struct _zes_device_gpu_topology_ext_properties_t zes_device_gpu_topology_ext_properties_t; @@ -667,6 +691,10 @@ typedef struct _zes_pci_config_properties_t zes_pci_config_properties_t; /// @brief Forward-declare zes_driver_pci_device_properties_t typedef struct _zes_driver_pci_device_properties_t zes_driver_pci_device_properties_t; +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare zes_device_soc_uid_ext_properties_t +typedef struct _zes_device_soc_uid_ext_properties_t zes_device_soc_uid_ext_properties_t; + #if !defined(__GNUC__) #pragma endregion @@ -825,6 +853,78 @@ zesDriverGetProperties( zes_driver_properties_t* pDriverProperties ///< [in,out] query result for sysman driver properties ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Supported sysman API versions +/// +/// @details +/// - API versions contain major and minor attributes, use +/// ::ZES_MAJOR_VERSION and ::ZES_MINOR_VERSION +typedef enum _zes_api_version_t +{ + ZES_API_VERSION_1_0 = ZES_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZES_API_VERSION_1_1 = ZES_MAKE_VERSION( 1, 1 ), ///< version 1.1 + ZES_API_VERSION_1_2 = ZES_MAKE_VERSION( 1, 2 ), ///< version 1.2 + ZES_API_VERSION_1_3 = ZES_MAKE_VERSION( 1, 3 ), ///< version 1.3 + ZES_API_VERSION_1_4 = ZES_MAKE_VERSION( 1, 4 ), ///< version 1.4 + ZES_API_VERSION_1_5 = ZES_MAKE_VERSION( 1, 5 ), ///< version 1.5 + ZES_API_VERSION_1_6 = ZES_MAKE_VERSION( 1, 6 ), ///< version 1.6 + ZES_API_VERSION_1_7 = ZES_MAKE_VERSION( 1, 7 ), ///< version 1.7 + ZES_API_VERSION_1_8 = ZES_MAKE_VERSION( 1, 8 ), ///< version 1.8 + ZES_API_VERSION_1_9 = ZES_MAKE_VERSION( 1, 9 ), ///< version 1.9 + ZES_API_VERSION_1_10 = ZES_MAKE_VERSION( 1, 10 ), ///< version 1.10 + ZES_API_VERSION_1_11 = ZES_MAKE_VERSION( 1, 11 ), ///< version 1.11 + ZES_API_VERSION_1_12 = ZES_MAKE_VERSION( 1, 12 ), ///< version 1.12 + ZES_API_VERSION_1_13 = ZES_MAKE_VERSION( 1, 13 ), ///< version 1.13 + ZES_API_VERSION_1_14 = ZES_MAKE_VERSION( 1, 14 ), ///< version 1.14 + ZES_API_VERSION_1_15 = ZES_MAKE_VERSION( 1, 15 ), ///< version 1.15 + ZES_API_VERSION_1_16 = ZES_MAKE_VERSION( 1, 16 ), ///< version 1.16 + ZES_API_VERSION_1_17 = ZES_MAKE_VERSION( 1, 17 ), ///< version 1.17 + ZES_API_VERSION_1_18 = ZES_MAKE_VERSION( 1, 18 ), ///< version 1.18 + ZES_API_VERSION_1_19 = ZES_MAKE_VERSION( 1, 19 ), ///< version 1.19 + ZES_API_VERSION_1_20 = ZES_MAKE_VERSION( 1, 20 ), ///< version 1.20 + ZES_API_VERSION_1_21 = ZES_MAKE_VERSION( 1, 21 ), ///< version 1.21 + ZES_API_VERSION_CURRENT = ZES_MAKE_VERSION( 1, 21 ), ///< latest known version + ZES_API_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZES_API_VERSION_* ENUMs + +} zes_api_version_t; + +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZES_API_VERSION_CURRENT_M +/// @brief Current sysman API version as a macro +#define ZES_API_VERSION_CURRENT_M ZES_MAKE_VERSION( 1, 21 ) +#endif // ZES_API_VERSION_CURRENT_M + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Returns the API version supported by the specified sysman driver +/// +/// @details +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function should be lock-free. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hDriver` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pVersion` +ZE_APIEXPORT ze_result_t ZE_APICALL +zesDriverGetApiVersion( + zes_driver_handle_t hDriver, ///< [in] handle of the sysman driver instance + zes_api_version_t* pVersion ///< [out] api version + ); + /////////////////////////////////////////////////////////////////////////////// #ifndef ZES_MAX_EXTENSION_NAME /// @brief Maximum extension name string size @@ -1084,13 +1184,21 @@ typedef enum _zes_device_property_flag_t /// topology of the device, pNext member of this structure should point to /// an instance of ${s}_device_gpu_topology_ext_properties_t with its /// stype set to ::ZES_STRUCTURE_TYPE_DEVICE_GPU_TOPOLOGY_EXT_PROPERTIES. +/// To get the SOC unique ID of the device, pNext member of this structure +/// should point to an instance of ::zes_device_soc_uid_ext_properties_t +/// with its stype set to +/// ::ZES_STRUCTURE_TYPE_DEVICE_SOC_UID_EXT_PROPERTIES. To get the UUID, +/// type and flags of the device, pNext member of this structure should +/// point to an instance of ::zes_device_ext_properties_t with its stype +/// set to ::ZES_STRUCTURE_TYPE_DEVICE_EXT_PROPERTIES. typedef struct _zes_device_properties_t { zes_structure_type_t stype; ///< [in] type of this structure void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific ///< structure (i.e. contains stype and pNext). - ze_device_properties_t core; ///< [out] [DEPRECATED since 1.7] Core device properties. Use - ///< ::zes_device_ext_properties_t instead. + ze_device_properties_t core; ///< [out] [DEPRECATED since 1.7] Core device properties. Get the UUID, + ///< type and flags through pNext. Use ::zes_device_ext_properties_t + ///< instead. uint32_t numSubdevices; ///< [out] Number of sub-devices. A value of 0 indicates that this device ///< doesn't have sub-devices. char serialNumber[ZES_STRING_PROPERTY_SIZE]; ///< [out] Manufacturing serial number (NULL terminated string value). This @@ -1175,6 +1283,9 @@ typedef struct _zes_device_index_ext_properties_t /// - To get the GPU topology of the device, the application may pass /// ::zes_device_gpu_topology_ext_properties_t in the pNext chain of /// pProperties. +/// - To get the SOC unique ID of the device, the application may pass +/// ::zes_device_soc_uid_ext_properties_t in the pNext chain of +/// pProperties. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -7891,7 +8002,11 @@ typedef struct _zes_power_ext_properties_t void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific ///< structure (i.e. contains stype and pNext). zes_power_domain_t domain; ///< [out] domain that the power limit belongs to. - zes_power_limit_ext_desc_t* defaultLimit; ///< [out] the factory default limit of the part. + zes_power_limit_ext_desc_t* defaultLimit; ///< [in,out][optional] pointer to a caller-allocated ::zes_power_limit_ext_desc_t + ///< that the driver fills with the factory default limit of the part. + ///< The application must allocate and initialize (including `stype`) the pointed-to + ///< structure and assign its address before calling ::zesPowerGetProperties. + ///< If this is null, the factory default limit will not be returned. } zes_power_ext_properties_t; @@ -9800,7 +9915,8 @@ typedef struct _zes_memory_vendor_info_ext_properties_t typedef enum _zes_info_logs_ext_version_t { ZES_INFO_LOGS_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZES_INFO_LOGS_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZES_INFO_LOGS_EXT_VERSION_1_1 = ZE_MAKE_VERSION( 1, 1 ), ///< version 1.1 + ZES_INFO_LOGS_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 1 ), ///< latest known version ZES_INFO_LOGS_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZES_INFO_LOGS_EXT_VERSION_* ENUMs } zes_info_logs_ext_version_t; @@ -10331,6 +10447,288 @@ zesInfoLogInstanceDeleteExt( zes_info_log_instance_handle_t hInfoLogInstance ///< [in][release] handle of the info log collection instance to delete ); +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZES_INFO_LOG_FIELD_DESC_SIZE +/// @brief Maximum number of characters in the description of a decodable field, +/// including the null terminator. +#define ZES_INFO_LOG_FIELD_DESC_SIZE 256 +#endif // ZES_INFO_LOG_FIELD_DESC_SIZE + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Handle for a Sysman info log decoder context +typedef struct _zes_info_log_decoder_context_handle_t *zes_info_log_decoder_context_handle_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Data types of a field decoded from an info log record +typedef enum _zes_info_log_field_type_ext_t +{ + ZES_INFO_LOG_FIELD_TYPE_EXT_UINT32 = 0, ///< The value of the field is a `uint32_t`. + ZES_INFO_LOG_FIELD_TYPE_EXT_INT64 = 1, ///< The value of the field is an `int64_t`. + ZES_INFO_LOG_FIELD_TYPE_EXT_DOUBLE = 2, ///< The value of the field is a `double`. + ZES_INFO_LOG_FIELD_TYPE_EXT_STRING = 3, ///< The value of the field is a null terminated array of `char`. + ZES_INFO_LOG_FIELD_TYPE_EXT_RAW_BYTES = 4, ///< The value of the field is an array of uninterpreted bytes. + ZES_INFO_LOG_FIELD_TYPE_EXT_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZES_INFO_LOG_FIELD_TYPE_EXT_* ENUMs + +} zes_info_log_field_type_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Description of one field that a decoder context can decode from an +/// info log record +/// +/// @details +/// - An array of these structures is returned by +/// ::zesInfoLogDecoderContextGetFieldInfoExt, one element per field. +/// - The fields that are reported are a property of the format of the info +/// log, reported in infoLogFormat of ::zes_info_log_ext_properties_t, and +/// not of a batch of records. Whether a given record carries a given +/// field is reported per record by +/// ::zesInfoLogDecoderContextReadFieldExt. +/// - The application must locate a field by `name`, and must then use the +/// `fieldId`, `type` and `requiredBytes` that are reported for that name. +typedef struct _zes_info_log_decodable_field_info_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). + char desc[ZES_INFO_LOG_FIELD_DESC_SIZE]; ///< [out] human readable description of the field (NULL terminated string + ///< value). + char name[ZES_STRING_PROPERTY_SIZE]; ///< [out] name of the field (NULL terminated string value). + uint32_t fieldId; ///< [out] identifier of the field, to be passed to + ///< ::zesInfoLogDecoderContextReadFieldExt. + zes_info_log_field_type_ext_t type; ///< [out] data type of the value of the field. + size_t requiredBytes; ///< [out] number of bytes that the application must provide to + ///< ::zesInfoLogDecoderContextReadFieldExt to read this field. + ///< For ::ZES_INFO_LOG_FIELD_TYPE_EXT_STRING this value includes the null terminator. + size_t elementCount; ///< [out] number of elements of the data type that the field holds. + char versionString[ZES_STRING_PROPERTY_SIZE]; ///< [out] version of this extension in which the field was first reported. + +} zes_info_log_decodable_field_info_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Create a decoder context for an info log +/// +/// @details +/// - A decoder context decodes the records returned by +/// ::zesInfoLogInstanceReadWithMetadataExt or by +/// ::zesInfoLogInstancePeekWithMetadataExt into named fields, which the +/// application reads one at a time using +/// ::zesInfoLogDecoderContextReadFieldExt. +/// - Any number of decoder contexts may exist for one info log. +/// - The application may call this function from simultaneous threads. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hInfoLog` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == phDecoderContext` +ZE_APIEXPORT ze_result_t ZE_APICALL +zesInfoLogDecoderContextCreateExt( + zes_info_log_handle_t hInfoLog, ///< [in] handle of the info log that the records are read from + zes_info_log_decoder_context_handle_t* phDecoderContext ///< [out] handle of the decoder context that was created. + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Get the fields that a decoder context can decode from an info log +/// record +/// +/// @details +/// - The application should first call this function with `pCount` pointing +/// to a value of zero to retrieve the number of fields that can be +/// decoded. +/// - A call in which `*pCount` is greater than zero and `pFieldInfos` is +/// nullptr shall report the number of fields and shall not write any +/// descriptor, as a call with a count of zero does. +/// - The application may call this function from simultaneous threads. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hDecoderContext` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pCount` +ZE_APIEXPORT ze_result_t ZE_APICALL +zesInfoLogDecoderContextGetFieldInfoExt( + zes_info_log_decoder_context_handle_t hDecoderContext, ///< [in] handle of the decoder context + uint32_t* pCount, ///< [in,out] pointer to the number of fields that can be decoded. + ///< if count is zero, then the driver shall update the value with the + ///< total number of fields that can be decoded and shall not return any descriptor. + ///< if count is greater than the number of fields that can be decoded, + ///< then the driver shall update the value with the correct number of fields. + zes_info_log_decodable_field_info_ext_t* pFieldInfos ///< [in,out][optional][range(0, *pCount)] array of field descriptions, one + ///< element per field. + ///< if count is less than the number of fields that can be decoded, then + ///< the driver shall only retrieve that number of descriptors. + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Start decoding info log records in a decoder context +/// +/// @details +/// - The application must not call this function from simultaneous threads +/// with the same decoder context handle. +/// - The application may call this function from simultaneous threads with +/// different decoder context handles. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hDecoderContext` +ZE_APIEXPORT ze_result_t ZE_APICALL +zesInfoLogDecoderContextDecodeStartExt( + zes_info_log_decoder_context_handle_t hDecoderContext, ///< [in] handle of the decoder context + uint32_t size, ///< [in] size, in bytes, of the record data in `pBuffer`, as returned in + ///< `*pSize` by the read or peek call + const uint8_t* pBuffer, ///< [in][optional][range(0, size)] the record data, as returned in + ///< `pBuffer` by the read or peek call + uint32_t recordCount, ///< [in] number of records in the batch, as returned in `*pRecordCount` by + ///< the read or peek call + const zes_info_log_metadata_ext_t* pDescriptors ///< [in][optional][range(0, recordCount)] array of metadata describing + ///< each record, as returned in `pDescriptors` by the read or peek call + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Read field values of one record that a decoder context is decoding +/// +/// @details +/// - The application must not call this function from simultaneous threads +/// with the same decoder context handle. +/// - The application may call this function from simultaneous threads with +/// different decoder context handles. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hDecoderContext` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pOutBuffer` +/// + `nullptr == pBytesCopied` +ZE_APIEXPORT ze_result_t ZE_APICALL +zesInfoLogDecoderContextReadFieldExt( + zes_info_log_decoder_context_handle_t hDecoderContext, ///< [in] handle of the decoder context, which must be decoding a batch + uint32_t fieldId, ///< [in] identifier of the field to read, as reported in `fieldId` of + ///< ::zes_info_log_decodable_field_info_ext_t + uint32_t recordId, ///< [in] index of the record in the `pDescriptors` that was passed to + ///< ::zesInfoLogDecoderContextDecodeStartExt + void* pOutBuffer, ///< [in,out][range(0, bufferLen)] buffer that will contain the value of + ///< the field + size_t bufferLen, ///< [in] size, in bytes, of `pOutBuffer` + size_t* pBytesCopied ///< [out] pointer to the number of bytes written to `pOutBuffer`. + ///< the driver shall update the value with zero when the record does not + ///< carry the field. + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Stop decoding of info log records that a decoder context is decoding +/// +/// @details +/// - The application must not call this function from simultaneous threads +/// with the same decoder context handle. +/// - The application may call this function from simultaneous threads with +/// different decoder context handles. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hDecoderContext` +ZE_APIEXPORT ze_result_t ZE_APICALL +zesInfoLogDecoderContextDecodeStopExt( + zes_info_log_decoder_context_handle_t hDecoderContext ///< [in] handle of the decoder context + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Delete a decoder context of an info log +/// +/// @details +/// - The application must ensure that no other function is using the handle +/// when calling this function. +/// - The application must not call this function from simultaneous threads +/// with the same handle. +/// - The implementation of this function must be thread-safe. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hInfoLog` +/// + `nullptr == hDecoderContext` +ZE_APIEXPORT ze_result_t ZE_APICALL +zesInfoLogDecoderContextDeleteExt( + zes_info_log_handle_t hInfoLog, ///< [in] handle of the info log that the decoder context was created from + zes_info_log_decoder_context_handle_t hDecoderContext ///< [in][release] handle of the decoder context to delete + ); + #if !defined(__GNUC__) #pragma endregion #endif @@ -10494,6 +10892,47 @@ zesDriverGetPciDeviceProperties( ///< driver, then the driver shall only retrieve that number of PCI device properties. ); +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Sysman Extension APIs for Device SOC Unique ID +#if !defined(__GNUC__) +#pragma region deviceSocUid +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZES_DEVICE_SOC_UID_EXT_NAME +/// @brief Device SOC Unique ID Extension Name +#define ZES_DEVICE_SOC_UID_EXT_NAME "ZES_extension_device_soc_uid" +#endif // ZES_DEVICE_SOC_UID_EXT_NAME + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Device SOC Unique ID Extension Version(s) +typedef enum _zes_device_soc_uid_ext_version_t +{ + ZES_DEVICE_SOC_UID_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZES_DEVICE_SOC_UID_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZES_DEVICE_SOC_UID_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZES_DEVICE_SOC_UID_EXT_VERSION_* ENUMs + +} zes_device_soc_uid_ext_version_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Device SOC Unique ID Extension structure +/// +/// @details +/// - This structure can be passed as an extension structure to +/// ::zesDeviceGetProperties via pNext member +/// - Returns the unique ID of the SOC on which the device resides +/// - Applications must treat an all-zero socUid as unavailable rather than +/// as a valid identifier +typedef struct _zes_device_soc_uid_ext_properties_t +{ + zes_structure_type_t stype; ///< [in] type of this structure + void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + zes_uuid_t socUid; ///< [out] unique identifier of the SOC, most significant byte first. + +} zes_device_soc_uid_ext_properties_t; + #if !defined(__GNUC__) #pragma endregion #endif diff --git a/include/zes_ddi.h b/include/zes_ddi.h index cad6cb8b..a430d29e 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.20-r1.20.41 + * @version v1.21-r1.21.26 * */ #ifndef _ZES_DDI_H @@ -569,6 +569,13 @@ typedef ze_result_t (ZE_APICALL *zes_pfnDriverGetPciDeviceProperties_t)( zes_driver_pci_device_properties_t* ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zesDriverGetApiVersion +typedef ze_result_t (ZE_APICALL *zes_pfnDriverGetApiVersion_t)( + zes_driver_handle_t, + zes_api_version_t* + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Table of Driver functions pointers typedef struct _zes_driver_dditable_t @@ -583,6 +590,7 @@ typedef struct _zes_driver_dditable_t zes_pfnDriverEventListenExt_t pfnEventListenExt; zes_pfnDriverEnumInfoLogsExt_t pfnEnumInfoLogsExt; zes_pfnDriverGetPciDeviceProperties_t pfnGetPciDeviceProperties; + zes_pfnDriverGetApiVersion_t pfnGetApiVersion; } zes_driver_dditable_t; /////////////////////////////////////////////////////////////////////////////// @@ -2203,6 +2211,89 @@ typedef ze_result_t (ZE_APICALL *zes_pfnGetInfoLogInstanceProcAddrTable_t)( zes_info_log_instance_dditable_t* ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zesInfoLogDecoderContextCreateExt +typedef ze_result_t (ZE_APICALL *zes_pfnInfoLogDecoderContextCreateExt_t)( + zes_info_log_handle_t, + zes_info_log_decoder_context_handle_t* + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zesInfoLogDecoderContextGetFieldInfoExt +typedef ze_result_t (ZE_APICALL *zes_pfnInfoLogDecoderContextGetFieldInfoExt_t)( + zes_info_log_decoder_context_handle_t, + uint32_t*, + zes_info_log_decodable_field_info_ext_t* + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zesInfoLogDecoderContextDecodeStartExt +typedef ze_result_t (ZE_APICALL *zes_pfnInfoLogDecoderContextDecodeStartExt_t)( + zes_info_log_decoder_context_handle_t, + uint32_t, + const uint8_t*, + uint32_t, + const zes_info_log_metadata_ext_t* + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zesInfoLogDecoderContextReadFieldExt +typedef ze_result_t (ZE_APICALL *zes_pfnInfoLogDecoderContextReadFieldExt_t)( + zes_info_log_decoder_context_handle_t, + uint32_t, + uint32_t, + void*, + size_t, + size_t* + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zesInfoLogDecoderContextDecodeStopExt +typedef ze_result_t (ZE_APICALL *zes_pfnInfoLogDecoderContextDecodeStopExt_t)( + zes_info_log_decoder_context_handle_t + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zesInfoLogDecoderContextDeleteExt +typedef ze_result_t (ZE_APICALL *zes_pfnInfoLogDecoderContextDeleteExt_t)( + zes_info_log_handle_t, + zes_info_log_decoder_context_handle_t + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Table of InfoLogDecoderContext functions pointers +typedef struct _zes_info_log_decoder_context_dditable_t +{ + zes_pfnInfoLogDecoderContextCreateExt_t pfnCreateExt; + zes_pfnInfoLogDecoderContextGetFieldInfoExt_t pfnGetFieldInfoExt; + zes_pfnInfoLogDecoderContextDecodeStartExt_t pfnDecodeStartExt; + zes_pfnInfoLogDecoderContextReadFieldExt_t pfnReadFieldExt; + zes_pfnInfoLogDecoderContextDecodeStopExt_t pfnDecodeStopExt; + zes_pfnInfoLogDecoderContextDeleteExt_t pfnDeleteExt; +} zes_info_log_decoder_context_dditable_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Exported function for filling application's InfoLogDecoderContext 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 +zesGetInfoLogDecoderContextProcAddrTable( + ze_api_version_t version, ///< [in] API version requested + zes_info_log_decoder_context_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zesGetInfoLogDecoderContextProcAddrTable +typedef ze_result_t (ZE_APICALL *zes_pfnGetInfoLogDecoderContextProcAddrTable_t)( + ze_api_version_t, + zes_info_log_decoder_context_dditable_t* + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Container for all DDI tables typedef struct _zes_dditable_t @@ -2233,6 +2324,7 @@ typedef struct _zes_dditable_t zes_vf_management_exp_dditable_t VFManagementExp; zes_info_log_dditable_t InfoLog; zes_info_log_instance_dditable_t InfoLogInstance; + zes_info_log_decoder_context_dditable_t InfoLogDecoderContext; } zes_dditable_t; /// @brief Container for all DDI tables with version and tables set by the Driver typedef struct _zes_dditable_driver_t @@ -2265,6 +2357,7 @@ typedef struct _zes_dditable_driver_t zes_vf_management_exp_dditable_t * VFManagementExp; zes_info_log_dditable_t * InfoLog; zes_info_log_instance_dditable_t * InfoLogInstance; + zes_info_log_decoder_context_dditable_t * InfoLogDecoderContext; } zes_dditable_driver_t; #if defined(__cplusplus) diff --git a/include/zet.py b/include/zet.py index 92cf6e67..1c600ea0 100644 --- a/include/zet.py +++ b/include/zet.py @@ -4,7 +4,7 @@ SPDX-License-Identifier: MIT @file zet.py - @version v1.20-r1.20.41 + @version v1.21-r1.21.26 """ import platform @@ -72,7 +72,12 @@ class zet_metric_query_handle_t(c_void_p): pass ############################################################################### -## @brief Handle of tracer object +## @brief [DEPRECATED since 1.14] Handle of tracer object +## +## @deprecated Since 1.14. Only used by the deprecated API Tracing extension. Use L0 +## Loader API Tracing +## (https://github.com/oneapi-src/level-zero/tree/master/source/layers/tracing) +## instead. class zet_tracer_exp_handle_t(c_void_p): pass diff --git a/include/zet_api.h b/include/zet_api.h index d52523fd..247339df 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.20-r1.20.41 + * @version v1.21-r1.21.26 * */ #ifndef _ZET_API_H @@ -70,7 +70,12 @@ typedef struct _zet_metric_query_pool_handle_t *zet_metric_query_pool_handle_t; typedef struct _zet_metric_query_handle_t *zet_metric_query_handle_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Handle of tracer object +/// @brief [DEPRECATED since 1.14] Handle of tracer object +/// +/// @deprecated Since 1.14. Only used by the deprecated API Tracing extension. Use L0 +/// Loader API Tracing +/// (https://github.com/oneapi-src/level-zero/tree/master/source/layers/tracing) +/// instead. typedef struct _zet_tracer_exp_handle_t *zet_tracer_exp_handle_t; /////////////////////////////////////////////////////////////////////////////// @@ -1521,7 +1526,7 @@ zetMetricStreamerClose( /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER /// + `nullptr == pRawDataSize` /// - ::ZE_RESULT_WARNING_DROPPED_DATA -/// + Metric streamer data may have been dropped. Reduce sampling period. +/// + Metric streamer data may have been dropped. Increase the streamer sampling period or read the streamer data more frequently. ZE_APIEXPORT ze_result_t ZE_APICALL zetMetricStreamerReadData( zet_metric_streamer_handle_t hMetricStreamer, ///< [in] handle of the metric streamer @@ -2306,6 +2311,8 @@ typedef enum _ze_calculate_multiple_metrics_exp_version_t /// + `nullptr == pRawData` /// + `nullptr == pSetCount` /// + `nullptr == pTotalMetricValueCount` +/// - ::ZE_RESULT_WARNING_DROPPED_DATA +/// + Metric streamer data may have been dropped. Increase the streamer sampling period or read the streamer data more frequently. ZE_APIEXPORT ze_result_t ZE_APICALL zetMetricGroupCalculateMultipleMetricValuesExp( zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group @@ -2540,6 +2547,8 @@ zetMetricGroupGetExportDataExp( /// + `nullptr == pCalculateDescriptor` /// + `nullptr == pSetCount` /// + `nullptr == pTotalMetricValueCount` +/// - ::ZE_RESULT_WARNING_DROPPED_DATA +/// + Metric streamer data may have been dropped. Increase the streamer sampling period or read the streamer data more frequently. ZE_APIEXPORT ze_result_t ZE_APICALL zetMetricGroupCalculateMetricExportDataExp( ze_driver_handle_t hDriver, ///< [in] handle of the driver instance @@ -3054,13 +3063,16 @@ zetMetricCreateFromProgrammableExp( /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hDevice` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == phMetrics` /// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT /// + metricGroupCount is lesser than the number of metric group handles that could be created. ZE_APIEXPORT ze_result_t ZE_APICALL zetDeviceCreateMetricGroupsFromMetricsExp( zet_device_handle_t hDevice, ///< [in] handle of the device. uint32_t metricCount, ///< [in] number of metric handles. - zet_metric_handle_t * phMetrics, ///< [in] metric handles to be added to the metric groups. + zet_metric_handle_t* phMetrics, ///< [in][range(0, metricCount)] array of metric handles to be added to the + ///< metric groups. const char * pMetricGroupNamePrefix, ///< [in] prefix to the name created for the metric groups. Must point to a ///< null-terminated character array no longer than ///< ::ZET_MAX_METRIC_GROUP_NAME_PREFIX_EXP. diff --git a/include/zet_ddi.h b/include/zet_ddi.h index 6d69b1ae..d9276eb7 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.20-r1.20.41 + * @version v1.21-r1.21.26 * */ #ifndef _ZET_DDI_H @@ -274,7 +274,7 @@ typedef ze_result_t (ZE_APICALL *zet_pfnDeviceGetConcurrentMetricGroupsExp_t)( typedef ze_result_t (ZE_APICALL *zet_pfnDeviceCreateMetricGroupsFromMetricsExp_t)( zet_device_handle_t, uint32_t, - zet_metric_handle_t *, + zet_metric_handle_t*, const char *, const char *, uint32_t *, diff --git a/scripts/spec_metadata/input.json b/scripts/spec_metadata/input.json index 564562e7..ef96e216 100644 --- a/scripts/spec_metadata/input.json +++ b/scripts/spec_metadata/input.json @@ -65,7 +65,7 @@ }, "class": { "$r": { - "ddi_ordinal": 63, + "ddi_ordinal": 64, "default_struct": [ "$xDefaultGPUImmediateCommandQueueDesc", "$xDefaultGPUDeviceMemAllocDesc", @@ -196,6 +196,7 @@ "$s_pci_bar_properties_1_2_t", "$s_pci_stats_t", "$s_device_gpu_topology_ext_properties_t", + "$s_device_soc_uid_ext_properties_t", "$s_device_ext_state_t", "$s_device_ecc_desc_t", "$s_device_ecc_properties_t", @@ -236,11 +237,13 @@ "$sDriver": { "ddi_ordinal": 43, "enum": [ + "$s_api_version_t", "$s_event_type_flags_t" ], "function": [ "Get", "GetProperties", + "GetApiVersion", "GetExtensionProperties", "GetExtensionFunctionAddress", "EventListen", @@ -443,7 +446,8 @@ "ordinal": 10019000, "owner": "$sDriver", "owns": [ - "$sInfoLogInstance" + "$sInfoLogInstance", + "$sInfoLogDecoderContext" ], "struct": [ "$s_info_log_ext_properties_t", @@ -452,6 +456,31 @@ "$s_info_log_read_status_ext_t" ] }, + "$sInfoLogDecoderContext": { + "ddi_ordinal": 63, + "enum": [ + "$s_info_log_field_type_ext_t" + ], + "function": [ + "CreateExt", + "GetFieldInfoExt", + "DecodeStartExt", + "ReadFieldExt", + "DecodeStopExt", + "DeleteExt" + ], + "handle": [ + "$s_info_log_decoder_context_handle_t" + ], + "members": [ + "$s_info_log_decoder_context_handle_t" + ], + "ordinal": 10019000, + "owner": "$sInfoLog", + "struct": [ + "$s_info_log_decodable_field_info_ext_t" + ] + }, "$sInfoLogInstance": { "ddi_ordinal": 62, "function": [ @@ -2198,7 +2227,7 @@ "type": "uint32_t" }, { - "desc": "[in] command queue index within the group;\nmust be zero.\n", + "desc": "[in] command queue index within the group;\nzero-based, so it must be less than the `numQueues` member of $x_command_queue_group_properties_t for the command queue group.\n", "init": 0, "name": "index", "type": "uint32_t" @@ -2225,6 +2254,35 @@ } }, "enum": { + "$s_api_version_t": { + "class": "$sDriver", + "etors": [ + "$S_API_VERSION_1_0", + "$S_API_VERSION_1_1", + "$S_API_VERSION_1_2", + "$S_API_VERSION_1_3", + "$S_API_VERSION_1_4", + "$S_API_VERSION_1_5", + "$S_API_VERSION_1_6", + "$S_API_VERSION_1_7", + "$S_API_VERSION_1_8", + "$S_API_VERSION_1_9", + "$S_API_VERSION_1_10", + "$S_API_VERSION_1_11", + "$S_API_VERSION_1_12", + "$S_API_VERSION_1_13", + "$S_API_VERSION_1_14", + "$S_API_VERSION_1_15", + "$S_API_VERSION_1_16", + "$S_API_VERSION_1_17", + "$S_API_VERSION_1_18", + "$S_API_VERSION_1_19", + "$S_API_VERSION_1_20", + "$S_API_VERSION_1_21", + "$S_API_VERSION_CURRENT" + ], + "max": "$S_API_VERSION_CURRENT" + }, "$s_control_state_t": { "class": "$sOverclock", "etors": [ @@ -2313,6 +2371,14 @@ ], "max": "0xf" }, + "$s_device_soc_uid_ext_version_t": { + "class": "", + "etors": [ + "$S_DEVICE_SOC_UID_EXT_VERSION_1_0", + "$S_DEVICE_SOC_UID_EXT_VERSION_CURRENT" + ], + "max": "$S_DEVICE_SOC_UID_EXT_VERSION_CURRENT" + }, "$s_device_state_ext_flags_t": { "class": "$sDevice", "etors": [ @@ -2488,6 +2554,17 @@ ], "max": "0x3ff" }, + "$s_info_log_field_type_ext_t": { + "class": "$sInfoLogDecoderContext", + "etors": [ + "$S_INFO_LOG_FIELD_TYPE_EXT_UINT32", + "$S_INFO_LOG_FIELD_TYPE_EXT_INT64", + "$S_INFO_LOG_FIELD_TYPE_EXT_DOUBLE", + "$S_INFO_LOG_FIELD_TYPE_EXT_STRING", + "$S_INFO_LOG_FIELD_TYPE_EXT_RAW_BYTES" + ], + "max": "$S_INFO_LOG_FIELD_TYPE_EXT_RAW_BYTES" + }, "$s_info_log_format_ext_t": { "class": "$sInfoLog", "etors": [ @@ -2517,6 +2594,7 @@ "class": "", "etors": [ "$S_INFO_LOGS_EXT_VERSION_1_0", + "$S_INFO_LOGS_EXT_VERSION_1_1", "$S_INFO_LOGS_EXT_VERSION_CURRENT" ], "max": "$S_INFO_LOGS_EXT_VERSION_CURRENT" @@ -2978,9 +3056,11 @@ "$S_STRUCTURE_TYPE_PCI_CONFIG_PROPERTIES", "$S_STRUCTURE_TYPE_DRIVER_PCI_DEVICE_PROPERTIES", "$S_STRUCTURE_TYPE_DEVICE_INDEX_EXT_PROPERTIES", - "$S_STRUCTURE_TYPE_DEVICE_GPU_TOPOLOGY_EXT_PROPERTIES" + "$S_STRUCTURE_TYPE_DEVICE_GPU_TOPOLOGY_EXT_PROPERTIES", + "$S_STRUCTURE_TYPE_DEVICE_SOC_UID_EXT_PROPERTIES", + "$S_STRUCTURE_TYPE_INFO_LOG_DECODABLE_FIELD_INFO_EXT" ], - "max": "$S_STRUCTURE_TYPE_DEVICE_GPU_TOPOLOGY_EXT_PROPERTIES" + "max": "$S_STRUCTURE_TYPE_INFO_LOG_DECODABLE_FIELD_INFO_EXT" }, "$s_sysman_device_mapping_exp_version_t": { "class": "", @@ -3368,6 +3448,7 @@ "$X_API_VERSION_1_18", "$X_API_VERSION_1_19", "$X_API_VERSION_1_20", + "$X_API_VERSION_1_21", "$X_API_VERSION_CURRENT" ], "max": "$X_API_VERSION_CURRENT" @@ -3495,10 +3576,12 @@ "class": "$xCommandQueue", "etors": [ "$X_COMMAND_QUEUE_PRIORITY_NORMAL", + "$X_COMMAND_QUEUE_PRIORITY_LOW", + "$X_COMMAND_QUEUE_PRIORITY_HIGH", "$X_COMMAND_QUEUE_PRIORITY_PRIORITY_LOW", "$X_COMMAND_QUEUE_PRIORITY_PRIORITY_HIGH" ], - "max": "$X_COMMAND_QUEUE_PRIORITY_PRIORITY_HIGH" + "max": "$X_COMMAND_QUEUE_PRIORITY_HIGH" }, "$x_command_queue_qos_ext_t": { "class": "$xCommandQueue", @@ -5933,6 +6016,17 @@ } ] }, + "$sDriverGetApiVersion": { + "class": "$sDriver", + "params": [ + { + "type": "$s_driver_handle_t" + }, + { + "type": "$s_api_version_t*" + } + ] + }, "$sDriverGetDeviceByUuidExp": { "class": "$sDriver", "params": [ @@ -6484,6 +6578,93 @@ } ] }, + "$sInfoLogDecoderContextCreateExt": { + "class": "$sInfoLogDecoderContext", + "params": [ + { + "type": "$s_info_log_handle_t" + }, + { + "type": "$s_info_log_decoder_context_handle_t*" + } + ] + }, + "$sInfoLogDecoderContextDecodeStartExt": { + "class": "$sInfoLogDecoderContext", + "params": [ + { + "type": "$s_info_log_decoder_context_handle_t" + }, + { + "type": "uint32_t" + }, + { + "type": "const uint8_t*" + }, + { + "type": "uint32_t" + }, + { + "type": "const $s_info_log_metadata_ext_t*" + } + ] + }, + "$sInfoLogDecoderContextDecodeStopExt": { + "class": "$sInfoLogDecoderContext", + "params": [ + { + "type": "$s_info_log_decoder_context_handle_t" + } + ] + }, + "$sInfoLogDecoderContextDeleteExt": { + "class": "$sInfoLogDecoderContext", + "params": [ + { + "type": "$s_info_log_handle_t" + }, + { + "type": "$s_info_log_decoder_context_handle_t" + } + ] + }, + "$sInfoLogDecoderContextGetFieldInfoExt": { + "class": "$sInfoLogDecoderContext", + "params": [ + { + "type": "$s_info_log_decoder_context_handle_t" + }, + { + "type": "uint32_t*" + }, + { + "type": "$s_info_log_decodable_field_info_ext_t*" + } + ] + }, + "$sInfoLogDecoderContextReadFieldExt": { + "class": "$sInfoLogDecoderContext", + "params": [ + { + "type": "$s_info_log_decoder_context_handle_t" + }, + { + "type": "uint32_t" + }, + { + "type": "uint32_t" + }, + { + "type": "void*" + }, + { + "type": "size_t" + }, + { + "type": "size_t*" + } + ] + }, "$sInfoLogGetPropertiesExt": { "class": "$sInfoLog", "params": [ @@ -7677,7 +7858,7 @@ "type": "uint32_t" }, { - "type": "zet_metric_handle_t *" + "type": "$t_metric_handle_t*" }, { "type": "const char *" @@ -12444,6 +12625,9 @@ "$s_freq_handle_t": { "class": "$sFrequency" }, + "$s_info_log_decoder_context_handle_t": { + "class": "$sInfoLogDecoderContext" + }, "$s_info_log_handle_t": { "class": "$sInfoLog" }, @@ -12602,6 +12786,12 @@ } }, "macro": { + "$S_API_VERSION_CURRENT_M": { + "class": "", + "values": [ + "$S_MAKE_VERSION( 1, 21 )" + ] + }, "$S_DEVICE_ECC_DEFAULT_PROPERTIES_EXT_NAME": { "class": "", "values": [ @@ -12632,6 +12822,12 @@ "\"$XS_extension_device_index\"" ] }, + "$S_DEVICE_SOC_UID_EXT_NAME": { + "class": "", + "values": [ + "\"$XS_extension_device_soc_uid\"" + ] + }, "$S_DIAG_FIRST_TEST_INDEX": { "class": "", "values": [ @@ -12668,6 +12864,24 @@ "\"$S_extension_info_logs\"" ] }, + "$S_INFO_LOG_FIELD_DESC_SIZE": { + "class": "", + "values": [ + "256" + ] + }, + "$S_MAJOR_VERSION": { + "class": "", + "values": [ + "( _ver >> 16 )" + ] + }, + "$S_MAKE_VERSION": { + "class": "", + "values": [ + "(( _major << 16 )|( _minor & 0x0000ffff))" + ] + }, "$S_MAX_EXTENSION_NAME": { "class": "", "values": [ @@ -12728,6 +12942,12 @@ "\"$XS_extension_mem_state\"" ] }, + "$S_MINOR_VERSION": { + "class": "", + "values": [ + "( _ver & 0x0000ffff )" + ] + }, "$S_OEM_SERIAL_ID_EXT_NAME": { "class": "", "values": [ @@ -12967,7 +13187,7 @@ "$X_API_VERSION_CURRENT_M": { "class": "", "values": [ - "$X_MAKE_VERSION( 1, 20 )" + "$X_MAKE_VERSION( 1, 21 )" ] }, "$X_BANDWIDTH_PROPERTIES_EXP_NAME": { @@ -13777,6 +13997,17 @@ } ] }, + "$s_device_soc_uid_ext_properties_t": { + "class": "$sDevice", + "members": [ + { + "desc": "[out] unique identifier of the SOC, most significant byte first.", + "init": null, + "name": "socUid", + "type": "$s_uuid_t" + } + ] + }, "$s_device_state_t": { "class": "$sDevice", "members": [ @@ -14457,6 +14688,53 @@ } ] }, + "$s_info_log_decodable_field_info_ext_t": { + "class": "$sInfoLogDecoderContext", + "members": [ + { + "desc": "[out] human readable description of the field (NULL terminated string value).", + "init": null, + "name": "desc[$S_INFO_LOG_FIELD_DESC_SIZE]", + "type": "char" + }, + { + "desc": "[out] name of the field (NULL terminated string value).", + "init": null, + "name": "name[$S_STRING_PROPERTY_SIZE]", + "type": "char" + }, + { + "desc": "[out] identifier of the field, to be passed to $sInfoLogDecoderContextReadFieldExt.", + "init": null, + "name": "fieldId", + "type": "uint32_t" + }, + { + "desc": "[out] data type of the value of the field.", + "init": null, + "name": "type", + "type": "$s_info_log_field_type_ext_t" + }, + { + "desc": "[out] number of bytes that the application must provide to $sInfoLogDecoderContextReadFieldExt to read this field.\nFor $S_INFO_LOG_FIELD_TYPE_EXT_STRING this value includes the null terminator.\n", + "init": null, + "name": "requiredBytes", + "type": "size_t" + }, + { + "desc": "[out] number of elements of the data type that the field holds.", + "init": null, + "name": "elementCount", + "type": "size_t" + }, + { + "desc": "[out] version of this extension in which the field was first reported.", + "init": null, + "name": "versionString[$S_STRING_PROPERTY_SIZE]", + "type": "char" + } + ] + }, "$s_info_log_ext_properties_t": { "class": "$sInfoLog", "members": [ @@ -15300,7 +15578,7 @@ "type": "$s_power_domain_t" }, { - "desc": "[out] the factory default limit of the part.", + "desc": "[in,out][optional] pointer to a caller-allocated $s_power_limit_ext_desc_t\nthat the driver fills with the factory default limit of the part.\nThe application must allocate and initialize (including `stype`) the pointed-to\nstructure and assign its address before calling $sPowerGetProperties.\nIf this is null, the factory default limit will not be returned.\n", "init": null, "name": "defaultLimit", "type": "$s_power_limit_ext_desc_t*" @@ -15332,19 +15610,19 @@ "desc": "[out] indicates if the power limit state (enabled/ignored) can be set (false) or is locked (true).", "init": null, "name": "enabledStateLocked", - "type": "ze_bool_t" + "type": "$x_bool_t" }, { "desc": "[in,out] indicates if the limit is enabled (true) or ignored (false). If enabledStateIsLocked is True, this value is ignored.", "init": null, "name": "enabled", - "type": "ze_bool_t" + "type": "$x_bool_t" }, { "desc": "[out] indicates if the interval can be modified (false) or is fixed (true).", "init": null, "name": "intervalValueLocked", - "type": "ze_bool_t" + "type": "$x_bool_t" }, { "desc": "[in,out] power averaging window in milliseconds. If intervalValueLocked is true, this value is ignored.", @@ -15356,7 +15634,7 @@ "desc": "[out] indicates if the limit can be set (false) or if the limit is fixed (true).", "init": null, "name": "limitValueLocked", - "type": "ze_bool_t" + "type": "$x_bool_t" }, { "desc": "[in,out] limit value. If limitValueLocked is true, this value is ignored. The value should be provided in the unit specified by limitUnit.", @@ -15643,7 +15921,7 @@ "desc": "[in] If set to true, all applications that are currently using the device will be forcibly killed.\n", "init": null, "name": "force", - "type": "ze_bool_t" + "type": "$x_bool_t" }, { "desc": "[in] Type of reset needs to be performed", @@ -16849,7 +17127,7 @@ "type": "uint32_t" }, { - "desc": "[in] command queue index within the group;\nmust be zero. \n", + "desc": "[in] command queue index within the group;\nzero-based, so it must be less than the `numQueues` member of $x_command_queue_group_properties_t for the command queue group.\n", "init": null, "name": "index", "type": "uint32_t" @@ -17140,37 +17418,37 @@ "type": "$x_device_dp_capability_flags_t" }, { - "desc": "[out] Supported input data types when dp4v dot product capability is supported.", + "desc": "[out] Supported input data types for the non-systolic vector dot-product path (DP4A). Valid only when $X_DEVICE_DP_CAPABILITY_FLAG_DEVICE_NON_SYSTOLIC_DPA4_SIMD_ALL is set in dp_caps; a value of 0 indicates no supported input types for this path. The member is named 'dpv4_*' for ABI compatibility; the feature it describes is DP4A.", "init": null, "name": "dpv4_input_types", "type": "$x_device_input_data_type_flags_t" }, { - "desc": "[out] Supported output data types when dp4v dot product capability is supported.", + "desc": "[out] Supported output / accumulator data types for the non-systolic vector dot-product path (DP4A). Valid only when $X_DEVICE_DP_CAPABILITY_FLAG_DEVICE_NON_SYSTOLIC_DPA4_SIMD_ALL is set in dp_caps; a value of 0 indicates no supported output types for this path. The member is named 'dpv4_*' for ABI compatibility; the feature it describes is DP4A.", "init": null, "name": "dpv4_output_types", "type": "$x_device_output_data_type_flags_t" }, { - "desc": "[out] Supported input data types when dpas dot product capability is supported.", + "desc": "[out] Supported input data types for the systolic dot-product (DPAS) path. Valid only when at least one of the DEVICE_SYSTOLIC_DPAS_* bits in $x_device_dp_capability_flags_t is set in dp_caps; a value of 0 indicates no supported input types for this path.", "init": null, "name": "dpas_input_types", "type": "$x_device_input_data_type_flags_t" }, { - "desc": "[out] Supported output data types when dpas dot product capability is supported.", + "desc": "[out] Supported output / accumulator data types for the systolic dot-product (DPAS) path. Valid only when at least one of the DEVICE_SYSTOLIC_DPAS_* bits in $x_device_dp_capability_flags_t is set in dp_caps; a value of 0 indicates no supported output types for this path.", "init": null, "name": "dpas_output_types", "type": "$x_device_output_data_type_flags_t" }, { - "desc": "[out] Supported input data types when bdpas dot product capability is supported.", + "desc": "[out] Supported input data types for the block-scaled systolic dot-product (BDPAS) path. Valid only when at least one of the DEVICE_SYSTOLIC_BDPAS_* bits in $x_device_dp_capability_flags_t is set in dp_caps; a value of 0 indicates no supported input types for this path. The DEVICE_INPUT_DATA_SCALING_* bits in $x_device_input_data_type_flags_t only have meaning in this member.", "init": null, "name": "bdpas_input_types", "type": "$x_device_input_data_type_flags_t" }, { - "desc": "[out] Supported output data types when bdpas dot product capability is supported.", + "desc": "[out] Supported output / accumulator data types for the block-scaled systolic dot-product (BDPAS) path. Valid only when at least one of the DEVICE_SYSTOLIC_BDPAS_* bits in $x_device_dp_capability_flags_t is set in dp_caps; a value of 0 indicates no supported output types for this path.", "init": null, "name": "bdpas_output_types", "type": "$x_device_output_data_type_flags_t" @@ -20076,7 +20354,7 @@ "type": "uint8_t" }, { - "desc": "[in] format of the specified transformation", + "desc": "[in] format of the specified transformation, must be $X_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_FLOAT3X4_COLUMN_MAJOR, $X_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_FLOAT3X4_ALIGNED_COLUMN_MAJOR, or $X_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_FLOAT3X4_ROW_MAJOR", "init": null, "name": "transformFormat", "type": "$x_rtas_builder_packed_input_data_format_exp_t" @@ -20129,7 +20407,7 @@ "type": "uint8_t" }, { - "desc": "[in] format of the specified transformation", + "desc": "[in] format of the specified transformation, must be $X_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_FLOAT3X4_COLUMN_MAJOR, $X_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_FLOAT3X4_ALIGNED_COLUMN_MAJOR, or $X_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_FLOAT3X4_ROW_MAJOR", "init": null, "name": "transformFormat", "type": "$x_rtas_builder_packed_input_data_format_ext_t" @@ -21422,7 +21700,7 @@ "desc": "[in] Is sRGB.", "init": null, "name": "sRGB", - "type": "ze_bool_t" + "type": "$x_bool_t" } ] }, @@ -22317,6 +22595,20 @@ "type": "class", "version": "1.19" }, + "zesInfoLogDecoderContext": { + "desc": "C++ wrapper for a Sysman info log decoder context", + "members": [ + { + "desc": "[in] handle of Sysman info log decoder context object", + "name": "handle", + "type": "zes_info_log_decoder_context_handle_t" + } + ], + "name": "zesInfoLogDecoderContext", + "owner": "zesInfoLog", + "type": "class", + "version": "1.21" + }, "zesInfoLogInstance": { "desc": "C++ wrapper for a Sysman info log collection instance", "members": [ @@ -22838,7 +23130,7 @@ "type": "uint32_t" }, { - "desc": "[in] command queue index within the group;\nmust be zero.\n", + "desc": "[in] command queue index within the group;\nzero-based, so it must be less than the `numQueues` member of ze_command_queue_group_properties_t for the command queue group.\n", "init": 0, "name": "index", "type": "uint32_t" @@ -23000,10 +23292,16 @@ "value": "ZE_MAKE_VERSION( 1, 20 )", "version": "1.20" }, + { + "desc": "version 1.21", + "name": "ZE_API_VERSION_1_21", + "value": "ZE_MAKE_VERSION( 1, 21 )", + "version": "1.21" + }, { "desc": "latest known version", "name": "ZE_API_VERSION_CURRENT", - "value": "ZE_MAKE_VERSION( 1, 20 )" + "value": "ZE_MAKE_VERSION( 1, 21 )" } ], "name": "ze_api_version_t", @@ -23133,7 +23431,7 @@ "since": "1.7", "use": "ZE_CACHE_EXT_REGION_NON_RESERVED" }, - "desc": "utilize non-reserverd region", + "desc": "utilize non-reserved region", "name": "ZE_CACHE_EXT_REGION_ZE_CACHE_NON_RESERVED_REGION", "value": "2" }, @@ -23150,7 +23448,7 @@ "version": "1.7" }, { - "desc": "utilize non-reserverd region", + "desc": "utilize non-reserved region", "name": "ZE_CACHE_EXT_REGION_NON_RESERVED", "value": "2", "version": "1.7" @@ -23378,11 +23676,31 @@ "value": "0" }, { + "desc": "lower priority than normal", + "name": "ZE_COMMAND_QUEUE_PRIORITY_LOW", + "value": "1", + "version": "1.21" + }, + { + "desc": "higher priority than normal", + "name": "ZE_COMMAND_QUEUE_PRIORITY_HIGH", + "value": "2", + "version": "1.21" + }, + { + "deprecated": { + "since": "1.21", + "use": "ZE_COMMAND_QUEUE_PRIORITY_LOW" + }, "desc": "lower priority than normal", "name": "ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_LOW", "value": "1" }, { + "deprecated": { + "since": "1.21", + "use": "ZE_COMMAND_QUEUE_PRIORITY_HIGH" + }, "desc": "higher priority than normal", "name": "ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_HIGH", "value": "2" @@ -23607,22 +23925,22 @@ "desc": "Supported device compute dot product(dp) capability flags", "etors": [ { - "desc": "Supports vector dot product instruction.", + "desc": "Supports the non-systolic vector dot product instruction (DP4A). When set, the dpv4_input_types and dpv4_output_types members of ze_device_compute_dotproduct_ext_properties_t describe the legal data types for this path.", "name": "ZE_DEVICE_DP_CAPABILITY_FLAG_DEVICE_NON_SYSTOLIC_DPA4_SIMD_ALL", "value": "ZE_BIT(0)" }, { - "desc": "Supports sytolic dot product with 8 SIMD lanes.", + "desc": "Supports systolic dot product (DPAS) with 8 SIMD lanes.", "name": "ZE_DEVICE_DP_CAPABILITY_FLAG_DEVICE_SYSTOLIC_DPAS_SIMD8", "value": "ZE_BIT(1)" }, { - "desc": "Supports sytolic dot product with 16 SIMD lanes.", + "desc": "Supports systolic dot product (DPAS) with 16 SIMD lanes.", "name": "ZE_DEVICE_DP_CAPABILITY_FLAG_DEVICE_SYSTOLIC_DPAS_SIMD16", "value": "ZE_BIT(2)" }, { - "desc": "Supports sytolic dot product with block scaling support with 16 SIMD lanes.", + "desc": "Supports systolic dot product with block-scaling support (BDPAS) with 16 SIMD lanes.", "name": "ZE_DEVICE_DP_CAPABILITY_FLAG_DEVICE_SYSTOLIC_BDPAS_SIMD16", "value": "ZE_BIT(3)" }, @@ -23642,12 +23960,12 @@ "value": "ZE_BIT(6)" }, { - "desc": "Supports output matrix row count upto 8", + "desc": "Output-shape modifier for the systolic DPAS/BDPAS path: the output matrix row count is variable, up to 8. Only meaningful when at least one of the DEVICE_SYSTOLIC_DPAS_* or DEVICE_SYSTOLIC_BDPAS_* bits is also set in dp_caps; this bit alone does not advertise DPAS or BDPAS support.", "name": "ZE_DEVICE_DP_CAPABILITY_FLAG_DEVICE_SYSTOLIC_OUTPUT_MATRIX_ROWCOUNT_UPTO8", "value": "ZE_BIT(7)" }, { - "desc": "Restricts output matrix row count to 8", + "desc": "Output-shape modifier for the systolic DPAS/BDPAS path: the output matrix row count is fixed at 8. Only meaningful when at least one of the DEVICE_SYSTOLIC_DPAS_* or DEVICE_SYSTOLIC_BDPAS_* bits is also set in dp_caps; this bit alone does not advertise DPAS or BDPAS support.", "name": "ZE_DEVICE_DP_CAPABILITY_FLAG_DEVICE_SYSTOLIC_OUTPUT_MATRIX_ROWCOUNT_FIXED8", "value": "ZE_BIT(8)" } @@ -23781,15 +24099,23 @@ }, "ze_device_input_data_type_flags_t": { "class": "zeDevice", - "desc": "Supported device dot product(dp) input data types flags", + "desc": "Supported device dot product (dp) input data type flags. A field value of 0 indicates no supported input data types for the associated dot-product path; non-zero values are the bitwise-OR of the supported type bits defined below. The containing *_input_types field (dpv4_input_types, dpas_input_types, or bdpas_input_types) determines which dot-product path this applies to.", "etors": [ { - "desc": "No data types available for the supported dot product operation", + "deprecated": { + "reason": "No replacement; a field value of 0 already indicates that no data types are supported.", + "since": "1.21" + }, + "desc": "Indicates that no data types are supported. This bit is semantically equivalent to all other field values being 0 and must not be combined with any other bit of this enum. Retained for ABI compatibility only.", "name": "ZE_DEVICE_INPUT_DATA_TYPE_FLAG_DEVICE_INPUT_DATA_TYPE_NONE", "value": "ZE_BIT(0)" }, { - "desc": "Supports int8 data type with 4 packed data elements per SIMD lane.", + "deprecated": { + "since": "1.21", + "use": "ZE_DEVICE_INPUT_DATA_TYPE_FLAG_DEVICE_INPUT_DATA_INT8_PACK4_PER_SIMD_LANE" + }, + "desc": "Supports int8 data type with 4 packed data elements per SIMD lane. This enumerator carries a stray 'ZE_' prefix in its name, producing the generated token ZE_DEVICE_INPUT_DATA_TYPE_FLAG_ZE_DEVICE_INPUT_DATA_INT8_PACK4_PER_SIMD_LANE. Retained for ABI compatibility only.", "name": "ZE_DEVICE_INPUT_DATA_TYPE_FLAG_ZE_DEVICE_INPUT_DATA_INT8_PACK4_PER_SIMD_LANE", "value": "ZE_BIT(1)" }, @@ -23839,22 +24165,22 @@ "value": "ZE_BIT(10)" }, { - "desc": "Supports 8bit integer data type with 4 packed data elements per SIMD lane.This is exclusively for DP4V dot product support", + "desc": "Supports int8 (8-bit signed integer) data type with 4 packed data elements per SIMD lane.", "name": "ZE_DEVICE_INPUT_DATA_TYPE_FLAG_DEVICE_INPUT_DATA_INT8_PACK4_PER_SIMD_LANE", "value": "ZE_BIT(11)" }, { - "desc": "Supports uint8 data type support for scaling, exclusive to BDPAS dot product support.", + "desc": "Supports uint8 (8-bit unsigned integer) scaling factor. Only meaningful when set in bdpas_input_types; exclusive to the BDPAS dot-product path.", "name": "ZE_DEVICE_INPUT_DATA_TYPE_FLAG_DEVICE_INPUT_DATA_SCALING_UINT8", "value": "ZE_BIT(12)" }, { - "desc": "Supports ue5m3 data type support for scaling, exclusive to BDPAS dot product support.", + "desc": "Supports ue5m3 (unsigned float, 5-bit exponent, 3-bit mantissa) scaling factor. Only meaningful when set in bdpas_input_types; exclusive to the BDPAS dot-product path.", "name": "ZE_DEVICE_INPUT_DATA_TYPE_FLAG_DEVICE_INPUT_DATA_SCALING_UE5M3", "value": "ZE_BIT(13)" }, { - "desc": "Supports ue4m3 data type support for scaling, exclusive to BDPAS dot product support.", + "desc": "Supports ue4m3 (unsigned float, 4-bit exponent, 3-bit mantissa) scaling factor. Only meaningful when set in bdpas_input_types; exclusive to the BDPAS dot-product path.", "name": "ZE_DEVICE_INPUT_DATA_TYPE_FLAG_DEVICE_INPUT_DATA_SCALING_UE4M3", "value": "ZE_BIT(14)" } @@ -24160,7 +24486,7 @@ }, "ze_device_output_data_type_flags_t": { "class": "zeDevice", - "desc": "Supported device dot product(dp) output data types or accumulator data types flags", + "desc": "Supported device dot product (dp) output / accumulator data type flags. A field value of 0 indicates no supported output data types for the associated dot-product path; non-zero values are the bitwise-OR of the supported type bits defined below.", "etors": [ { "desc": "Supports signed and unsigned 32bit integer data type for output", @@ -28719,6 +29045,154 @@ "type": "enum", "version": "1.17" }, + "zes_api_version_t": { + "class": "zesDriver", + "desc": "Supported sysman API versions", + "details": [ + "API versions contain major and minor attributes, use ZES_MAJOR_VERSION and ZES_MINOR_VERSION" + ], + "etors": [ + { + "desc": "version 1.0", + "name": "ZES_API_VERSION_1_0", + "value": "ZES_MAKE_VERSION( 1, 0 )" + }, + { + "desc": "version 1.1", + "name": "ZES_API_VERSION_1_1", + "value": "ZES_MAKE_VERSION( 1, 1 )", + "version": "1.1" + }, + { + "desc": "version 1.2", + "name": "ZES_API_VERSION_1_2", + "value": "ZES_MAKE_VERSION( 1, 2 )", + "version": "1.2" + }, + { + "desc": "version 1.3", + "name": "ZES_API_VERSION_1_3", + "value": "ZES_MAKE_VERSION( 1, 3 )", + "version": "1.3" + }, + { + "desc": "version 1.4", + "name": "ZES_API_VERSION_1_4", + "value": "ZES_MAKE_VERSION( 1, 4 )", + "version": "1.4" + }, + { + "desc": "version 1.5", + "name": "ZES_API_VERSION_1_5", + "value": "ZES_MAKE_VERSION( 1, 5 )", + "version": "1.5" + }, + { + "desc": "version 1.6", + "name": "ZES_API_VERSION_1_6", + "value": "ZES_MAKE_VERSION( 1, 6 )", + "version": "1.6" + }, + { + "desc": "version 1.7", + "name": "ZES_API_VERSION_1_7", + "value": "ZES_MAKE_VERSION( 1, 7 )", + "version": "1.7" + }, + { + "desc": "version 1.8", + "name": "ZES_API_VERSION_1_8", + "value": "ZES_MAKE_VERSION( 1, 8 )", + "version": "1.8" + }, + { + "desc": "version 1.9", + "name": "ZES_API_VERSION_1_9", + "value": "ZES_MAKE_VERSION( 1, 9 )", + "version": "1.9" + }, + { + "desc": "version 1.10", + "name": "ZES_API_VERSION_1_10", + "value": "ZES_MAKE_VERSION( 1, 10 )", + "version": "1.10" + }, + { + "desc": "version 1.11", + "name": "ZES_API_VERSION_1_11", + "value": "ZES_MAKE_VERSION( 1, 11 )", + "version": "1.11" + }, + { + "desc": "version 1.12", + "name": "ZES_API_VERSION_1_12", + "value": "ZES_MAKE_VERSION( 1, 12 )", + "version": "1.12" + }, + { + "desc": "version 1.13", + "name": "ZES_API_VERSION_1_13", + "value": "ZES_MAKE_VERSION( 1, 13 )", + "version": "1.13" + }, + { + "desc": "version 1.14", + "name": "ZES_API_VERSION_1_14", + "value": "ZES_MAKE_VERSION( 1, 14 )", + "version": "1.14" + }, + { + "desc": "version 1.15", + "name": "ZES_API_VERSION_1_15", + "value": "ZES_MAKE_VERSION( 1, 15 )", + "version": "1.15" + }, + { + "desc": "version 1.16", + "name": "ZES_API_VERSION_1_16", + "value": "ZES_MAKE_VERSION( 1, 16 )", + "version": "1.16" + }, + { + "desc": "version 1.17", + "name": "ZES_API_VERSION_1_17", + "value": "ZES_MAKE_VERSION( 1, 17 )", + "version": "1.17" + }, + { + "desc": "version 1.18", + "name": "ZES_API_VERSION_1_18", + "value": "ZES_MAKE_VERSION( 1, 18 )", + "version": "1.18" + }, + { + "desc": "version 1.19", + "name": "ZES_API_VERSION_1_19", + "value": "ZES_MAKE_VERSION( 1, 19 )", + "version": "1.19" + }, + { + "desc": "version 1.20", + "name": "ZES_API_VERSION_1_20", + "value": "ZES_MAKE_VERSION( 1, 20 )", + "version": "1.20" + }, + { + "desc": "version 1.21", + "name": "ZES_API_VERSION_1_21", + "value": "ZES_MAKE_VERSION( 1, 21 )", + "version": "1.21" + }, + { + "desc": "latest known version", + "name": "ZES_API_VERSION_CURRENT", + "value": "ZES_MAKE_VERSION( 1, 21 )" + } + ], + "name": "zes_api_version_t", + "type": "enum", + "version": "1.21" + }, "zes_control_state_t": { "class": "zesOverclock", "desc": "Overclock control states.", @@ -28954,6 +29428,25 @@ "type": "enum", "version": "1.7" }, + "zes_device_soc_uid_ext_version_t": { + "desc": "Device SOC Unique ID Extension Version(s)", + "etors": [ + { + "desc": "version 1.0", + "name": "ZES_DEVICE_SOC_UID_EXT_VERSION_1_0", + "value": "ZE_MAKE_VERSION( 1, 0 )", + "version": "1.21" + }, + { + "desc": "latest known version", + "name": "ZES_DEVICE_SOC_UID_EXT_VERSION_CURRENT", + "value": "ZE_MAKE_VERSION( 1, 0 )" + } + ], + "name": "zes_device_soc_uid_ext_version_t", + "type": "enum", + "version": "1.21" + }, "zes_device_state_ext_flags_t": { "class": "zesDevice", "desc": "Device state flags", @@ -29544,6 +30037,45 @@ "type": "enum", "version": "1.0" }, + "zes_info_log_field_type_ext_t": { + "class": "zesInfoLogDecoderContext", + "desc": "Data types of a field decoded from an info log record", + "etors": [ + { + "desc": "The value of the field is a `uint32_t`.", + "name": "ZES_INFO_LOG_FIELD_TYPE_EXT_UINT32", + "value": "0", + "version": "1.21" + }, + { + "desc": "The value of the field is an `int64_t`.", + "name": "ZES_INFO_LOG_FIELD_TYPE_EXT_INT64", + "value": "1", + "version": "1.21" + }, + { + "desc": "The value of the field is a `double`.", + "name": "ZES_INFO_LOG_FIELD_TYPE_EXT_DOUBLE", + "value": "2", + "version": "1.21" + }, + { + "desc": "The value of the field is a null terminated array of `char`.", + "name": "ZES_INFO_LOG_FIELD_TYPE_EXT_STRING", + "value": "3", + "version": "1.21" + }, + { + "desc": "The value of the field is an array of uninterpreted bytes.", + "name": "ZES_INFO_LOG_FIELD_TYPE_EXT_RAW_BYTES", + "value": "4", + "version": "1.21" + } + ], + "name": "zes_info_log_field_type_ext_t", + "type": "enum", + "version": "1.21" + }, "zes_info_log_format_ext_t": { "class": "zesInfoLog", "desc": "Info log record formats", @@ -29622,10 +30154,16 @@ "value": "ZE_MAKE_VERSION( 1, 0 )", "version": "1.19" }, + { + "desc": "version 1.1", + "name": "ZES_INFO_LOGS_EXT_VERSION_1_1", + "value": "ZE_MAKE_VERSION( 1, 1 )", + "version": "1.21" + }, { "desc": "latest known version", "name": "ZES_INFO_LOGS_EXT_VERSION_CURRENT", - "value": "ZE_MAKE_VERSION( 1, 0 )" + "value": "ZE_MAKE_VERSION( 1, 1 )" } ], "name": "zes_info_logs_ext_version_t", @@ -31223,6 +31761,18 @@ "name": "ZES_STRUCTURE_TYPE_DEVICE_GPU_TOPOLOGY_EXT_PROPERTIES", "value": "0x00020027", "version": "1.20" + }, + { + "desc": "zes_device_soc_uid_ext_properties_t", + "name": "ZES_STRUCTURE_TYPE_DEVICE_SOC_UID_EXT_PROPERTIES", + "value": "0x00020028", + "version": "1.21" + }, + { + "desc": "zes_info_log_decodable_field_info_ext_t", + "name": "ZES_STRUCTURE_TYPE_INFO_LOG_DECODABLE_FIELD_INFO_EXT", + "value": "0x00020029", + "version": "1.21" } ], "name": "zes_structure_type_t", @@ -37877,6 +38427,11 @@ "`nullptr == pSetCount`", "`nullptr == pTotalMetricValueCount`" ] + }, + { + "ZE_RESULT_WARNING_DROPPED_DATA": [ + "Metric streamer data may have been dropped. Increase the streamer sampling period or read the streamer data more frequently." + ] } ], "type": "function", @@ -38104,6 +38659,11 @@ "`nullptr == pSetCount`", "`nullptr == pTotalMetricValueCount`" ] + }, + { + "ZE_RESULT_WARNING_DROPPED_DATA": [ + "Metric streamer data may have been dropped. Increase the streamer sampling period or read the streamer data more frequently." + ] } ], "type": "function", @@ -39414,31 +39974,25 @@ "version": "1.10" }, "CreateExt": { - "class": "zeGraph", - "decl": "static", - "desc": "Creates a new graph object.", + "class": "zesInfoLogDecoderContext", + "desc": "Create a decoder context for an info log", "details": [ - "A newly created graph is an empty container for captured operations.", - "The application may instantiate executable graph objects from a recorded graph using zeGraphInstantiateExt.", - "The application may begin capturing into an empty graph using zeCommandListBeginCaptureIntoGraphExt." + "A decoder context decodes the records returned by zesInfoLogInstanceReadWithMetadataExt or by zesInfoLogInstancePeekWithMetadataExt into named fields, which the application reads one at a time using zesInfoLogDecoderContextReadFieldExt.", + "Any number of decoder contexts may exist for one info log.", + "The application may call this function from simultaneous threads." ], - "hash": "f7ce1c122aaac408e02d681765504f137d7118891841cf5ea31efdbed4f5039f", + "hash": "0620d5f7adcdc46285bbaa31379cdacdf54ae87eb39a3b4bacbf5ba114f7e10e", "name": "CreateExt", "params": [ { - "desc": "[in] handle of the context", - "name": "hContext", - "type": "ze_context_handle_t" - }, - { - "desc": "[in][optional] must be null or a pointer to an extension-specific structure (i.e. contains stype and pNext)", - "name": "pNext", - "type": "const void*" + "desc": "[in] handle of the info log that the records are read from", + "name": "hInfoLog", + "type": "zes_info_log_handle_t" }, { - "desc": "[out] pointer to handle of the graph object created", - "name": "phGraph", - "type": "ze_graph_handle_t*" + "desc": "[out] handle of the decoder context that was created.", + "name": "phDecoderContext", + "type": "zes_info_log_decoder_context_handle_t*" } ], "return_desc": "[out] ze_result_t API result", @@ -39485,17 +40039,17 @@ }, { "ZE_RESULT_ERROR_INVALID_NULL_HANDLE": [ - "`nullptr == hContext`" + "`nullptr == hInfoLog`" ] }, { "ZE_RESULT_ERROR_INVALID_NULL_POINTER": [ - "`nullptr == phGraph`" + "`nullptr == phDecoderContext`" ] } ], "type": "function", - "version": "1.17" + "version": "1.21" }, "CreateFromProgrammableExp": { "class": "zetMetric", @@ -39809,7 +40363,7 @@ "ZE_RESULT_ERROR_INVALID_ENUMERATION": [ "`0x7 < altdesc->flags`", "`ZE_COMMAND_QUEUE_MODE_ASYNCHRONOUS < altdesc->mode`", - "`ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_HIGH < altdesc->priority`" + "`ZE_COMMAND_QUEUE_PRIORITY_HIGH < altdesc->priority`" ] }, { @@ -39931,7 +40485,7 @@ "The metric groups created using this API are managed by the application and cannot be retrieved using zetMetricGroupGet().", "The created metric groups are ready for activation and collection." ], - "hash": "ee04ae2896c387da5871785e7599c03a4d78d896df59a843f7776ff538f754ec", + "hash": "c6c0b3b798b9fb7baee89aee1f375968c9afb4c81f53f1e9d221aba6bd58f486", "name": "CreateMetricGroupsFromMetricsExp", "ordinal": "2", "params": [ @@ -39946,9 +40500,9 @@ "type": "uint32_t" }, { - "desc": "[in] metric handles to be added to the metric groups.", + "desc": "[in][range(0, metricCount)] array of metric handles to be added to the metric groups.", "name": "phMetrics", - "type": "zet_metric_handle_t *" + "type": "zet_metric_handle_t*" }, { "desc": "[in] prefix to the name created for the metric groups. Must point to a null-terminated character array no longer than ZET_MAX_METRIC_GROUP_NAME_PREFIX_EXP.", @@ -40015,6 +40569,11 @@ "`nullptr == hDevice`" ] }, + { + "ZE_RESULT_ERROR_INVALID_NULL_POINTER": [ + "`nullptr == phMetrics`" + ] + }, { "ZE_RESULT_ERROR_INVALID_ARGUMENT": [ "metricGroupCount is lesser than the number of metric group handles that could be created." @@ -40135,22 +40694,180 @@ "type": "function", "version": "1.10" }, + "DecodeStartExt": { + "class": "zesInfoLogDecoderContext", + "desc": "Start decoding info log records in a decoder context", + "details": [ + "The application must not call this function from simultaneous threads with the same decoder context handle.", + "The application may call this function from simultaneous threads with different decoder context handles." + ], + "hash": "62584af547a89be936adac4e3609c6130d080f0e4e15e2669f7d6ea53d82a28f", + "name": "DecodeStartExt", + "params": [ + { + "desc": "[in] handle of the decoder context", + "name": "hDecoderContext", + "type": "zes_info_log_decoder_context_handle_t" + }, + { + "desc": "[in] size, in bytes, of the record data in `pBuffer`, as returned in `*pSize` by the read or peek call", + "name": "size", + "type": "uint32_t" + }, + { + "desc": "[in][optional][range(0, size)] the record data, as returned in `pBuffer` by the read or peek call", + "name": "pBuffer", + "type": "const uint8_t*" + }, + { + "desc": "[in] number of records in the batch, as returned in `*pRecordCount` by the read or peek call", + "name": "recordCount", + "type": "uint32_t" + }, + { + "desc": "[in][optional][range(0, recordCount)] array of metadata describing each record, as returned in `pDescriptors` by the read or peek call", + "name": "pDescriptors", + "type": "const zes_info_log_metadata_ext_t*" + } + ], + "return_desc": "[out] ze_result_t API result", + "return_type": "ze_result_t", + "returns": [ + { + "ZE_RESULT_SUCCESS": [] + }, + { + "ZE_RESULT_ERROR_UNINITIALIZED": [] + }, + { + "ZE_RESULT_ERROR_DEVICE_LOST": [] + }, + { + "ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY": [] + }, + { + "ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY": [] + }, + { + "ZE_RESULT_ERROR_INVALID_ARGUMENT": [] + }, + { + "ZE_RESULT_ERROR_UNSUPPORTED_FEATURE": [] + }, + { + "ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE": [] + }, + { + "ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS": [] + }, + { + "ZE_RESULT_ERROR_NOT_AVAILABLE": [] + }, + { + "ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET": [] + }, + { + "ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE": [] + }, + { + "ZE_RESULT_ERROR_UNKNOWN": [] + }, + { + "ZE_RESULT_ERROR_INVALID_NULL_HANDLE": [ + "`nullptr == hDecoderContext`" + ] + } + ], + "type": "function", + "version": "1.21" + }, + "DecodeStopExt": { + "class": "zesInfoLogDecoderContext", + "desc": "Stop decoding of info log records that a decoder context is decoding", + "details": [ + "The application must not call this function from simultaneous threads with the same decoder context handle.", + "The application may call this function from simultaneous threads with different decoder context handles." + ], + "hash": "d0979f7c4606c70657a0be64ab66ba9866ba0005154f0693017105dc1690238a", + "name": "DecodeStopExt", + "params": [ + { + "desc": "[in] handle of the decoder context", + "name": "hDecoderContext", + "type": "zes_info_log_decoder_context_handle_t" + } + ], + "return_desc": "[out] ze_result_t API result", + "return_type": "ze_result_t", + "returns": [ + { + "ZE_RESULT_SUCCESS": [] + }, + { + "ZE_RESULT_ERROR_UNINITIALIZED": [] + }, + { + "ZE_RESULT_ERROR_DEVICE_LOST": [] + }, + { + "ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY": [] + }, + { + "ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY": [] + }, + { + "ZE_RESULT_ERROR_INVALID_ARGUMENT": [] + }, + { + "ZE_RESULT_ERROR_UNSUPPORTED_FEATURE": [] + }, + { + "ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE": [] + }, + { + "ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS": [] + }, + { + "ZE_RESULT_ERROR_NOT_AVAILABLE": [] + }, + { + "ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET": [] + }, + { + "ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE": [] + }, + { + "ZE_RESULT_ERROR_UNKNOWN": [] + }, + { + "ZE_RESULT_ERROR_INVALID_NULL_HANDLE": [ + "`nullptr == hDecoderContext`" + ] + } + ], + "type": "function", + "version": "1.21" + }, "DeleteExt": { - "class": "zesInfoLogInstance", - "desc": "Delete a collection instance of an info log", + "class": "zesInfoLogDecoderContext", + "desc": "Delete a decoder context of an info log", "details": [ - "Deleting a collection instance stops the collection of records into that instance and releases the resources used by the instance.", "The application must ensure that no other function is using the handle when calling this function.", "The application must not call this function from simultaneous threads with the same handle.", "The implementation of this function must be thread-safe." ], - "hash": "302680384c2f4d5ab5514e21b1c26228d5e749d6d8626d7895ac9f0cdaaee594", + "hash": "e954dd228b2fe62cfcdccc2c5643bdabe5fc1195dd269ca71b887b4fdf7d8b0e", "name": "DeleteExt", "params": [ { - "desc": "[in][release] handle of the info log collection instance to delete", - "name": "hInfoLogInstance", - "type": "zes_info_log_instance_handle_t" + "desc": "[in] handle of the info log that the decoder context was created from", + "name": "hInfoLog", + "type": "zes_info_log_handle_t" + }, + { + "desc": "[in][release] handle of the decoder context to delete", + "name": "hDecoderContext", + "type": "zes_info_log_decoder_context_handle_t" } ], "return_desc": "[out] ze_result_t API result", @@ -40197,12 +40914,13 @@ }, { "ZE_RESULT_ERROR_INVALID_NULL_HANDLE": [ - "`nullptr == hInfoLogInstance`" + "`nullptr == hInfoLog`", + "`nullptr == hDecoderContext`" ] } ], "type": "function", - "version": "1.19" + "version": "1.21" }, "Destroy": { "class": "zetTracerExp", @@ -44589,26 +45307,24 @@ "version": "1.14" }, "GetApiVersion": { - "class": "zeDriver", - "desc": "Returns the API version supported by the specified driver", + "class": "zesDriver", + "desc": "Returns the API version supported by the specified sysman driver", "details": [ "The application may call this function from simultaneous threads.", - "The implementation of this function should be lock-free.", - "Starting from API version 1.17, any driver reporting version 1.17 or later is assumed to support the ZE_DRIVER_DDI_HANDLES_EXT_NAME extension; see ze_driver_ddi_handles_ext_properties_t for details." + "The implementation of this function should be lock-free." ], - "hash": "4aeb05f8ea502a5a979a88d1e84cb6f237eed4d53f73fd96e47287706c95a15d", + "hash": "76e70d42b083d89e1a534d565b1e6c5ed4b36e00f2f580d750054607f94b8bde", "name": "GetApiVersion", - "ordinal": "1", "params": [ { - "desc": "[in] handle of the driver instance", + "desc": "[in] handle of the sysman driver instance", "name": "hDriver", - "type": "ze_driver_handle_t" + "type": "zes_driver_handle_t" }, { "desc": "[out] api version", - "name": "version", - "type": "ze_api_version_t*" + "name": "pVersion", + "type": "zes_api_version_t*" } ], "return_desc": "[out] ze_result_t API result", @@ -44660,12 +45376,12 @@ }, { "ZE_RESULT_ERROR_INVALID_NULL_POINTER": [ - "`nullptr == version`" + "`nullptr == pVersion`" ] } ], "type": "function", - "version": "1.0" + "version": "1.21" }, "GetAtomicAccessAttributeExp": { "class": "zeMem", @@ -48543,32 +49259,31 @@ "type": "function", "version": "1.4" }, - "GetFileDescriptorFromIpcHandleExp": { - "class": "zeMem", - "decl": "static", - "desc": "Gets the file descriptor contained in an IPC memory handle", + "GetFieldInfoExt": { + "class": "zesInfoLogDecoderContext", + "desc": "Get the fields that a decoder context can decode from an info log record", "details": [ - "IPC memory handle must be a valid handle obtained with zeMemGetIpcHandle.", - "The application may call this function from simultaneous threads.", - "The implementation of this function must be thread-safe." + "The application should first call this function with `pCount` pointing to a value of zero to retrieve the number of fields that can be decoded.", + "A call in which `*pCount` is greater than zero and `pFieldInfos` is nullptr shall report the number of fields and shall not write any descriptor, as a call with a count of zero does.", + "The application may call this function from simultaneous threads." ], - "hash": "4f0cd196b792fa6c5010f1779f899fc5252608ccded499cc460199f47343f4b6", - "name": "GetFileDescriptorFromIpcHandleExp", + "hash": "abe21e9a44be187caca5ee20cbf7f75867078369ee159cb2fb566d5be761affa", + "name": "GetFieldInfoExt", "params": [ { - "desc": "[in] handle of the context object", - "name": "hContext", - "type": "ze_context_handle_t" + "desc": "[in] handle of the decoder context", + "name": "hDecoderContext", + "type": "zes_info_log_decoder_context_handle_t" }, { - "desc": "[in] IPC memory handle", - "name": "ipcHandle", - "type": "ze_ipc_mem_handle_t" + "desc": "[in,out] pointer to the number of fields that can be decoded.\nif count is zero, then the driver shall update the value with the total number of fields that can be decoded and shall not return any descriptor.\nif count is greater than the number of fields that can be decoded, then the driver shall update the value with the correct number of fields.\n", + "name": "pCount", + "type": "uint32_t*" }, { - "desc": "[out] Returned file descriptor", - "name": "pHandle", - "type": "uint64_t*" + "desc": "[in,out][optional][range(0, *pCount)] array of field descriptions, one element per field.\nif count is less than the number of fields that can be decoded, then the driver shall only retrieve that number of descriptors.\n", + "name": "pFieldInfos", + "type": "zes_info_log_decodable_field_info_ext_t*" } ], "return_desc": "[out] ze_result_t API result", @@ -48615,37 +49330,121 @@ }, { "ZE_RESULT_ERROR_INVALID_NULL_HANDLE": [ - "`nullptr == hContext`" + "`nullptr == hDecoderContext`" ] }, { "ZE_RESULT_ERROR_INVALID_NULL_POINTER": [ - "`nullptr == pHandle`" + "`nullptr == pCount`" ] } ], "type": "function", - "version": "1.6" + "version": "1.21" }, - "GetFlags": { - "class": "zeEventPool", - "desc": "Gets the creation flags used to create the event pool.", + "GetFileDescriptorFromIpcHandleExp": { + "class": "zeMem", + "decl": "static", + "desc": "Gets the file descriptor contained in an IPC memory handle", "details": [ + "IPC memory handle must be a valid handle obtained with zeMemGetIpcHandle.", "The application may call this function from simultaneous threads.", - "The implementation of this function should be lock-free." + "The implementation of this function must be thread-safe." ], - "hash": "f132708d6d6b4e42b911405306c79565a83cb1e6e19d94d904406f7375c72e7d", - "name": "GetFlags", + "hash": "4f0cd196b792fa6c5010f1779f899fc5252608ccded499cc460199f47343f4b6", + "name": "GetFileDescriptorFromIpcHandleExp", "params": [ { - "desc": "[in] handle of the event pool", - "name": "hEventPool", - "type": "ze_event_pool_handle_t" + "desc": "[in] handle of the context object", + "name": "hContext", + "type": "ze_context_handle_t" }, { - "desc": "[out] creation flags used to create the event pool; may be 0 or a valid combination of ze_event_pool_flag_t", - "name": "pFlags", - "type": "ze_event_pool_flags_t*" + "desc": "[in] IPC memory handle", + "name": "ipcHandle", + "type": "ze_ipc_mem_handle_t" + }, + { + "desc": "[out] Returned file descriptor", + "name": "pHandle", + "type": "uint64_t*" + } + ], + "return_desc": "[out] ze_result_t API result", + "return_type": "ze_result_t", + "returns": [ + { + "ZE_RESULT_SUCCESS": [] + }, + { + "ZE_RESULT_ERROR_UNINITIALIZED": [] + }, + { + "ZE_RESULT_ERROR_DEVICE_LOST": [] + }, + { + "ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY": [] + }, + { + "ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY": [] + }, + { + "ZE_RESULT_ERROR_INVALID_ARGUMENT": [] + }, + { + "ZE_RESULT_ERROR_UNSUPPORTED_FEATURE": [] + }, + { + "ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE": [] + }, + { + "ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS": [] + }, + { + "ZE_RESULT_ERROR_NOT_AVAILABLE": [] + }, + { + "ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET": [] + }, + { + "ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE": [] + }, + { + "ZE_RESULT_ERROR_UNKNOWN": [] + }, + { + "ZE_RESULT_ERROR_INVALID_NULL_HANDLE": [ + "`nullptr == hContext`" + ] + }, + { + "ZE_RESULT_ERROR_INVALID_NULL_POINTER": [ + "`nullptr == pHandle`" + ] + } + ], + "type": "function", + "version": "1.6" + }, + "GetFlags": { + "class": "zeEventPool", + "desc": "Gets the creation flags used to create the event pool.", + "details": [ + "The application may call this function from simultaneous threads.", + "The implementation of this function should be lock-free." + ], + "hash": "f132708d6d6b4e42b911405306c79565a83cb1e6e19d94d904406f7375c72e7d", + "name": "GetFlags", + "params": [ + { + "desc": "[in] handle of the event pool", + "name": "hEventPool", + "type": "ze_event_pool_handle_t" + }, + { + "desc": "[out] creation flags used to create the event pool; may be 0 or a valid combination of ze_event_pool_flag_t", + "name": "pFlags", + "type": "ze_event_pool_flags_t*" } ], "return_desc": "[out] ze_result_t API result", @@ -59139,7 +59938,12 @@ }, { "ZE_RESULT_ERROR_INVALID_ARGUMENT": [ - "Graph is not in a recording state" + "Capture into `hGraph` is already paused" + ] + }, + { + "ZE_RESULT_ERROR_COMMAND_LIST_NOT_CAPTURING": [ + "Capture into `hGraph` was never started or has already ended" ] } ], @@ -60633,7 +61437,7 @@ }, { "ZE_RESULT_WARNING_DROPPED_DATA": [ - "Metric streamer data may have been dropped. Reduce sampling period." + "Metric streamer data may have been dropped. Increase the streamer sampling period or read the streamer data more frequently." ] } ], @@ -60815,39 +61619,45 @@ "type": "function", "version": "1.0" }, - "ReadMemory": { - "class": "zetDebug", - "desc": "Read memory.", + "ReadFieldExt": { + "class": "zesInfoLogDecoderContext", + "desc": "Read field values of one record that a decoder context is decoding", "details": [ - "The thread identifier 'all' can be used for accessing the default memory space, e.g. for setting breakpoints." + "The application must not call this function from simultaneous threads with the same decoder context handle.", + "The application may call this function from simultaneous threads with different decoder context handles." ], - "hash": "32d1103937128d0fdc73b46974a88ff0502d29fdd3bdbe361a6819eea9e2af36", - "name": "ReadMemory", + "hash": "450664f556c18c6b4bd8d1c409082affce397fda1ad13eaf1ea23239563db0df", + "name": "ReadFieldExt", "params": [ { - "desc": "[in] debug session handle", - "name": "hDebug", - "type": "zet_debug_session_handle_t" + "desc": "[in] handle of the decoder context, which must be decoding a batch", + "name": "hDecoderContext", + "type": "zes_info_log_decoder_context_handle_t" }, { - "desc": "[in] the thread identifier.", - "name": "thread", - "type": "ze_device_thread_t" + "desc": "[in] identifier of the field to read, as reported in `fieldId` of zes_info_log_decodable_field_info_ext_t", + "name": "fieldId", + "type": "uint32_t" }, { - "desc": "[in] memory space descriptor", - "name": "desc", - "type": "const zet_debug_memory_space_desc_t*" + "desc": "[in] index of the record in the `pDescriptors` that was passed to zesInfoLogDecoderContextDecodeStartExt", + "name": "recordId", + "type": "uint32_t" }, { - "desc": "[in] the number of bytes to read", - "name": "size", + "desc": "[in,out][range(0, bufferLen)] buffer that will contain the value of the field", + "name": "pOutBuffer", + "type": "void*" + }, + { + "desc": "[in] size, in bytes, of `pOutBuffer`", + "name": "bufferLen", "type": "size_t" }, { - "desc": "[in,out] a buffer to hold a copy of the memory", - "name": "buffer", - "type": "void*" + "desc": "[out] pointer to the number of bytes written to `pOutBuffer`.\nthe driver shall update the value with zero when the record does not carry the field.\n", + "name": "pBytesCopied", + "type": "size_t*" } ], "return_desc": "[out] ze_result_t API result", @@ -60880,112 +61690,6 @@ { "ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS": [] }, - { - "ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET": [] - }, - { - "ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE": [] - }, - { - "ZE_RESULT_ERROR_UNKNOWN": [] - }, - { - "ZE_RESULT_ERROR_INVALID_NULL_HANDLE": [ - "`nullptr == hDebug`" - ] - }, - { - "ZE_RESULT_ERROR_INVALID_NULL_POINTER": [ - "`nullptr == desc`", - "`nullptr == buffer`" - ] - }, - { - "ZE_RESULT_ERROR_INVALID_ENUMERATION": [ - "`ZET_DEBUG_MEMORY_SPACE_TYPE_BARRIER < desc->type`" - ] - }, - { - "ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION": [] - }, - { - "ZE_RESULT_ERROR_NOT_AVAILABLE": [ - "the thread is running or unavailable", - "the memory cannot be accessed from the supplied thread" - ] - } - ], - "type": "function", - "version": "1.0" - }, - "ReadOverclockState": { - "class": "zesDevice", - "desc": "Determine the state of overclocking", - "details": [ - "The application may call this function from simultaneous threads.", - "The implementation of this function should be lock-free." - ], - "hash": "bf83d33d94f9f7a4212f5acf692aa525675b4ae890259e8e179069c1a95c83e2", - "name": "ReadOverclockState", - "params": [ - { - "desc": "[in] Sysman handle of the device.", - "name": "hDevice", - "type": "zes_device_handle_t" - }, - { - "desc": "[out] One of overclock mode.", - "name": "pOverclockMode", - "type": "zes_overclock_mode_t*" - }, - { - "desc": "[out] Waiver setting: 0 = Waiver not set, 1 = waiver has been set.", - "name": "pWaiverSetting", - "type": "ze_bool_t*" - }, - { - "desc": "[out] Current settings 0 =manufacturing state, 1= shipped state)..", - "name": "pOverclockState", - "type": "ze_bool_t*" - }, - { - "desc": "[out] This enum is returned when the driver attempts to set an overclock control or reset overclock settings.", - "name": "pPendingAction", - "type": "zes_pending_action_t*" - }, - { - "desc": "[out] Pending reset 0 =manufacturing state, 1= shipped state)..", - "name": "pPendingReset", - "type": "ze_bool_t*" - } - ], - "return_desc": "[out] ze_result_t API result", - "return_type": "ze_result_t", - "returns": [ - { - "ZE_RESULT_SUCCESS": [] - }, - { - "ZE_RESULT_ERROR_UNINITIALIZED": [] - }, - { - "ZE_RESULT_ERROR_DEVICE_LOST": [] - }, - { - "ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY": [] - }, - { - "ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY": [] - }, - { - "ZE_RESULT_ERROR_INVALID_ARGUMENT": [] - }, - { - "ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE": [] - }, - { - "ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS": [] - }, { "ZE_RESULT_ERROR_NOT_AVAILABLE": [] }, @@ -61000,32 +61704,27 @@ }, { "ZE_RESULT_ERROR_INVALID_NULL_HANDLE": [ - "`nullptr == hDevice`" + "`nullptr == hDecoderContext`" ] }, { "ZE_RESULT_ERROR_INVALID_NULL_POINTER": [ - "`nullptr == pOverclockMode`", - "`nullptr == pWaiverSetting`", - "`nullptr == pOverclockState`", - "`nullptr == pPendingAction`", - "`nullptr == pPendingReset`" - ] - }, - { - "ZE_RESULT_ERROR_UNSUPPORTED_FEATURE": [ - "Overclocking is not supported on this control domain" + "`nullptr == pOutBuffer`", + "`nullptr == pBytesCopied`" ] } ], "type": "function", - "version": "1.5" + "version": "1.21" }, - "ReadRegisters": { + "ReadMemory": { "class": "zetDebug", - "desc": "Read register state.", - "hash": "4971ff5ff86f5c20fda571c8540832b90f68b99ff6b2c72527ae590fb92ecd13", - "name": "ReadRegisters", + "desc": "Read memory.", + "details": [ + "The thread identifier 'all' can be used for accessing the default memory space, e.g. for setting breakpoints." + ], + "hash": "32d1103937128d0fdc73b46974a88ff0502d29fdd3bdbe361a6819eea9e2af36", + "name": "ReadMemory", "params": [ { "desc": "[in] debug session handle", @@ -61033,28 +61732,231 @@ "type": "zet_debug_session_handle_t" }, { - "desc": "[in] the thread identifier", + "desc": "[in] the thread identifier.", "name": "thread", "type": "ze_device_thread_t" }, { - "desc": "[in] register set type", - "name": "type", - "type": "uint32_t" - }, - { - "desc": "[in] the starting offset into the register state area; must be less than the `count` member of zet_debug_regset_properties_t for the type", - "name": "start", - "type": "uint32_t" + "desc": "[in] memory space descriptor", + "name": "desc", + "type": "const zet_debug_memory_space_desc_t*" }, { - "desc": "[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", - "name": "count", - "type": "uint32_t" + "desc": "[in] the number of bytes to read", + "name": "size", + "type": "size_t" }, { - "desc": "[in,out][optional][range(0, count)] buffer of register values", - "name": "pRegisterValues", + "desc": "[in,out] a buffer to hold a copy of the memory", + "name": "buffer", + "type": "void*" + } + ], + "return_desc": "[out] ze_result_t API result", + "return_type": "ze_result_t", + "returns": [ + { + "ZE_RESULT_SUCCESS": [] + }, + { + "ZE_RESULT_ERROR_UNINITIALIZED": [] + }, + { + "ZE_RESULT_ERROR_DEVICE_LOST": [] + }, + { + "ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY": [] + }, + { + "ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY": [] + }, + { + "ZE_RESULT_ERROR_INVALID_ARGUMENT": [] + }, + { + "ZE_RESULT_ERROR_UNSUPPORTED_FEATURE": [] + }, + { + "ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE": [] + }, + { + "ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS": [] + }, + { + "ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET": [] + }, + { + "ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE": [] + }, + { + "ZE_RESULT_ERROR_UNKNOWN": [] + }, + { + "ZE_RESULT_ERROR_INVALID_NULL_HANDLE": [ + "`nullptr == hDebug`" + ] + }, + { + "ZE_RESULT_ERROR_INVALID_NULL_POINTER": [ + "`nullptr == desc`", + "`nullptr == buffer`" + ] + }, + { + "ZE_RESULT_ERROR_INVALID_ENUMERATION": [ + "`ZET_DEBUG_MEMORY_SPACE_TYPE_BARRIER < desc->type`" + ] + }, + { + "ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION": [] + }, + { + "ZE_RESULT_ERROR_NOT_AVAILABLE": [ + "the thread is running or unavailable", + "the memory cannot be accessed from the supplied thread" + ] + } + ], + "type": "function", + "version": "1.0" + }, + "ReadOverclockState": { + "class": "zesDevice", + "desc": "Determine the state of overclocking", + "details": [ + "The application may call this function from simultaneous threads.", + "The implementation of this function should be lock-free." + ], + "hash": "bf83d33d94f9f7a4212f5acf692aa525675b4ae890259e8e179069c1a95c83e2", + "name": "ReadOverclockState", + "params": [ + { + "desc": "[in] Sysman handle of the device.", + "name": "hDevice", + "type": "zes_device_handle_t" + }, + { + "desc": "[out] One of overclock mode.", + "name": "pOverclockMode", + "type": "zes_overclock_mode_t*" + }, + { + "desc": "[out] Waiver setting: 0 = Waiver not set, 1 = waiver has been set.", + "name": "pWaiverSetting", + "type": "ze_bool_t*" + }, + { + "desc": "[out] Current settings 0 =manufacturing state, 1= shipped state)..", + "name": "pOverclockState", + "type": "ze_bool_t*" + }, + { + "desc": "[out] This enum is returned when the driver attempts to set an overclock control or reset overclock settings.", + "name": "pPendingAction", + "type": "zes_pending_action_t*" + }, + { + "desc": "[out] Pending reset 0 =manufacturing state, 1= shipped state)..", + "name": "pPendingReset", + "type": "ze_bool_t*" + } + ], + "return_desc": "[out] ze_result_t API result", + "return_type": "ze_result_t", + "returns": [ + { + "ZE_RESULT_SUCCESS": [] + }, + { + "ZE_RESULT_ERROR_UNINITIALIZED": [] + }, + { + "ZE_RESULT_ERROR_DEVICE_LOST": [] + }, + { + "ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY": [] + }, + { + "ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY": [] + }, + { + "ZE_RESULT_ERROR_INVALID_ARGUMENT": [] + }, + { + "ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE": [] + }, + { + "ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS": [] + }, + { + "ZE_RESULT_ERROR_NOT_AVAILABLE": [] + }, + { + "ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET": [] + }, + { + "ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE": [] + }, + { + "ZE_RESULT_ERROR_UNKNOWN": [] + }, + { + "ZE_RESULT_ERROR_INVALID_NULL_HANDLE": [ + "`nullptr == hDevice`" + ] + }, + { + "ZE_RESULT_ERROR_INVALID_NULL_POINTER": [ + "`nullptr == pOverclockMode`", + "`nullptr == pWaiverSetting`", + "`nullptr == pOverclockState`", + "`nullptr == pPendingAction`", + "`nullptr == pPendingReset`" + ] + }, + { + "ZE_RESULT_ERROR_UNSUPPORTED_FEATURE": [ + "Overclocking is not supported on this control domain" + ] + } + ], + "type": "function", + "version": "1.5" + }, + "ReadRegisters": { + "class": "zetDebug", + "desc": "Read register state.", + "hash": "4971ff5ff86f5c20fda571c8540832b90f68b99ff6b2c72527ae590fb92ecd13", + "name": "ReadRegisters", + "params": [ + { + "desc": "[in] debug session handle", + "name": "hDebug", + "type": "zet_debug_session_handle_t" + }, + { + "desc": "[in] the thread identifier", + "name": "thread", + "type": "ze_device_thread_t" + }, + { + "desc": "[in] register set type", + "name": "type", + "type": "uint32_t" + }, + { + "desc": "[in] the starting offset into the register state area; must be less than the `count` member of zet_debug_regset_properties_t for the type", + "name": "start", + "type": "uint32_t" + }, + { + "desc": "[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", + "name": "count", + "type": "uint32_t" + }, + { + "desc": "[in,out][optional][range(0, count)] buffer of register values", + "name": "pRegisterValues", "type": "void*" } ], @@ -61932,7 +62834,13 @@ }, { "ZE_RESULT_ERROR_INVALID_ARGUMENT": [ - "Graph is not in a paused state" + "Capture into `hGraph` is not paused", + "The command list from which `hGraph` was recording is capturing into another graph" + ] + }, + { + "ZE_RESULT_ERROR_COMMAND_LIST_NOT_CAPTURING": [ + "Capture into `hGraph` was never started or has already ended" ] } ], @@ -64513,7 +65421,7 @@ }, { "ZE_RESULT_ERROR_INVALID_ENUMERATION": [ - "`ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_HIGH < priority`" + "`ZE_COMMAND_QUEUE_PRIORITY_HIGH < priority`" ] }, { @@ -67746,6 +68654,13 @@ "type": "handle", "version": "1.0" }, + "zes_info_log_decoder_context_handle_t": { + "class": "zesInfoLogDecoderContext", + "desc": "Handle for a Sysman info log decoder context", + "name": "zes_info_log_decoder_context_handle_t", + "type": "handle", + "version": "1.21" + }, "zes_info_log_handle_t": { "class": "zesInfoLog", "desc": "Handle for a Sysman info log", @@ -67950,6 +68865,11 @@ }, "zet_tracer_exp_handle_t": { "class": "zetTracerExp", + "deprecated": { + "reason": "Only used by the deprecated API Tracing extension.", + "since": "1.14", + "use": "L0 Loader API Tracing " + }, "desc": "Handle of tracer object", "name": "zet_tracer_exp_handle_t", "type": "handle", @@ -67957,6 +68877,13 @@ } }, "macro": { + "ZES_API_VERSION_CURRENT_M": { + "desc": "Current sysman API version as a macro", + "name": "ZES_API_VERSION_CURRENT_M", + "type": "macro", + "value": "ZES_MAKE_VERSION( 1, 21 )", + "version": "1.21" + }, "ZES_DEVICE_ECC_DEFAULT_PROPERTIES_EXT_NAME": { "desc": "Device ECC default properties Extension Name", "name": "ZES_DEVICE_ECC_DEFAULT_PROPERTIES_EXT_NAME", @@ -67992,6 +68919,13 @@ "value": "\"ZES_extension_device_index\"", "version": "1.20" }, + "ZES_DEVICE_SOC_UID_EXT_NAME": { + "desc": "Device SOC Unique ID Extension Name", + "name": "ZES_DEVICE_SOC_UID_EXT_NAME", + "type": "macro", + "value": "\"ZES_extension_device_soc_uid\"", + "version": "1.21" + }, "ZES_DIAG_FIRST_TEST_INDEX": { "desc": "Diagnostic test index to use for the very first test.", "name": "ZES_DIAG_FIRST_TEST_INDEX", @@ -68034,6 +68968,27 @@ "value": "\"ZES_extension_info_logs\"", "version": "1.19" }, + "ZES_INFO_LOG_FIELD_DESC_SIZE": { + "desc": "Maximum number of characters in the description of a decodable field, including the null terminator.", + "name": "ZES_INFO_LOG_FIELD_DESC_SIZE", + "type": "macro", + "value": "256", + "version": "1.21" + }, + "ZES_MAJOR_VERSION": { + "desc": "Extracts 'oneAPI' Sysman API major version", + "name": "ZES_MAJOR_VERSION( _ver )", + "type": "macro", + "value": "( _ver >> 16 )", + "version": "1.21" + }, + "ZES_MAKE_VERSION": { + "desc": "Generates generic 'oneAPI' Sysman API versions", + "name": "ZES_MAKE_VERSION( _major, _minor )", + "type": "macro", + "value": "(( _major << 16 )|( _minor & 0x0000ffff))", + "version": "1.21" + }, "ZES_MAX_EXTENSION_NAME": { "desc": "Maximum extension name string size", "name": "ZES_MAX_EXTENSION_NAME", @@ -68104,6 +69059,13 @@ "value": "\"ZES_extension_mem_state\"", "version": "1.8" }, + "ZES_MINOR_VERSION": { + "desc": "Extracts 'oneAPI' Sysman API minor version", + "name": "ZES_MINOR_VERSION( _ver )", + "type": "macro", + "value": "( _ver & 0x0000ffff )", + "version": "1.21" + }, "ZES_OEM_SERIAL_ID_EXT_NAME": { "desc": "OEM Serial ID Extension Name", "name": "ZES_OEM_SERIAL_ID_EXT_NAME", @@ -68391,7 +69353,7 @@ "desc": "Current API version as a macro", "name": "ZE_API_VERSION_CURRENT_M", "type": "macro", - "value": "ZE_MAKE_VERSION( 1, 20 )", + "value": "ZE_MAKE_VERSION( 1, 21 )", "version": "1.10" }, "ZE_BANDWIDTH_PROPERTIES_EXP_NAME": { @@ -69195,7 +70157,7 @@ "type": "uint32_t" }, { - "desc": "[in] command queue index within the group;\nmust be zero. \n", + "desc": "[in] command queue index within the group;\nzero-based, so it must be less than the `numQueues` member of ze_command_queue_group_properties_t for the command queue group.\n", "name": "index", "type": "uint32_t" }, @@ -69715,32 +70677,32 @@ "type": "ze_device_dp_capability_flags_t" }, { - "desc": "[out] Supported input data types when dp4v dot product capability is supported.", + "desc": "[out] Supported input data types for the non-systolic vector dot-product path (DP4A). Valid only when ZE_DEVICE_DP_CAPABILITY_FLAG_DEVICE_NON_SYSTOLIC_DPA4_SIMD_ALL is set in dp_caps; a value of 0 indicates no supported input types for this path. The member is named 'dpv4_*' for ABI compatibility; the feature it describes is DP4A.", "name": "dpv4_input_types", "type": "ze_device_input_data_type_flags_t" }, { - "desc": "[out] Supported output data types when dp4v dot product capability is supported.", + "desc": "[out] Supported output / accumulator data types for the non-systolic vector dot-product path (DP4A). Valid only when ZE_DEVICE_DP_CAPABILITY_FLAG_DEVICE_NON_SYSTOLIC_DPA4_SIMD_ALL is set in dp_caps; a value of 0 indicates no supported output types for this path. The member is named 'dpv4_*' for ABI compatibility; the feature it describes is DP4A.", "name": "dpv4_output_types", "type": "ze_device_output_data_type_flags_t" }, { - "desc": "[out] Supported input data types when dpas dot product capability is supported.", + "desc": "[out] Supported input data types for the systolic dot-product (DPAS) path. Valid only when at least one of the DEVICE_SYSTOLIC_DPAS_* bits in ze_device_dp_capability_flags_t is set in dp_caps; a value of 0 indicates no supported input types for this path.", "name": "dpas_input_types", "type": "ze_device_input_data_type_flags_t" }, { - "desc": "[out] Supported output data types when dpas dot product capability is supported.", + "desc": "[out] Supported output / accumulator data types for the systolic dot-product (DPAS) path. Valid only when at least one of the DEVICE_SYSTOLIC_DPAS_* bits in ze_device_dp_capability_flags_t is set in dp_caps; a value of 0 indicates no supported output types for this path.", "name": "dpas_output_types", "type": "ze_device_output_data_type_flags_t" }, { - "desc": "[out] Supported input data types when bdpas dot product capability is supported.", + "desc": "[out] Supported input data types for the block-scaled systolic dot-product (BDPAS) path. Valid only when at least one of the DEVICE_SYSTOLIC_BDPAS_* bits in ze_device_dp_capability_flags_t is set in dp_caps; a value of 0 indicates no supported input types for this path. The DEVICE_INPUT_DATA_SCALING_* bits in ze_device_input_data_type_flags_t only have meaning in this member.", "name": "bdpas_input_types", "type": "ze_device_input_data_type_flags_t" }, { - "desc": "[out] Supported output data types when bdpas dot product capability is supported.", + "desc": "[out] Supported output / accumulator data types for the block-scaled systolic dot-product (BDPAS) path. Valid only when at least one of the DEVICE_SYSTOLIC_BDPAS_* bits in ze_device_dp_capability_flags_t is set in dp_caps; a value of 0 indicates no supported output types for this path.", "name": "bdpas_output_types", "type": "ze_device_output_data_type_flags_t" } @@ -74574,7 +75536,7 @@ "type": "uint8_t" }, { - "desc": "[in] format of the specified transformation", + "desc": "[in] format of the specified transformation, must be ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_FLOAT3X4_COLUMN_MAJOR, ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_FLOAT3X4_ALIGNED_COLUMN_MAJOR, or ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_FLOAT3X4_ROW_MAJOR", "name": "transformFormat", "type": "ze_rtas_builder_packed_input_data_format_exp_t" }, @@ -74623,7 +75585,7 @@ "type": "uint8_t" }, { - "desc": "[in] format of the specified transformation", + "desc": "[in] format of the specified transformation, must be ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_FLOAT3X4_COLUMN_MAJOR, ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_FLOAT3X4_ALIGNED_COLUMN_MAJOR, or ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_FLOAT3X4_ROW_MAJOR", "name": "transformFormat", "type": "ze_rtas_builder_packed_input_data_format_ext_t" }, @@ -76622,7 +77584,7 @@ "zes_device_properties_t": { "base": "zes_base_properties_t", "class": "zesDevice", - "desc": "Device properties. To get OEM Serial ID, pNext member of this structure should point to an instance of ${s}_oem_serial_id_ext_properties_t with its stype set to ZES_STRUCTURE_TYPE_OEM_SERIAL_ID_EXT_PROPERTIES. To get Device Index, pNext member of this structure should point to an instance of ${s}_device_index_ext_properties_t with its stype set to ZES_STRUCTURE_TYPE_DEVICE_INDEX_EXT_PROPERTIES. To get the GPU topology of the device, pNext member of this structure should point to an instance of ${s}_device_gpu_topology_ext_properties_t with its stype set to ZES_STRUCTURE_TYPE_DEVICE_GPU_TOPOLOGY_EXT_PROPERTIES.", + "desc": "Device properties. To get OEM Serial ID, pNext member of this structure should point to an instance of ${s}_oem_serial_id_ext_properties_t with its stype set to ZES_STRUCTURE_TYPE_OEM_SERIAL_ID_EXT_PROPERTIES. To get Device Index, pNext member of this structure should point to an instance of ${s}_device_index_ext_properties_t with its stype set to ZES_STRUCTURE_TYPE_DEVICE_INDEX_EXT_PROPERTIES. To get the GPU topology of the device, pNext member of this structure should point to an instance of ${s}_device_gpu_topology_ext_properties_t with its stype set to ZES_STRUCTURE_TYPE_DEVICE_GPU_TOPOLOGY_EXT_PROPERTIES. To get the SOC unique ID of the device, pNext member of this structure should point to an instance of zes_device_soc_uid_ext_properties_t with its stype set to ZES_STRUCTURE_TYPE_DEVICE_SOC_UID_EXT_PROPERTIES. To get the UUID, type and flags of the device, pNext member of this structure should point to an instance of zes_device_ext_properties_t with its stype set to ZES_STRUCTURE_TYPE_DEVICE_EXT_PROPERTIES.", "members": [ { "desc": "[in] type of this structure", @@ -76638,6 +77600,7 @@ }, { "deprecated": { + "reason": "Get the UUID, type and flags through pNext.", "since": "1.7", "use": "zes_device_ext_properties_t" }, @@ -76685,6 +77648,38 @@ "type": "struct", "version": "1.0" }, + "zes_device_soc_uid_ext_properties_t": { + "base": "zes_base_properties_t", + "class": "zesDevice", + "desc": "Device SOC Unique ID Extension structure", + "details": [ + "This structure can be passed as an extension structure to zesDeviceGetProperties via pNext member", + "Returns the unique ID of the SOC on which the device resides", + "Applications must treat an all-zero socUid as unavailable rather than as a valid identifier" + ], + "members": [ + { + "desc": "[in] type of this structure", + "init": "ZES_STRUCTURE_TYPE_DEVICE_SOC_UID_EXT_PROPERTIES", + "name": "stype", + "type": "zes_structure_type_t" + }, + { + "desc": "[in,out][optional] must be null or a pointer to an extension-specific structure (i.e. contains stype and pNext).", + "init": "nullptr", + "name": "pNext", + "type": "void*" + }, + { + "desc": "[out] unique identifier of the SOC, most significant byte first.", + "name": "socUid", + "type": "zes_uuid_t" + } + ], + "name": "zes_device_soc_uid_ext_properties_t", + "type": "struct", + "version": "1.21" + }, "zes_device_state_t": { "base": "zes_base_state_t", "class": "zesDevice", @@ -77613,6 +78608,68 @@ "type": "struct", "version": "1.0" }, + "zes_info_log_decodable_field_info_ext_t": { + "base": "zes_base_properties_t", + "class": "zesInfoLogDecoderContext", + "desc": "Description of one field that a decoder context can decode from an info log record", + "details": [ + "An array of these structures is returned by zesInfoLogDecoderContextGetFieldInfoExt, one element per field.", + "The fields that are reported are a property of the format of the info log, reported in infoLogFormat of zes_info_log_ext_properties_t, and not of a batch of records. Whether a given record carries a given field is reported per record by zesInfoLogDecoderContextReadFieldExt.", + "The application must locate a field by `name`, and must then use the `fieldId`, `type` and `requiredBytes` that are reported for that name." + ], + "members": [ + { + "desc": "[in] type of this structure", + "init": "ZES_STRUCTURE_TYPE_INFO_LOG_DECODABLE_FIELD_INFO_EXT", + "name": "stype", + "type": "zes_structure_type_t" + }, + { + "desc": "[in,out][optional] must be null or a pointer to an extension-specific structure (i.e. contains stype and pNext).", + "init": "nullptr", + "name": "pNext", + "type": "void*" + }, + { + "desc": "[out] human readable description of the field (NULL terminated string value).", + "name": "desc[ZES_INFO_LOG_FIELD_DESC_SIZE]", + "type": "char" + }, + { + "desc": "[out] name of the field (NULL terminated string value).", + "name": "name[ZES_STRING_PROPERTY_SIZE]", + "type": "char" + }, + { + "desc": "[out] identifier of the field, to be passed to zesInfoLogDecoderContextReadFieldExt.", + "name": "fieldId", + "type": "uint32_t" + }, + { + "desc": "[out] data type of the value of the field.", + "name": "type", + "type": "zes_info_log_field_type_ext_t" + }, + { + "desc": "[out] number of bytes that the application must provide to zesInfoLogDecoderContextReadFieldExt to read this field.\nFor ZES_INFO_LOG_FIELD_TYPE_EXT_STRING this value includes the null terminator.\n", + "name": "requiredBytes", + "type": "size_t" + }, + { + "desc": "[out] number of elements of the data type that the field holds.", + "name": "elementCount", + "type": "size_t" + }, + { + "desc": "[out] version of this extension in which the field was first reported.", + "name": "versionString[ZES_STRING_PROPERTY_SIZE]", + "type": "char" + } + ], + "name": "zes_info_log_decodable_field_info_ext_t", + "type": "struct", + "version": "1.21" + }, "zes_info_log_ext_properties_t": { "base": "zes_base_properties_t", "class": "zesInfoLog", @@ -78881,7 +79938,7 @@ "type": "zes_power_domain_t" }, { - "desc": "[out] the factory default limit of the part.", + "desc": "[in,out][optional] pointer to a caller-allocated zes_power_limit_ext_desc_t\nthat the driver fills with the factory default limit of the part.\nThe application must allocate and initialize (including `stype`) the pointed-to\nstructure and assign its address before calling zesPowerGetProperties.\nIf this is null, the factory default limit will not be returned.\n", "name": "defaultLimit", "type": "zes_power_limit_ext_desc_t*" } @@ -83418,10 +84475,16 @@ "value": "$X_MAKE_VERSION( 1, 20 )", "version": "1.20" }, + { + "desc": "version 1.21", + "name": "$X_API_VERSION_1_21", + "value": "$X_MAKE_VERSION( 1, 21 )", + "version": "1.21" + }, { "desc": "latest known version", "name": "$X_API_VERSION_CURRENT", - "value": "$X_MAKE_VERSION( 1, 20 )" + "value": "$X_MAKE_VERSION( 1, 21 )" } ], "name": "$x_api_version_t", @@ -83432,7 +84495,7 @@ "desc": "Current API version as a macro", "name": "$X_API_VERSION_CURRENT_M", "type": "macro", - "value": "$X_MAKE_VERSION( 1, 20 )", + "value": "$X_MAKE_VERSION( 1, 21 )", "version": "1.10" }, { @@ -84767,22 +85830,22 @@ "desc": "Supported device compute dot product(dp) capability flags", "etors": [ { - "desc": "Supports vector dot product instruction.", + "desc": "Supports the non-systolic vector dot product instruction (DP4A). When set, the dpv4_input_types and dpv4_output_types members of $x_device_compute_dotproduct_ext_properties_t describe the legal data types for this path.", "name": "$X_DEVICE_DP_CAPABILITY_FLAG_DEVICE_NON_SYSTOLIC_DPA4_SIMD_ALL", "value": "$X_BIT(0)" }, { - "desc": "Supports sytolic dot product with 8 SIMD lanes.", + "desc": "Supports systolic dot product (DPAS) with 8 SIMD lanes.", "name": "$X_DEVICE_DP_CAPABILITY_FLAG_DEVICE_SYSTOLIC_DPAS_SIMD8", "value": "$X_BIT(1)" }, { - "desc": "Supports sytolic dot product with 16 SIMD lanes.", + "desc": "Supports systolic dot product (DPAS) with 16 SIMD lanes.", "name": "$X_DEVICE_DP_CAPABILITY_FLAG_DEVICE_SYSTOLIC_DPAS_SIMD16", "value": "$X_BIT(2)" }, { - "desc": "Supports sytolic dot product with block scaling support with 16 SIMD lanes.", + "desc": "Supports systolic dot product with block-scaling support (BDPAS) with 16 SIMD lanes.", "name": "$X_DEVICE_DP_CAPABILITY_FLAG_DEVICE_SYSTOLIC_BDPAS_SIMD16", "value": "$X_BIT(3)" }, @@ -84802,12 +85865,12 @@ "value": "$X_BIT(6)" }, { - "desc": "Supports output matrix row count upto 8", + "desc": "Output-shape modifier for the systolic DPAS/BDPAS path: the output matrix row count is variable, up to 8. Only meaningful when at least one of the DEVICE_SYSTOLIC_DPAS_* or DEVICE_SYSTOLIC_BDPAS_* bits is also set in dp_caps; this bit alone does not advertise DPAS or BDPAS support.", "name": "$X_DEVICE_DP_CAPABILITY_FLAG_DEVICE_SYSTOLIC_OUTPUT_MATRIX_ROWCOUNT_UPTO8", "value": "$X_BIT(7)" }, { - "desc": "Restricts output matrix row count to 8", + "desc": "Output-shape modifier for the systolic DPAS/BDPAS path: the output matrix row count is fixed at 8. Only meaningful when at least one of the DEVICE_SYSTOLIC_DPAS_* or DEVICE_SYSTOLIC_BDPAS_* bits is also set in dp_caps; this bit alone does not advertise DPAS or BDPAS support.", "name": "$X_DEVICE_DP_CAPABILITY_FLAG_DEVICE_SYSTOLIC_OUTPUT_MATRIX_ROWCOUNT_FIXED8", "value": "$X_BIT(8)" } @@ -84818,15 +85881,23 @@ }, { "class": "$xDevice", - "desc": "Supported device dot product(dp) input data types flags", + "desc": "Supported device dot product (dp) input data type flags. A field value of 0 indicates no supported input data types for the associated dot-product path; non-zero values are the bitwise-OR of the supported type bits defined below. The containing *_input_types field (dpv4_input_types, dpas_input_types, or bdpas_input_types) determines which dot-product path this applies to.", "etors": [ { - "desc": "No data types available for the supported dot product operation", + "deprecated": { + "reason": "No replacement; a field value of 0 already indicates that no data types are supported.", + "since": "1.21" + }, + "desc": "Indicates that no data types are supported. This bit is semantically equivalent to all other field values being 0 and must not be combined with any other bit of this enum. Retained for ABI compatibility only.", "name": "$X_DEVICE_INPUT_DATA_TYPE_FLAG_DEVICE_INPUT_DATA_TYPE_NONE", "value": "$X_BIT(0)" }, { - "desc": "Supports int8 data type with 4 packed data elements per SIMD lane.", + "deprecated": { + "since": "1.21", + "use": "$X_DEVICE_INPUT_DATA_TYPE_FLAG_DEVICE_INPUT_DATA_INT8_PACK4_PER_SIMD_LANE" + }, + "desc": "Supports int8 data type with 4 packed data elements per SIMD lane. This enumerator carries a stray 'ZE_' prefix in its name, producing the generated token $X_DEVICE_INPUT_DATA_TYPE_FLAG_ZE_DEVICE_INPUT_DATA_INT8_PACK4_PER_SIMD_LANE. Retained for ABI compatibility only.", "name": "$X_DEVICE_INPUT_DATA_TYPE_FLAG_ZE_DEVICE_INPUT_DATA_INT8_PACK4_PER_SIMD_LANE", "value": "$X_BIT(1)" }, @@ -84876,22 +85947,22 @@ "value": "$X_BIT(10)" }, { - "desc": "Supports 8bit integer data type with 4 packed data elements per SIMD lane.This is exclusively for DP4V dot product support", + "desc": "Supports int8 (8-bit signed integer) data type with 4 packed data elements per SIMD lane.", "name": "$X_DEVICE_INPUT_DATA_TYPE_FLAG_DEVICE_INPUT_DATA_INT8_PACK4_PER_SIMD_LANE", "value": "$X_BIT(11)" }, { - "desc": "Supports uint8 data type support for scaling, exclusive to BDPAS dot product support.", + "desc": "Supports uint8 (8-bit unsigned integer) scaling factor. Only meaningful when set in bdpas_input_types; exclusive to the BDPAS dot-product path.", "name": "$X_DEVICE_INPUT_DATA_TYPE_FLAG_DEVICE_INPUT_DATA_SCALING_UINT8", "value": "$X_BIT(12)" }, { - "desc": "Supports ue5m3 data type support for scaling, exclusive to BDPAS dot product support.", + "desc": "Supports ue5m3 (unsigned float, 5-bit exponent, 3-bit mantissa) scaling factor. Only meaningful when set in bdpas_input_types; exclusive to the BDPAS dot-product path.", "name": "$X_DEVICE_INPUT_DATA_TYPE_FLAG_DEVICE_INPUT_DATA_SCALING_UE5M3", "value": "$X_BIT(13)" }, { - "desc": "Supports ue4m3 data type support for scaling, exclusive to BDPAS dot product support.", + "desc": "Supports ue4m3 (unsigned float, 4-bit exponent, 3-bit mantissa) scaling factor. Only meaningful when set in bdpas_input_types; exclusive to the BDPAS dot-product path.", "name": "$X_DEVICE_INPUT_DATA_TYPE_FLAG_DEVICE_INPUT_DATA_SCALING_UE4M3", "value": "$X_BIT(14)" } @@ -84902,7 +85973,7 @@ }, { "class": "$xDevice", - "desc": "Supported device dot product(dp) output data types or accumulator data types flags", + "desc": "Supported device dot product (dp) output / accumulator data type flags. A field value of 0 indicates no supported output data types for the associated dot-product path; non-zero values are the bitwise-OR of the supported type bits defined below.", "etors": [ { "desc": "Supports signed and unsigned 32bit integer data type for output", @@ -84977,32 +86048,32 @@ "type": "$x_device_dp_capability_flags_t" }, { - "desc": "[out] Supported input data types when dp4v dot product capability is supported.", + "desc": "[out] Supported input data types for the non-systolic vector dot-product path (DP4A). Valid only when $X_DEVICE_DP_CAPABILITY_FLAG_DEVICE_NON_SYSTOLIC_DPA4_SIMD_ALL is set in dp_caps; a value of 0 indicates no supported input types for this path. The member is named 'dpv4_*' for ABI compatibility; the feature it describes is DP4A.", "name": "dpv4_input_types", "type": "$x_device_input_data_type_flags_t" }, { - "desc": "[out] Supported output data types when dp4v dot product capability is supported.", + "desc": "[out] Supported output / accumulator data types for the non-systolic vector dot-product path (DP4A). Valid only when $X_DEVICE_DP_CAPABILITY_FLAG_DEVICE_NON_SYSTOLIC_DPA4_SIMD_ALL is set in dp_caps; a value of 0 indicates no supported output types for this path. The member is named 'dpv4_*' for ABI compatibility; the feature it describes is DP4A.", "name": "dpv4_output_types", "type": "$x_device_output_data_type_flags_t" }, { - "desc": "[out] Supported input data types when dpas dot product capability is supported.", + "desc": "[out] Supported input data types for the systolic dot-product (DPAS) path. Valid only when at least one of the DEVICE_SYSTOLIC_DPAS_* bits in $x_device_dp_capability_flags_t is set in dp_caps; a value of 0 indicates no supported input types for this path.", "name": "dpas_input_types", "type": "$x_device_input_data_type_flags_t" }, { - "desc": "[out] Supported output data types when dpas dot product capability is supported.", + "desc": "[out] Supported output / accumulator data types for the systolic dot-product (DPAS) path. Valid only when at least one of the DEVICE_SYSTOLIC_DPAS_* bits in $x_device_dp_capability_flags_t is set in dp_caps; a value of 0 indicates no supported output types for this path.", "name": "dpas_output_types", "type": "$x_device_output_data_type_flags_t" }, { - "desc": "[out] Supported input data types when bdpas dot product capability is supported.", + "desc": "[out] Supported input data types for the block-scaled systolic dot-product (BDPAS) path. Valid only when at least one of the DEVICE_SYSTOLIC_BDPAS_* bits in $x_device_dp_capability_flags_t is set in dp_caps; a value of 0 indicates no supported input types for this path. The DEVICE_INPUT_DATA_SCALING_* bits in $x_device_input_data_type_flags_t only have meaning in this member.", "name": "bdpas_input_types", "type": "$x_device_input_data_type_flags_t" }, { - "desc": "[out] Supported output data types when bdpas dot product capability is supported.", + "desc": "[out] Supported output / accumulator data types for the block-scaled systolic dot-product (BDPAS) path. Valid only when at least one of the DEVICE_SYSTOLIC_BDPAS_* bits in $x_device_dp_capability_flags_t is set in dp_caps; a value of 0 indicates no supported output types for this path.", "name": "bdpas_output_types", "type": "$x_device_output_data_type_flags_t" } @@ -87785,11 +88856,31 @@ "value": "0" }, { + "desc": "lower priority than normal", + "name": "$X_COMMAND_QUEUE_PRIORITY_LOW", + "value": "1", + "version": "1.21" + }, + { + "desc": "higher priority than normal", + "name": "$X_COMMAND_QUEUE_PRIORITY_HIGH", + "value": "2", + "version": "1.21" + }, + { + "deprecated": { + "since": "1.21", + "use": "$X_COMMAND_QUEUE_PRIORITY_LOW" + }, "desc": "lower priority than normal", "name": "$X_COMMAND_QUEUE_PRIORITY_PRIORITY_LOW", "value": "1" }, { + "deprecated": { + "since": "1.21", + "use": "$X_COMMAND_QUEUE_PRIORITY_HIGH" + }, "desc": "higher priority than normal", "name": "$X_COMMAND_QUEUE_PRIORITY_PRIORITY_HIGH", "value": "2" @@ -87822,7 +88913,7 @@ "type": "uint32_t" }, { - "desc": "[in] command queue index within the group;\nmust be zero. \n", + "desc": "[in] command queue index within the group;\nzero-based, so it must be less than the `numQueues` member of $x_command_queue_group_properties_t for the command queue group.\n", "name": "index", "type": "uint32_t" }, @@ -87945,7 +89036,7 @@ "$X_RESULT_ERROR_INVALID_ENUMERATION": [ "`0x7 < desc->flags`", "`$X_COMMAND_QUEUE_MODE_ASYNCHRONOUS < desc->mode`", - "`$X_COMMAND_QUEUE_PRIORITY_PRIORITY_HIGH < desc->priority`" + "`$X_COMMAND_QUEUE_PRIORITY_HIGH < desc->priority`" ] }, { @@ -88930,7 +90021,7 @@ "$X_RESULT_ERROR_INVALID_ENUMERATION": [ "`0x7 < altdesc->flags`", "`$X_COMMAND_QUEUE_MODE_ASYNCHRONOUS < altdesc->mode`", - "`$X_COMMAND_QUEUE_PRIORITY_PRIORITY_HIGH < altdesc->priority`" + "`$X_COMMAND_QUEUE_PRIORITY_HIGH < altdesc->priority`" ] }, { @@ -89262,6 +90353,7 @@ "details": [ "The application must call this function only with command lists created with $xCommandListCreateImmediate.", "Waiting on one immediate command list shall not block the concurrent execution of commands appended to other\nimmediate command lists created with either a different ordinal or different index.\n", + "Some implementations may associate immediate command lists created with the same ordinal and index with the same hardware queue.\nIn that case, this function may also wait for commands appended to the other immediate command lists before\nthe last command appended to this command list, and may return $X_RESULT_NOT_READY while those commands are not complete.\n", "The application may call this function from simultaneous threads.", "The implementation of this function should be lock-free." ], @@ -103909,7 +105001,7 @@ "since": "1.7", "use": "$X_CACHE_EXT_REGION_NON_RESERVED" }, - "desc": "utilize non-reserverd region", + "desc": "utilize non-reserved region", "name": "$X_CACHE_EXT_REGION_$X_CACHE_NON_RESERVED_REGION", "value": "2" }, @@ -103926,7 +105018,7 @@ "version": "1.7" }, { - "desc": "utilize non-reserverd region", + "desc": "utilize non-reserved region", "name": "$X_CACHE_EXT_REGION_NON_RESERVED", "value": "2", "version": "1.7" @@ -105481,7 +106573,7 @@ { "desc": "[in] Is sRGB.", "name": "sRGB", - "type": "ze_bool_t" + "type": "$x_bool_t" } ], "name": "$x_srgb_ext_desc_t", @@ -109589,7 +110681,7 @@ "type": "uint8_t" }, { - "desc": "[in] format of the specified transformation", + "desc": "[in] format of the specified transformation, must be $X_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_FLOAT3X4_COLUMN_MAJOR, $X_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_FLOAT3X4_ALIGNED_COLUMN_MAJOR, or $X_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_FLOAT3X4_ROW_MAJOR", "name": "transformFormat", "type": "$x_rtas_builder_packed_input_data_format_exp_t" }, @@ -114802,7 +115894,7 @@ "type": "uint8_t" }, { - "desc": "[in] format of the specified transformation", + "desc": "[in] format of the specified transformation, must be $X_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_FLOAT3X4_COLUMN_MAJOR, $X_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_FLOAT3X4_ALIGNED_COLUMN_MAJOR, or $X_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_FLOAT3X4_ROW_MAJOR", "name": "transformFormat", "type": "$x_rtas_builder_packed_input_data_format_ext_t" }, @@ -118055,7 +119147,12 @@ }, { "$X_RESULT_ERROR_INVALID_ARGUMENT": [ - "Graph is not in a recording state" + "Capture into `hGraph` is already paused" + ] + }, + { + "$X_RESULT_ERROR_COMMAND_LIST_NOT_CAPTURING": [ + "Capture into `hGraph` was never started or has already ended" ] } ], @@ -118120,7 +119217,13 @@ }, { "$X_RESULT_ERROR_INVALID_ARGUMENT": [ - "Graph is not in a paused state" + "Capture into `hGraph` is not paused", + "The command list from which `hGraph` was recording is capturing into another graph" + ] + }, + { + "$X_RESULT_ERROR_COMMAND_LIST_NOT_CAPTURING": [ + "Capture into `hGraph` was never started or has already ended" ] } ], @@ -118537,7 +119640,7 @@ }, { "$X_RESULT_ERROR_INVALID_ENUMERATION": [ - "`$X_COMMAND_QUEUE_PRIORITY_PRIORITY_HIGH < priority`" + "`$X_COMMAND_QUEUE_PRIORITY_HIGH < priority`" ] }, { @@ -121164,6 +122267,11 @@ }, { "class": "$tTracerExp", + "deprecated": { + "reason": "Only used by the deprecated API Tracing extension.", + "since": "1.14", + "use": "L0 Loader API Tracing " + }, "desc": "Handle of tracer object", "name": "$t_tracer_exp_handle_t", "type": "handle", @@ -124384,7 +125492,7 @@ }, { "$X_RESULT_WARNING_DROPPED_DATA": [ - "Metric streamer data may have been dropped. Reduce sampling period." + "Metric streamer data may have been dropped. Increase the streamer sampling period or read the streamer data more frequently." ] } ], @@ -126182,6 +127290,11 @@ "`nullptr == pSetCount`", "`nullptr == pTotalMetricValueCount`" ] + }, + { + "$X_RESULT_WARNING_DROPPED_DATA": [ + "Metric streamer data may have been dropped. Increase the streamer sampling period or read the streamer data more frequently." + ] } ], "type": "function", @@ -126641,6 +127754,11 @@ "`nullptr == pSetCount`", "`nullptr == pTotalMetricValueCount`" ] + }, + { + "$X_RESULT_WARNING_DROPPED_DATA": [ + "Metric streamer data may have been dropped. Increase the streamer sampling period or read the streamer data more frequently." + ] } ], "type": "function", @@ -127654,7 +128772,7 @@ "The metric groups created using this API are managed by the application and cannot be retrieved using $tMetricGroupGet().", "The created metric groups are ready for activation and collection." ], - "hash": "ee04ae2896c387da5871785e7599c03a4d78d896df59a843f7776ff538f754ec", + "hash": "c6c0b3b798b9fb7baee89aee1f375968c9afb4c81f53f1e9d221aba6bd58f486", "name": "CreateMetricGroupsFromMetricsExp", "ordinal": "2", "params": [ @@ -127669,9 +128787,9 @@ "type": "uint32_t" }, { - "desc": "[in] metric handles to be added to the metric groups.", + "desc": "[in][range(0, metricCount)] array of metric handles to be added to the metric groups.", "name": "phMetrics", - "type": "zet_metric_handle_t *" + "type": "$t_metric_handle_t*" }, { "desc": "[in] prefix to the name created for the metric groups. Must point to a null-terminated character array no longer than $T_MAX_METRIC_GROUP_NAME_PREFIX_EXP.", @@ -127738,6 +128856,11 @@ "`nullptr == hDevice`" ] }, + { + "$X_RESULT_ERROR_INVALID_NULL_POINTER": [ + "`nullptr == phMetrics`" + ] + }, { "$X_RESULT_ERROR_INVALID_ARGUMENT": [ "metricGroupCount is lesser than the number of metric group handles that could be created." @@ -129730,6 +130853,27 @@ }, "name": "common", "objects": [ + { + "desc": "Generates generic $OneApi Sysman API versions", + "name": "$S_MAKE_VERSION( _major, _minor )", + "type": "macro", + "value": "(( _major << 16 )|( _minor & 0x0000ffff))", + "version": "1.21" + }, + { + "desc": "Extracts $OneApi Sysman API major version", + "name": "$S_MAJOR_VERSION( _ver )", + "type": "macro", + "value": "( _ver >> 16 )", + "version": "1.21" + }, + { + "desc": "Extracts $OneApi Sysman API minor version", + "name": "$S_MINOR_VERSION( _ver )", + "type": "macro", + "value": "( _ver & 0x0000ffff )", + "version": "1.21" + }, { "alias": "$x_driver_handle_t", "class": "$sDriver", @@ -130275,6 +131419,18 @@ "name": "$S_STRUCTURE_TYPE_DEVICE_GPU_TOPOLOGY_EXT_PROPERTIES", "value": "0x00020027", "version": "1.20" + }, + { + "desc": "$s_device_soc_uid_ext_properties_t", + "name": "$S_STRUCTURE_TYPE_DEVICE_SOC_UID_EXT_PROPERTIES", + "value": "0x00020028", + "version": "1.21" + }, + { + "desc": "$s_info_log_decodable_field_info_ext_t", + "name": "$S_STRUCTURE_TYPE_INFO_LOG_DECODABLE_FIELD_INFO_EXT", + "value": "0x00020029", + "version": "1.21" } ], "name": "$s_structure_type_t", @@ -130709,56 +131865,180 @@ "type": "function", "version": "1.19" }, - { - "desc": "Maximum extension name string size", - "name": "$S_MAX_EXTENSION_NAME", - "type": "macro", - "value": "256", - "version": "1.8" - }, { "class": "$sDriver", - "desc": "Extension properties queried using $sDriverGetExtensionProperties", - "members": [ + "desc": "Supported sysman API versions", + "details": [ + "API versions contain major and minor attributes, use $S_MAJOR_VERSION and $S_MINOR_VERSION" + ], + "etors": [ { - "desc": "[out] extension name", - "name": "name[$S_MAX_EXTENSION_NAME]", - "type": "char" + "desc": "version 1.0", + "name": "$S_API_VERSION_1_0", + "value": "$S_MAKE_VERSION( 1, 0 )" }, { - "desc": "[out] extension version using $X_MAKE_VERSION", - "name": "version", - "type": "uint32_t" + "desc": "version 1.1", + "name": "$S_API_VERSION_1_1", + "value": "$S_MAKE_VERSION( 1, 1 )", + "version": "1.1" + }, + { + "desc": "version 1.2", + "name": "$S_API_VERSION_1_2", + "value": "$S_MAKE_VERSION( 1, 2 )", + "version": "1.2" + }, + { + "desc": "version 1.3", + "name": "$S_API_VERSION_1_3", + "value": "$S_MAKE_VERSION( 1, 3 )", + "version": "1.3" + }, + { + "desc": "version 1.4", + "name": "$S_API_VERSION_1_4", + "value": "$S_MAKE_VERSION( 1, 4 )", + "version": "1.4" + }, + { + "desc": "version 1.5", + "name": "$S_API_VERSION_1_5", + "value": "$S_MAKE_VERSION( 1, 5 )", + "version": "1.5" + }, + { + "desc": "version 1.6", + "name": "$S_API_VERSION_1_6", + "value": "$S_MAKE_VERSION( 1, 6 )", + "version": "1.6" + }, + { + "desc": "version 1.7", + "name": "$S_API_VERSION_1_7", + "value": "$S_MAKE_VERSION( 1, 7 )", + "version": "1.7" + }, + { + "desc": "version 1.8", + "name": "$S_API_VERSION_1_8", + "value": "$S_MAKE_VERSION( 1, 8 )", + "version": "1.8" + }, + { + "desc": "version 1.9", + "name": "$S_API_VERSION_1_9", + "value": "$S_MAKE_VERSION( 1, 9 )", + "version": "1.9" + }, + { + "desc": "version 1.10", + "name": "$S_API_VERSION_1_10", + "value": "$S_MAKE_VERSION( 1, 10 )", + "version": "1.10" + }, + { + "desc": "version 1.11", + "name": "$S_API_VERSION_1_11", + "value": "$S_MAKE_VERSION( 1, 11 )", + "version": "1.11" + }, + { + "desc": "version 1.12", + "name": "$S_API_VERSION_1_12", + "value": "$S_MAKE_VERSION( 1, 12 )", + "version": "1.12" + }, + { + "desc": "version 1.13", + "name": "$S_API_VERSION_1_13", + "value": "$S_MAKE_VERSION( 1, 13 )", + "version": "1.13" + }, + { + "desc": "version 1.14", + "name": "$S_API_VERSION_1_14", + "value": "$S_MAKE_VERSION( 1, 14 )", + "version": "1.14" + }, + { + "desc": "version 1.15", + "name": "$S_API_VERSION_1_15", + "value": "$S_MAKE_VERSION( 1, 15 )", + "version": "1.15" + }, + { + "desc": "version 1.16", + "name": "$S_API_VERSION_1_16", + "value": "$S_MAKE_VERSION( 1, 16 )", + "version": "1.16" + }, + { + "desc": "version 1.17", + "name": "$S_API_VERSION_1_17", + "value": "$S_MAKE_VERSION( 1, 17 )", + "version": "1.17" + }, + { + "desc": "version 1.18", + "name": "$S_API_VERSION_1_18", + "value": "$S_MAKE_VERSION( 1, 18 )", + "version": "1.18" + }, + { + "desc": "version 1.19", + "name": "$S_API_VERSION_1_19", + "value": "$S_MAKE_VERSION( 1, 19 )", + "version": "1.19" + }, + { + "desc": "version 1.20", + "name": "$S_API_VERSION_1_20", + "value": "$S_MAKE_VERSION( 1, 20 )", + "version": "1.20" + }, + { + "desc": "version 1.21", + "name": "$S_API_VERSION_1_21", + "value": "$S_MAKE_VERSION( 1, 21 )", + "version": "1.21" + }, + { + "desc": "latest known version", + "name": "$S_API_VERSION_CURRENT", + "value": "$S_MAKE_VERSION( 1, 21 )" } ], - "name": "$s_driver_extension_properties_t", - "type": "struct", - "version": "1.8" + "name": "$s_api_version_t", + "type": "enum", + "version": "1.21" + }, + { + "desc": "Current sysman API version as a macro", + "name": "$S_API_VERSION_CURRENT_M", + "type": "macro", + "value": "$S_MAKE_VERSION( 1, 21 )", + "version": "1.21" }, { "class": "$sDriver", - "desc": "Retrieves extension properties", + "desc": "Returns the API version supported by the specified sysman driver", "details": [ "The application may call this function from simultaneous threads.", "The implementation of this function should be lock-free." ], - "hash": "dff8b1c749c24800e4522d72ec77d0d2f80e86dcd753f1f4131dfd642cffd285", - "name": "GetExtensionProperties", + "hash": "76e70d42b083d89e1a534d565b1e6c5ed4b36e00f2f580d750054607f94b8bde", + "name": "GetApiVersion", "params": [ { - "desc": "[in] handle of the driver instance", + "desc": "[in] handle of the sysman driver instance", "name": "hDriver", "type": "$s_driver_handle_t" }, { - "desc": "[in,out] pointer to the number of extension properties.\nif count is zero, then the driver shall update the value with the total number of extension properties available.\nif count is greater than the number of extension properties available, then the driver shall update the value with the correct number of extension properties available.\n", - "name": "pCount", - "type": "uint32_t*" - }, - { - "desc": "[in,out][optional][range(0, *pCount)] array of query results for extension properties.\nif count is less than the number of extension properties available, then driver shall only retrieve that number of extension properties.\n", - "name": "pExtensionProperties", - "type": "$s_driver_extension_properties_t*" + "desc": "[out] api version", + "name": "pVersion", + "type": "$s_api_version_t*" } ], "return_desc": "[out] ze_result_t API result", @@ -130810,22 +132090,48 @@ }, { "$X_RESULT_ERROR_INVALID_NULL_POINTER": [ - "`nullptr == pCount`" + "`nullptr == pVersion`" ] } ], "type": "function", + "version": "1.21" + }, + { + "desc": "Maximum extension name string size", + "name": "$S_MAX_EXTENSION_NAME", + "type": "macro", + "value": "256", "version": "1.8" }, { "class": "$sDriver", - "desc": "Retrieves function pointer for vendor-specific or experimental extensions", + "desc": "Extension properties queried using $sDriverGetExtensionProperties", + "members": [ + { + "desc": "[out] extension name", + "name": "name[$S_MAX_EXTENSION_NAME]", + "type": "char" + }, + { + "desc": "[out] extension version using $X_MAKE_VERSION", + "name": "version", + "type": "uint32_t" + } + ], + "name": "$s_driver_extension_properties_t", + "type": "struct", + "version": "1.8" + }, + { + "class": "$sDriver", + "desc": "Retrieves extension properties", "details": [ "The application may call this function from simultaneous threads.", "The implementation of this function should be lock-free." ], - "hash": "f9e53cbf6dd9fb646d04ca02d88d69da064b659dcd4e935e0a8a799656259ffc", - "name": "GetExtensionFunctionAddress", + "hash": "dff8b1c749c24800e4522d72ec77d0d2f80e86dcd753f1f4131dfd642cffd285", + "name": "GetExtensionProperties", "params": [ { "desc": "[in] handle of the driver instance", @@ -130833,14 +132139,96 @@ "type": "$s_driver_handle_t" }, { - "desc": "[in] extension function name", - "name": "name", - "type": "const char*" + "desc": "[in,out] pointer to the number of extension properties.\nif count is zero, then the driver shall update the value with the total number of extension properties available.\nif count is greater than the number of extension properties available, then the driver shall update the value with the correct number of extension properties available.\n", + "name": "pCount", + "type": "uint32_t*" }, { - "desc": "[out] pointer to function pointer", - "name": "ppFunctionAddress", - "type": "void**" + "desc": "[in,out][optional][range(0, *pCount)] array of query results for extension properties.\nif count is less than the number of extension properties available, then driver shall only retrieve that number of extension properties.\n", + "name": "pExtensionProperties", + "type": "$s_driver_extension_properties_t*" + } + ], + "return_desc": "[out] ze_result_t API result", + "return_type": "ze_result_t", + "returns": [ + { + "$X_RESULT_SUCCESS": [] + }, + { + "$X_RESULT_ERROR_UNINITIALIZED": [] + }, + { + "$X_RESULT_ERROR_DEVICE_LOST": [] + }, + { + "$X_RESULT_ERROR_OUT_OF_HOST_MEMORY": [] + }, + { + "$X_RESULT_ERROR_OUT_OF_DEVICE_MEMORY": [] + }, + { + "$X_RESULT_ERROR_INVALID_ARGUMENT": [] + }, + { + "$X_RESULT_ERROR_UNSUPPORTED_FEATURE": [] + }, + { + "$X_RESULT_ERROR_DEPENDENCY_UNAVAILABLE": [] + }, + { + "$X_RESULT_ERROR_INSUFFICIENT_PERMISSIONS": [] + }, + { + "$X_RESULT_ERROR_NOT_AVAILABLE": [] + }, + { + "$X_RESULT_ERROR_DEVICE_REQUIRES_RESET": [] + }, + { + "$X_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE": [] + }, + { + "$X_RESULT_ERROR_UNKNOWN": [] + }, + { + "$X_RESULT_ERROR_INVALID_NULL_HANDLE": [ + "`nullptr == hDriver`" + ] + }, + { + "$X_RESULT_ERROR_INVALID_NULL_POINTER": [ + "`nullptr == pCount`" + ] + } + ], + "type": "function", + "version": "1.8" + }, + { + "class": "$sDriver", + "desc": "Retrieves function pointer for vendor-specific or experimental extensions", + "details": [ + "The application may call this function from simultaneous threads.", + "The implementation of this function should be lock-free." + ], + "hash": "f9e53cbf6dd9fb646d04ca02d88d69da064b659dcd4e935e0a8a799656259ffc", + "name": "GetExtensionFunctionAddress", + "params": [ + { + "desc": "[in] handle of the driver instance", + "name": "hDriver", + "type": "$s_driver_handle_t" + }, + { + "desc": "[in] extension function name", + "name": "name", + "type": "const char*" + }, + { + "desc": "[out] pointer to function pointer", + "name": "ppFunctionAddress", + "type": "void**" } ], "return_desc": "[out] ze_result_t API result", @@ -131162,7 +132550,7 @@ { "desc": "[in] If set to true, all applications that are currently using the device will be forcibly killed.\n", "name": "force", - "type": "ze_bool_t" + "type": "$x_bool_t" }, { "desc": "[in] Type of reset needs to be performed", @@ -131240,7 +132628,7 @@ { "base": "$s_base_properties_t", "class": "$sDevice", - "desc": "Device properties. To get OEM Serial ID, pNext member of this structure should point to an instance of ${s}_oem_serial_id_ext_properties_t with its stype set to $S_STRUCTURE_TYPE_OEM_SERIAL_ID_EXT_PROPERTIES. To get Device Index, pNext member of this structure should point to an instance of ${s}_device_index_ext_properties_t with its stype set to $S_STRUCTURE_TYPE_DEVICE_INDEX_EXT_PROPERTIES. To get the GPU topology of the device, pNext member of this structure should point to an instance of ${s}_device_gpu_topology_ext_properties_t with its stype set to $S_STRUCTURE_TYPE_DEVICE_GPU_TOPOLOGY_EXT_PROPERTIES.", + "desc": "Device properties. To get OEM Serial ID, pNext member of this structure should point to an instance of ${s}_oem_serial_id_ext_properties_t with its stype set to $S_STRUCTURE_TYPE_OEM_SERIAL_ID_EXT_PROPERTIES. To get Device Index, pNext member of this structure should point to an instance of ${s}_device_index_ext_properties_t with its stype set to $S_STRUCTURE_TYPE_DEVICE_INDEX_EXT_PROPERTIES. To get the GPU topology of the device, pNext member of this structure should point to an instance of ${s}_device_gpu_topology_ext_properties_t with its stype set to $S_STRUCTURE_TYPE_DEVICE_GPU_TOPOLOGY_EXT_PROPERTIES. To get the SOC unique ID of the device, pNext member of this structure should point to an instance of $s_device_soc_uid_ext_properties_t with its stype set to $S_STRUCTURE_TYPE_DEVICE_SOC_UID_EXT_PROPERTIES. To get the UUID, type and flags of the device, pNext member of this structure should point to an instance of $s_device_ext_properties_t with its stype set to $S_STRUCTURE_TYPE_DEVICE_EXT_PROPERTIES.", "members": [ { "desc": "[in] type of this structure", @@ -131256,6 +132644,7 @@ }, { "deprecated": { + "reason": "Get the UUID, type and flags through pNext.", "since": "1.7", "use": "$s_device_ext_properties_t" }, @@ -131404,7 +132793,8 @@ "details": [ "The application may call this function from simultaneous threads.", "The implementation of this function should be lock-free.", - "To get the GPU topology of the device, the application may pass $s_device_gpu_topology_ext_properties_t in the pNext chain of pProperties." + "To get the GPU topology of the device, the application may pass $s_device_gpu_topology_ext_properties_t in the pNext chain of pProperties.", + "To get the SOC unique ID of the device, the application may pass $s_device_soc_uid_ext_properties_t in the pNext chain of pProperties." ], "hash": "c558d1b867032600d877bf98f17dfab339d27cf77a33bb46c846981ac08d0fd0", "name": "GetProperties", @@ -146351,17 +147741,17 @@ { "desc": "[out] indicates if the power limit state (enabled/ignored) can be set (false) or is locked (true).", "name": "enabledStateLocked", - "type": "ze_bool_t" + "type": "$x_bool_t" }, { "desc": "[in,out] indicates if the limit is enabled (true) or ignored (false). If enabledStateIsLocked is True, this value is ignored.", "name": "enabled", - "type": "ze_bool_t" + "type": "$x_bool_t" }, { "desc": "[out] indicates if the interval can be modified (false) or is fixed (true).", "name": "intervalValueLocked", - "type": "ze_bool_t" + "type": "$x_bool_t" }, { "desc": "[in,out] power averaging window in milliseconds. If intervalValueLocked is true, this value is ignored.", @@ -146371,7 +147761,7 @@ { "desc": "[out] indicates if the limit can be set (false) or if the limit is fixed (true).", "name": "limitValueLocked", - "type": "ze_bool_t" + "type": "$x_bool_t" }, { "desc": "[in,out] limit value. If limitValueLocked is true, this value is ignored. The value should be provided in the unit specified by limitUnit.", @@ -146411,7 +147801,7 @@ "type": "$s_power_domain_t" }, { - "desc": "[out] the factory default limit of the part.", + "desc": "[in,out][optional] pointer to a caller-allocated $s_power_limit_ext_desc_t\nthat the driver fills with the factory default limit of the part.\nThe application must allocate and initialize (including `stype`) the pointed-to\nstructure and assign its address before calling $sPowerGetProperties.\nIf this is null, the factory default limit will not be returned.\n", "name": "defaultLimit", "type": "$s_power_limit_ext_desc_t*" } @@ -150391,10 +151781,16 @@ "value": "$X_MAKE_VERSION( 1, 0 )", "version": "1.19" }, + { + "desc": "version 1.1", + "name": "$S_INFO_LOGS_EXT_VERSION_1_1", + "value": "$X_MAKE_VERSION( 1, 1 )", + "version": "1.21" + }, { "desc": "latest known version", "name": "$S_INFO_LOGS_EXT_VERSION_CURRENT", - "value": "$X_MAKE_VERSION( 1, 0 )" + "value": "$X_MAKE_VERSION( 1, 1 )" } ], "name": "$s_info_logs_ext_version_t", @@ -151018,77 +152414,644 @@ }, { "$X_RESULT_ERROR_INVALID_NULL_HANDLE": [ - "`nullptr == hInfoLogInstance`" + "`nullptr == hInfoLogInstance`" + ] + }, + { + "$X_RESULT_ERROR_INVALID_NULL_POINTER": [ + "`nullptr == pSize`", + "`nullptr == pRecordCount`" + ] + }, + { + "$X_RESULT_WARNING_DROPPED_DATA": [ + "One or more records were dropped because the collection buffer overflowed. The number of records dropped is reported in $s_info_log_read_status_ext_t." + ] + }, + { + "$X_RESULT_ERROR_INSUFFICIENT_PERMISSIONS": [ + "User does not have permissions to read info log records." + ] + } + ], + "type": "function", + "version": "1.19" + }, + { + "class": "$sInfoLogInstance", + "desc": "Read collected info log records and their metadata without consuming them", + "details": [ + "This function is equivalent to $sInfoLogInstanceReadWithMetadataExt, except that the records it returns are not consumed and remain available to subsequent calls to either function.", + "Reading records without consuming them is only supported when isPeekDataSupported of $s_info_log_ext_properties_t is true.", + "As with $sInfoLogInstanceReadWithMetadataExt, a call in which `*pSize` is zero or `*pRecordCount` is zero on input is a query call, which reports the total size, in bytes, of the record data and the total number of records that were found without writing to `pBuffer` or `pDescriptors`.", + "The application should then call this function with `*pSize` and `*pRecordCount` both non-zero to inspect the records that are available.", + "The application must not call this function from simultaneous threads.", + "The application must not call this function and $sInfoLogInstanceReadWithMetadataExt simultaneously with the same handle." + ], + "hash": "d8c0da8b03e1531fcd953f7b88963c49d8f9dfd8166518bb0e49e7c05ac02f86", + "name": "PeekWithMetadataExt", + "params": [ + { + "desc": "[in] handle of the info log collection instance", + "name": "hInfoLogInstance", + "type": "$s_info_log_instance_handle_t" + }, + { + "desc": "[in] maximum time, in milliseconds, that this function may spend searching the collection instance for records.\nif zero, then the function shall return immediately without searching.\nif `UINT64_MAX`, then the function shall not return until it has searched all of the data held by the collection instance.\nwhen this time elapses, the function shall return $X_RESULT_SUCCESS with the records it has found so far, which may be none.\ndue to external dependencies, timeout may be rounded to the closest value allowed by the accuracy of those dependencies.\n", + "name": "timeout", + "type": "uint64_t" + }, + { + "desc": "[in,out] pointer to the size, in bytes, of the record data.\non input, the value is the size of `pBuffer`.\nif the value is zero, or if `*pRecordCount` is zero, then this is a query call: the driver shall update the value with the total size of the record data that was found.\notherwise, on output the driver shall update the value with the size of the record data written to `pBuffer`.\n", + "name": "pSize", + "type": "uint32_t*" + }, + { + "desc": "[in,out][optional][range(0, *pSize)] buffer that will contain the record data.\nthe driver shall not write to this buffer on a query call, and the application may pass nullptr for such a call.\n", + "name": "pBuffer", + "type": "uint8_t*" + }, + { + "desc": "[in,out] pointer to the number of records.\non input, the value is the number of elements in `pDescriptors`.\nif the value is zero, or if `*pSize` is zero, then this is a query call: the driver shall update the value with the total number of records that were found.\notherwise, on output the driver shall update the value with the number of records written to `pDescriptors`.\n", + "name": "pRecordCount", + "type": "uint32_t*" + }, + { + "desc": "[in,out][optional][range(0, *pRecordCount)] array of metadata describing each record written to `pBuffer`.\nthe driver shall not write to this array on a query call, and the application may pass nullptr for such a call.\nthe application must initialize the stype member of each element in the array.\n", + "name": "pDescriptors", + "type": "$s_info_log_metadata_ext_t*" + }, + { + "desc": "[in,out][optional] pointer to a structure that will contain the status of this call.\nif nullptr, then the driver shall not report the status of this call, and the application cannot determine whether records were dropped or whether records remain available.\nthe application must initialize the stype member.\n", + "name": "pReadStatus", + "type": "$s_info_log_read_status_ext_t*" + } + ], + "return_desc": "[out] ze_result_t API result", + "return_type": "ze_result_t", + "returns": [ + { + "$X_RESULT_SUCCESS": [] + }, + { + "$X_RESULT_ERROR_UNINITIALIZED": [] + }, + { + "$X_RESULT_ERROR_DEVICE_LOST": [] + }, + { + "$X_RESULT_ERROR_OUT_OF_HOST_MEMORY": [] + }, + { + "$X_RESULT_ERROR_OUT_OF_DEVICE_MEMORY": [] + }, + { + "$X_RESULT_ERROR_INVALID_ARGUMENT": [] + }, + { + "$X_RESULT_ERROR_DEPENDENCY_UNAVAILABLE": [] + }, + { + "$X_RESULT_ERROR_NOT_AVAILABLE": [] + }, + { + "$X_RESULT_ERROR_DEVICE_REQUIRES_RESET": [] + }, + { + "$X_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE": [] + }, + { + "$X_RESULT_ERROR_UNKNOWN": [] + }, + { + "$X_RESULT_ERROR_INVALID_NULL_HANDLE": [ + "`nullptr == hInfoLogInstance`" + ] + }, + { + "$X_RESULT_ERROR_INVALID_NULL_POINTER": [ + "`nullptr == pSize`", + "`nullptr == pRecordCount`" + ] + }, + { + "$X_RESULT_ERROR_UNSUPPORTED_FEATURE": [ + "isPeekDataSupported of $s_info_log_ext_properties_t is false." + ] + }, + { + "$X_RESULT_WARNING_DROPPED_DATA": [ + "One or more records were dropped because the collection buffer overflowed. The number of records dropped is reported in $s_info_log_read_status_ext_t." + ] + }, + { + "$X_RESULT_ERROR_INSUFFICIENT_PERMISSIONS": [ + "User does not have permissions to read info log records." + ] + } + ], + "type": "function", + "version": "1.19" + }, + { + "class": "$sInfoLogInstance", + "desc": "Delete a collection instance of an info log", + "details": [ + "Deleting a collection instance stops the collection of records into that instance and releases the resources used by the instance.", + "The application must ensure that no other function is using the handle when calling this function.", + "The application must not call this function from simultaneous threads with the same handle.", + "The implementation of this function must be thread-safe." + ], + "hash": "302680384c2f4d5ab5514e21b1c26228d5e749d6d8626d7895ac9f0cdaaee594", + "name": "DeleteExt", + "params": [ + { + "desc": "[in][release] handle of the info log collection instance to delete", + "name": "hInfoLogInstance", + "type": "$s_info_log_instance_handle_t" + } + ], + "return_desc": "[out] ze_result_t API result", + "return_type": "ze_result_t", + "returns": [ + { + "$X_RESULT_SUCCESS": [] + }, + { + "$X_RESULT_ERROR_UNINITIALIZED": [] + }, + { + "$X_RESULT_ERROR_DEVICE_LOST": [] + }, + { + "$X_RESULT_ERROR_OUT_OF_HOST_MEMORY": [] + }, + { + "$X_RESULT_ERROR_OUT_OF_DEVICE_MEMORY": [] + }, + { + "$X_RESULT_ERROR_INVALID_ARGUMENT": [] + }, + { + "$X_RESULT_ERROR_UNSUPPORTED_FEATURE": [] + }, + { + "$X_RESULT_ERROR_DEPENDENCY_UNAVAILABLE": [] + }, + { + "$X_RESULT_ERROR_INSUFFICIENT_PERMISSIONS": [] + }, + { + "$X_RESULT_ERROR_NOT_AVAILABLE": [] + }, + { + "$X_RESULT_ERROR_DEVICE_REQUIRES_RESET": [] + }, + { + "$X_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE": [] + }, + { + "$X_RESULT_ERROR_UNKNOWN": [] + }, + { + "$X_RESULT_ERROR_INVALID_NULL_HANDLE": [ + "`nullptr == hInfoLogInstance`" + ] + } + ], + "type": "function", + "version": "1.19" + }, + { + "desc": "C++ wrapper for a Sysman info log", + "members": [ + { + "desc": "[in] handle of Sysman info log object", + "name": "handle", + "type": "$s_info_log_handle_t" + } + ], + "name": "$sInfoLog", + "owner": "$sDriver", + "type": "class", + "version": "1.19" + }, + { + "desc": "C++ wrapper for a Sysman info log collection instance", + "members": [ + { + "desc": "[in] handle of Sysman info log collection instance object", + "name": "handle", + "type": "$s_info_log_instance_handle_t" + } + ], + "name": "$sInfoLogInstance", + "owner": "$sInfoLog", + "type": "class", + "version": "1.19" + }, + { + "desc": "Maximum number of characters in the description of a decodable field, including the null terminator.", + "name": "$S_INFO_LOG_FIELD_DESC_SIZE", + "type": "macro", + "value": "256", + "version": "1.21" + }, + { + "class": "$sInfoLogDecoderContext", + "desc": "Handle for a Sysman info log decoder context", + "name": "$s_info_log_decoder_context_handle_t", + "type": "handle", + "version": "1.21" + }, + { + "class": "$sInfoLogDecoderContext", + "desc": "Data types of a field decoded from an info log record", + "etors": [ + { + "desc": "The value of the field is a `uint32_t`.", + "name": "$S_INFO_LOG_FIELD_TYPE_EXT_UINT32", + "value": "0", + "version": "1.21" + }, + { + "desc": "The value of the field is an `int64_t`.", + "name": "$S_INFO_LOG_FIELD_TYPE_EXT_INT64", + "value": "1", + "version": "1.21" + }, + { + "desc": "The value of the field is a `double`.", + "name": "$S_INFO_LOG_FIELD_TYPE_EXT_DOUBLE", + "value": "2", + "version": "1.21" + }, + { + "desc": "The value of the field is a null terminated array of `char`.", + "name": "$S_INFO_LOG_FIELD_TYPE_EXT_STRING", + "value": "3", + "version": "1.21" + }, + { + "desc": "The value of the field is an array of uninterpreted bytes.", + "name": "$S_INFO_LOG_FIELD_TYPE_EXT_RAW_BYTES", + "value": "4", + "version": "1.21" + } + ], + "name": "$s_info_log_field_type_ext_t", + "type": "enum", + "version": "1.21" + }, + { + "base": "$s_base_properties_t", + "class": "$sInfoLogDecoderContext", + "desc": "Description of one field that a decoder context can decode from an info log record", + "details": [ + "An array of these structures is returned by $sInfoLogDecoderContextGetFieldInfoExt, one element per field.", + "The fields that are reported are a property of the format of the info log, reported in infoLogFormat of $s_info_log_ext_properties_t, and not of a batch of records. Whether a given record carries a given field is reported per record by $sInfoLogDecoderContextReadFieldExt.", + "The application must locate a field by `name`, and must then use the `fieldId`, `type` and `requiredBytes` that are reported for that name." + ], + "members": [ + { + "desc": "[in] type of this structure", + "init": "$S_STRUCTURE_TYPE_INFO_LOG_DECODABLE_FIELD_INFO_EXT", + "name": "stype", + "type": "$s_structure_type_t" + }, + { + "desc": "[in,out][optional] must be null or a pointer to an extension-specific structure (i.e. contains stype and pNext).", + "init": "nullptr", + "name": "pNext", + "type": "void*" + }, + { + "desc": "[out] human readable description of the field (NULL terminated string value).", + "name": "desc[$S_INFO_LOG_FIELD_DESC_SIZE]", + "type": "char" + }, + { + "desc": "[out] name of the field (NULL terminated string value).", + "name": "name[$S_STRING_PROPERTY_SIZE]", + "type": "char" + }, + { + "desc": "[out] identifier of the field, to be passed to $sInfoLogDecoderContextReadFieldExt.", + "name": "fieldId", + "type": "uint32_t" + }, + { + "desc": "[out] data type of the value of the field.", + "name": "type", + "type": "$s_info_log_field_type_ext_t" + }, + { + "desc": "[out] number of bytes that the application must provide to $sInfoLogDecoderContextReadFieldExt to read this field.\nFor $S_INFO_LOG_FIELD_TYPE_EXT_STRING this value includes the null terminator.\n", + "name": "requiredBytes", + "type": "size_t" + }, + { + "desc": "[out] number of elements of the data type that the field holds.", + "name": "elementCount", + "type": "size_t" + }, + { + "desc": "[out] version of this extension in which the field was first reported.", + "name": "versionString[$S_STRING_PROPERTY_SIZE]", + "type": "char" + } + ], + "name": "$s_info_log_decodable_field_info_ext_t", + "type": "struct", + "version": "1.21" + }, + { + "class": "$sInfoLogDecoderContext", + "desc": "Create a decoder context for an info log", + "details": [ + "A decoder context decodes the records returned by $sInfoLogInstanceReadWithMetadataExt or by $sInfoLogInstancePeekWithMetadataExt into named fields, which the application reads one at a time using $sInfoLogDecoderContextReadFieldExt.", + "Any number of decoder contexts may exist for one info log.", + "The application may call this function from simultaneous threads." + ], + "hash": "0620d5f7adcdc46285bbaa31379cdacdf54ae87eb39a3b4bacbf5ba114f7e10e", + "name": "CreateExt", + "params": [ + { + "desc": "[in] handle of the info log that the records are read from", + "name": "hInfoLog", + "type": "$s_info_log_handle_t" + }, + { + "desc": "[out] handle of the decoder context that was created.", + "name": "phDecoderContext", + "type": "$s_info_log_decoder_context_handle_t*" + } + ], + "return_desc": "[out] ze_result_t API result", + "return_type": "ze_result_t", + "returns": [ + { + "$X_RESULT_SUCCESS": [] + }, + { + "$X_RESULT_ERROR_UNINITIALIZED": [] + }, + { + "$X_RESULT_ERROR_DEVICE_LOST": [] + }, + { + "$X_RESULT_ERROR_OUT_OF_HOST_MEMORY": [] + }, + { + "$X_RESULT_ERROR_OUT_OF_DEVICE_MEMORY": [] + }, + { + "$X_RESULT_ERROR_INVALID_ARGUMENT": [] + }, + { + "$X_RESULT_ERROR_UNSUPPORTED_FEATURE": [] + }, + { + "$X_RESULT_ERROR_DEPENDENCY_UNAVAILABLE": [] + }, + { + "$X_RESULT_ERROR_INSUFFICIENT_PERMISSIONS": [] + }, + { + "$X_RESULT_ERROR_NOT_AVAILABLE": [] + }, + { + "$X_RESULT_ERROR_DEVICE_REQUIRES_RESET": [] + }, + { + "$X_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE": [] + }, + { + "$X_RESULT_ERROR_UNKNOWN": [] + }, + { + "$X_RESULT_ERROR_INVALID_NULL_HANDLE": [ + "`nullptr == hInfoLog`" + ] + }, + { + "$X_RESULT_ERROR_INVALID_NULL_POINTER": [ + "`nullptr == phDecoderContext`" + ] + } + ], + "type": "function", + "version": "1.21" + }, + { + "class": "$sInfoLogDecoderContext", + "desc": "Get the fields that a decoder context can decode from an info log record", + "details": [ + "The application should first call this function with `pCount` pointing to a value of zero to retrieve the number of fields that can be decoded.", + "A call in which `*pCount` is greater than zero and `pFieldInfos` is nullptr shall report the number of fields and shall not write any descriptor, as a call with a count of zero does.", + "The application may call this function from simultaneous threads." + ], + "hash": "abe21e9a44be187caca5ee20cbf7f75867078369ee159cb2fb566d5be761affa", + "name": "GetFieldInfoExt", + "params": [ + { + "desc": "[in] handle of the decoder context", + "name": "hDecoderContext", + "type": "$s_info_log_decoder_context_handle_t" + }, + { + "desc": "[in,out] pointer to the number of fields that can be decoded.\nif count is zero, then the driver shall update the value with the total number of fields that can be decoded and shall not return any descriptor.\nif count is greater than the number of fields that can be decoded, then the driver shall update the value with the correct number of fields.\n", + "name": "pCount", + "type": "uint32_t*" + }, + { + "desc": "[in,out][optional][range(0, *pCount)] array of field descriptions, one element per field.\nif count is less than the number of fields that can be decoded, then the driver shall only retrieve that number of descriptors.\n", + "name": "pFieldInfos", + "type": "$s_info_log_decodable_field_info_ext_t*" + } + ], + "return_desc": "[out] ze_result_t API result", + "return_type": "ze_result_t", + "returns": [ + { + "$X_RESULT_SUCCESS": [] + }, + { + "$X_RESULT_ERROR_UNINITIALIZED": [] + }, + { + "$X_RESULT_ERROR_DEVICE_LOST": [] + }, + { + "$X_RESULT_ERROR_OUT_OF_HOST_MEMORY": [] + }, + { + "$X_RESULT_ERROR_OUT_OF_DEVICE_MEMORY": [] + }, + { + "$X_RESULT_ERROR_INVALID_ARGUMENT": [] + }, + { + "$X_RESULT_ERROR_UNSUPPORTED_FEATURE": [] + }, + { + "$X_RESULT_ERROR_DEPENDENCY_UNAVAILABLE": [] + }, + { + "$X_RESULT_ERROR_INSUFFICIENT_PERMISSIONS": [] + }, + { + "$X_RESULT_ERROR_NOT_AVAILABLE": [] + }, + { + "$X_RESULT_ERROR_DEVICE_REQUIRES_RESET": [] + }, + { + "$X_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE": [] + }, + { + "$X_RESULT_ERROR_UNKNOWN": [] + }, + { + "$X_RESULT_ERROR_INVALID_NULL_HANDLE": [ + "`nullptr == hDecoderContext`" ] }, { "$X_RESULT_ERROR_INVALID_NULL_POINTER": [ - "`nullptr == pSize`", - "`nullptr == pRecordCount`" + "`nullptr == pCount`" ] + } + ], + "type": "function", + "version": "1.21" + }, + { + "class": "$sInfoLogDecoderContext", + "desc": "Start decoding info log records in a decoder context", + "details": [ + "The application must not call this function from simultaneous threads with the same decoder context handle.", + "The application may call this function from simultaneous threads with different decoder context handles." + ], + "hash": "62584af547a89be936adac4e3609c6130d080f0e4e15e2669f7d6ea53d82a28f", + "name": "DecodeStartExt", + "params": [ + { + "desc": "[in] handle of the decoder context", + "name": "hDecoderContext", + "type": "$s_info_log_decoder_context_handle_t" }, { - "$X_RESULT_WARNING_DROPPED_DATA": [ - "One or more records were dropped because the collection buffer overflowed. The number of records dropped is reported in $s_info_log_read_status_ext_t." - ] + "desc": "[in] size, in bytes, of the record data in `pBuffer`, as returned in `*pSize` by the read or peek call", + "name": "size", + "type": "uint32_t" }, { - "$X_RESULT_ERROR_INSUFFICIENT_PERMISSIONS": [ - "User does not have permissions to read info log records." + "desc": "[in][optional][range(0, size)] the record data, as returned in `pBuffer` by the read or peek call", + "name": "pBuffer", + "type": "const uint8_t*" + }, + { + "desc": "[in] number of records in the batch, as returned in `*pRecordCount` by the read or peek call", + "name": "recordCount", + "type": "uint32_t" + }, + { + "desc": "[in][optional][range(0, recordCount)] array of metadata describing each record, as returned in `pDescriptors` by the read or peek call", + "name": "pDescriptors", + "type": "const $s_info_log_metadata_ext_t*" + } + ], + "return_desc": "[out] ze_result_t API result", + "return_type": "ze_result_t", + "returns": [ + { + "$X_RESULT_SUCCESS": [] + }, + { + "$X_RESULT_ERROR_UNINITIALIZED": [] + }, + { + "$X_RESULT_ERROR_DEVICE_LOST": [] + }, + { + "$X_RESULT_ERROR_OUT_OF_HOST_MEMORY": [] + }, + { + "$X_RESULT_ERROR_OUT_OF_DEVICE_MEMORY": [] + }, + { + "$X_RESULT_ERROR_INVALID_ARGUMENT": [] + }, + { + "$X_RESULT_ERROR_UNSUPPORTED_FEATURE": [] + }, + { + "$X_RESULT_ERROR_DEPENDENCY_UNAVAILABLE": [] + }, + { + "$X_RESULT_ERROR_INSUFFICIENT_PERMISSIONS": [] + }, + { + "$X_RESULT_ERROR_NOT_AVAILABLE": [] + }, + { + "$X_RESULT_ERROR_DEVICE_REQUIRES_RESET": [] + }, + { + "$X_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE": [] + }, + { + "$X_RESULT_ERROR_UNKNOWN": [] + }, + { + "$X_RESULT_ERROR_INVALID_NULL_HANDLE": [ + "`nullptr == hDecoderContext`" ] } ], "type": "function", - "version": "1.19" + "version": "1.21" }, { - "class": "$sInfoLogInstance", - "desc": "Read collected info log records and their metadata without consuming them", + "class": "$sInfoLogDecoderContext", + "desc": "Read field values of one record that a decoder context is decoding", "details": [ - "This function is equivalent to $sInfoLogInstanceReadWithMetadataExt, except that the records it returns are not consumed and remain available to subsequent calls to either function.", - "Reading records without consuming them is only supported when isPeekDataSupported of $s_info_log_ext_properties_t is true.", - "As with $sInfoLogInstanceReadWithMetadataExt, a call in which `*pSize` is zero or `*pRecordCount` is zero on input is a query call, which reports the total size, in bytes, of the record data and the total number of records that were found without writing to `pBuffer` or `pDescriptors`.", - "The application should then call this function with `*pSize` and `*pRecordCount` both non-zero to inspect the records that are available.", - "The application must not call this function from simultaneous threads.", - "The application must not call this function and $sInfoLogInstanceReadWithMetadataExt simultaneously with the same handle." + "The application must not call this function from simultaneous threads with the same decoder context handle.", + "The application may call this function from simultaneous threads with different decoder context handles." ], - "hash": "d8c0da8b03e1531fcd953f7b88963c49d8f9dfd8166518bb0e49e7c05ac02f86", - "name": "PeekWithMetadataExt", + "hash": "450664f556c18c6b4bd8d1c409082affce397fda1ad13eaf1ea23239563db0df", + "name": "ReadFieldExt", "params": [ { - "desc": "[in] handle of the info log collection instance", - "name": "hInfoLogInstance", - "type": "$s_info_log_instance_handle_t" - }, - { - "desc": "[in] maximum time, in milliseconds, that this function may spend searching the collection instance for records.\nif zero, then the function shall return immediately without searching.\nif `UINT64_MAX`, then the function shall not return until it has searched all of the data held by the collection instance.\nwhen this time elapses, the function shall return $X_RESULT_SUCCESS with the records it has found so far, which may be none.\ndue to external dependencies, timeout may be rounded to the closest value allowed by the accuracy of those dependencies.\n", - "name": "timeout", - "type": "uint64_t" + "desc": "[in] handle of the decoder context, which must be decoding a batch", + "name": "hDecoderContext", + "type": "$s_info_log_decoder_context_handle_t" }, { - "desc": "[in,out] pointer to the size, in bytes, of the record data.\non input, the value is the size of `pBuffer`.\nif the value is zero, or if `*pRecordCount` is zero, then this is a query call: the driver shall update the value with the total size of the record data that was found.\notherwise, on output the driver shall update the value with the size of the record data written to `pBuffer`.\n", - "name": "pSize", - "type": "uint32_t*" + "desc": "[in] identifier of the field to read, as reported in `fieldId` of $s_info_log_decodable_field_info_ext_t", + "name": "fieldId", + "type": "uint32_t" }, { - "desc": "[in,out][optional][range(0, *pSize)] buffer that will contain the record data.\nthe driver shall not write to this buffer on a query call, and the application may pass nullptr for such a call.\n", - "name": "pBuffer", - "type": "uint8_t*" + "desc": "[in] index of the record in the `pDescriptors` that was passed to $sInfoLogDecoderContextDecodeStartExt", + "name": "recordId", + "type": "uint32_t" }, { - "desc": "[in,out] pointer to the number of records.\non input, the value is the number of elements in `pDescriptors`.\nif the value is zero, or if `*pSize` is zero, then this is a query call: the driver shall update the value with the total number of records that were found.\notherwise, on output the driver shall update the value with the number of records written to `pDescriptors`.\n", - "name": "pRecordCount", - "type": "uint32_t*" + "desc": "[in,out][range(0, bufferLen)] buffer that will contain the value of the field", + "name": "pOutBuffer", + "type": "void*" }, { - "desc": "[in,out][optional][range(0, *pRecordCount)] array of metadata describing each record written to `pBuffer`.\nthe driver shall not write to this array on a query call, and the application may pass nullptr for such a call.\nthe application must initialize the stype member of each element in the array.\n", - "name": "pDescriptors", - "type": "$s_info_log_metadata_ext_t*" + "desc": "[in] size, in bytes, of `pOutBuffer`", + "name": "bufferLen", + "type": "size_t" }, { - "desc": "[in,out][optional] pointer to a structure that will contain the status of this call.\nif nullptr, then the driver shall not report the status of this call, and the application cannot determine whether records were dropped or whether records remain available.\nthe application must initialize the stype member.\n", - "name": "pReadStatus", - "type": "$s_info_log_read_status_ext_t*" + "desc": "[out] pointer to the number of bytes written to `pOutBuffer`.\nthe driver shall update the value with zero when the record does not carry the field.\n", + "name": "pBytesCopied", + "type": "size_t*" } ], "return_desc": "[out] ze_result_t API result", @@ -151112,9 +153075,15 @@ { "$X_RESULT_ERROR_INVALID_ARGUMENT": [] }, + { + "$X_RESULT_ERROR_UNSUPPORTED_FEATURE": [] + }, { "$X_RESULT_ERROR_DEPENDENCY_UNAVAILABLE": [] }, + { + "$X_RESULT_ERROR_INSUFFICIENT_PERMISSIONS": [] + }, { "$X_RESULT_ERROR_NOT_AVAILABLE": [] }, @@ -151129,50 +153098,106 @@ }, { "$X_RESULT_ERROR_INVALID_NULL_HANDLE": [ - "`nullptr == hInfoLogInstance`" + "`nullptr == hDecoderContext`" ] }, { "$X_RESULT_ERROR_INVALID_NULL_POINTER": [ - "`nullptr == pSize`", - "`nullptr == pRecordCount`" + "`nullptr == pOutBuffer`", + "`nullptr == pBytesCopied`" ] + } + ], + "type": "function", + "version": "1.21" + }, + { + "class": "$sInfoLogDecoderContext", + "desc": "Stop decoding of info log records that a decoder context is decoding", + "details": [ + "The application must not call this function from simultaneous threads with the same decoder context handle.", + "The application may call this function from simultaneous threads with different decoder context handles." + ], + "hash": "d0979f7c4606c70657a0be64ab66ba9866ba0005154f0693017105dc1690238a", + "name": "DecodeStopExt", + "params": [ + { + "desc": "[in] handle of the decoder context", + "name": "hDecoderContext", + "type": "$s_info_log_decoder_context_handle_t" + } + ], + "return_desc": "[out] ze_result_t API result", + "return_type": "ze_result_t", + "returns": [ + { + "$X_RESULT_SUCCESS": [] }, { - "$X_RESULT_ERROR_UNSUPPORTED_FEATURE": [ - "isPeekDataSupported of $s_info_log_ext_properties_t is false." - ] + "$X_RESULT_ERROR_UNINITIALIZED": [] }, { - "$X_RESULT_WARNING_DROPPED_DATA": [ - "One or more records were dropped because the collection buffer overflowed. The number of records dropped is reported in $s_info_log_read_status_ext_t." - ] + "$X_RESULT_ERROR_DEVICE_LOST": [] }, { - "$X_RESULT_ERROR_INSUFFICIENT_PERMISSIONS": [ - "User does not have permissions to read info log records." + "$X_RESULT_ERROR_OUT_OF_HOST_MEMORY": [] + }, + { + "$X_RESULT_ERROR_OUT_OF_DEVICE_MEMORY": [] + }, + { + "$X_RESULT_ERROR_INVALID_ARGUMENT": [] + }, + { + "$X_RESULT_ERROR_UNSUPPORTED_FEATURE": [] + }, + { + "$X_RESULT_ERROR_DEPENDENCY_UNAVAILABLE": [] + }, + { + "$X_RESULT_ERROR_INSUFFICIENT_PERMISSIONS": [] + }, + { + "$X_RESULT_ERROR_NOT_AVAILABLE": [] + }, + { + "$X_RESULT_ERROR_DEVICE_REQUIRES_RESET": [] + }, + { + "$X_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE": [] + }, + { + "$X_RESULT_ERROR_UNKNOWN": [] + }, + { + "$X_RESULT_ERROR_INVALID_NULL_HANDLE": [ + "`nullptr == hDecoderContext`" ] } ], "type": "function", - "version": "1.19" + "version": "1.21" }, { - "class": "$sInfoLogInstance", - "desc": "Delete a collection instance of an info log", + "class": "$sInfoLogDecoderContext", + "desc": "Delete a decoder context of an info log", "details": [ - "Deleting a collection instance stops the collection of records into that instance and releases the resources used by the instance.", "The application must ensure that no other function is using the handle when calling this function.", "The application must not call this function from simultaneous threads with the same handle.", "The implementation of this function must be thread-safe." ], - "hash": "302680384c2f4d5ab5514e21b1c26228d5e749d6d8626d7895ac9f0cdaaee594", + "hash": "e954dd228b2fe62cfcdccc2c5643bdabe5fc1195dd269ca71b887b4fdf7d8b0e", "name": "DeleteExt", "params": [ { - "desc": "[in][release] handle of the info log collection instance to delete", - "name": "hInfoLogInstance", - "type": "$s_info_log_instance_handle_t" + "desc": "[in] handle of the info log that the decoder context was created from", + "name": "hInfoLog", + "type": "$s_info_log_handle_t" + }, + { + "desc": "[in][release] handle of the decoder context to delete", + "name": "hDecoderContext", + "type": "$s_info_log_decoder_context_handle_t" } ], "return_desc": "[out] ze_result_t API result", @@ -151219,40 +153244,27 @@ }, { "$X_RESULT_ERROR_INVALID_NULL_HANDLE": [ - "`nullptr == hInfoLogInstance`" + "`nullptr == hInfoLog`", + "`nullptr == hDecoderContext`" ] } ], "type": "function", - "version": "1.19" + "version": "1.21" }, { - "desc": "C++ wrapper for a Sysman info log", + "desc": "C++ wrapper for a Sysman info log decoder context", "members": [ { - "desc": "[in] handle of Sysman info log object", + "desc": "[in] handle of Sysman info log decoder context object", "name": "handle", - "type": "$s_info_log_handle_t" + "type": "$s_info_log_decoder_context_handle_t" } ], - "name": "$sInfoLog", - "owner": "$sDriver", - "type": "class", - "version": "1.19" - }, - { - "desc": "C++ wrapper for a Sysman info log collection instance", - "members": [ - { - "desc": "[in] handle of Sysman info log collection instance object", - "name": "handle", - "type": "$s_info_log_instance_handle_t" - } - ], - "name": "$sInfoLogInstance", + "name": "$sInfoLogDecoderContext", "owner": "$sInfoLog", "type": "class", - "version": "1.19" + "version": "1.21" } ] }, @@ -151592,6 +153604,75 @@ "version": "1.20" } ] + }, + { + "header": { + "desc": "Intel $OneApi Level-Zero Sysman Extension APIs for Device SOC Unique ID", + "ordinal": 10021000, + "type": "header", + "version": "1.21" + }, + "name": "deviceSocUid", + "objects": [ + { + "desc": "Device SOC Unique ID Extension Name", + "name": "$S_DEVICE_SOC_UID_EXT_NAME", + "type": "macro", + "value": "\"$XS_extension_device_soc_uid\"", + "version": "1.21" + }, + { + "desc": "Device SOC Unique ID Extension Version(s)", + "etors": [ + { + "desc": "version 1.0", + "name": "$S_DEVICE_SOC_UID_EXT_VERSION_1_0", + "value": "$X_MAKE_VERSION( 1, 0 )", + "version": "1.21" + }, + { + "desc": "latest known version", + "name": "$S_DEVICE_SOC_UID_EXT_VERSION_CURRENT", + "value": "$X_MAKE_VERSION( 1, 0 )" + } + ], + "name": "$s_device_soc_uid_ext_version_t", + "type": "enum", + "version": "1.21" + }, + { + "base": "$s_base_properties_t", + "class": "$sDevice", + "desc": "Device SOC Unique ID Extension structure", + "details": [ + "This structure can be passed as an extension structure to $sDeviceGetProperties via pNext member", + "Returns the unique ID of the SOC on which the device resides", + "Applications must treat an all-zero socUid as unavailable rather than as a valid identifier" + ], + "members": [ + { + "desc": "[in] type of this structure", + "init": "$S_STRUCTURE_TYPE_DEVICE_SOC_UID_EXT_PROPERTIES", + "name": "stype", + "type": "$s_structure_type_t" + }, + { + "desc": "[in,out][optional] must be null or a pointer to an extension-specific structure (i.e. contains stype and pNext).", + "init": "nullptr", + "name": "pNext", + "type": "void*" + }, + { + "desc": "[out] unique identifier of the SOC, most significant byte first.", + "name": "socUid", + "type": "$s_uuid_t" + } + ], + "name": "$s_device_soc_uid_ext_properties_t", + "type": "struct", + "version": "1.21" + } + ] } ], [ @@ -151628,7 +153709,7 @@ "type": "uint32_t" }, { - "desc": "[in] command queue index within the group;\nmust be zero.\n", + "desc": "[in] command queue index within the group;\nzero-based, so it must be less than the `numQueues` member of $x_command_queue_group_properties_t for the command queue group.\n", "init": 0, "name": "index", "type": "uint32_t" diff --git a/scripts/spec_metadata/spec_metadata.json b/scripts/spec_metadata/spec_metadata.json index aa916ae4..316febd0 100644 --- a/scripts/spec_metadata/spec_metadata.json +++ b/scripts/spec_metadata/spec_metadata.json @@ -6,12 +6,12 @@ "that scripts/templates/*.mako owns. Refresh both files together whenever the spec", "is updated -- see scripts/spec_metadata.py refresh." ], - "api_version": "1.20", - "generated_by": "scripts/spec_metadata.py refresh --spec-repo --ref v1.20.41 --ver 1.20", + "api_version": "1.21", + "generated_by": "scripts/spec_metadata.py refresh --spec-repo --ref v1.21.26 --ver 1.21", "input_json": "input.json", - "input_json_sha256": "e0f06669ba4c23218ff84d5d09b03257aa73130fc2e9aed86a5c89aa94c19550", - "spec_commit": "ed9ac097db6387aeaae2b35b65ebcf44aab1fecc", + "input_json_sha256": "dff4562a0c20cb0ff8360fd6a856efae06fae7ba51a5fd483ddcd5d8ac782cbe", + "spec_commit": "628f3c80921c9a385a8034dac9f39d1c1319238b", "spec_repository": "https://github.com/oneapi-src/level-zero-spec", - "spec_revision": "1.20.41", - "spec_tag": "v1.20.41" + "spec_revision": "1.21.26", + "spec_tag": "v1.21.26" } diff --git a/scripts/templates/ze_loader_internal.h.mako b/scripts/templates/ze_loader_internal.h.mako index 42d27603..12f71255 100644 --- a/scripts/templates/ze_loader_internal.h.mako +++ b/scripts/templates/ze_loader_internal.h.mako @@ -9,7 +9,7 @@ from templates import helper as th X=x.upper() %>/* * - * Copyright (C) 2019-2025 Intel Corporation + * Copyright (C) 2019-2026 Intel Corporation * * SPDX-License-Identifier: MIT * diff --git a/source/drivers/null/zes_nullddi.cpp b/source/drivers/null/zes_nullddi.cpp index 5c2dcb33..2e7b1440 100644 --- a/source/drivers/null/zes_nullddi.cpp +++ b/source/drivers/null/zes_nullddi.cpp @@ -108,6 +108,33 @@ namespace driver return result; } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesDriverGetApiVersion + __zedlllocal ze_result_t ZE_APICALL + zesDriverGetApiVersion( + zes_driver_handle_t hDriver, ///< [in] handle of the sysman driver instance + zes_api_version_t* pVersion ///< [out] api version + ) + { + 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 pfnGetApiVersion = context.zesDdiTable.Driver.pfnGetApiVersion; + if( nullptr != pfnGetApiVersion ) + { + result = pfnGetApiVersion( hDriver, pVersion ); + } + else + { + // generic implementation + } + + char *env_str = context.setenv_var_with_driver_id("zesDriverGetApiVersion", ZEL_NULL_DRIVER_ID); + context.env_vars.push_back(env_str); + + return result; + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zesDriverGetExtensionProperties __zedlllocal ze_result_t ZE_APICALL @@ -5202,6 +5229,194 @@ namespace driver return result; } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesInfoLogDecoderContextCreateExt + __zedlllocal ze_result_t ZE_APICALL + zesInfoLogDecoderContextCreateExt( + zes_info_log_handle_t hInfoLog, ///< [in] handle of the info log that the records are read from + zes_info_log_decoder_context_handle_t* phDecoderContext ///< [out] handle of the decoder context that was created. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // if the driver has created a custom function, then call it instead of using the generic path + auto pfnCreateExt = context.zesDdiTable.InfoLogDecoderContext.pfnCreateExt; + if( nullptr != pfnCreateExt ) + { + result = pfnCreateExt( hInfoLog, phDecoderContext ); + } + else + { + // generic implementation + *phDecoderContext = reinterpret_cast( context.get() ); + + } + + char *env_str = context.setenv_var_with_driver_id("zesInfoLogDecoderContextCreateExt", ZEL_NULL_DRIVER_ID); + context.env_vars.push_back(env_str); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesInfoLogDecoderContextGetFieldInfoExt + __zedlllocal ze_result_t ZE_APICALL + zesInfoLogDecoderContextGetFieldInfoExt( + zes_info_log_decoder_context_handle_t hDecoderContext, ///< [in] handle of the decoder context + uint32_t* pCount, ///< [in,out] pointer to the number of fields that can be decoded. + ///< if count is zero, then the driver shall update the value with the + ///< total number of fields that can be decoded and shall not return any descriptor. + ///< if count is greater than the number of fields that can be decoded, + ///< then the driver shall update the value with the correct number of fields. + zes_info_log_decodable_field_info_ext_t* pFieldInfos///< [in,out][optional][range(0, *pCount)] array of field descriptions, one + ///< element per field. + ///< if count is less than the number of fields that can be decoded, then + ///< the driver shall only retrieve that number of descriptors. + ) + { + 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 pfnGetFieldInfoExt = context.zesDdiTable.InfoLogDecoderContext.pfnGetFieldInfoExt; + if( nullptr != pfnGetFieldInfoExt ) + { + result = pfnGetFieldInfoExt( hDecoderContext, pCount, pFieldInfos ); + } + else + { + // generic implementation + } + + char *env_str = context.setenv_var_with_driver_id("zesInfoLogDecoderContextGetFieldInfoExt", ZEL_NULL_DRIVER_ID); + context.env_vars.push_back(env_str); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesInfoLogDecoderContextDecodeStartExt + __zedlllocal ze_result_t ZE_APICALL + zesInfoLogDecoderContextDecodeStartExt( + zes_info_log_decoder_context_handle_t hDecoderContext, ///< [in] handle of the decoder context + uint32_t size, ///< [in] size, in bytes, of the record data in `pBuffer`, as returned in + ///< `*pSize` by the read or peek call + const uint8_t* pBuffer, ///< [in][optional][range(0, size)] the record data, as returned in + ///< `pBuffer` by the read or peek call + uint32_t recordCount, ///< [in] number of records in the batch, as returned in `*pRecordCount` by + ///< the read or peek call + const zes_info_log_metadata_ext_t* pDescriptors ///< [in][optional][range(0, recordCount)] array of metadata describing + ///< each record, as returned in `pDescriptors` by the read or peek call + ) + { + 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 pfnDecodeStartExt = context.zesDdiTable.InfoLogDecoderContext.pfnDecodeStartExt; + if( nullptr != pfnDecodeStartExt ) + { + result = pfnDecodeStartExt( hDecoderContext, size, pBuffer, recordCount, pDescriptors ); + } + else + { + // generic implementation + } + + char *env_str = context.setenv_var_with_driver_id("zesInfoLogDecoderContextDecodeStartExt", ZEL_NULL_DRIVER_ID); + context.env_vars.push_back(env_str); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesInfoLogDecoderContextReadFieldExt + __zedlllocal ze_result_t ZE_APICALL + zesInfoLogDecoderContextReadFieldExt( + zes_info_log_decoder_context_handle_t hDecoderContext, ///< [in] handle of the decoder context, which must be decoding a batch + uint32_t fieldId, ///< [in] identifier of the field to read, as reported in `fieldId` of + ///< ::zes_info_log_decodable_field_info_ext_t + uint32_t recordId, ///< [in] index of the record in the `pDescriptors` that was passed to + ///< ::zesInfoLogDecoderContextDecodeStartExt + void* pOutBuffer, ///< [in,out][range(0, bufferLen)] buffer that will contain the value of + ///< the field + size_t bufferLen, ///< [in] size, in bytes, of `pOutBuffer` + size_t* pBytesCopied ///< [out] pointer to the number of bytes written to `pOutBuffer`. + ///< the driver shall update the value with zero when the record does not + ///< carry the field. + ) + { + 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 pfnReadFieldExt = context.zesDdiTable.InfoLogDecoderContext.pfnReadFieldExt; + if( nullptr != pfnReadFieldExt ) + { + result = pfnReadFieldExt( hDecoderContext, fieldId, recordId, pOutBuffer, bufferLen, pBytesCopied ); + } + else + { + // generic implementation + } + + char *env_str = context.setenv_var_with_driver_id("zesInfoLogDecoderContextReadFieldExt", ZEL_NULL_DRIVER_ID); + context.env_vars.push_back(env_str); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesInfoLogDecoderContextDecodeStopExt + __zedlllocal ze_result_t ZE_APICALL + zesInfoLogDecoderContextDecodeStopExt( + zes_info_log_decoder_context_handle_t hDecoderContext ///< [in] handle of the decoder context + ) + { + 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 pfnDecodeStopExt = context.zesDdiTable.InfoLogDecoderContext.pfnDecodeStopExt; + if( nullptr != pfnDecodeStopExt ) + { + result = pfnDecodeStopExt( hDecoderContext ); + } + else + { + // generic implementation + } + + char *env_str = context.setenv_var_with_driver_id("zesInfoLogDecoderContextDecodeStopExt", ZEL_NULL_DRIVER_ID); + context.env_vars.push_back(env_str); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesInfoLogDecoderContextDeleteExt + __zedlllocal ze_result_t ZE_APICALL + zesInfoLogDecoderContextDeleteExt( + zes_info_log_handle_t hInfoLog, ///< [in] handle of the info log that the decoder context was created from + zes_info_log_decoder_context_handle_t hDecoderContext ///< [in][release] handle of the decoder context to delete + ) + { + 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 pfnDeleteExt = context.zesDdiTable.InfoLogDecoderContext.pfnDeleteExt; + if( nullptr != pfnDeleteExt ) + { + result = pfnDeleteExt( hInfoLog, hDecoderContext ); + } + else + { + // generic implementation + + } + + char *env_str = context.setenv_var_with_driver_id("zesInfoLogDecoderContextDeleteExt", ZEL_NULL_DRIVER_ID); + context.env_vars.push_back(env_str); + + return result; + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zesDriverGetPciDeviceProperties __zedlllocal ze_result_t ZE_APICALL @@ -5544,6 +5759,10 @@ zesGetDriverProcAddrTable( pDdiTable->pfnGetPciDeviceProperties = driver::zesDriverGetPciDeviceProperties; } + if (version >= ZE_API_VERSION_1_21) { + pDdiTable->pfnGetApiVersion = driver::zesDriverGetApiVersion; + } + if (version >= ZE_API_VERSION_1_5) { pDdiTable->pfnGet = driver::zesDriverGet; } @@ -6532,6 +6751,55 @@ zesGetInfoLogProcAddrTable( return result; } +/////////////////////////////////////////////////////////////////////////////// +/// @brief Exported function for filling application's InfoLogDecoderContext 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 +zesGetInfoLogDecoderContextProcAddrTable( + ze_api_version_t version, ///< [in] API version requested + zes_info_log_decoder_context_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers + ) +{ + if( nullptr == pDdiTable ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + if (ZE_MAJOR_VERSION(driver::context.version) != ZE_MAJOR_VERSION(version)) + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + + ze_result_t result = ZE_RESULT_SUCCESS; + + if (version >= ZE_API_VERSION_1_21) { + pDdiTable->pfnCreateExt = driver::zesInfoLogDecoderContextCreateExt; + } + + if (version >= ZE_API_VERSION_1_21) { + pDdiTable->pfnGetFieldInfoExt = driver::zesInfoLogDecoderContextGetFieldInfoExt; + } + + if (version >= ZE_API_VERSION_1_21) { + pDdiTable->pfnDecodeStartExt = driver::zesInfoLogDecoderContextDecodeStartExt; + } + + if (version >= ZE_API_VERSION_1_21) { + pDdiTable->pfnReadFieldExt = driver::zesInfoLogDecoderContextReadFieldExt; + } + + if (version >= ZE_API_VERSION_1_21) { + pDdiTable->pfnDecodeStopExt = driver::zesInfoLogDecoderContextDecodeStopExt; + } + + if (version >= ZE_API_VERSION_1_21) { + pDdiTable->pfnDeleteExt = driver::zesInfoLogDecoderContextDeleteExt; + } + + return result; +} + /////////////////////////////////////////////////////////////////////////////// /// @brief Exported function for filling application's InfoLogInstance table /// with current process' addresses diff --git a/source/drivers/null/zet_nullddi.cpp b/source/drivers/null/zet_nullddi.cpp index 88f2e025..9e6345e4 100644 --- a/source/drivers/null/zet_nullddi.cpp +++ b/source/drivers/null/zet_nullddi.cpp @@ -1589,7 +1589,8 @@ namespace driver zetDeviceCreateMetricGroupsFromMetricsExp( zet_device_handle_t hDevice, ///< [in] handle of the device. uint32_t metricCount, ///< [in] number of metric handles. - zet_metric_handle_t * phMetrics, ///< [in] metric handles to be added to the metric groups. + zet_metric_handle_t* phMetrics, ///< [in][range(0, metricCount)] array of metric handles to be added to the + ///< metric groups. const char * pMetricGroupNamePrefix, ///< [in] prefix to the name created for the metric groups. Must point to a ///< null-terminated character array no longer than ///< ::ZET_MAX_METRIC_GROUP_NAME_PREFIX_EXP. diff --git a/source/layers/validation/checkers/certification/generated/zes_certification.h b/source/layers/validation/checkers/certification/generated/zes_certification.h index 2a2c0ddd..70e5438f 100644 --- a/source/layers/validation/checkers/certification/generated/zes_certification.h +++ b/source/layers/validation/checkers/certification/generated/zes_certification.h @@ -33,6 +33,12 @@ class ZEScertificationCheckerGenerated : public ZESValidationEntryPoints { } return ZE_RESULT_SUCCESS; } + virtual ze_result_t zesDriverGetApiVersionPrologue( zes_driver_handle_t hDriver, zes_api_version_t* pVersion ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_21) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } virtual ze_result_t zesDriverGetExtensionPropertiesPrologue( zes_driver_handle_t hDriver, uint32_t* pCount, zes_driver_extension_properties_t* pExtensionProperties ) override { if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_8) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; @@ -1023,6 +1029,42 @@ class ZEScertificationCheckerGenerated : public ZESValidationEntryPoints { } return ZE_RESULT_SUCCESS; } + virtual ze_result_t zesInfoLogDecoderContextCreateExtPrologue( zes_info_log_handle_t hInfoLog, zes_info_log_decoder_context_handle_t* phDecoderContext ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_21) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesInfoLogDecoderContextGetFieldInfoExtPrologue( zes_info_log_decoder_context_handle_t hDecoderContext, uint32_t* pCount, zes_info_log_decodable_field_info_ext_t* pFieldInfos ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_21) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesInfoLogDecoderContextDecodeStartExtPrologue( zes_info_log_decoder_context_handle_t hDecoderContext, uint32_t size, const uint8_t* pBuffer, uint32_t recordCount, const zes_info_log_metadata_ext_t* pDescriptors ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_21) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesInfoLogDecoderContextReadFieldExtPrologue( zes_info_log_decoder_context_handle_t hDecoderContext, uint32_t fieldId, uint32_t recordId, void* pOutBuffer, size_t bufferLen, size_t* pBytesCopied ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_21) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesInfoLogDecoderContextDecodeStopExtPrologue( zes_info_log_decoder_context_handle_t hDecoderContext ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_21) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesInfoLogDecoderContextDeleteExtPrologue( zes_info_log_handle_t hInfoLog, zes_info_log_decoder_context_handle_t hDecoderContext ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_21) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } virtual ze_result_t zesDriverGetPciDevicePropertiesPrologue( zes_driver_handle_t hDriver, uint32_t* pCount, zes_driver_pci_device_properties_t* pProperties ) override { if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_20) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; diff --git a/source/layers/validation/checkers/certification/generated/zet_certification.h b/source/layers/validation/checkers/certification/generated/zet_certification.h index c323e599..cad88c70 100644 --- a/source/layers/validation/checkers/certification/generated/zet_certification.h +++ b/source/layers/validation/checkers/certification/generated/zet_certification.h @@ -309,7 +309,7 @@ class ZETcertificationCheckerGenerated : public ZETValidationEntryPoints { } return ZE_RESULT_SUCCESS; } - virtual ze_result_t zetDeviceCreateMetricGroupsFromMetricsExpPrologue( zet_device_handle_t hDevice, uint32_t metricCount, zet_metric_handle_t * phMetrics, const char * pMetricGroupNamePrefix, const char * pDescription, uint32_t * pMetricGroupCount, zet_metric_group_handle_t* phMetricGroup ) override { + virtual ze_result_t zetDeviceCreateMetricGroupsFromMetricsExpPrologue( zet_device_handle_t hDevice, uint32_t metricCount, zet_metric_handle_t* phMetrics, const char * pMetricGroupNamePrefix, const char * pDescription, uint32_t * pMetricGroupCount, zet_metric_group_handle_t* phMetricGroup ) override { if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_10) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } 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 de1fb32a..6ec52b01 100644 --- a/source/layers/validation/checkers/parameter_validation/ze_parameter_validation.cpp +++ b/source/layers/validation/checkers/parameter_validation/ze_parameter_validation.cpp @@ -755,7 +755,7 @@ namespace validation_layer if( ZE_COMMAND_QUEUE_MODE_ASYNCHRONOUS < desc->mode ) return ZE_RESULT_ERROR_INVALID_ENUMERATION; - if( ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_HIGH < desc->priority ) + if( ZE_COMMAND_QUEUE_PRIORITY_HIGH < desc->priority ) return ZE_RESULT_ERROR_INVALID_ENUMERATION; return ParameterValidation::validateExtensions(desc); @@ -948,7 +948,7 @@ namespace validation_layer if( ZE_COMMAND_QUEUE_MODE_ASYNCHRONOUS < altdesc->mode ) return ZE_RESULT_ERROR_INVALID_ENUMERATION; - if( ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_HIGH < altdesc->priority ) + if( ZE_COMMAND_QUEUE_PRIORITY_HIGH < altdesc->priority ) return ZE_RESULT_ERROR_INVALID_ENUMERATION; return ParameterValidation::validateExtensions(altdesc); @@ -5373,7 +5373,7 @@ namespace validation_layer if( nullptr == hCommandQueue ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - if( ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_HIGH < priority ) + if( ZE_COMMAND_QUEUE_PRIORITY_HIGH < priority ) return ZE_RESULT_ERROR_INVALID_ENUMERATION; return ZE_RESULT_SUCCESS; diff --git a/source/layers/validation/checkers/parameter_validation/zes_parameter_validation.cpp b/source/layers/validation/checkers/parameter_validation/zes_parameter_validation.cpp index 238779a8..91321fcb 100644 --- a/source/layers/validation/checkers/parameter_validation/zes_parameter_validation.cpp +++ b/source/layers/validation/checkers/parameter_validation/zes_parameter_validation.cpp @@ -64,6 +64,22 @@ namespace validation_layer } + ze_result_t + ZESParameterValidation::zesDriverGetApiVersionPrologue( + zes_driver_handle_t hDriver, ///< [in] handle of the sysman driver instance + zes_api_version_t* pVersion ///< [out] api version + ) + { + if( nullptr == hDriver ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + if( nullptr == pVersion ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + return ZE_RESULT_SUCCESS; + } + + ze_result_t ZESParameterValidation::zesDriverGetExtensionPropertiesPrologue( zes_driver_handle_t hDriver, ///< [in] handle of the driver instance @@ -3332,6 +3348,122 @@ namespace validation_layer } + ze_result_t + ZESParameterValidation::zesInfoLogDecoderContextCreateExtPrologue( + zes_info_log_handle_t hInfoLog, ///< [in] handle of the info log that the records are read from + zes_info_log_decoder_context_handle_t* phDecoderContext ///< [out] handle of the decoder context that was created. + ) + { + if( nullptr == hInfoLog ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + if( nullptr == phDecoderContext ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + return ZE_RESULT_SUCCESS; + } + + + ze_result_t + ZESParameterValidation::zesInfoLogDecoderContextGetFieldInfoExtPrologue( + zes_info_log_decoder_context_handle_t hDecoderContext, ///< [in] handle of the decoder context + uint32_t* pCount, ///< [in,out] pointer to the number of fields that can be decoded. + ///< if count is zero, then the driver shall update the value with the + ///< total number of fields that can be decoded and shall not return any descriptor. + ///< if count is greater than the number of fields that can be decoded, + ///< then the driver shall update the value with the correct number of fields. + zes_info_log_decodable_field_info_ext_t* pFieldInfos///< [in,out][optional][range(0, *pCount)] array of field descriptions, one + ///< element per field. + ///< if count is less than the number of fields that can be decoded, then + ///< the driver shall only retrieve that number of descriptors. + ) + { + if( nullptr == hDecoderContext ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + if( nullptr == pCount ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + return ZE_RESULT_SUCCESS; + } + + + ze_result_t + ZESParameterValidation::zesInfoLogDecoderContextDecodeStartExtPrologue( + zes_info_log_decoder_context_handle_t hDecoderContext, ///< [in] handle of the decoder context + uint32_t size, ///< [in] size, in bytes, of the record data in `pBuffer`, as returned in + ///< `*pSize` by the read or peek call + const uint8_t* pBuffer, ///< [in][optional][range(0, size)] the record data, as returned in + ///< `pBuffer` by the read or peek call + uint32_t recordCount, ///< [in] number of records in the batch, as returned in `*pRecordCount` by + ///< the read or peek call + const zes_info_log_metadata_ext_t* pDescriptors ///< [in][optional][range(0, recordCount)] array of metadata describing + ///< each record, as returned in `pDescriptors` by the read or peek call + ) + { + if( nullptr == hDecoderContext ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + return ZE_RESULT_SUCCESS; + } + + + ze_result_t + ZESParameterValidation::zesInfoLogDecoderContextReadFieldExtPrologue( + zes_info_log_decoder_context_handle_t hDecoderContext, ///< [in] handle of the decoder context, which must be decoding a batch + uint32_t fieldId, ///< [in] identifier of the field to read, as reported in `fieldId` of + ///< ::zes_info_log_decodable_field_info_ext_t + uint32_t recordId, ///< [in] index of the record in the `pDescriptors` that was passed to + ///< ::zesInfoLogDecoderContextDecodeStartExt + void* pOutBuffer, ///< [in,out][range(0, bufferLen)] buffer that will contain the value of + ///< the field + size_t bufferLen, ///< [in] size, in bytes, of `pOutBuffer` + size_t* pBytesCopied ///< [out] pointer to the number of bytes written to `pOutBuffer`. + ///< the driver shall update the value with zero when the record does not + ///< carry the field. + ) + { + if( nullptr == hDecoderContext ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + if( nullptr == pOutBuffer ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + if( nullptr == pBytesCopied ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + return ZE_RESULT_SUCCESS; + } + + + ze_result_t + ZESParameterValidation::zesInfoLogDecoderContextDecodeStopExtPrologue( + zes_info_log_decoder_context_handle_t hDecoderContext ///< [in] handle of the decoder context + ) + { + if( nullptr == hDecoderContext ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + return ZE_RESULT_SUCCESS; + } + + + ze_result_t + ZESParameterValidation::zesInfoLogDecoderContextDeleteExtPrologue( + zes_info_log_handle_t hInfoLog, ///< [in] handle of the info log that the decoder context was created from + zes_info_log_decoder_context_handle_t hDecoderContext ///< [in][release] handle of the decoder context to delete + ) + { + if( nullptr == hInfoLog ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + if( nullptr == hDecoderContext ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + return ZE_RESULT_SUCCESS; + } + + ze_result_t ZESParameterValidation::zesDriverGetPciDevicePropertiesPrologue( zes_driver_handle_t hDriver, ///< [in] handle of the sysman driver instance diff --git a/source/layers/validation/checkers/parameter_validation/zes_parameter_validation.h b/source/layers/validation/checkers/parameter_validation/zes_parameter_validation.h index b89f379f..431dc4b6 100644 --- a/source/layers/validation/checkers/parameter_validation/zes_parameter_validation.h +++ b/source/layers/validation/checkers/parameter_validation/zes_parameter_validation.h @@ -23,6 +23,7 @@ namespace validation_layer ze_result_t zesInitPrologue( zes_init_flags_t flags ) override; ze_result_t zesDriverGetPrologue( uint32_t* pCount, zes_driver_handle_t* phDrivers ) override; ze_result_t zesDriverGetPropertiesPrologue( zes_driver_handle_t hDriver, zes_driver_properties_t* pDriverProperties ) override; + ze_result_t zesDriverGetApiVersionPrologue( zes_driver_handle_t hDriver, zes_api_version_t* pVersion ) override; ze_result_t zesDriverGetExtensionPropertiesPrologue( zes_driver_handle_t hDriver, uint32_t* pCount, zes_driver_extension_properties_t* pExtensionProperties ) override; ze_result_t zesDriverGetExtensionFunctionAddressPrologue( zes_driver_handle_t hDriver, const char* name, void** ppFunctionAddress ) override; ze_result_t zesDeviceGetPrologue( zes_driver_handle_t hDriver, uint32_t* pCount, zes_device_handle_t* phDevices ) override; @@ -188,6 +189,12 @@ namespace validation_layer ze_result_t zesInfoLogInstanceReadWithMetadataExtPrologue( zes_info_log_instance_handle_t hInfoLogInstance, uint64_t timeout, uint32_t* pSize, uint8_t* pBuffer, uint32_t* pRecordCount, zes_info_log_metadata_ext_t* pDescriptors, zes_info_log_read_status_ext_t* pReadStatus ) override; ze_result_t zesInfoLogInstancePeekWithMetadataExtPrologue( zes_info_log_instance_handle_t hInfoLogInstance, uint64_t timeout, uint32_t* pSize, uint8_t* pBuffer, uint32_t* pRecordCount, zes_info_log_metadata_ext_t* pDescriptors, zes_info_log_read_status_ext_t* pReadStatus ) override; ze_result_t zesInfoLogInstanceDeleteExtPrologue( zes_info_log_instance_handle_t hInfoLogInstance ) override; + ze_result_t zesInfoLogDecoderContextCreateExtPrologue( zes_info_log_handle_t hInfoLog, zes_info_log_decoder_context_handle_t* phDecoderContext ) override; + ze_result_t zesInfoLogDecoderContextGetFieldInfoExtPrologue( zes_info_log_decoder_context_handle_t hDecoderContext, uint32_t* pCount, zes_info_log_decodable_field_info_ext_t* pFieldInfos ) override; + ze_result_t zesInfoLogDecoderContextDecodeStartExtPrologue( zes_info_log_decoder_context_handle_t hDecoderContext, uint32_t size, const uint8_t* pBuffer, uint32_t recordCount, const zes_info_log_metadata_ext_t* pDescriptors ) override; + ze_result_t zesInfoLogDecoderContextReadFieldExtPrologue( zes_info_log_decoder_context_handle_t hDecoderContext, uint32_t fieldId, uint32_t recordId, void* pOutBuffer, size_t bufferLen, size_t* pBytesCopied ) override; + ze_result_t zesInfoLogDecoderContextDecodeStopExtPrologue( zes_info_log_decoder_context_handle_t hDecoderContext ) override; + ze_result_t zesInfoLogDecoderContextDeleteExtPrologue( zes_info_log_handle_t hInfoLog, zes_info_log_decoder_context_handle_t hDecoderContext ) override; ze_result_t zesDriverGetPciDevicePropertiesPrologue( zes_driver_handle_t hDriver, uint32_t* pCount, zes_driver_pci_device_properties_t* pProperties ) override; }; } \ No newline at end of file diff --git a/source/layers/validation/checkers/parameter_validation/zet_parameter_validation.cpp b/source/layers/validation/checkers/parameter_validation/zet_parameter_validation.cpp index fb9a2447..8a3dd09c 100644 --- a/source/layers/validation/checkers/parameter_validation/zet_parameter_validation.cpp +++ b/source/layers/validation/checkers/parameter_validation/zet_parameter_validation.cpp @@ -1093,7 +1093,8 @@ namespace validation_layer ZETParameterValidation::zetDeviceCreateMetricGroupsFromMetricsExpPrologue( zet_device_handle_t hDevice, ///< [in] handle of the device. uint32_t metricCount, ///< [in] number of metric handles. - zet_metric_handle_t * phMetrics, ///< [in] metric handles to be added to the metric groups. + zet_metric_handle_t* phMetrics, ///< [in][range(0, metricCount)] array of metric handles to be added to the + ///< metric groups. const char * pMetricGroupNamePrefix, ///< [in] prefix to the name created for the metric groups. Must point to a ///< null-terminated character array no longer than ///< ::ZET_MAX_METRIC_GROUP_NAME_PREFIX_EXP. @@ -1116,6 +1117,9 @@ namespace validation_layer if( nullptr == hDevice ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + if( nullptr == phMetrics ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + return ZE_RESULT_SUCCESS; } diff --git a/source/layers/validation/checkers/parameter_validation/zet_parameter_validation.h b/source/layers/validation/checkers/parameter_validation/zet_parameter_validation.h index da24b3a6..e08d1fea 100644 --- a/source/layers/validation/checkers/parameter_validation/zet_parameter_validation.h +++ b/source/layers/validation/checkers/parameter_validation/zet_parameter_validation.h @@ -69,7 +69,7 @@ namespace validation_layer ze_result_t zetMetricProgrammableGetParamValueInfoExpPrologue( zet_metric_programmable_exp_handle_t hMetricProgrammable, uint32_t parameterOrdinal, uint32_t* pValueInfoCount, zet_metric_programmable_param_value_info_exp_t* pValueInfo ) override; ze_result_t zetMetricCreateFromProgrammableExp2Prologue( zet_metric_programmable_exp_handle_t hMetricProgrammable, uint32_t parameterCount, zet_metric_programmable_param_value_exp_t* pParameterValues, const char* pName, const char* pDescription, uint32_t* pMetricHandleCount, zet_metric_handle_t* phMetricHandles ) override; ze_result_t zetMetricCreateFromProgrammableExpPrologue( zet_metric_programmable_exp_handle_t hMetricProgrammable, zet_metric_programmable_param_value_exp_t* pParameterValues, uint32_t parameterCount, const char* pName, const char* pDescription, uint32_t* pMetricHandleCount, zet_metric_handle_t* phMetricHandles ) override; - ze_result_t zetDeviceCreateMetricGroupsFromMetricsExpPrologue( zet_device_handle_t hDevice, uint32_t metricCount, zet_metric_handle_t * phMetrics, const char * pMetricGroupNamePrefix, const char * pDescription, uint32_t * pMetricGroupCount, zet_metric_group_handle_t* phMetricGroup ) override; + ze_result_t zetDeviceCreateMetricGroupsFromMetricsExpPrologue( zet_device_handle_t hDevice, uint32_t metricCount, zet_metric_handle_t* phMetrics, const char * pMetricGroupNamePrefix, const char * pDescription, uint32_t * pMetricGroupCount, zet_metric_group_handle_t* phMetricGroup ) override; ze_result_t zetMetricGroupCreateExpPrologue( zet_device_handle_t hDevice, const char* pName, const char* pDescription, zet_metric_group_sampling_type_flags_t samplingType, zet_metric_group_handle_t* phMetricGroup ) override; ze_result_t zetMetricGroupAddMetricExpPrologue( zet_metric_group_handle_t hMetricGroup, zet_metric_handle_t hMetric, size_t * pErrorStringSize, char* pErrorString ) override; ze_result_t zetMetricGroupRemoveMetricExpPrologue( zet_metric_group_handle_t hMetricGroup, zet_metric_handle_t hMetric ) override; diff --git a/source/layers/validation/common/zes_entry_points.h b/source/layers/validation/common/zes_entry_points.h index 2566d995..97c3d7aa 100644 --- a/source/layers/validation/common/zes_entry_points.h +++ b/source/layers/validation/common/zes_entry_points.h @@ -23,6 +23,8 @@ class ZESValidationEntryPoints { virtual ze_result_t zesDriverGetEpilogue( uint32_t* pCount, zes_driver_handle_t* phDrivers , ze_result_t result) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zesDriverGetPropertiesPrologue( zes_driver_handle_t hDriver, zes_driver_properties_t* pDriverProperties ) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zesDriverGetPropertiesEpilogue( zes_driver_handle_t hDriver, zes_driver_properties_t* pDriverProperties , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zesDriverGetApiVersionPrologue( zes_driver_handle_t hDriver, zes_api_version_t* pVersion ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zesDriverGetApiVersionEpilogue( zes_driver_handle_t hDriver, zes_api_version_t* pVersion , ze_result_t result) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zesDriverGetExtensionPropertiesPrologue( zes_driver_handle_t hDriver, uint32_t* pCount, zes_driver_extension_properties_t* pExtensionProperties ) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zesDriverGetExtensionPropertiesEpilogue( zes_driver_handle_t hDriver, uint32_t* pCount, zes_driver_extension_properties_t* pExtensionProperties , ze_result_t result) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zesDriverGetExtensionFunctionAddressPrologue( zes_driver_handle_t hDriver, const char* name, void** ppFunctionAddress ) {return ZE_RESULT_SUCCESS;} @@ -353,6 +355,18 @@ class ZESValidationEntryPoints { virtual ze_result_t zesInfoLogInstancePeekWithMetadataExtEpilogue( zes_info_log_instance_handle_t hInfoLogInstance, uint64_t timeout, uint32_t* pSize, uint8_t* pBuffer, uint32_t* pRecordCount, zes_info_log_metadata_ext_t* pDescriptors, zes_info_log_read_status_ext_t* pReadStatus , ze_result_t result) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zesInfoLogInstanceDeleteExtPrologue( zes_info_log_instance_handle_t hInfoLogInstance ) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zesInfoLogInstanceDeleteExtEpilogue( zes_info_log_instance_handle_t hInfoLogInstance , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zesInfoLogDecoderContextCreateExtPrologue( zes_info_log_handle_t hInfoLog, zes_info_log_decoder_context_handle_t* phDecoderContext ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zesInfoLogDecoderContextCreateExtEpilogue( zes_info_log_handle_t hInfoLog, zes_info_log_decoder_context_handle_t* phDecoderContext , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zesInfoLogDecoderContextGetFieldInfoExtPrologue( zes_info_log_decoder_context_handle_t hDecoderContext, uint32_t* pCount, zes_info_log_decodable_field_info_ext_t* pFieldInfos ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zesInfoLogDecoderContextGetFieldInfoExtEpilogue( zes_info_log_decoder_context_handle_t hDecoderContext, uint32_t* pCount, zes_info_log_decodable_field_info_ext_t* pFieldInfos , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zesInfoLogDecoderContextDecodeStartExtPrologue( zes_info_log_decoder_context_handle_t hDecoderContext, uint32_t size, const uint8_t* pBuffer, uint32_t recordCount, const zes_info_log_metadata_ext_t* pDescriptors ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zesInfoLogDecoderContextDecodeStartExtEpilogue( zes_info_log_decoder_context_handle_t hDecoderContext, uint32_t size, const uint8_t* pBuffer, uint32_t recordCount, const zes_info_log_metadata_ext_t* pDescriptors , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zesInfoLogDecoderContextReadFieldExtPrologue( zes_info_log_decoder_context_handle_t hDecoderContext, uint32_t fieldId, uint32_t recordId, void* pOutBuffer, size_t bufferLen, size_t* pBytesCopied ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zesInfoLogDecoderContextReadFieldExtEpilogue( zes_info_log_decoder_context_handle_t hDecoderContext, uint32_t fieldId, uint32_t recordId, void* pOutBuffer, size_t bufferLen, size_t* pBytesCopied , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zesInfoLogDecoderContextDecodeStopExtPrologue( zes_info_log_decoder_context_handle_t hDecoderContext ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zesInfoLogDecoderContextDecodeStopExtEpilogue( zes_info_log_decoder_context_handle_t hDecoderContext , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zesInfoLogDecoderContextDeleteExtPrologue( zes_info_log_handle_t hInfoLog, zes_info_log_decoder_context_handle_t hDecoderContext ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zesInfoLogDecoderContextDeleteExtEpilogue( zes_info_log_handle_t hInfoLog, zes_info_log_decoder_context_handle_t hDecoderContext , ze_result_t result) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zesDriverGetPciDevicePropertiesPrologue( zes_driver_handle_t hDriver, uint32_t* pCount, zes_driver_pci_device_properties_t* pProperties ) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zesDriverGetPciDevicePropertiesEpilogue( zes_driver_handle_t hDriver, uint32_t* pCount, zes_driver_pci_device_properties_t* pProperties , ze_result_t result) {return ZE_RESULT_SUCCESS;} virtual ~ZESValidationEntryPoints() {} diff --git a/source/layers/validation/common/zet_entry_points.h b/source/layers/validation/common/zet_entry_points.h index 32697438..a5e02429 100644 --- a/source/layers/validation/common/zet_entry_points.h +++ b/source/layers/validation/common/zet_entry_points.h @@ -115,8 +115,8 @@ class ZETValidationEntryPoints { virtual ze_result_t zetMetricCreateFromProgrammableExp2Epilogue( zet_metric_programmable_exp_handle_t hMetricProgrammable, uint32_t parameterCount, zet_metric_programmable_param_value_exp_t* pParameterValues, const char* pName, const char* pDescription, uint32_t* pMetricHandleCount, zet_metric_handle_t* phMetricHandles , ze_result_t result) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zetMetricCreateFromProgrammableExpPrologue( zet_metric_programmable_exp_handle_t hMetricProgrammable, zet_metric_programmable_param_value_exp_t* pParameterValues, uint32_t parameterCount, const char* pName, const char* pDescription, uint32_t* pMetricHandleCount, zet_metric_handle_t* phMetricHandles ) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zetMetricCreateFromProgrammableExpEpilogue( zet_metric_programmable_exp_handle_t hMetricProgrammable, zet_metric_programmable_param_value_exp_t* pParameterValues, uint32_t parameterCount, const char* pName, const char* pDescription, uint32_t* pMetricHandleCount, zet_metric_handle_t* phMetricHandles , ze_result_t result) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zetDeviceCreateMetricGroupsFromMetricsExpPrologue( zet_device_handle_t hDevice, uint32_t metricCount, zet_metric_handle_t * phMetrics, const char * pMetricGroupNamePrefix, const char * pDescription, uint32_t * pMetricGroupCount, zet_metric_group_handle_t* phMetricGroup ) {return ZE_RESULT_SUCCESS;} - virtual ze_result_t zetDeviceCreateMetricGroupsFromMetricsExpEpilogue( zet_device_handle_t hDevice, uint32_t metricCount, zet_metric_handle_t * phMetrics, const char * pMetricGroupNamePrefix, const char * pDescription, uint32_t * pMetricGroupCount, zet_metric_group_handle_t* phMetricGroup , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zetDeviceCreateMetricGroupsFromMetricsExpPrologue( zet_device_handle_t hDevice, uint32_t metricCount, zet_metric_handle_t* phMetrics, const char * pMetricGroupNamePrefix, const char * pDescription, uint32_t * pMetricGroupCount, zet_metric_group_handle_t* phMetricGroup ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zetDeviceCreateMetricGroupsFromMetricsExpEpilogue( zet_device_handle_t hDevice, uint32_t metricCount, zet_metric_handle_t* phMetrics, const char * pMetricGroupNamePrefix, const char * pDescription, uint32_t * pMetricGroupCount, zet_metric_group_handle_t* phMetricGroup , ze_result_t result) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zetMetricGroupCreateExpPrologue( zet_device_handle_t hDevice, const char* pName, const char* pDescription, zet_metric_group_sampling_type_flags_t samplingType, zet_metric_group_handle_t* phMetricGroup ) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zetMetricGroupCreateExpEpilogue( zet_device_handle_t hDevice, const char* pName, const char* pDescription, zet_metric_group_sampling_type_flags_t samplingType, zet_metric_group_handle_t* phMetricGroup , ze_result_t result) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zetMetricGroupAddMetricExpPrologue( zet_metric_group_handle_t hMetricGroup, zet_metric_handle_t hMetric, size_t * pErrorStringSize, char* pErrorString ) {return ZE_RESULT_SUCCESS;} diff --git a/source/layers/validation/handle_lifetime_tracking/zes_handle_lifetime.cpp b/source/layers/validation/handle_lifetime_tracking/zes_handle_lifetime.cpp index 30494cac..96588ea7 100644 --- a/source/layers/validation/handle_lifetime_tracking/zes_handle_lifetime.cpp +++ b/source/layers/validation/handle_lifetime_tracking/zes_handle_lifetime.cpp @@ -27,6 +27,18 @@ namespace validation_layer return ZE_RESULT_SUCCESS; } ze_result_t + ZESHandleLifetimeValidation::zesDriverGetApiVersionPrologue( + zes_driver_handle_t hDriver, ///< [in] handle of the sysman driver instance + zes_api_version_t* pVersion ///< [out] api version + ) + { + + if ( !context.handleLifetime->isHandleValid( hDriver )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + return ZE_RESULT_SUCCESS; + } + ze_result_t ZESHandleLifetimeValidation::zesDriverGetExtensionPropertiesPrologue( zes_driver_handle_t hDriver, ///< [in] handle of the driver instance uint32_t* pCount, ///< [in,out] pointer to the number of extension properties. @@ -2599,6 +2611,104 @@ namespace validation_layer return ZE_RESULT_SUCCESS; } ze_result_t + ZESHandleLifetimeValidation::zesInfoLogDecoderContextCreateExtPrologue( + zes_info_log_handle_t hInfoLog, ///< [in] handle of the info log that the records are read from + zes_info_log_decoder_context_handle_t* phDecoderContext ///< [out] handle of the decoder context that was created. + ) + { + + if ( !context.handleLifetime->isHandleValid( hInfoLog )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + return ZE_RESULT_SUCCESS; + } + ze_result_t + ZESHandleLifetimeValidation::zesInfoLogDecoderContextGetFieldInfoExtPrologue( + zes_info_log_decoder_context_handle_t hDecoderContext, ///< [in] handle of the decoder context + uint32_t* pCount, ///< [in,out] pointer to the number of fields that can be decoded. + ///< if count is zero, then the driver shall update the value with the + ///< total number of fields that can be decoded and shall not return any descriptor. + ///< if count is greater than the number of fields that can be decoded, + ///< then the driver shall update the value with the correct number of fields. + zes_info_log_decodable_field_info_ext_t* pFieldInfos///< [in,out][optional][range(0, *pCount)] array of field descriptions, one + ///< element per field. + ///< if count is less than the number of fields that can be decoded, then + ///< the driver shall only retrieve that number of descriptors. + ) + { + + if ( !context.handleLifetime->isHandleValid( hDecoderContext )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + return ZE_RESULT_SUCCESS; + } + ze_result_t + ZESHandleLifetimeValidation::zesInfoLogDecoderContextDecodeStartExtPrologue( + zes_info_log_decoder_context_handle_t hDecoderContext, ///< [in] handle of the decoder context + uint32_t size, ///< [in] size, in bytes, of the record data in `pBuffer`, as returned in + ///< `*pSize` by the read or peek call + const uint8_t* pBuffer, ///< [in][optional][range(0, size)] the record data, as returned in + ///< `pBuffer` by the read or peek call + uint32_t recordCount, ///< [in] number of records in the batch, as returned in `*pRecordCount` by + ///< the read or peek call + const zes_info_log_metadata_ext_t* pDescriptors ///< [in][optional][range(0, recordCount)] array of metadata describing + ///< each record, as returned in `pDescriptors` by the read or peek call + ) + { + + if ( !context.handleLifetime->isHandleValid( hDecoderContext )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + return ZE_RESULT_SUCCESS; + } + ze_result_t + ZESHandleLifetimeValidation::zesInfoLogDecoderContextReadFieldExtPrologue( + zes_info_log_decoder_context_handle_t hDecoderContext, ///< [in] handle of the decoder context, which must be decoding a batch + uint32_t fieldId, ///< [in] identifier of the field to read, as reported in `fieldId` of + ///< ::zes_info_log_decodable_field_info_ext_t + uint32_t recordId, ///< [in] index of the record in the `pDescriptors` that was passed to + ///< ::zesInfoLogDecoderContextDecodeStartExt + void* pOutBuffer, ///< [in,out][range(0, bufferLen)] buffer that will contain the value of + ///< the field + size_t bufferLen, ///< [in] size, in bytes, of `pOutBuffer` + size_t* pBytesCopied ///< [out] pointer to the number of bytes written to `pOutBuffer`. + ///< the driver shall update the value with zero when the record does not + ///< carry the field. + ) + { + + if ( !context.handleLifetime->isHandleValid( hDecoderContext )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + return ZE_RESULT_SUCCESS; + } + ze_result_t + ZESHandleLifetimeValidation::zesInfoLogDecoderContextDecodeStopExtPrologue( + zes_info_log_decoder_context_handle_t hDecoderContext ///< [in] handle of the decoder context + ) + { + + if ( !context.handleLifetime->isHandleValid( hDecoderContext )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + return ZE_RESULT_SUCCESS; + } + ze_result_t + ZESHandleLifetimeValidation::zesInfoLogDecoderContextDeleteExtPrologue( + zes_info_log_handle_t hInfoLog, ///< [in] handle of the info log that the decoder context was created from + zes_info_log_decoder_context_handle_t hDecoderContext ///< [in][release] handle of the decoder context to delete + ) + { + + if ( !context.handleLifetime->isHandleValid( hInfoLog )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + if ( !context.handleLifetime->isHandleValid( hDecoderContext )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + return ZE_RESULT_SUCCESS; + } + ze_result_t ZESHandleLifetimeValidation::zesDriverGetPciDevicePropertiesPrologue( zes_driver_handle_t hDriver, ///< [in] handle of the sysman driver instance uint32_t* pCount, ///< [in,out] pointer to the number of PCI devices. diff --git a/source/layers/validation/handle_lifetime_tracking/zes_handle_lifetime.h b/source/layers/validation/handle_lifetime_tracking/zes_handle_lifetime.h index b4b2ef5a..043971f5 100644 --- a/source/layers/validation/handle_lifetime_tracking/zes_handle_lifetime.h +++ b/source/layers/validation/handle_lifetime_tracking/zes_handle_lifetime.h @@ -20,6 +20,7 @@ namespace validation_layer class ZESHandleLifetimeValidation : public ZESValidationEntryPoints { public: ze_result_t zesDriverGetPropertiesPrologue( zes_driver_handle_t hDriver, zes_driver_properties_t* pDriverProperties ) override; + ze_result_t zesDriverGetApiVersionPrologue( zes_driver_handle_t hDriver, zes_api_version_t* pVersion ) override; ze_result_t zesDriverGetExtensionPropertiesPrologue( zes_driver_handle_t hDriver, uint32_t* pCount, zes_driver_extension_properties_t* pExtensionProperties ) override; ze_result_t zesDriverGetExtensionFunctionAddressPrologue( zes_driver_handle_t hDriver, const char* name, void** ppFunctionAddress ) override; ze_result_t zesDeviceGetPrologue( zes_driver_handle_t hDriver, uint32_t* pCount, zes_device_handle_t* phDevices ) override; @@ -185,6 +186,12 @@ namespace validation_layer ze_result_t zesInfoLogInstanceReadWithMetadataExtPrologue( zes_info_log_instance_handle_t hInfoLogInstance, uint64_t timeout, uint32_t* pSize, uint8_t* pBuffer, uint32_t* pRecordCount, zes_info_log_metadata_ext_t* pDescriptors, zes_info_log_read_status_ext_t* pReadStatus ) override; ze_result_t zesInfoLogInstancePeekWithMetadataExtPrologue( zes_info_log_instance_handle_t hInfoLogInstance, uint64_t timeout, uint32_t* pSize, uint8_t* pBuffer, uint32_t* pRecordCount, zes_info_log_metadata_ext_t* pDescriptors, zes_info_log_read_status_ext_t* pReadStatus ) override; ze_result_t zesInfoLogInstanceDeleteExtPrologue( zes_info_log_instance_handle_t hInfoLogInstance ) override; + ze_result_t zesInfoLogDecoderContextCreateExtPrologue( zes_info_log_handle_t hInfoLog, zes_info_log_decoder_context_handle_t* phDecoderContext ) override; + ze_result_t zesInfoLogDecoderContextGetFieldInfoExtPrologue( zes_info_log_decoder_context_handle_t hDecoderContext, uint32_t* pCount, zes_info_log_decodable_field_info_ext_t* pFieldInfos ) override; + ze_result_t zesInfoLogDecoderContextDecodeStartExtPrologue( zes_info_log_decoder_context_handle_t hDecoderContext, uint32_t size, const uint8_t* pBuffer, uint32_t recordCount, const zes_info_log_metadata_ext_t* pDescriptors ) override; + ze_result_t zesInfoLogDecoderContextReadFieldExtPrologue( zes_info_log_decoder_context_handle_t hDecoderContext, uint32_t fieldId, uint32_t recordId, void* pOutBuffer, size_t bufferLen, size_t* pBytesCopied ) override; + ze_result_t zesInfoLogDecoderContextDecodeStopExtPrologue( zes_info_log_decoder_context_handle_t hDecoderContext ) override; + ze_result_t zesInfoLogDecoderContextDeleteExtPrologue( zes_info_log_handle_t hInfoLog, zes_info_log_decoder_context_handle_t hDecoderContext ) override; ze_result_t zesDriverGetPciDevicePropertiesPrologue( zes_driver_handle_t hDriver, uint32_t* pCount, zes_driver_pci_device_properties_t* pProperties ) 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 c49ef4fb..c3f40856 100644 --- a/source/layers/validation/handle_lifetime_tracking/zet_handle_lifetime.cpp +++ b/source/layers/validation/handle_lifetime_tracking/zet_handle_lifetime.cpp @@ -889,7 +889,8 @@ namespace validation_layer ZETHandleLifetimeValidation::zetDeviceCreateMetricGroupsFromMetricsExpPrologue( zet_device_handle_t hDevice, ///< [in] handle of the device. uint32_t metricCount, ///< [in] number of metric handles. - zet_metric_handle_t * phMetrics, ///< [in] metric handles to be added to the metric groups. + zet_metric_handle_t* phMetrics, ///< [in][range(0, metricCount)] array of metric handles to be added to the + ///< metric groups. const char * pMetricGroupNamePrefix, ///< [in] prefix to the name created for the metric groups. Must point to a ///< null-terminated character array no longer than ///< ::ZET_MAX_METRIC_GROUP_NAME_PREFIX_EXP. @@ -913,6 +914,11 @@ namespace validation_layer if ( !context.handleLifetime->isHandleValid( hDevice )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } + for (size_t i = 0; ( nullptr != phMetrics) && (i < metricCount); ++i){ + if (!context.handleLifetime->isHandleValid( phMetrics[i] )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + } return ZE_RESULT_SUCCESS; } ze_result_t 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 63ce8b33..34e0e2a2 100644 --- a/source/layers/validation/handle_lifetime_tracking/zet_handle_lifetime.h +++ b/source/layers/validation/handle_lifetime_tracking/zet_handle_lifetime.h @@ -68,7 +68,7 @@ namespace validation_layer ze_result_t zetMetricProgrammableGetParamValueInfoExpPrologue( zet_metric_programmable_exp_handle_t hMetricProgrammable, uint32_t parameterOrdinal, uint32_t* pValueInfoCount, zet_metric_programmable_param_value_info_exp_t* pValueInfo ) override; ze_result_t zetMetricCreateFromProgrammableExp2Prologue( zet_metric_programmable_exp_handle_t hMetricProgrammable, uint32_t parameterCount, zet_metric_programmable_param_value_exp_t* pParameterValues, const char* pName, const char* pDescription, uint32_t* pMetricHandleCount, zet_metric_handle_t* phMetricHandles ) override; ze_result_t zetMetricCreateFromProgrammableExpPrologue( zet_metric_programmable_exp_handle_t hMetricProgrammable, zet_metric_programmable_param_value_exp_t* pParameterValues, uint32_t parameterCount, const char* pName, const char* pDescription, uint32_t* pMetricHandleCount, zet_metric_handle_t* phMetricHandles ) override; - ze_result_t zetDeviceCreateMetricGroupsFromMetricsExpPrologue( zet_device_handle_t hDevice, uint32_t metricCount, zet_metric_handle_t * phMetrics, const char * pMetricGroupNamePrefix, const char * pDescription, uint32_t * pMetricGroupCount, zet_metric_group_handle_t* phMetricGroup ) override; + ze_result_t zetDeviceCreateMetricGroupsFromMetricsExpPrologue( zet_device_handle_t hDevice, uint32_t metricCount, zet_metric_handle_t* phMetrics, const char * pMetricGroupNamePrefix, const char * pDescription, uint32_t * pMetricGroupCount, zet_metric_group_handle_t* phMetricGroup ) override; ze_result_t zetMetricGroupCreateExpPrologue( zet_device_handle_t hDevice, const char* pName, const char* pDescription, zet_metric_group_sampling_type_flags_t samplingType, zet_metric_group_handle_t* phMetricGroup ) override; ze_result_t zetMetricGroupAddMetricExpPrologue( zet_metric_group_handle_t hMetricGroup, zet_metric_handle_t hMetric, size_t * pErrorStringSize, char* pErrorString ) override; ze_result_t zetMetricGroupRemoveMetricExpPrologue( zet_metric_group_handle_t hMetricGroup, zet_metric_handle_t hMetric ) override; diff --git a/source/layers/validation/zes_valddi.cpp b/source/layers/validation/zes_valddi.cpp index 12793d66..8667c27f 100644 --- a/source/layers/validation/zes_valddi.cpp +++ b/source/layers/validation/zes_valddi.cpp @@ -100,6 +100,35 @@ namespace validation_layer oss << ")"; context.logger->log_trace(oss.str()); return result; + } + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zesDriverGetApiVersion( + ze_result_t result, + zes_driver_handle_t hDriver, ///< [in] handle of the sysman driver instance + zes_api_version_t* pVersion ///< [out] api version +) { + // Only log success results if verbose logging is enabled + if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { + return result; + } + std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; + std::ostringstream oss; + oss << status << " (" << loader::to_string(result) << ") in zesDriverGetApiVersion("; + + + oss << "hDriver="; + oss << loader::to_string(hDriver); + + oss << ", "; + oss << "pVersion="; + // Dereference output parameter if not null and result is success + if (result == ZE_RESULT_SUCCESS && pVersion != nullptr) { + oss << loader::to_string(*pVersion); + } else { + oss << loader::to_string(pVersion); + } + oss << ")"; + context.logger->log_trace(oss.str()); + return result; } VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zesDriverGetExtensionProperties( ze_result_t result, @@ -5198,6 +5227,211 @@ namespace validation_layer oss << ")"; context.logger->log_trace(oss.str()); return result; + } + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zesInfoLogDecoderContextCreateExt( + ze_result_t result, + zes_info_log_handle_t hInfoLog, ///< [in] handle of the info log that the records are read from + zes_info_log_decoder_context_handle_t* phDecoderContext ///< [out] handle of the decoder context that was created. +) { + // Only log success results if verbose logging is enabled + if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { + return result; + } + std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; + std::ostringstream oss; + oss << status << " (" << loader::to_string(result) << ") in zesInfoLogDecoderContextCreateExt("; + + + oss << "hInfoLog="; + oss << loader::to_string(hInfoLog); + + oss << ", "; + oss << "phDecoderContext="; + // Dereference output parameter if not null and result is success + if (result == ZE_RESULT_SUCCESS && phDecoderContext != nullptr) { + oss << loader::to_string(*phDecoderContext); + } else { + oss << loader::to_string(phDecoderContext); + } + oss << ")"; + context.logger->log_trace(oss.str()); + return result; + } + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zesInfoLogDecoderContextGetFieldInfoExt( + ze_result_t result, + zes_info_log_decoder_context_handle_t hDecoderContext, ///< [in] handle of the decoder context + uint32_t* pCount, ///< [in,out] pointer to the number of fields that can be decoded. + ///< if count is zero, then the driver shall update the value with the + ///< total number of fields that can be decoded and shall not return any descriptor. + ///< if count is greater than the number of fields that can be decoded, + ///< then the driver shall update the value with the correct number of fields. + zes_info_log_decodable_field_info_ext_t* pFieldInfos///< [in,out][optional][range(0, *pCount)] array of field descriptions, one + ///< element per field. + ///< if count is less than the number of fields that can be decoded, then + ///< the driver shall only retrieve that number of descriptors. +) { + // Only log success results if verbose logging is enabled + if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { + return result; + } + std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; + std::ostringstream oss; + oss << status << " (" << loader::to_string(result) << ") in zesInfoLogDecoderContextGetFieldInfoExt("; + + + oss << "hDecoderContext="; + oss << loader::to_string(hDecoderContext); + + oss << ", "; + oss << "pCount="; + oss << loader::to_string(pCount); + + oss << ", "; + oss << "pFieldInfos="; + oss << loader::to_string(pFieldInfos); + oss << ")"; + context.logger->log_trace(oss.str()); + return result; + } + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zesInfoLogDecoderContextDecodeStartExt( + ze_result_t result, + zes_info_log_decoder_context_handle_t hDecoderContext, ///< [in] handle of the decoder context + uint32_t size, ///< [in] size, in bytes, of the record data in `pBuffer`, as returned in + ///< `*pSize` by the read or peek call + const uint8_t* pBuffer, ///< [in][optional][range(0, size)] the record data, as returned in + ///< `pBuffer` by the read or peek call + uint32_t recordCount, ///< [in] number of records in the batch, as returned in `*pRecordCount` by + ///< the read or peek call + const zes_info_log_metadata_ext_t* pDescriptors ///< [in][optional][range(0, recordCount)] array of metadata describing + ///< each record, as returned in `pDescriptors` by the read or peek call +) { + // Only log success results if verbose logging is enabled + if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { + return result; + } + std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; + std::ostringstream oss; + oss << status << " (" << loader::to_string(result) << ") in zesInfoLogDecoderContextDecodeStartExt("; + + + oss << "hDecoderContext="; + oss << loader::to_string(hDecoderContext); + + oss << ", "; + oss << "size="; + oss << loader::to_string(size); + + oss << ", "; + oss << "pBuffer="; + oss << loader::to_string(pBuffer); + + oss << ", "; + oss << "recordCount="; + oss << loader::to_string(recordCount); + + oss << ", "; + oss << "pDescriptors="; + oss << loader::to_string(pDescriptors); + oss << ")"; + context.logger->log_trace(oss.str()); + return result; + } + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zesInfoLogDecoderContextReadFieldExt( + ze_result_t result, + zes_info_log_decoder_context_handle_t hDecoderContext, ///< [in] handle of the decoder context, which must be decoding a batch + uint32_t fieldId, ///< [in] identifier of the field to read, as reported in `fieldId` of + ///< ::zes_info_log_decodable_field_info_ext_t + uint32_t recordId, ///< [in] index of the record in the `pDescriptors` that was passed to + ///< ::zesInfoLogDecoderContextDecodeStartExt + void* pOutBuffer, ///< [in,out][range(0, bufferLen)] buffer that will contain the value of + ///< the field + size_t bufferLen, ///< [in] size, in bytes, of `pOutBuffer` + size_t* pBytesCopied ///< [out] pointer to the number of bytes written to `pOutBuffer`. + ///< the driver shall update the value with zero when the record does not + ///< carry the field. +) { + // Only log success results if verbose logging is enabled + if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { + return result; + } + std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; + std::ostringstream oss; + oss << status << " (" << loader::to_string(result) << ") in zesInfoLogDecoderContextReadFieldExt("; + + + oss << "hDecoderContext="; + oss << loader::to_string(hDecoderContext); + + oss << ", "; + oss << "fieldId="; + oss << loader::to_string(fieldId); + + oss << ", "; + oss << "recordId="; + oss << loader::to_string(recordId); + + oss << ", "; + oss << "pOutBuffer="; + oss << loader::to_string(pOutBuffer); + + oss << ", "; + oss << "bufferLen="; + oss << loader::to_string(bufferLen); + + oss << ", "; + oss << "pBytesCopied="; + // Dereference output parameter if not null and result is success + if (result == ZE_RESULT_SUCCESS && pBytesCopied != nullptr) { + oss << loader::to_string(*pBytesCopied); + } else { + oss << loader::to_string(pBytesCopied); + } + oss << ")"; + context.logger->log_trace(oss.str()); + return result; + } + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zesInfoLogDecoderContextDecodeStopExt( + ze_result_t result, + zes_info_log_decoder_context_handle_t hDecoderContext ///< [in] handle of the decoder context +) { + // Only log success results if verbose logging is enabled + if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { + return result; + } + std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; + std::ostringstream oss; + oss << status << " (" << loader::to_string(result) << ") in zesInfoLogDecoderContextDecodeStopExt("; + + + oss << "hDecoderContext="; + oss << loader::to_string(hDecoderContext); + oss << ")"; + context.logger->log_trace(oss.str()); + return result; + } + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zesInfoLogDecoderContextDeleteExt( + ze_result_t result, + zes_info_log_handle_t hInfoLog, ///< [in] handle of the info log that the decoder context was created from + zes_info_log_decoder_context_handle_t hDecoderContext ///< [in][release] handle of the decoder context to delete +) { + // Only log success results if verbose logging is enabled + if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { + return result; + } + std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; + std::ostringstream oss; + oss << status << " (" << loader::to_string(result) << ") in zesInfoLogDecoderContextDeleteExt("; + + + oss << "hInfoLog="; + oss << loader::to_string(hInfoLog); + + oss << ", "; + oss << "hDecoderContext="; + oss << loader::to_string(hDecoderContext); + oss << ")"; + context.logger->log_trace(oss.str()); + return result; } VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zesDriverGetPciDeviceProperties( ze_result_t result, @@ -5379,6 +5613,48 @@ namespace validation_layer return logAndPropagateResult_zesDriverGetProperties(driver_result, hDriver, pDriverProperties); } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesDriverGetApiVersion + __zedlllocal ze_result_t ZE_APICALL + zesDriverGetApiVersion( + zes_driver_handle_t hDriver, ///< [in] handle of the sysman driver instance + zes_api_version_t* pVersion ///< [out] api version + ) + { + context.logger->log_trace("zesDriverGetApiVersion(hDriver, pVersion)"); + + auto pfnGetApiVersion = context.zesDdiTable.Driver.pfnGetApiVersion; + + if( nullptr == pfnGetApiVersion ) + return logAndPropagateResult_zesDriverGetApiVersion(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDriver, pVersion); + + auto numValHandlers = context.validationHandlers.size(); + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zesValidation->zesDriverGetApiVersionPrologue( hDriver, pVersion ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zesDriverGetApiVersion(result, hDriver, pVersion); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zesHandleLifetime.zesDriverGetApiVersionPrologue( hDriver, pVersion ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zesDriverGetApiVersion(result, hDriver, pVersion); + } + + auto driver_result = pfnGetApiVersion( hDriver, pVersion ); + + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zesValidation->zesDriverGetApiVersionEpilogue( hDriver, pVersion ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zesDriverGetApiVersion(result, hDriver, pVersion); + } + + return logAndPropagateResult_zesDriverGetApiVersion(driver_result, hDriver, pVersion); + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zesDriverGetExtensionProperties __zedlllocal ze_result_t ZE_APICALL @@ -12945,6 +13221,290 @@ namespace validation_layer return logAndPropagateResult_zesInfoLogInstanceDeleteExt(driver_result, hInfoLogInstance); } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesInfoLogDecoderContextCreateExt + __zedlllocal ze_result_t ZE_APICALL + zesInfoLogDecoderContextCreateExt( + zes_info_log_handle_t hInfoLog, ///< [in] handle of the info log that the records are read from + zes_info_log_decoder_context_handle_t* phDecoderContext ///< [out] handle of the decoder context that was created. + ) + { + context.logger->log_trace("zesInfoLogDecoderContextCreateExt(hInfoLog, phDecoderContext)"); + + auto pfnCreateExt = context.zesDdiTable.InfoLogDecoderContext.pfnCreateExt; + + if( nullptr == pfnCreateExt ) + return logAndPropagateResult_zesInfoLogDecoderContextCreateExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hInfoLog, phDecoderContext); + + auto numValHandlers = context.validationHandlers.size(); + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zesValidation->zesInfoLogDecoderContextCreateExtPrologue( hInfoLog, phDecoderContext ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zesInfoLogDecoderContextCreateExt(result, hInfoLog, phDecoderContext); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zesHandleLifetime.zesInfoLogDecoderContextCreateExtPrologue( hInfoLog, phDecoderContext ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zesInfoLogDecoderContextCreateExt(result, hInfoLog, phDecoderContext); + } + + auto driver_result = pfnCreateExt( hInfoLog, phDecoderContext ); + + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zesValidation->zesInfoLogDecoderContextCreateExtEpilogue( hInfoLog, phDecoderContext ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zesInfoLogDecoderContextCreateExt(result, hInfoLog, phDecoderContext); + } + + + if( driver_result == ZE_RESULT_SUCCESS && context.enableHandleLifetime ){ + + if (phDecoderContext){ + context.handleLifetime->addHandle( *phDecoderContext ); + context.handleLifetime->addDependent( hInfoLog, *phDecoderContext ); + + } + } + return logAndPropagateResult_zesInfoLogDecoderContextCreateExt(driver_result, hInfoLog, phDecoderContext); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesInfoLogDecoderContextGetFieldInfoExt + __zedlllocal ze_result_t ZE_APICALL + zesInfoLogDecoderContextGetFieldInfoExt( + zes_info_log_decoder_context_handle_t hDecoderContext, ///< [in] handle of the decoder context + uint32_t* pCount, ///< [in,out] pointer to the number of fields that can be decoded. + ///< if count is zero, then the driver shall update the value with the + ///< total number of fields that can be decoded and shall not return any descriptor. + ///< if count is greater than the number of fields that can be decoded, + ///< then the driver shall update the value with the correct number of fields. + zes_info_log_decodable_field_info_ext_t* pFieldInfos///< [in,out][optional][range(0, *pCount)] array of field descriptions, one + ///< element per field. + ///< if count is less than the number of fields that can be decoded, then + ///< the driver shall only retrieve that number of descriptors. + ) + { + context.logger->log_trace("zesInfoLogDecoderContextGetFieldInfoExt(hDecoderContext, pCount, pFieldInfos)"); + + auto pfnGetFieldInfoExt = context.zesDdiTable.InfoLogDecoderContext.pfnGetFieldInfoExt; + + if( nullptr == pfnGetFieldInfoExt ) + return logAndPropagateResult_zesInfoLogDecoderContextGetFieldInfoExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDecoderContext, pCount, pFieldInfos); + + auto numValHandlers = context.validationHandlers.size(); + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zesValidation->zesInfoLogDecoderContextGetFieldInfoExtPrologue( hDecoderContext, pCount, pFieldInfos ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zesInfoLogDecoderContextGetFieldInfoExt(result, hDecoderContext, pCount, pFieldInfos); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zesHandleLifetime.zesInfoLogDecoderContextGetFieldInfoExtPrologue( hDecoderContext, pCount, pFieldInfos ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zesInfoLogDecoderContextGetFieldInfoExt(result, hDecoderContext, pCount, pFieldInfos); + } + + auto driver_result = pfnGetFieldInfoExt( hDecoderContext, pCount, pFieldInfos ); + + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zesValidation->zesInfoLogDecoderContextGetFieldInfoExtEpilogue( hDecoderContext, pCount, pFieldInfos ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zesInfoLogDecoderContextGetFieldInfoExt(result, hDecoderContext, pCount, pFieldInfos); + } + + return logAndPropagateResult_zesInfoLogDecoderContextGetFieldInfoExt(driver_result, hDecoderContext, pCount, pFieldInfos); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesInfoLogDecoderContextDecodeStartExt + __zedlllocal ze_result_t ZE_APICALL + zesInfoLogDecoderContextDecodeStartExt( + zes_info_log_decoder_context_handle_t hDecoderContext, ///< [in] handle of the decoder context + uint32_t size, ///< [in] size, in bytes, of the record data in `pBuffer`, as returned in + ///< `*pSize` by the read or peek call + const uint8_t* pBuffer, ///< [in][optional][range(0, size)] the record data, as returned in + ///< `pBuffer` by the read or peek call + uint32_t recordCount, ///< [in] number of records in the batch, as returned in `*pRecordCount` by + ///< the read or peek call + const zes_info_log_metadata_ext_t* pDescriptors ///< [in][optional][range(0, recordCount)] array of metadata describing + ///< each record, as returned in `pDescriptors` by the read or peek call + ) + { + context.logger->log_trace("zesInfoLogDecoderContextDecodeStartExt(hDecoderContext, size, pBuffer, recordCount, pDescriptors)"); + + auto pfnDecodeStartExt = context.zesDdiTable.InfoLogDecoderContext.pfnDecodeStartExt; + + if( nullptr == pfnDecodeStartExt ) + return logAndPropagateResult_zesInfoLogDecoderContextDecodeStartExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDecoderContext, size, pBuffer, recordCount, pDescriptors); + + auto numValHandlers = context.validationHandlers.size(); + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zesValidation->zesInfoLogDecoderContextDecodeStartExtPrologue( hDecoderContext, size, pBuffer, recordCount, pDescriptors ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zesInfoLogDecoderContextDecodeStartExt(result, hDecoderContext, size, pBuffer, recordCount, pDescriptors); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zesHandleLifetime.zesInfoLogDecoderContextDecodeStartExtPrologue( hDecoderContext, size, pBuffer, recordCount, pDescriptors ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zesInfoLogDecoderContextDecodeStartExt(result, hDecoderContext, size, pBuffer, recordCount, pDescriptors); + } + + auto driver_result = pfnDecodeStartExt( hDecoderContext, size, pBuffer, recordCount, pDescriptors ); + + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zesValidation->zesInfoLogDecoderContextDecodeStartExtEpilogue( hDecoderContext, size, pBuffer, recordCount, pDescriptors ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zesInfoLogDecoderContextDecodeStartExt(result, hDecoderContext, size, pBuffer, recordCount, pDescriptors); + } + + return logAndPropagateResult_zesInfoLogDecoderContextDecodeStartExt(driver_result, hDecoderContext, size, pBuffer, recordCount, pDescriptors); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesInfoLogDecoderContextReadFieldExt + __zedlllocal ze_result_t ZE_APICALL + zesInfoLogDecoderContextReadFieldExt( + zes_info_log_decoder_context_handle_t hDecoderContext, ///< [in] handle of the decoder context, which must be decoding a batch + uint32_t fieldId, ///< [in] identifier of the field to read, as reported in `fieldId` of + ///< ::zes_info_log_decodable_field_info_ext_t + uint32_t recordId, ///< [in] index of the record in the `pDescriptors` that was passed to + ///< ::zesInfoLogDecoderContextDecodeStartExt + void* pOutBuffer, ///< [in,out][range(0, bufferLen)] buffer that will contain the value of + ///< the field + size_t bufferLen, ///< [in] size, in bytes, of `pOutBuffer` + size_t* pBytesCopied ///< [out] pointer to the number of bytes written to `pOutBuffer`. + ///< the driver shall update the value with zero when the record does not + ///< carry the field. + ) + { + context.logger->log_trace("zesInfoLogDecoderContextReadFieldExt(hDecoderContext, fieldId, recordId, pOutBuffer, bufferLen, pBytesCopied)"); + + auto pfnReadFieldExt = context.zesDdiTable.InfoLogDecoderContext.pfnReadFieldExt; + + if( nullptr == pfnReadFieldExt ) + return logAndPropagateResult_zesInfoLogDecoderContextReadFieldExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDecoderContext, fieldId, recordId, pOutBuffer, bufferLen, pBytesCopied); + + auto numValHandlers = context.validationHandlers.size(); + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zesValidation->zesInfoLogDecoderContextReadFieldExtPrologue( hDecoderContext, fieldId, recordId, pOutBuffer, bufferLen, pBytesCopied ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zesInfoLogDecoderContextReadFieldExt(result, hDecoderContext, fieldId, recordId, pOutBuffer, bufferLen, pBytesCopied); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zesHandleLifetime.zesInfoLogDecoderContextReadFieldExtPrologue( hDecoderContext, fieldId, recordId, pOutBuffer, bufferLen, pBytesCopied ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zesInfoLogDecoderContextReadFieldExt(result, hDecoderContext, fieldId, recordId, pOutBuffer, bufferLen, pBytesCopied); + } + + auto driver_result = pfnReadFieldExt( hDecoderContext, fieldId, recordId, pOutBuffer, bufferLen, pBytesCopied ); + + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zesValidation->zesInfoLogDecoderContextReadFieldExtEpilogue( hDecoderContext, fieldId, recordId, pOutBuffer, bufferLen, pBytesCopied ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zesInfoLogDecoderContextReadFieldExt(result, hDecoderContext, fieldId, recordId, pOutBuffer, bufferLen, pBytesCopied); + } + + return logAndPropagateResult_zesInfoLogDecoderContextReadFieldExt(driver_result, hDecoderContext, fieldId, recordId, pOutBuffer, bufferLen, pBytesCopied); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesInfoLogDecoderContextDecodeStopExt + __zedlllocal ze_result_t ZE_APICALL + zesInfoLogDecoderContextDecodeStopExt( + zes_info_log_decoder_context_handle_t hDecoderContext ///< [in] handle of the decoder context + ) + { + context.logger->log_trace("zesInfoLogDecoderContextDecodeStopExt(hDecoderContext)"); + + auto pfnDecodeStopExt = context.zesDdiTable.InfoLogDecoderContext.pfnDecodeStopExt; + + if( nullptr == pfnDecodeStopExt ) + return logAndPropagateResult_zesInfoLogDecoderContextDecodeStopExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDecoderContext); + + auto numValHandlers = context.validationHandlers.size(); + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zesValidation->zesInfoLogDecoderContextDecodeStopExtPrologue( hDecoderContext ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zesInfoLogDecoderContextDecodeStopExt(result, hDecoderContext); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zesHandleLifetime.zesInfoLogDecoderContextDecodeStopExtPrologue( hDecoderContext ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zesInfoLogDecoderContextDecodeStopExt(result, hDecoderContext); + } + + auto driver_result = pfnDecodeStopExt( hDecoderContext ); + + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zesValidation->zesInfoLogDecoderContextDecodeStopExtEpilogue( hDecoderContext ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zesInfoLogDecoderContextDecodeStopExt(result, hDecoderContext); + } + + return logAndPropagateResult_zesInfoLogDecoderContextDecodeStopExt(driver_result, hDecoderContext); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesInfoLogDecoderContextDeleteExt + __zedlllocal ze_result_t ZE_APICALL + zesInfoLogDecoderContextDeleteExt( + zes_info_log_handle_t hInfoLog, ///< [in] handle of the info log that the decoder context was created from + zes_info_log_decoder_context_handle_t hDecoderContext ///< [in][release] handle of the decoder context to delete + ) + { + context.logger->log_trace("zesInfoLogDecoderContextDeleteExt(hInfoLog, hDecoderContext)"); + + auto pfnDeleteExt = context.zesDdiTable.InfoLogDecoderContext.pfnDeleteExt; + + if( nullptr == pfnDeleteExt ) + return logAndPropagateResult_zesInfoLogDecoderContextDeleteExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hInfoLog, hDecoderContext); + + auto numValHandlers = context.validationHandlers.size(); + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zesValidation->zesInfoLogDecoderContextDeleteExtPrologue( hInfoLog, hDecoderContext ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zesInfoLogDecoderContextDeleteExt(result, hInfoLog, hDecoderContext); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zesHandleLifetime.zesInfoLogDecoderContextDeleteExtPrologue( hInfoLog, hDecoderContext ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zesInfoLogDecoderContextDeleteExt(result, hInfoLog, hDecoderContext); + } + + auto driver_result = pfnDeleteExt( hInfoLog, hDecoderContext ); + + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zesValidation->zesInfoLogDecoderContextDeleteExtEpilogue( hInfoLog, hDecoderContext ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zesInfoLogDecoderContextDeleteExt(result, hInfoLog, hDecoderContext); + } + + return logAndPropagateResult_zesInfoLogDecoderContextDeleteExt(driver_result, hInfoLog, hDecoderContext); + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zesDriverGetPciDeviceProperties __zedlllocal ze_result_t ZE_APICALL @@ -13310,6 +13870,10 @@ zesGetDriverProcAddrTable( dditable.pfnGetPciDeviceProperties = pDdiTable->pfnGetPciDeviceProperties; pDdiTable->pfnGetPciDeviceProperties = validation_layer::zesDriverGetPciDeviceProperties; } + if (version >= ZE_API_VERSION_1_21) { + dditable.pfnGetApiVersion = pDdiTable->pfnGetApiVersion; + pDdiTable->pfnGetApiVersion = validation_layer::zesDriverGetApiVersion; + } if (version >= ZE_API_VERSION_1_5) { dditable.pfnGet = pDdiTable->pfnGet; pDdiTable->pfnGet = validation_layer::zesDriverGet; @@ -14340,6 +14904,57 @@ zesGetInfoLogProcAddrTable( return result; } +/////////////////////////////////////////////////////////////////////////////// +/// @brief Exported function for filling application's InfoLogDecoderContext 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 +zesGetInfoLogDecoderContextProcAddrTable( + ze_api_version_t version, ///< [in] API version requested + zes_info_log_decoder_context_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers + ) +{ + auto& dditable = validation_layer::context.zesDdiTable.InfoLogDecoderContext; + + 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_21) { + dditable.pfnCreateExt = pDdiTable->pfnCreateExt; + pDdiTable->pfnCreateExt = validation_layer::zesInfoLogDecoderContextCreateExt; + } + if (version >= ZE_API_VERSION_1_21) { + dditable.pfnGetFieldInfoExt = pDdiTable->pfnGetFieldInfoExt; + pDdiTable->pfnGetFieldInfoExt = validation_layer::zesInfoLogDecoderContextGetFieldInfoExt; + } + if (version >= ZE_API_VERSION_1_21) { + dditable.pfnDecodeStartExt = pDdiTable->pfnDecodeStartExt; + pDdiTable->pfnDecodeStartExt = validation_layer::zesInfoLogDecoderContextDecodeStartExt; + } + if (version >= ZE_API_VERSION_1_21) { + dditable.pfnReadFieldExt = pDdiTable->pfnReadFieldExt; + pDdiTable->pfnReadFieldExt = validation_layer::zesInfoLogDecoderContextReadFieldExt; + } + if (version >= ZE_API_VERSION_1_21) { + dditable.pfnDecodeStopExt = pDdiTable->pfnDecodeStopExt; + pDdiTable->pfnDecodeStopExt = validation_layer::zesInfoLogDecoderContextDecodeStopExt; + } + if (version >= ZE_API_VERSION_1_21) { + dditable.pfnDeleteExt = pDdiTable->pfnDeleteExt; + pDdiTable->pfnDeleteExt = validation_layer::zesInfoLogDecoderContextDeleteExt; + } + return result; +} + /////////////////////////////////////////////////////////////////////////////// /// @brief Exported function for filling application's InfoLogInstance table /// with current process' addresses diff --git a/source/layers/validation/zet_valddi.cpp b/source/layers/validation/zet_valddi.cpp index c5a55abd..dfde245d 100644 --- a/source/layers/validation/zet_valddi.cpp +++ b/source/layers/validation/zet_valddi.cpp @@ -1744,7 +1744,8 @@ namespace validation_layer ze_result_t result, zet_device_handle_t hDevice, ///< [in] handle of the device. uint32_t metricCount, ///< [in] number of metric handles. - zet_metric_handle_t * phMetrics, ///< [in] metric handles to be added to the metric groups. + zet_metric_handle_t* phMetrics, ///< [in][range(0, metricCount)] array of metric handles to be added to the + ///< metric groups. const char * pMetricGroupNamePrefix, ///< [in] prefix to the name created for the metric groups. Must point to a ///< null-terminated character array no longer than ///< ::ZET_MAX_METRIC_GROUP_NAME_PREFIX_EXP. @@ -4806,7 +4807,8 @@ namespace validation_layer zetDeviceCreateMetricGroupsFromMetricsExp( zet_device_handle_t hDevice, ///< [in] handle of the device. uint32_t metricCount, ///< [in] number of metric handles. - zet_metric_handle_t * phMetrics, ///< [in] metric handles to be added to the metric groups. + zet_metric_handle_t* phMetrics, ///< [in][range(0, metricCount)] array of metric handles to be added to the + ///< metric groups. const char * pMetricGroupNamePrefix, ///< [in] prefix to the name created for the metric groups. Must point to a ///< null-terminated character array no longer than ///< ::ZET_MAX_METRIC_GROUP_NAME_PREFIX_EXP. @@ -4826,7 +4828,7 @@ namespace validation_layer ///< Created Metric group handles. ) { - context.logger->log_trace("zetDeviceCreateMetricGroupsFromMetricsExp(hDevice, metricCount, phMetrics, pMetricGroupNamePrefix, pDescription, pMetricGroupCount, phMetricGroup)"); + context.logger->log_trace("zetDeviceCreateMetricGroupsFromMetricsExp(hDevice, metricCount, phMetricsLocal, pMetricGroupNamePrefix, pDescription, pMetricGroupCount, phMetricGroup)"); auto pfnCreateMetricGroupsFromMetricsExp = context.zetDdiTable.DeviceExp.pfnCreateMetricGroupsFromMetricsExp; diff --git a/source/lib/ze_libapi.cpp b/source/lib/ze_libapi.cpp index 89aef2f3..a38e9b52 100644 --- a/source/lib/ze_libapi.cpp +++ b/source/lib/ze_libapi.cpp @@ -2520,7 +2520,7 @@ zeContextGetStatus( /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION /// + `0x7 < desc->flags` /// + `::ZE_COMMAND_QUEUE_MODE_ASYNCHRONOUS < desc->mode` -/// + `::ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_HIGH < desc->priority` +/// + `::ZE_COMMAND_QUEUE_PRIORITY_HIGH < desc->priority` /// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION ze_result_t ZE_APICALL zeCommandQueueCreate( @@ -3183,7 +3183,7 @@ zeCommandListCreate( /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION /// + `0x7 < altdesc->flags` /// + `::ZE_COMMAND_QUEUE_MODE_ASYNCHRONOUS < altdesc->mode` -/// + `::ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_HIGH < altdesc->priority` +/// + `::ZE_COMMAND_QUEUE_PRIORITY_HIGH < altdesc->priority` /// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION ze_result_t ZE_APICALL zeCommandListCreateImmediate( @@ -3491,6 +3491,12 @@ zeCommandListAppendWriteGlobalTimestamp( /// execution of commands appended to other /// immediate command lists created with either a different ordinal or /// different index. +/// - Some implementations may associate immediate command lists created +/// with the same ordinal and index with the same hardware queue. +/// In that case, this function may also wait for commands appended to the +/// other immediate command lists before +/// the last command appended to this command list, and may return +/// ::ZE_RESULT_NOT_READY while those commands are not complete. /// - The application may call this function from simultaneous threads. /// - The implementation of this function should be lock-free. /// @@ -17804,7 +17810,9 @@ zeGraphDestroyExt( /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hGraph` /// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT -/// + Graph is not in a recording state +/// + Capture into `hGraph` is already paused +/// - ::ZE_RESULT_ERROR_COMMAND_LIST_NOT_CAPTURING +/// + Capture into `hGraph` was never started or has already ended ze_result_t ZE_APICALL zeGraphPauseCaptureExt( ze_graph_handle_t hGraph ///< [in] handle to the graph to pause capture @@ -17857,7 +17865,10 @@ zeGraphPauseCaptureExt( /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hGraph` /// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT -/// + Graph is not in a paused state +/// + Capture into `hGraph` is not paused +/// + The command list from which `hGraph` was recording is capturing into another graph +/// - ::ZE_RESULT_ERROR_COMMAND_LIST_NOT_CAPTURING +/// + Capture into `hGraph` was never started or has already ended ze_result_t ZE_APICALL zeGraphResumeCaptureExt( ze_graph_handle_t hGraph ///< [in] handle to the graph to resume capture @@ -18060,7 +18071,7 @@ zeCommandListAppendHostFunction( /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hCommandQueue` /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `::ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_HIGH < priority` +/// + `::ZE_COMMAND_QUEUE_PRIORITY_HIGH < priority` /// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION ze_result_t ZE_APICALL zeCommandQueueSetPriorityExt( diff --git a/source/lib/zes_libapi.cpp b/source/lib/zes_libapi.cpp index c966c31b..878de102 100644 --- a/source/lib/zes_libapi.cpp +++ b/source/lib/zes_libapi.cpp @@ -222,6 +222,65 @@ zesDriverGetProperties( #endif } +/////////////////////////////////////////////////////////////////////////////// +/// @brief Returns the API version supported by the specified sysman driver +/// +/// @details +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function should be lock-free. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hDriver` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pVersion` +ze_result_t ZE_APICALL +zesDriverGetApiVersion( + zes_driver_handle_t hDriver, ///< [in] handle of the sysman driver instance + zes_api_version_t* pVersion ///< [out] api version + ) +{ + #ifdef L0_STATIC_LOADER_BUILD + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + static const zes_pfnDriverGetApiVersion_t pfnGetApiVersion = [] { + return ze_lib::context->zesDdiTable.load()->Driver.pfnGetApiVersion; + }(); + if (nullptr == pfnGetApiVersion) { + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnGetApiVersion( hDriver, pVersion ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + auto pfnGetApiVersion = ze_lib::context->zesDdiTable.load()->Driver.pfnGetApiVersion; + if( nullptr == pfnGetApiVersion ) { + if(!ze_lib::context->isInitialized) + return ZE_RESULT_ERROR_UNINITIALIZED; + else + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + + return pfnGetApiVersion( hDriver, pVersion ); + #endif +} + /////////////////////////////////////////////////////////////////////////////// /// @brief Retrieves extension properties /// @@ -433,6 +492,9 @@ zesDeviceGet( /// - To get the GPU topology of the device, the application may pass /// ::zes_device_gpu_topology_ext_properties_t in the pNext chain of /// pProperties. +/// - To get the SOC unique ID of the device, the application may pass +/// ::zes_device_soc_uid_ext_properties_t in the pNext chain of +/// pProperties. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -11042,6 +11104,399 @@ zesInfoLogInstanceDeleteExt( #endif } +/////////////////////////////////////////////////////////////////////////////// +/// @brief Create a decoder context for an info log +/// +/// @details +/// - A decoder context decodes the records returned by +/// ::zesInfoLogInstanceReadWithMetadataExt or by +/// ::zesInfoLogInstancePeekWithMetadataExt into named fields, which the +/// application reads one at a time using +/// ::zesInfoLogDecoderContextReadFieldExt. +/// - Any number of decoder contexts may exist for one info log. +/// - The application may call this function from simultaneous threads. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hInfoLog` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == phDecoderContext` +ze_result_t ZE_APICALL +zesInfoLogDecoderContextCreateExt( + zes_info_log_handle_t hInfoLog, ///< [in] handle of the info log that the records are read from + zes_info_log_decoder_context_handle_t* phDecoderContext ///< [out] handle of the decoder context that was created. + ) +{ + #ifdef L0_STATIC_LOADER_BUILD + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + static const zes_pfnInfoLogDecoderContextCreateExt_t pfnCreateExt = [] { + return ze_lib::context->zesDdiTable.load()->InfoLogDecoderContext.pfnCreateExt; + }(); + if (nullptr == pfnCreateExt) { + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnCreateExt( hInfoLog, phDecoderContext ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + auto pfnCreateExt = ze_lib::context->zesDdiTable.load()->InfoLogDecoderContext.pfnCreateExt; + if( nullptr == pfnCreateExt ) { + if(!ze_lib::context->isInitialized) + return ZE_RESULT_ERROR_UNINITIALIZED; + else + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + + return pfnCreateExt( hInfoLog, phDecoderContext ); + #endif +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Get the fields that a decoder context can decode from an info log +/// record +/// +/// @details +/// - The application should first call this function with `pCount` pointing +/// to a value of zero to retrieve the number of fields that can be +/// decoded. +/// - A call in which `*pCount` is greater than zero and `pFieldInfos` is +/// nullptr shall report the number of fields and shall not write any +/// descriptor, as a call with a count of zero does. +/// - The application may call this function from simultaneous threads. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hDecoderContext` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pCount` +ze_result_t ZE_APICALL +zesInfoLogDecoderContextGetFieldInfoExt( + zes_info_log_decoder_context_handle_t hDecoderContext, ///< [in] handle of the decoder context + uint32_t* pCount, ///< [in,out] pointer to the number of fields that can be decoded. + ///< if count is zero, then the driver shall update the value with the + ///< total number of fields that can be decoded and shall not return any descriptor. + ///< if count is greater than the number of fields that can be decoded, + ///< then the driver shall update the value with the correct number of fields. + zes_info_log_decodable_field_info_ext_t* pFieldInfos///< [in,out][optional][range(0, *pCount)] array of field descriptions, one + ///< element per field. + ///< if count is less than the number of fields that can be decoded, then + ///< the driver shall only retrieve that number of descriptors. + ) +{ + #ifdef L0_STATIC_LOADER_BUILD + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + static const zes_pfnInfoLogDecoderContextGetFieldInfoExt_t pfnGetFieldInfoExt = [] { + return ze_lib::context->zesDdiTable.load()->InfoLogDecoderContext.pfnGetFieldInfoExt; + }(); + if (nullptr == pfnGetFieldInfoExt) { + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnGetFieldInfoExt( hDecoderContext, pCount, pFieldInfos ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + auto pfnGetFieldInfoExt = ze_lib::context->zesDdiTable.load()->InfoLogDecoderContext.pfnGetFieldInfoExt; + if( nullptr == pfnGetFieldInfoExt ) { + if(!ze_lib::context->isInitialized) + return ZE_RESULT_ERROR_UNINITIALIZED; + else + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + + return pfnGetFieldInfoExt( hDecoderContext, pCount, pFieldInfos ); + #endif +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Start decoding info log records in a decoder context +/// +/// @details +/// - The application must not call this function from simultaneous threads +/// with the same decoder context handle. +/// - The application may call this function from simultaneous threads with +/// different decoder context handles. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hDecoderContext` +ze_result_t ZE_APICALL +zesInfoLogDecoderContextDecodeStartExt( + zes_info_log_decoder_context_handle_t hDecoderContext, ///< [in] handle of the decoder context + uint32_t size, ///< [in] size, in bytes, of the record data in `pBuffer`, as returned in + ///< `*pSize` by the read or peek call + const uint8_t* pBuffer, ///< [in][optional][range(0, size)] the record data, as returned in + ///< `pBuffer` by the read or peek call + uint32_t recordCount, ///< [in] number of records in the batch, as returned in `*pRecordCount` by + ///< the read or peek call + const zes_info_log_metadata_ext_t* pDescriptors ///< [in][optional][range(0, recordCount)] array of metadata describing + ///< each record, as returned in `pDescriptors` by the read or peek call + ) +{ + #ifdef L0_STATIC_LOADER_BUILD + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + static const zes_pfnInfoLogDecoderContextDecodeStartExt_t pfnDecodeStartExt = [] { + return ze_lib::context->zesDdiTable.load()->InfoLogDecoderContext.pfnDecodeStartExt; + }(); + if (nullptr == pfnDecodeStartExt) { + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnDecodeStartExt( hDecoderContext, size, pBuffer, recordCount, pDescriptors ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + auto pfnDecodeStartExt = ze_lib::context->zesDdiTable.load()->InfoLogDecoderContext.pfnDecodeStartExt; + if( nullptr == pfnDecodeStartExt ) { + if(!ze_lib::context->isInitialized) + return ZE_RESULT_ERROR_UNINITIALIZED; + else + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + + return pfnDecodeStartExt( hDecoderContext, size, pBuffer, recordCount, pDescriptors ); + #endif +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Read field values of one record that a decoder context is decoding +/// +/// @details +/// - The application must not call this function from simultaneous threads +/// with the same decoder context handle. +/// - The application may call this function from simultaneous threads with +/// different decoder context handles. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hDecoderContext` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pOutBuffer` +/// + `nullptr == pBytesCopied` +ze_result_t ZE_APICALL +zesInfoLogDecoderContextReadFieldExt( + zes_info_log_decoder_context_handle_t hDecoderContext, ///< [in] handle of the decoder context, which must be decoding a batch + uint32_t fieldId, ///< [in] identifier of the field to read, as reported in `fieldId` of + ///< ::zes_info_log_decodable_field_info_ext_t + uint32_t recordId, ///< [in] index of the record in the `pDescriptors` that was passed to + ///< ::zesInfoLogDecoderContextDecodeStartExt + void* pOutBuffer, ///< [in,out][range(0, bufferLen)] buffer that will contain the value of + ///< the field + size_t bufferLen, ///< [in] size, in bytes, of `pOutBuffer` + size_t* pBytesCopied ///< [out] pointer to the number of bytes written to `pOutBuffer`. + ///< the driver shall update the value with zero when the record does not + ///< carry the field. + ) +{ + #ifdef L0_STATIC_LOADER_BUILD + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + static const zes_pfnInfoLogDecoderContextReadFieldExt_t pfnReadFieldExt = [] { + return ze_lib::context->zesDdiTable.load()->InfoLogDecoderContext.pfnReadFieldExt; + }(); + if (nullptr == pfnReadFieldExt) { + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnReadFieldExt( hDecoderContext, fieldId, recordId, pOutBuffer, bufferLen, pBytesCopied ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + auto pfnReadFieldExt = ze_lib::context->zesDdiTable.load()->InfoLogDecoderContext.pfnReadFieldExt; + if( nullptr == pfnReadFieldExt ) { + if(!ze_lib::context->isInitialized) + return ZE_RESULT_ERROR_UNINITIALIZED; + else + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + + return pfnReadFieldExt( hDecoderContext, fieldId, recordId, pOutBuffer, bufferLen, pBytesCopied ); + #endif +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Stop decoding of info log records that a decoder context is decoding +/// +/// @details +/// - The application must not call this function from simultaneous threads +/// with the same decoder context handle. +/// - The application may call this function from simultaneous threads with +/// different decoder context handles. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hDecoderContext` +ze_result_t ZE_APICALL +zesInfoLogDecoderContextDecodeStopExt( + zes_info_log_decoder_context_handle_t hDecoderContext ///< [in] handle of the decoder context + ) +{ + #ifdef L0_STATIC_LOADER_BUILD + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + static const zes_pfnInfoLogDecoderContextDecodeStopExt_t pfnDecodeStopExt = [] { + return ze_lib::context->zesDdiTable.load()->InfoLogDecoderContext.pfnDecodeStopExt; + }(); + if (nullptr == pfnDecodeStopExt) { + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnDecodeStopExt( hDecoderContext ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + auto pfnDecodeStopExt = ze_lib::context->zesDdiTable.load()->InfoLogDecoderContext.pfnDecodeStopExt; + if( nullptr == pfnDecodeStopExt ) { + if(!ze_lib::context->isInitialized) + return ZE_RESULT_ERROR_UNINITIALIZED; + else + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + + return pfnDecodeStopExt( hDecoderContext ); + #endif +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Delete a decoder context of an info log +/// +/// @details +/// - The application must ensure that no other function is using the handle +/// when calling this function. +/// - The application must not call this function from simultaneous threads +/// with the same handle. +/// - The implementation of this function must be thread-safe. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hInfoLog` +/// + `nullptr == hDecoderContext` +ze_result_t ZE_APICALL +zesInfoLogDecoderContextDeleteExt( + zes_info_log_handle_t hInfoLog, ///< [in] handle of the info log that the decoder context was created from + zes_info_log_decoder_context_handle_t hDecoderContext ///< [in][release] handle of the decoder context to delete + ) +{ + #ifdef L0_STATIC_LOADER_BUILD + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + static const zes_pfnInfoLogDecoderContextDeleteExt_t pfnDeleteExt = [] { + return ze_lib::context->zesDdiTable.load()->InfoLogDecoderContext.pfnDeleteExt; + }(); + if (nullptr == pfnDeleteExt) { + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnDeleteExt( hInfoLog, hDecoderContext ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + auto pfnDeleteExt = ze_lib::context->zesDdiTable.load()->InfoLogDecoderContext.pfnDeleteExt; + if( nullptr == pfnDeleteExt ) { + if(!ze_lib::context->isInitialized) + return ZE_RESULT_ERROR_UNINITIALIZED; + else + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + + return pfnDeleteExt( hInfoLog, hDecoderContext ); + #endif +} + /////////////////////////////////////////////////////////////////////////////// /// @brief Get the PCI properties of every device supported by the driver that is /// present on the PCI bus diff --git a/source/lib/zes_libddi.cpp b/source/lib/zes_libddi.cpp index 285a73a7..4f9e2066 100644 --- a/source/lib/zes_libddi.cpp +++ b/source/lib/zes_libddi.cpp @@ -151,6 +151,8 @@ namespace ze_lib GET_FUNCTION_PTR(loader, "zesDriverEnumInfoLogsExt") ); initialzesDdiTable.Driver.pfnGetPciDeviceProperties = reinterpret_cast( GET_FUNCTION_PTR(loader, "zesDriverGetPciDeviceProperties") ); + initialzesDdiTable.Driver.pfnGetApiVersion = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zesDriverGetApiVersion") ); initialzesDdiTable.Driver.pfnGet = reinterpret_cast( GET_FUNCTION_PTR(loader, "zesDriverGet") ); initialzesDdiTable.Driver.pfnGetExtensionProperties = reinterpret_cast( @@ -536,6 +538,26 @@ namespace ze_lib GET_FUNCTION_PTR(loader, "zesInfoLogCreateInstanceExt") ); } + if( ZE_RESULT_SUCCESS == result ) + { + // Optional + auto getTable = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zesGetInfoLogDecoderContextProcAddrTable") ); + getTableWithCheck(getTable, version, &initialzesDdiTable.InfoLogDecoderContext ); + initialzesDdiTable.InfoLogDecoderContext.pfnCreateExt = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zesInfoLogDecoderContextCreateExt") ); + initialzesDdiTable.InfoLogDecoderContext.pfnGetFieldInfoExt = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zesInfoLogDecoderContextGetFieldInfoExt") ); + initialzesDdiTable.InfoLogDecoderContext.pfnDecodeStartExt = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zesInfoLogDecoderContextDecodeStartExt") ); + initialzesDdiTable.InfoLogDecoderContext.pfnReadFieldExt = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zesInfoLogDecoderContextReadFieldExt") ); + initialzesDdiTable.InfoLogDecoderContext.pfnDecodeStopExt = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zesInfoLogDecoderContextDecodeStopExt") ); + initialzesDdiTable.InfoLogDecoderContext.pfnDeleteExt = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zesInfoLogDecoderContextDeleteExt") ); + } + if( ZE_RESULT_SUCCESS == result ) { // Optional @@ -690,6 +712,12 @@ namespace ze_lib zesGetInfoLogProcAddrTable( version, &initialzesDdiTable.InfoLog ); } + if( ZE_RESULT_SUCCESS == result ) + { + // Optional + zesGetInfoLogDecoderContextProcAddrTable( version, &initialzesDdiTable.InfoLogDecoderContext ); + } + if( ZE_RESULT_SUCCESS == result ) { // Optional diff --git a/source/lib/zet_libapi.cpp b/source/lib/zet_libapi.cpp index c0445c73..9dedf15f 100644 --- a/source/lib/zet_libapi.cpp +++ b/source/lib/zet_libapi.cpp @@ -1489,7 +1489,7 @@ zetMetricStreamerClose( /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER /// + `nullptr == pRawDataSize` /// - ::ZE_RESULT_WARNING_DROPPED_DATA -/// + Metric streamer data may have been dropped. Reduce sampling period. +/// + Metric streamer data may have been dropped. Increase the streamer sampling period or read the streamer data more frequently. ze_result_t ZE_APICALL zetMetricStreamerReadData( zet_metric_streamer_handle_t hMetricStreamer, ///< [in] handle of the metric streamer @@ -2527,6 +2527,8 @@ zetTracerExpSetEnabled( /// + `nullptr == pRawData` /// + `nullptr == pSetCount` /// + `nullptr == pTotalMetricValueCount` +/// - ::ZE_RESULT_WARNING_DROPPED_DATA +/// + Metric streamer data may have been dropped. Increase the streamer sampling period or read the streamer data more frequently. ze_result_t ZE_APICALL zetMetricGroupCalculateMultipleMetricValuesExp( zet_metric_group_handle_t hMetricGroup, ///< [in] handle of the metric group @@ -2755,6 +2757,8 @@ zetMetricGroupGetExportDataExp( /// + `nullptr == pCalculateDescriptor` /// + `nullptr == pSetCount` /// + `nullptr == pTotalMetricValueCount` +/// - ::ZE_RESULT_WARNING_DROPPED_DATA +/// + Metric streamer data may have been dropped. Increase the streamer sampling period or read the streamer data more frequently. ze_result_t ZE_APICALL zetMetricGroupCalculateMetricExportDataExp( ze_driver_handle_t hDriver, ///< [in] handle of the driver instance @@ -3259,13 +3263,16 @@ zetMetricCreateFromProgrammableExp( /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hDevice` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == phMetrics` /// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT /// + metricGroupCount is lesser than the number of metric group handles that could be created. ze_result_t ZE_APICALL zetDeviceCreateMetricGroupsFromMetricsExp( zet_device_handle_t hDevice, ///< [in] handle of the device. uint32_t metricCount, ///< [in] number of metric handles. - zet_metric_handle_t * phMetrics, ///< [in] metric handles to be added to the metric groups. + zet_metric_handle_t* phMetrics, ///< [in][range(0, metricCount)] array of metric handles to be added to the + ///< metric groups. const char * pMetricGroupNamePrefix, ///< [in] prefix to the name created for the metric groups. Must point to a ///< null-terminated character array no longer than ///< ::ZET_MAX_METRIC_GROUP_NAME_PREFIX_EXP. diff --git a/source/loader/ze_loader_internal.h b/source/loader/ze_loader_internal.h index 93bab523..9b8ce1ba 100644 --- a/source/loader/ze_loader_internal.h +++ b/source/loader/ze_loader_internal.h @@ -1,6 +1,6 @@ /* * - * Copyright (C) 2019-2025 Intel Corporation + * Copyright (C) 2019-2026 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -116,6 +116,7 @@ namespace loader zes_fan_factory_t zes_fan_factory; zes_firmware_factory_t zes_firmware_factory; zes_freq_factory_t zes_freq_factory; + zes_info_log_decoder_context_factory_t zes_info_log_decoder_context_factory; zes_info_log_factory_t zes_info_log_factory; zes_info_log_instance_factory_t zes_info_log_instance_factory; zes_led_factory_t zes_led_factory; diff --git a/source/loader/zes_ldrddi.cpp b/source/loader/zes_ldrddi.cpp index b01263c5..969406eb 100644 --- a/source/loader/zes_ldrddi.cpp +++ b/source/loader/zes_ldrddi.cpp @@ -131,6 +131,9 @@ namespace loader zesGetInfoLogProcAddrTableFromDriver(driver); result = ZE_RESULT_SUCCESS; // Optional DDI Table, ignore failure if a driver implements the ddi table, but returns an error. + zesGetInfoLogDecoderContextProcAddrTableFromDriver(driver); + result = ZE_RESULT_SUCCESS; + // Optional DDI Table, ignore failure if a driver implements the ddi table, but returns an error. zesGetInfoLogInstanceProcAddrTableFromDriver(driver); result = ZE_RESULT_SUCCESS; return result; @@ -281,6 +284,31 @@ namespace loader return result; } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesDriverGetApiVersion + __zedlllocal ze_result_t ZE_APICALL + zesDriverGetApiVersion( + zes_driver_handle_t hDriver, ///< [in] handle of the sysman driver instance + zes_api_version_t* pVersion ///< [out] api version + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract driver's function pointer table + auto dditable = reinterpret_cast( hDriver )->dditable; + auto pfnGetApiVersion = dditable->zes.Driver.pfnGetApiVersion; + if( nullptr == pfnGetApiVersion ) + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + + // convert loader handle to driver handle + hDriver = reinterpret_cast( hDriver )->handle; + + // forward to device-driver + result = pfnGetApiVersion( hDriver, pVersion ); + + return result; + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zesDriverGetExtensionProperties __zedlllocal ze_result_t ZE_APICALL @@ -5350,6 +5378,202 @@ namespace loader return result; } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesInfoLogDecoderContextCreateExt + __zedlllocal ze_result_t ZE_APICALL + zesInfoLogDecoderContextCreateExt( + zes_info_log_handle_t hInfoLog, ///< [in] handle of the info log that the records are read from + zes_info_log_decoder_context_handle_t* phDecoderContext ///< [out] handle of the decoder context that was created. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract driver's function pointer table + auto dditable = reinterpret_cast( hInfoLog )->dditable; + auto pfnCreateExt = dditable->zes.InfoLogDecoderContext.pfnCreateExt; + if( nullptr == pfnCreateExt ) + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + + // convert loader handle to driver handle + hInfoLog = reinterpret_cast( hInfoLog )->handle; + + // forward to device-driver + result = pfnCreateExt( hInfoLog, phDecoderContext ); + + if( ZE_RESULT_SUCCESS != result ) + return result; + + try + { + // convert driver handle to loader handle + *phDecoderContext = reinterpret_cast( + context->zes_info_log_decoder_context_factory.getInstance( *phDecoderContext, dditable ) ); + } + catch( std::bad_alloc& ) + { + result = ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY; + } + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesInfoLogDecoderContextGetFieldInfoExt + __zedlllocal ze_result_t ZE_APICALL + zesInfoLogDecoderContextGetFieldInfoExt( + zes_info_log_decoder_context_handle_t hDecoderContext, ///< [in] handle of the decoder context + uint32_t* pCount, ///< [in,out] pointer to the number of fields that can be decoded. + ///< if count is zero, then the driver shall update the value with the + ///< total number of fields that can be decoded and shall not return any descriptor. + ///< if count is greater than the number of fields that can be decoded, + ///< then the driver shall update the value with the correct number of fields. + zes_info_log_decodable_field_info_ext_t* pFieldInfos///< [in,out][optional][range(0, *pCount)] array of field descriptions, one + ///< element per field. + ///< if count is less than the number of fields that can be decoded, then + ///< the driver shall only retrieve that number of descriptors. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract driver's function pointer table + auto dditable = reinterpret_cast( hDecoderContext )->dditable; + auto pfnGetFieldInfoExt = dditable->zes.InfoLogDecoderContext.pfnGetFieldInfoExt; + if( nullptr == pfnGetFieldInfoExt ) + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + + // convert loader handle to driver handle + hDecoderContext = reinterpret_cast( hDecoderContext )->handle; + + // forward to device-driver + result = pfnGetFieldInfoExt( hDecoderContext, pCount, pFieldInfos ); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesInfoLogDecoderContextDecodeStartExt + __zedlllocal ze_result_t ZE_APICALL + zesInfoLogDecoderContextDecodeStartExt( + zes_info_log_decoder_context_handle_t hDecoderContext, ///< [in] handle of the decoder context + uint32_t size, ///< [in] size, in bytes, of the record data in `pBuffer`, as returned in + ///< `*pSize` by the read or peek call + const uint8_t* pBuffer, ///< [in][optional][range(0, size)] the record data, as returned in + ///< `pBuffer` by the read or peek call + uint32_t recordCount, ///< [in] number of records in the batch, as returned in `*pRecordCount` by + ///< the read or peek call + const zes_info_log_metadata_ext_t* pDescriptors ///< [in][optional][range(0, recordCount)] array of metadata describing + ///< each record, as returned in `pDescriptors` by the read or peek call + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract driver's function pointer table + auto dditable = reinterpret_cast( hDecoderContext )->dditable; + auto pfnDecodeStartExt = dditable->zes.InfoLogDecoderContext.pfnDecodeStartExt; + if( nullptr == pfnDecodeStartExt ) + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + + // convert loader handle to driver handle + hDecoderContext = reinterpret_cast( hDecoderContext )->handle; + + // forward to device-driver + result = pfnDecodeStartExt( hDecoderContext, size, pBuffer, recordCount, pDescriptors ); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesInfoLogDecoderContextReadFieldExt + __zedlllocal ze_result_t ZE_APICALL + zesInfoLogDecoderContextReadFieldExt( + zes_info_log_decoder_context_handle_t hDecoderContext, ///< [in] handle of the decoder context, which must be decoding a batch + uint32_t fieldId, ///< [in] identifier of the field to read, as reported in `fieldId` of + ///< ::zes_info_log_decodable_field_info_ext_t + uint32_t recordId, ///< [in] index of the record in the `pDescriptors` that was passed to + ///< ::zesInfoLogDecoderContextDecodeStartExt + void* pOutBuffer, ///< [in,out][range(0, bufferLen)] buffer that will contain the value of + ///< the field + size_t bufferLen, ///< [in] size, in bytes, of `pOutBuffer` + size_t* pBytesCopied ///< [out] pointer to the number of bytes written to `pOutBuffer`. + ///< the driver shall update the value with zero when the record does not + ///< carry the field. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract driver's function pointer table + auto dditable = reinterpret_cast( hDecoderContext )->dditable; + auto pfnReadFieldExt = dditable->zes.InfoLogDecoderContext.pfnReadFieldExt; + if( nullptr == pfnReadFieldExt ) + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + + // convert loader handle to driver handle + hDecoderContext = reinterpret_cast( hDecoderContext )->handle; + + // forward to device-driver + result = pfnReadFieldExt( hDecoderContext, fieldId, recordId, pOutBuffer, bufferLen, pBytesCopied ); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesInfoLogDecoderContextDecodeStopExt + __zedlllocal ze_result_t ZE_APICALL + zesInfoLogDecoderContextDecodeStopExt( + zes_info_log_decoder_context_handle_t hDecoderContext ///< [in] handle of the decoder context + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract driver's function pointer table + auto dditable = reinterpret_cast( hDecoderContext )->dditable; + auto pfnDecodeStopExt = dditable->zes.InfoLogDecoderContext.pfnDecodeStopExt; + if( nullptr == pfnDecodeStopExt ) + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + + // convert loader handle to driver handle + hDecoderContext = reinterpret_cast( hDecoderContext )->handle; + + // forward to device-driver + result = pfnDecodeStopExt( hDecoderContext ); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesInfoLogDecoderContextDeleteExt + __zedlllocal ze_result_t ZE_APICALL + zesInfoLogDecoderContextDeleteExt( + zes_info_log_handle_t hInfoLog, ///< [in] handle of the info log that the decoder context was created from + zes_info_log_decoder_context_handle_t hDecoderContext ///< [in][release] handle of the decoder context to delete + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract driver's function pointer table + auto dditable = reinterpret_cast( hInfoLog )->dditable; + auto pfnDeleteExt = dditable->zes.InfoLogDecoderContext.pfnDeleteExt; + if( nullptr == pfnDeleteExt ) + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + + // convert loader handle to driver handle + hInfoLog = reinterpret_cast( hInfoLog )->handle; + + // convert loader handle to driver handle + hDecoderContext = reinterpret_cast( hDecoderContext )->handle; + + // forward to device-driver + result = pfnDeleteExt( hInfoLog, hDecoderContext ); + + if( ZE_RESULT_SUCCESS != result ) + return result; + + // release loader handle + context->zes_info_log_decoder_context_factory.release( hDecoderContext ); + + return result; + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zesDriverGetPciDeviceProperties __zedlllocal ze_result_t ZE_APICALL @@ -5470,6 +5694,7 @@ zesGetDriverProcAddrTableLegacy() loader::loaderDispatch->pSysman->Driver->pfnEventListenExt = loader::zesDriverEventListenExt; loader::loaderDispatch->pSysman->Driver->pfnEnumInfoLogsExt = loader::zesDriverEnumInfoLogsExt; loader::loaderDispatch->pSysman->Driver->pfnGetPciDeviceProperties = loader::zesDriverGetPciDeviceProperties; + loader::loaderDispatch->pSysman->Driver->pfnGetApiVersion = loader::zesDriverGetApiVersion; loader::loaderDispatch->pSysman->Driver->pfnGet = loader::zesDriverGet; loader::loaderDispatch->pSysman->Driver->pfnGetExtensionProperties = loader::zesDriverGetExtensionProperties; loader::loaderDispatch->pSysman->Driver->pfnGetExtensionFunctionAddress = loader::zesDriverGetExtensionFunctionAddress; @@ -5755,6 +5980,20 @@ zesGetInfoLogProcAddrTableLegacy() loader::loaderDispatch->pSysman->InfoLog->pfnCreateInstanceExt = loader::zesInfoLogCreateInstanceExt; } +/////////////////////////////////////////////////////////////////////////////// +/// @brief function for filling the legacy api pointers for InfoLogDecoderContext table +__zedlllocal void ZE_APICALL +zesGetInfoLogDecoderContextProcAddrTableLegacy() +{ + // return pointers to the Loader's Functions. + loader::loaderDispatch->pSysman->InfoLogDecoderContext->pfnCreateExt = loader::zesInfoLogDecoderContextCreateExt; + loader::loaderDispatch->pSysman->InfoLogDecoderContext->pfnGetFieldInfoExt = loader::zesInfoLogDecoderContextGetFieldInfoExt; + loader::loaderDispatch->pSysman->InfoLogDecoderContext->pfnDecodeStartExt = loader::zesInfoLogDecoderContextDecodeStartExt; + loader::loaderDispatch->pSysman->InfoLogDecoderContext->pfnReadFieldExt = loader::zesInfoLogDecoderContextReadFieldExt; + loader::loaderDispatch->pSysman->InfoLogDecoderContext->pfnDecodeStopExt = loader::zesInfoLogDecoderContextDecodeStopExt; + loader::loaderDispatch->pSysman->InfoLogDecoderContext->pfnDeleteExt = loader::zesInfoLogDecoderContextDeleteExt; +} + /////////////////////////////////////////////////////////////////////////////// /// @brief function for filling the legacy api pointers for InfoLogInstance table __zedlllocal void ZE_APICALL @@ -6392,6 +6631,28 @@ zesGetInfoLogProcAddrTableFromDriver(loader::driver_t *driver) return result; } /////////////////////////////////////////////////////////////////////////////// +/// @brief Exported function for filling application's InfoLogDecoderContext table +/// with current process' addresses +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_VERSION +__zedlllocal ze_result_t ZE_APICALL +zesGetInfoLogDecoderContextProcAddrTableFromDriver(loader::driver_t *driver) +{ + ze_result_t result = ZE_RESULT_SUCCESS; + if(driver->initStatus != ZE_RESULT_SUCCESS) + return driver->initStatus; + auto getTable = reinterpret_cast( + GET_FUNCTION_PTR( driver->handle, "zesGetInfoLogDecoderContextProcAddrTable") ); + if(!getTable) + return driver->initStatus; + result = getTable( loader::context->ddi_init_version, &driver->dditable.zes.InfoLogDecoderContext); + return result; +} +/////////////////////////////////////////////////////////////////////////////// /// @brief Exported function for filling application's InfoLogInstance table /// with current process' addresses /// @@ -7125,6 +7386,13 @@ zesGetDriverProcAddrTable( pDdiTable->pfnGetPciDeviceProperties = loader::zesDriverGetPciDeviceProperties; } } + if (version >= ZE_API_VERSION_1_21) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetApiVersion = loader_driver_ddi::zesDriverGetApiVersion; + } else { + pDdiTable->pfnGetApiVersion = loader::zesDriverGetApiVersion; + } + } if (version >= ZE_API_VERSION_1_5) { pDdiTable->pfnGet = loader::zesDriverGet; } @@ -7168,6 +7436,9 @@ zesGetDriverProcAddrTable( if (version >= ZE_API_VERSION_1_20) { pDdiTable->pfnGetPciDeviceProperties = firstDriver->dditable.zes.Driver.pfnGetPciDeviceProperties; } + if (version >= ZE_API_VERSION_1_21) { + pDdiTable->pfnGetApiVersion = firstDriver->dditable.zes.Driver.pfnGetApiVersion; + } if (version >= ZE_API_VERSION_1_5) { pDdiTable->pfnGet = firstDriver->dditable.zes.Driver.pfnGet; } @@ -9615,6 +9886,128 @@ zesGetInfoLogProcAddrTable( return result; } +/////////////////////////////////////////////////////////////////////////////// +/// @brief Exported function for filling application's InfoLogDecoderContext 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 +zesGetInfoLogDecoderContextProcAddrTable( + ze_api_version_t version, ///< [in] API version requested + zes_info_log_decoder_context_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers + ) +{ + if( loader::context->sysmanInstanceDrivers->size() < 1 ) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + if( nullptr == pDdiTable ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + if( loader::context->version < version ) + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + + loader::context->ddi_init_version = version; + + ze_result_t result = ZE_RESULT_SUCCESS; + + auto driverCount = loader::context->sysmanInstanceDrivers->size(); + auto firstDriver = &loader::context->sysmanInstanceDrivers->at(0); + if (driverCount == 1 && firstDriver && !loader::context->forceIntercept) { + result = zesGetInfoLogDecoderContextProcAddrTableFromDriver(firstDriver); + } + + if( ZE_RESULT_SUCCESS == result ) + { + if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) + { + // return pointers to loader's DDIs + loader::loaderDispatch->pSysman->InfoLogDecoderContext = new zes_info_log_decoder_context_dditable_t; + if (version >= ZE_API_VERSION_1_21) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnCreateExt = loader_driver_ddi::zesInfoLogDecoderContextCreateExt; + } else { + pDdiTable->pfnCreateExt = loader::zesInfoLogDecoderContextCreateExt; + } + } + if (version >= ZE_API_VERSION_1_21) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetFieldInfoExt = loader_driver_ddi::zesInfoLogDecoderContextGetFieldInfoExt; + } else { + pDdiTable->pfnGetFieldInfoExt = loader::zesInfoLogDecoderContextGetFieldInfoExt; + } + } + if (version >= ZE_API_VERSION_1_21) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnDecodeStartExt = loader_driver_ddi::zesInfoLogDecoderContextDecodeStartExt; + } else { + pDdiTable->pfnDecodeStartExt = loader::zesInfoLogDecoderContextDecodeStartExt; + } + } + if (version >= ZE_API_VERSION_1_21) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnReadFieldExt = loader_driver_ddi::zesInfoLogDecoderContextReadFieldExt; + } else { + pDdiTable->pfnReadFieldExt = loader::zesInfoLogDecoderContextReadFieldExt; + } + } + if (version >= ZE_API_VERSION_1_21) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnDecodeStopExt = loader_driver_ddi::zesInfoLogDecoderContextDecodeStopExt; + } else { + pDdiTable->pfnDecodeStopExt = loader::zesInfoLogDecoderContextDecodeStopExt; + } + } + if (version >= ZE_API_VERSION_1_21) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnDeleteExt = loader_driver_ddi::zesInfoLogDecoderContextDeleteExt; + } else { + pDdiTable->pfnDeleteExt = loader::zesInfoLogDecoderContextDeleteExt; + } + } + zesGetInfoLogDecoderContextProcAddrTableLegacy(); + } + else + { + // return pointers directly to driver's DDIs + if (version >= ZE_API_VERSION_1_21) { + pDdiTable->pfnCreateExt = firstDriver->dditable.zes.InfoLogDecoderContext.pfnCreateExt; + } + if (version >= ZE_API_VERSION_1_21) { + pDdiTable->pfnGetFieldInfoExt = firstDriver->dditable.zes.InfoLogDecoderContext.pfnGetFieldInfoExt; + } + if (version >= ZE_API_VERSION_1_21) { + pDdiTable->pfnDecodeStartExt = firstDriver->dditable.zes.InfoLogDecoderContext.pfnDecodeStartExt; + } + if (version >= ZE_API_VERSION_1_21) { + pDdiTable->pfnReadFieldExt = firstDriver->dditable.zes.InfoLogDecoderContext.pfnReadFieldExt; + } + if (version >= ZE_API_VERSION_1_21) { + pDdiTable->pfnDecodeStopExt = firstDriver->dditable.zes.InfoLogDecoderContext.pfnDecodeStopExt; + } + if (version >= ZE_API_VERSION_1_21) { + pDdiTable->pfnDeleteExt = firstDriver->dditable.zes.InfoLogDecoderContext.pfnDeleteExt; + } + } + } + + // 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, "zesGetInfoLogDecoderContextProcAddrTable") ); + if(!getTable) + return ZE_RESULT_ERROR_UNINITIALIZED; + result = getTable( version, pDdiTable ); + } + + return result; +} + /////////////////////////////////////////////////////////////////////////////// /// @brief Exported function for filling application's InfoLogInstance table /// with current process' addresses diff --git a/source/loader/zes_ldrddi.h b/source/loader/zes_ldrddi.h index c2c50879..c74c7426 100644 --- a/source/loader/zes_ldrddi.h +++ b/source/loader/zes_ldrddi.h @@ -79,6 +79,9 @@ namespace loader using zes_info_log_instance_object_t = object_t < zes_info_log_instance_handle_t >; using zes_info_log_instance_factory_t = singleton_factory_t < zes_info_log_instance_object_t, zes_info_log_instance_handle_t >; + using zes_info_log_decoder_context_object_t = object_t < zes_info_log_decoder_context_handle_t >; + using zes_info_log_decoder_context_factory_t = singleton_factory_t < zes_info_log_decoder_context_object_t, zes_info_log_decoder_context_handle_t >; + __zedlllocal ze_result_t ZE_APICALL zesloaderInitDriverDDITables(loader::driver_t *driver); } @@ -93,6 +96,11 @@ namespace loader_driver_ddi zes_driver_properties_t* pDriverProperties ///< [in,out] query result for sysman driver properties ); __zedlllocal ze_result_t ZE_APICALL + zesDriverGetApiVersion( + zes_driver_handle_t hDriver, ///< [in] handle of the sysman driver instance + zes_api_version_t* pVersion ///< [out] api version + ); + __zedlllocal ze_result_t ZE_APICALL zesDriverGetExtensionProperties( zes_driver_handle_t hDriver, ///< [in] handle of the driver instance uint32_t* pCount, ///< [in,out] pointer to the number of extension properties. @@ -1490,6 +1498,59 @@ namespace loader_driver_ddi zes_info_log_instance_handle_t hInfoLogInstance ///< [in][release] handle of the info log collection instance to delete ); __zedlllocal ze_result_t ZE_APICALL + zesInfoLogDecoderContextCreateExt( + zes_info_log_handle_t hInfoLog, ///< [in] handle of the info log that the records are read from + zes_info_log_decoder_context_handle_t* phDecoderContext ///< [out] handle of the decoder context that was created. + ); + __zedlllocal ze_result_t ZE_APICALL + zesInfoLogDecoderContextGetFieldInfoExt( + zes_info_log_decoder_context_handle_t hDecoderContext, ///< [in] handle of the decoder context + uint32_t* pCount, ///< [in,out] pointer to the number of fields that can be decoded. + ///< if count is zero, then the driver shall update the value with the + ///< total number of fields that can be decoded and shall not return any descriptor. + ///< if count is greater than the number of fields that can be decoded, + ///< then the driver shall update the value with the correct number of fields. + zes_info_log_decodable_field_info_ext_t* pFieldInfos///< [in,out][optional][range(0, *pCount)] array of field descriptions, one + ///< element per field. + ///< if count is less than the number of fields that can be decoded, then + ///< the driver shall only retrieve that number of descriptors. + ); + __zedlllocal ze_result_t ZE_APICALL + zesInfoLogDecoderContextDecodeStartExt( + zes_info_log_decoder_context_handle_t hDecoderContext, ///< [in] handle of the decoder context + uint32_t size, ///< [in] size, in bytes, of the record data in `pBuffer`, as returned in + ///< `*pSize` by the read or peek call + const uint8_t* pBuffer, ///< [in][optional][range(0, size)] the record data, as returned in + ///< `pBuffer` by the read or peek call + uint32_t recordCount, ///< [in] number of records in the batch, as returned in `*pRecordCount` by + ///< the read or peek call + const zes_info_log_metadata_ext_t* pDescriptors ///< [in][optional][range(0, recordCount)] array of metadata describing + ///< each record, as returned in `pDescriptors` by the read or peek call + ); + __zedlllocal ze_result_t ZE_APICALL + zesInfoLogDecoderContextReadFieldExt( + zes_info_log_decoder_context_handle_t hDecoderContext, ///< [in] handle of the decoder context, which must be decoding a batch + uint32_t fieldId, ///< [in] identifier of the field to read, as reported in `fieldId` of + ///< ::zes_info_log_decodable_field_info_ext_t + uint32_t recordId, ///< [in] index of the record in the `pDescriptors` that was passed to + ///< ::zesInfoLogDecoderContextDecodeStartExt + void* pOutBuffer, ///< [in,out][range(0, bufferLen)] buffer that will contain the value of + ///< the field + size_t bufferLen, ///< [in] size, in bytes, of `pOutBuffer` + size_t* pBytesCopied ///< [out] pointer to the number of bytes written to `pOutBuffer`. + ///< the driver shall update the value with zero when the record does not + ///< carry the field. + ); + __zedlllocal ze_result_t ZE_APICALL + zesInfoLogDecoderContextDecodeStopExt( + zes_info_log_decoder_context_handle_t hDecoderContext ///< [in] handle of the decoder context + ); + __zedlllocal ze_result_t ZE_APICALL + zesInfoLogDecoderContextDeleteExt( + zes_info_log_handle_t hInfoLog, ///< [in] handle of the info log that the decoder context was created from + zes_info_log_decoder_context_handle_t hDecoderContext ///< [in][release] handle of the decoder context to delete + ); + __zedlllocal ze_result_t ZE_APICALL zesDriverGetPciDeviceProperties( zes_driver_handle_t hDriver, ///< [in] handle of the sysman driver instance uint32_t* pCount, ///< [in,out] pointer to the number of PCI devices. @@ -1609,6 +1670,10 @@ zesGetInfoLogProcAddrTableLegacy(); __zedlllocal ze_result_t ZE_APICALL zesGetInfoLogProcAddrTableFromDriver(loader::driver_t *driver); __zedlllocal void ZE_APICALL +zesGetInfoLogDecoderContextProcAddrTableLegacy(); +__zedlllocal ze_result_t ZE_APICALL +zesGetInfoLogDecoderContextProcAddrTableFromDriver(loader::driver_t *driver); +__zedlllocal void ZE_APICALL zesGetInfoLogInstanceProcAddrTableLegacy(); __zedlllocal ze_result_t ZE_APICALL zesGetInfoLogInstanceProcAddrTableFromDriver(loader::driver_t *driver); diff --git a/source/loader/zes_ldrddi_driver_ddi.cpp b/source/loader/zes_ldrddi_driver_ddi.cpp index ce3e92e6..6acba284 100644 --- a/source/loader/zes_ldrddi_driver_ddi.cpp +++ b/source/loader/zes_ldrddi_driver_ddi.cpp @@ -42,6 +42,37 @@ namespace loader_driver_ddi return result; } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesDriverGetApiVersion + __zedlllocal ze_result_t ZE_APICALL + zesDriverGetApiVersion( + zes_driver_handle_t hDriver, ///< [in] handle of the sysman driver instance + zes_api_version_t* pVersion ///< [out] api version + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hDriver )->pSysman; + if (dditable->isValidFlag == 0) + return ZE_RESULT_ERROR_UNINITIALIZED; + // Check that api version in the driver is supported by this version of the API + if (dditable->version < ZE_API_VERSION_1_21) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + // Check that the driver has the function pointer table init + if (dditable->Driver == nullptr) { + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + auto pfnGetApiVersion = dditable->Driver->pfnGetApiVersion; + if( nullptr == pfnGetApiVersion ) { + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + // forward to device-driver + result = pfnGetApiVersion( hDriver, pVersion ); + return result; + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zesDriverGetExtensionProperties __zedlllocal ze_result_t ZE_APICALL @@ -5729,6 +5760,215 @@ namespace loader_driver_ddi return result; } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesInfoLogDecoderContextCreateExt + __zedlllocal ze_result_t ZE_APICALL + zesInfoLogDecoderContextCreateExt( + zes_info_log_handle_t hInfoLog, ///< [in] handle of the info log that the records are read from + zes_info_log_decoder_context_handle_t* phDecoderContext ///< [out] handle of the decoder context that was created. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hInfoLog )->pSysman; + if (dditable->isValidFlag == 0) + return ZE_RESULT_ERROR_UNINITIALIZED; + // Check that api version in the driver is supported by this version of the API + if (dditable->version < ZE_API_VERSION_1_21) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + // Check that the driver has the function pointer table init + if (dditable->InfoLogDecoderContext == nullptr) { + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + auto pfnCreateExt = dditable->InfoLogDecoderContext->pfnCreateExt; + if( nullptr == pfnCreateExt ) { + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + // forward to device-driver + result = pfnCreateExt( hInfoLog, phDecoderContext ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesInfoLogDecoderContextGetFieldInfoExt + __zedlllocal ze_result_t ZE_APICALL + zesInfoLogDecoderContextGetFieldInfoExt( + zes_info_log_decoder_context_handle_t hDecoderContext, ///< [in] handle of the decoder context + uint32_t* pCount, ///< [in,out] pointer to the number of fields that can be decoded. + ///< if count is zero, then the driver shall update the value with the + ///< total number of fields that can be decoded and shall not return any descriptor. + ///< if count is greater than the number of fields that can be decoded, + ///< then the driver shall update the value with the correct number of fields. + zes_info_log_decodable_field_info_ext_t* pFieldInfos///< [in,out][optional][range(0, *pCount)] array of field descriptions, one + ///< element per field. + ///< if count is less than the number of fields that can be decoded, then + ///< the driver shall only retrieve that number of descriptors. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hDecoderContext )->pSysman; + if (dditable->isValidFlag == 0) + return ZE_RESULT_ERROR_UNINITIALIZED; + // Check that api version in the driver is supported by this version of the API + if (dditable->version < ZE_API_VERSION_1_21) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + // Check that the driver has the function pointer table init + if (dditable->InfoLogDecoderContext == nullptr) { + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + auto pfnGetFieldInfoExt = dditable->InfoLogDecoderContext->pfnGetFieldInfoExt; + if( nullptr == pfnGetFieldInfoExt ) { + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + // forward to device-driver + result = pfnGetFieldInfoExt( hDecoderContext, pCount, pFieldInfos ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesInfoLogDecoderContextDecodeStartExt + __zedlllocal ze_result_t ZE_APICALL + zesInfoLogDecoderContextDecodeStartExt( + zes_info_log_decoder_context_handle_t hDecoderContext, ///< [in] handle of the decoder context + uint32_t size, ///< [in] size, in bytes, of the record data in `pBuffer`, as returned in + ///< `*pSize` by the read or peek call + const uint8_t* pBuffer, ///< [in][optional][range(0, size)] the record data, as returned in + ///< `pBuffer` by the read or peek call + uint32_t recordCount, ///< [in] number of records in the batch, as returned in `*pRecordCount` by + ///< the read or peek call + const zes_info_log_metadata_ext_t* pDescriptors ///< [in][optional][range(0, recordCount)] array of metadata describing + ///< each record, as returned in `pDescriptors` by the read or peek call + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hDecoderContext )->pSysman; + if (dditable->isValidFlag == 0) + return ZE_RESULT_ERROR_UNINITIALIZED; + // Check that api version in the driver is supported by this version of the API + if (dditable->version < ZE_API_VERSION_1_21) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + // Check that the driver has the function pointer table init + if (dditable->InfoLogDecoderContext == nullptr) { + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + auto pfnDecodeStartExt = dditable->InfoLogDecoderContext->pfnDecodeStartExt; + if( nullptr == pfnDecodeStartExt ) { + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + // forward to device-driver + result = pfnDecodeStartExt( hDecoderContext, size, pBuffer, recordCount, pDescriptors ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesInfoLogDecoderContextReadFieldExt + __zedlllocal ze_result_t ZE_APICALL + zesInfoLogDecoderContextReadFieldExt( + zes_info_log_decoder_context_handle_t hDecoderContext, ///< [in] handle of the decoder context, which must be decoding a batch + uint32_t fieldId, ///< [in] identifier of the field to read, as reported in `fieldId` of + ///< ::zes_info_log_decodable_field_info_ext_t + uint32_t recordId, ///< [in] index of the record in the `pDescriptors` that was passed to + ///< ::zesInfoLogDecoderContextDecodeStartExt + void* pOutBuffer, ///< [in,out][range(0, bufferLen)] buffer that will contain the value of + ///< the field + size_t bufferLen, ///< [in] size, in bytes, of `pOutBuffer` + size_t* pBytesCopied ///< [out] pointer to the number of bytes written to `pOutBuffer`. + ///< the driver shall update the value with zero when the record does not + ///< carry the field. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hDecoderContext )->pSysman; + if (dditable->isValidFlag == 0) + return ZE_RESULT_ERROR_UNINITIALIZED; + // Check that api version in the driver is supported by this version of the API + if (dditable->version < ZE_API_VERSION_1_21) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + // Check that the driver has the function pointer table init + if (dditable->InfoLogDecoderContext == nullptr) { + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + auto pfnReadFieldExt = dditable->InfoLogDecoderContext->pfnReadFieldExt; + if( nullptr == pfnReadFieldExt ) { + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + // forward to device-driver + result = pfnReadFieldExt( hDecoderContext, fieldId, recordId, pOutBuffer, bufferLen, pBytesCopied ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesInfoLogDecoderContextDecodeStopExt + __zedlllocal ze_result_t ZE_APICALL + zesInfoLogDecoderContextDecodeStopExt( + zes_info_log_decoder_context_handle_t hDecoderContext ///< [in] handle of the decoder context + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hDecoderContext )->pSysman; + if (dditable->isValidFlag == 0) + return ZE_RESULT_ERROR_UNINITIALIZED; + // Check that api version in the driver is supported by this version of the API + if (dditable->version < ZE_API_VERSION_1_21) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + // Check that the driver has the function pointer table init + if (dditable->InfoLogDecoderContext == nullptr) { + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + auto pfnDecodeStopExt = dditable->InfoLogDecoderContext->pfnDecodeStopExt; + if( nullptr == pfnDecodeStopExt ) { + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + // forward to device-driver + result = pfnDecodeStopExt( hDecoderContext ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesInfoLogDecoderContextDeleteExt + __zedlllocal ze_result_t ZE_APICALL + zesInfoLogDecoderContextDeleteExt( + zes_info_log_handle_t hInfoLog, ///< [in] handle of the info log that the decoder context was created from + zes_info_log_decoder_context_handle_t hDecoderContext ///< [in][release] handle of the decoder context to delete + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hInfoLog )->pSysman; + if (dditable->isValidFlag == 0) + return ZE_RESULT_ERROR_UNINITIALIZED; + // Check that api version in the driver is supported by this version of the API + if (dditable->version < ZE_API_VERSION_1_21) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + // Check that the driver has the function pointer table init + if (dditable->InfoLogDecoderContext == nullptr) { + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + auto pfnDeleteExt = dditable->InfoLogDecoderContext->pfnDeleteExt; + if( nullptr == pfnDeleteExt ) { + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + // forward to device-driver + result = pfnDeleteExt( hInfoLog, hDecoderContext ); + return result; + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zesDriverGetPciDeviceProperties __zedlllocal ze_result_t ZE_APICALL @@ -5800,6 +6040,7 @@ namespace loader_driver_ddi delete pDdiTable->Temperature; delete pDdiTable->VFManagementExp; delete pDdiTable->InfoLog; + delete pDdiTable->InfoLogDecoderContext; delete pDdiTable->InfoLogInstance; delete pDdiTable; } diff --git a/source/loader/zet_ldrddi.cpp b/source/loader/zet_ldrddi.cpp index 5272f361..00f751e8 100644 --- a/source/loader/zet_ldrddi.cpp +++ b/source/loader/zet_ldrddi.cpp @@ -1775,7 +1775,8 @@ namespace loader zetDeviceCreateMetricGroupsFromMetricsExp( zet_device_handle_t hDevice, ///< [in] handle of the device. uint32_t metricCount, ///< [in] number of metric handles. - zet_metric_handle_t * phMetrics, ///< [in] metric handles to be added to the metric groups. + zet_metric_handle_t* phMetrics, ///< [in][range(0, metricCount)] array of metric handles to be added to the + ///< metric groups. const char * pMetricGroupNamePrefix, ///< [in] prefix to the name created for the metric groups. Must point to a ///< null-terminated character array no longer than ///< ::ZET_MAX_METRIC_GROUP_NAME_PREFIX_EXP. @@ -1806,8 +1807,14 @@ namespace loader // convert loader handle to driver handle hDevice = reinterpret_cast( hDevice )->handle; + // convert loader handles to driver handles, preserving a null input array + auto phMetricsLocal = ( phMetrics ) ? new zet_metric_handle_t [metricCount] : nullptr; + for( size_t i = 0; ( nullptr != phMetrics ) && ( i < metricCount ); ++i ) + phMetricsLocal[ i ] = reinterpret_cast( phMetrics[ i ] )->handle; + // forward to device-driver - result = pfnCreateMetricGroupsFromMetricsExp( hDevice, metricCount, phMetrics, pMetricGroupNamePrefix, pDescription, pMetricGroupCount, phMetricGroup ); + result = pfnCreateMetricGroupsFromMetricsExp( hDevice, metricCount, phMetricsLocal, pMetricGroupNamePrefix, pDescription, pMetricGroupCount, phMetricGroup ); + delete []phMetricsLocal; if( ZE_RESULT_SUCCESS != result ) return result; diff --git a/source/loader/zet_ldrddi.h b/source/loader/zet_ldrddi.h index 4a9ec631..5b29d5f6 100644 --- a/source/loader/zet_ldrddi.h +++ b/source/loader/zet_ldrddi.h @@ -539,7 +539,8 @@ namespace loader_driver_ddi zetDeviceCreateMetricGroupsFromMetricsExp( zet_device_handle_t hDevice, ///< [in] handle of the device. uint32_t metricCount, ///< [in] number of metric handles. - zet_metric_handle_t * phMetrics, ///< [in] metric handles to be added to the metric groups. + zet_metric_handle_t* phMetrics, ///< [in][range(0, metricCount)] array of metric handles to be added to the + ///< metric groups. const char * pMetricGroupNamePrefix, ///< [in] prefix to the name created for the metric groups. Must point to a ///< null-terminated character array no longer than ///< ::ZET_MAX_METRIC_GROUP_NAME_PREFIX_EXP. diff --git a/source/loader/zet_ldrddi_driver_ddi.cpp b/source/loader/zet_ldrddi_driver_ddi.cpp index 5e473606..0b6b93b3 100644 --- a/source/loader/zet_ldrddi_driver_ddi.cpp +++ b/source/loader/zet_ldrddi_driver_ddi.cpp @@ -1754,7 +1754,8 @@ namespace loader_driver_ddi zetDeviceCreateMetricGroupsFromMetricsExp( zet_device_handle_t hDevice, ///< [in] handle of the device. uint32_t metricCount, ///< [in] number of metric handles. - zet_metric_handle_t * phMetrics, ///< [in] metric handles to be added to the metric groups. + zet_metric_handle_t* phMetrics, ///< [in][range(0, metricCount)] array of metric handles to be added to the + ///< metric groups. const char * pMetricGroupNamePrefix, ///< [in] prefix to the name created for the metric groups. Must point to a ///< null-terminated character array no longer than ///< ::ZET_MAX_METRIC_GROUP_NAME_PREFIX_EXP. diff --git a/source/utils/zes_to_string.h b/source/utils/zes_to_string.h index e2a9d327..b27847e8 100644 --- a/source/utils/zes_to_string.h +++ b/source/utils/zes_to_string.h @@ -1640,6 +1640,26 @@ inline std::string to_string(const zes_info_log_read_status_ext_t& desc) { return to_string(&desc); } +inline std::string to_string(const zes_info_log_decodable_field_info_ext_t* desc) { + if (!desc) return "nullptr"; + std::ostringstream oss; + oss << "{"; + oss << "stype=" << to_string(&desc->stype); + oss << ", desc=" << to_string(desc->desc); + oss << ", name=" << to_string(desc->name); + oss << ", fieldId=" << to_string(desc->fieldId); + oss << ", type=" << to_string(&desc->type); + oss << ", requiredBytes=" << to_string(desc->requiredBytes); + oss << ", elementCount=" << to_string(desc->elementCount); + oss << ", versionString=" << to_string(desc->versionString); + oss << "}"; + return oss.str(); +} + +inline std::string to_string(const zes_info_log_decodable_field_info_ext_t& desc) { + return to_string(&desc); +} + inline std::string to_string(const zes_device_gpu_topology_ext_properties_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; @@ -1696,6 +1716,20 @@ inline std::string to_string(const zes_driver_pci_device_properties_t& desc) { return to_string(&desc); } +inline std::string to_string(const zes_device_soc_uid_ext_properties_t* desc) { + if (!desc) return "nullptr"; + std::ostringstream oss; + oss << "{"; + oss << "stype=" << to_string(&desc->stype); + oss << ", socUid=" << to_string(&desc->socUid); + oss << "}"; + return oss.str(); +} + +inline std::string to_string(const zes_device_soc_uid_ext_properties_t& desc) { + return to_string(&desc); +} + } // namespace loader #endif // _ZES_TO_STRING_H