From 018dc1a26c30753faf85f42d2cb63052871a5005 Mon Sep 17 00:00:00 2001 From: shubham kumar Date: Wed, 18 Dec 2024 07:19:44 +0000 Subject: [PATCH] test: Make streamer test to use concurrent metric groups Related-To: VLCLJ-2375 Signed-off-by: shubham kumar --- .../tools/metrics/src/test_metric.cpp | 6 +++++ .../tools/include/test_harness_metric.hpp | 3 +-- .../tools/src/test_harness_metric.cpp | 23 +++++++++++++------ 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/conformance_tests/tools/metrics/src/test_metric.cpp b/conformance_tests/tools/metrics/src/test_metric.cpp index 398b766e..33b6ef98 100644 --- a/conformance_tests/tools/metrics/src/test_metric.cpp +++ b/conformance_tests/tools/metrics/src/test_metric.cpp @@ -1270,7 +1270,10 @@ TEST_F( auto metricGroupInfo = lzt::get_metric_group_info( device, ZET_METRIC_GROUP_SAMPLING_TYPE_FLAG_TIME_BASED, true); +<<<<<<< HEAD ASSERT_GT(metricGroupInfo.size(), 0u) << "No metric groups found"; +======= +>>>>>>> test: Make streamer test to use concurrent metric groups metricGroupInfo = lzt::optimize_metric_group_info_list(metricGroupInfo); for (auto groupInfo : metricGroupInfo) { @@ -1367,7 +1370,10 @@ TEST_F( auto metricGroupInfo = lzt::get_metric_group_info( device, ZET_METRIC_GROUP_SAMPLING_TYPE_FLAG_TIME_BASED, true); +<<<<<<< HEAD ASSERT_GT(metricGroupInfo.size(), 0u) << "No metric groups found"; +======= +>>>>>>> test: Make streamer test to use concurrent metric groups metricGroupInfo = lzt::optimize_metric_group_info_list(metricGroupInfo); void *a_buffer, *b_buffer, *c_buffer; diff --git a/utils/test_harness/tools/include/test_harness_metric.hpp b/utils/test_harness/tools/include/test_harness_metric.hpp index f2a5da69..1f8b9aec 100644 --- a/utils/test_harness/tools/include/test_harness_metric.hpp +++ b/utils/test_harness/tools/include/test_harness_metric.hpp @@ -39,8 +39,7 @@ std::vector get_metric_type_ip_group_info( std::vector get_metric_group_info(ze_device_handle_t device, zet_metric_group_sampling_type_flags_t samplingType, - bool includeExpFeature, - bool useConcurrentMetricGroups = false); + bool includeExpFeature); uint32_t get_metric_group_handles_count(ze_device_handle_t device); std::vector diff --git a/utils/test_harness/tools/src/test_harness_metric.cpp b/utils/test_harness/tools/src/test_harness_metric.cpp index 34380e7f..9f130c14 100644 --- a/utils/test_harness/tools/src/test_harness_metric.cpp +++ b/utils/test_harness/tools/src/test_harness_metric.cpp @@ -284,7 +284,7 @@ std::vector optimize_metric_group_info_list( std::vector get_metric_group_info(ze_device_handle_t device, zet_metric_group_sampling_type_flags_t metricSamplingType, - bool includeExpFeature, bool useConcurrentMetricGroups) { + bool includeExpFeature) { ze_result_t result = zeInit(0); if (result) { @@ -295,12 +295,8 @@ get_metric_group_info(ze_device_handle_t device, std::vector metricGroupHandles = get_metric_group_handles(device); - if (useConcurrentMetricGroups) { - metricGroupHandles = - get_concurrent_metric_group(device, metricGroupHandles); - } - std::vector matchedGroupsInfo; + std::vector concurrentMetricGroupHandles; for (auto metricGroupHandle : metricGroupHandles) { zet_metric_group_properties_t metricGroupProp = {}; @@ -319,12 +315,25 @@ get_metric_group_info(ze_device_handle_t device, continue; } + concurrentMetricGroupHandles.push_back(metricGroupHandle); matchedGroupsInfo.emplace_back( metricGroupHandle, metricGroupProp.name, metricGroupProp.description, metricGroupProp.domain, metricGroupProp.metricCount); } - return matchedGroupsInfo; + concurrentMetricGroupHandles = + get_concurrent_metric_group(device, concurrentMetricGroupHandles); + std::vector concurrentMatchedGroupsInfo; + + for (auto groupsInfo : matchedGroupsInfo) { + if (count(concurrentMetricGroupHandles.begin(), + concurrentMetricGroupHandles.end(), + groupsInfo.metricGroupHandle)) { + concurrentMatchedGroupsInfo.push_back(groupsInfo); + } + } + + return concurrentMatchedGroupsInfo; } std::vector get_metric_type_ip_group_info(