diff --git a/level_zero/include/level_zero/ze_stypes.h b/level_zero/include/level_zero/ze_stypes.h index c8ee24b855..7318ed9914 100644 --- a/level_zero/include/level_zero/ze_stypes.h +++ b/level_zero/include/level_zero/ze_stypes.h @@ -13,6 +13,7 @@ #include using ze_structure_type_ext_t = uint32_t; +using zet_structure_type_ext_t = uint32_t; #define ZE_STRUCTURE_TYPE_SYNCHRONIZED_DISPATCH_EXP_DESC static_cast(0x00020020) #define ZE_STRUCTURE_TYPE_INTEL_MEDIA_COMMUNICATION_DESC static_cast(0x00020021) @@ -32,8 +33,9 @@ using ze_structure_type_ext_t = uint32_t; #define ZEX_STRUCTURE_COUNTER_BASED_EVENT_EXTERNAL_STORAGE_ALLOC_PROPERTIES static_cast(0x00030027) // Metric structure types -#define ZET_INTEL_STRUCTURE_TYPE_METRIC_SOURCE_ID_EXP (zet_structure_type_t)0x0001000a // NOLINT(clang-analyzer-optin.core.EnumCastOutOfRange), NEO-12901 -#define ZET_INTEL_STRUCTURE_TYPE_METRIC_CALCULATE_DESC_EXP (zet_structure_type_t)0x00010009 // NOLINT(clang-analyzer-optin.core.EnumCastOutOfRange), NEO-12901 -#define ZET_INTEL_STRUCTURE_TYPE_METRIC_GROUP_CALCULATE_EXP_PROPERTIES (zet_structure_type_t)0x00010008 // NOLINT(clang-analyzer-optin.core.EnumCastOutOfRange), NEO-12901 +#define ZET_INTEL_STRUCTURE_TYPE_METRIC_GROUP_CALCULATE_EXP_PROPERTIES static_cast(0x00010008) +#define ZET_INTEL_STRUCTURE_TYPE_METRIC_CALCULATE_DESC_EXP static_cast(0x00010009) +#define ZET_INTEL_STRUCTURE_TYPE_METRIC_SOURCE_ID_EXP static_cast(0x0001000a) +#define ZET_INTEL_STRUCTURE_TYPE_METRIC_DECODED_BUFFER_PROPERTIES_EXP static_cast(0x0001000b) #endif diff --git a/level_zero/include/level_zero/zet_intel_gpu_metric.h b/level_zero/include/level_zero/zet_intel_gpu_metric.h index 6fd933c41f..f537c07e3b 100644 --- a/level_zero/include/level_zero/zet_intel_gpu_metric.h +++ b/level_zero/include/level_zero/zet_intel_gpu_metric.h @@ -40,10 +40,10 @@ typedef enum _zet_intel_metric_source_id_exp_version_t { /// @brief Query an unique identifier representing the source of a metric group /// This structure can be passed in the 'pNext' of zet_metric_group_properties_t typedef struct _zet_intel_metric_source_id_exp_t { - zet_structure_type_t stype; ///< [in] type of this structure - const void *pNext; ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext). - uint32_t sourceId; ///< [out] Returns an unique source Id of the metric group + zet_structure_type_ext_t stype; ///< [in] type of this structure + const void *pNext; ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + uint32_t sourceId; ///< [out] Returns an unique source Id of the metric group } zet_intel_metric_source_id_exp_t; #ifndef ZET_INTEL_METRIC_APPEND_MARKER_EXP_NAME @@ -207,11 +207,11 @@ typedef enum _zet_intel_metric_calculate_exp_version_t { /// @brief Query an metric group calculate properties /// This structure can be passed in the 'pNext' of zet_metric_group_properties_t typedef struct _zet_intel_metric_group_calculate_properties_exp_t { - zet_structure_type_t stype; ///< [in] type of this structure - void *pNext; ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext). - bool isTimeFilterSupported; ///< [out] Flag to indicate if the metric group supports time filtering for - ///< metrics calculation. + zet_structure_type_ext_t stype; ///< [in] type of this structure + void *pNext; ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + bool isTimeFilterSupported; ///< [out] Flag to indicate if the metric group supports time filtering for + ///< metrics calculation. } zet_intel_metric_group_calculate_properties_exp_t; /////////////////////////////////////////////////////////////////////////////// @@ -227,7 +227,7 @@ typedef struct _zet_intel_metric_calculate_time_window_exp_t { } zet_intel_metric_calculate_time_window_exp_t; typedef struct _zet_intel_metric_calculate_exp_desc_t { - zet_structure_type_t stype; ///< [in] type of this structure + zet_structure_type_ext_t stype; ///< [in] type of this structure const void *pNext; ///< [in][optional] must be null or a pointer to an extension-specific ///< structure (i.e. contains stype and pNext). uint32_t metricGroupCount; ///< [in] [in] count for metric group handles in metric hMetricGroups array. @@ -268,11 +268,11 @@ typedef struct _zet_intel_metric_result_exp_t { zet_intel_metric_calculate_result_status_exp_t resultStatus; ///< [out] type of the result for the filters applied to the calculation. } zet_intel_metric_result_exp_t; typedef struct _zet_intel_metric_decoded_buffer_exp_properties_t { - zet_structure_type_t stype; ///< [in] type of this structure - void *pNext; ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext). - uint64_t minTimeStamp; ///< [out] minimum timestamp contained in the raw data buffer - uint64_t maxTimeStamp; ///< [out] maximum timestamp contained in the raw data buffer + zet_structure_type_ext_t stype; ///< [in] type of this structure + void *pNext; ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + uint64_t minTimeStamp; ///< [out] minimum timestamp contained in the raw data buffer + uint64_t maxTimeStamp; ///< [out] maximum timestamp contained in the raw data buffer } zet_intel_metric_decoded_buffer_exp_properties_t; ze_result_t ZE_APICALL diff --git a/level_zero/tools/source/metrics/metric_ip_sampling_source.cpp b/level_zero/tools/source/metrics/metric_ip_sampling_source.cpp index be9188a1ba..dd52254d04 100644 --- a/level_zero/tools/source/metrics/metric_ip_sampling_source.cpp +++ b/level_zero/tools/source/metrics/metric_ip_sampling_source.cpp @@ -217,7 +217,7 @@ ze_result_t IpSamplingMetricSourceImp::handleMetricGroupExtendedProperties(zet_m while (pNext) { auto extendedProperties = reinterpret_cast(pNext); - if (extendedProperties->stype == ZET_INTEL_STRUCTURE_TYPE_METRIC_SOURCE_ID_EXP) { + if (static_cast(extendedProperties->stype) == ZET_INTEL_STRUCTURE_TYPE_METRIC_SOURCE_ID_EXP) { getMetricGroupSourceIdProperty(extendedProperties); retVal = ZE_RESULT_SUCCESS; @@ -233,7 +233,7 @@ ze_result_t IpSamplingMetricSourceImp::handleMetricGroupExtendedProperties(zet_m zet_metric_group_type_exp_t *groupType = reinterpret_cast(extendedProperties); groupType->type = ZET_METRIC_GROUP_TYPE_EXP_FLAG_OTHER; retVal = ZE_RESULT_SUCCESS; - } else if (extendedProperties->stype == ZET_INTEL_STRUCTURE_TYPE_METRIC_GROUP_CALCULATE_EXP_PROPERTIES) { + } else if (static_cast(extendedProperties->stype) == ZET_INTEL_STRUCTURE_TYPE_METRIC_GROUP_CALCULATE_EXP_PROPERTIES) { auto calcProperties = reinterpret_cast(extendedProperties); calcProperties->isTimeFilterSupported = false; retVal = ZE_RESULT_SUCCESS; diff --git a/level_zero/tools/source/metrics/metric_oa_source.cpp b/level_zero/tools/source/metrics/metric_oa_source.cpp index ae35d4b5f9..7a7e2de50f 100644 --- a/level_zero/tools/source/metrics/metric_oa_source.cpp +++ b/level_zero/tools/source/metrics/metric_oa_source.cpp @@ -189,7 +189,7 @@ ze_result_t OaMetricSourceImp::handleMetricGroupExtendedProperties(zet_metric_gr while (pNext) { auto extendedProperties = reinterpret_cast(pNext); - if (extendedProperties->stype == ZET_INTEL_STRUCTURE_TYPE_METRIC_SOURCE_ID_EXP) { + if (static_cast(extendedProperties->stype) == ZET_INTEL_STRUCTURE_TYPE_METRIC_SOURCE_ID_EXP) { getMetricGroupSourceIdProperty(extendedProperties); retVal = ZE_RESULT_SUCCESS; @@ -211,7 +211,7 @@ ze_result_t OaMetricSourceImp::handleMetricGroupExtendedProperties(zet_metric_gr zet_metric_group_type_exp_t *groupType = reinterpret_cast(extendedProperties); groupType->type = ZET_METRIC_GROUP_TYPE_EXP_FLAG_OTHER; retVal = ZE_RESULT_SUCCESS; - } else if (extendedProperties->stype == ZET_INTEL_STRUCTURE_TYPE_METRIC_GROUP_CALCULATE_EXP_PROPERTIES) { + } else if (static_cast(extendedProperties->stype) == ZET_INTEL_STRUCTURE_TYPE_METRIC_GROUP_CALCULATE_EXP_PROPERTIES) { auto calcProperties = reinterpret_cast(extendedProperties); if (pBaseProperties->samplingType == ZET_METRIC_GROUP_SAMPLING_TYPE_FLAG_TIME_BASED) { calcProperties->isTimeFilterSupported = true; diff --git a/level_zero/tools/test/unit_tests/sources/metrics/test_metric_ip_sampling_enumeration.cpp b/level_zero/tools/test/unit_tests/sources/metrics/test_metric_ip_sampling_enumeration.cpp index d56f44e9c3..953d70089e 100644 --- a/level_zero/tools/test/unit_tests/sources/metrics/test_metric_ip_sampling_enumeration.cpp +++ b/level_zero/tools/test/unit_tests/sources/metrics/test_metric_ip_sampling_enumeration.cpp @@ -395,7 +395,7 @@ HWTEST2_F(MetricIpSamplingEnumerationTest, GivenEnumerationIsSuccessfulWhenQuery ASSERT_NE(metricGroups[0], nullptr); zet_metric_group_type_exp_t metricGroupType{}; - metricGroupType.stype = static_cast(ZET_INTEL_STRUCTURE_TYPE_METRIC_SOURCE_ID_EXP + 1); // NOLINT(clang-analyzer-optin.core.EnumCastOutOfRange), NEO-12901 + metricGroupType.stype = ZET_STRUCTURE_TYPE_METRIC_GROUP_PROPERTIES; metricGroupType.pNext = nullptr; metricGroupType.type = ZET_METRIC_GROUP_TYPE_EXP_FLAG_FORCE_UINT32;