@@ -664,33 +664,39 @@ void append_metric_memory_barrier(zet_command_list_handle_t commandList) {
664
664
}
665
665
666
666
void verify_typed_metric_value (zet_typed_value_t result,
667
- zet_value_type_t metricValueType) {
667
+ zet_value_type_t metricValueType, char *name ) {
668
668
EXPECT_EQ (metricValueType, result.type );
669
+ LOG_DEBUG << " Metric: " << name;
669
670
switch (result.type ) {
670
671
case zet_value_type_t ::ZET_VALUE_TYPE_BOOL8:
671
672
EXPECT_GE (result.value .b8 , std::numeric_limits<unsigned char >::min ());
672
673
EXPECT_LE (result.value .b8 , std::numeric_limits<unsigned char >::max ());
673
- LOG_DEBUG << " BOOL " << result.value .b8 ;
674
+ LOG_DEBUG << " . BOOL " << result.value .b8
675
+ << (result.value .b8 ? " TRUE " : " \t FALSE" );
674
676
break ;
675
677
case zet_value_type_t ::ZET_VALUE_TYPE_FLOAT32:
676
678
EXPECT_GE (result.value .fp32 , std::numeric_limits<float >::lowest ());
677
679
EXPECT_LE (result.value .fp32 , std::numeric_limits<float >::max ());
678
- LOG_DEBUG << " fp32 " << result.value .fp32 ;
680
+ LOG_DEBUG << " . fp32 " << result.value .fp32
681
+ << (result.value .fp32 ? " OK " : " \t ZERO" );
679
682
break ;
680
683
case zet_value_type_t ::ZET_VALUE_TYPE_FLOAT64:
681
684
EXPECT_GE (result.value .fp64 , std::numeric_limits<double >::lowest ());
682
685
EXPECT_LE (result.value .fp64 , std::numeric_limits<double >::max ());
683
- LOG_DEBUG << " fp64 " << result.value .fp64 ;
686
+ LOG_DEBUG << " . fp64 " << result.value .fp64
687
+ << (result.value .fp64 ? " OK " : " \t ZERO" );
684
688
break ;
685
689
case zet_value_type_t ::ZET_VALUE_TYPE_UINT32:
686
690
EXPECT_GE (result.value .ui32 , 0 );
687
691
EXPECT_LE (result.value .ui32 , std::numeric_limits<uint32_t >::max ());
688
- LOG_DEBUG << " uint32_t " << result.value .ui32 ;
692
+ LOG_DEBUG << " . uint32_t " << result.value .ui32
693
+ << (result.value .ui32 ? " OK " : " \t ZERO" );
689
694
break ;
690
695
case zet_value_type_t ::ZET_VALUE_TYPE_UINT64:
691
696
EXPECT_GE (result.value .ui64 , 0 );
692
697
EXPECT_LE (result.value .ui64 , std::numeric_limits<uint64_t >::max ());
693
- LOG_DEBUG << " uint64_t " << result.value .ui64 ;
698
+ LOG_DEBUG << " . uint64_t " << result.value .ui64
699
+ << (result.value .ui64 ? " OK " : " \t ZERO" );
694
700
break ;
695
701
default :
696
702
ADD_FAILURE () << " Unexpected value type returned for metric query" ;
@@ -771,7 +777,8 @@ void validate_metrics_common(
771
777
const size_t metricIndex = report * metricCount + metric;
772
778
zet_typed_value_t typed_value =
773
779
totalMetricValues[startIndex + metricIndex];
774
- verify_typed_metric_value (typed_value, properties.resultType );
780
+ verify_typed_metric_value (typed_value, properties.resultType ,
781
+ properties.name );
775
782
if ((metricNameForTest != nullptr )) {
776
783
if (strncmp (metricNameForTest, properties.name ,
777
784
strnlen (metricNameForTest, 1024 )) == 0 ) {
@@ -781,9 +788,7 @@ void validate_metrics_common(
781
788
}
782
789
LOG_DEBUG << " END METRIC INSTANCE" ;
783
790
}
784
-
785
791
LOG_DEBUG << " END METRIC SET" ;
786
-
787
792
if ((metricNameForTest != nullptr )) {
788
793
typedValuesFound.push_back (valueVector);
789
794
}
@@ -840,14 +845,19 @@ void validate_metrics_std(zet_metric_group_handle_t hMetricGroup,
840
845
LOG_DEBUG << " metricValueCount " << metricValueCount << " metricCount "
841
846
<< metricCount;
842
847
843
- for (uint32_t count = 0 ; count < metricValueCount; count++) {
844
- zet_metric_properties_t properties = {ZET_STRUCTURE_TYPE_METRIC_PROPERTIES,
845
- nullptr };
846
- EXPECT_ZE_RESULT_SUCCESS (
847
-
848
- zetMetricGetProperties (phMetrics[count % metricCount], &properties));
849
- zet_typed_value_t typed_value = metricValues[count];
850
- verify_typed_metric_value (typed_value, properties.resultType );
848
+ uint32_t reportNumber = metricValueCount / metricCount;
849
+ for (uint32_t count = 0 ; count < reportNumber; count++) {
850
+ LOG_DEBUG << " --- Result Report : " << count;
851
+ for (uint32_t metric = 0 ; metric < metricCount; metric++) {
852
+ zet_metric_properties_t properties = {
853
+ ZET_STRUCTURE_TYPE_METRIC_PROPERTIES, nullptr };
854
+ EXPECT_ZE_RESULT_SUCCESS (
855
+ zetMetricGetProperties (phMetrics[metric], &properties));
856
+ zet_typed_value_t typed_value =
857
+ metricValues[count * metricCount + metric];
858
+ verify_typed_metric_value (typed_value, properties.resultType ,
859
+ properties.name );
860
+ }
851
861
}
852
862
}
853
863
0 commit comments