Skip to content

Commit

Permalink
test: Make streamer test to use concurrent metric groups
Browse files Browse the repository at this point in the history
Related-To: VLCLJ-2375

Signed-off-by: shubham kumar <[email protected]>
  • Loading branch information
shubskmr committed Jan 3, 2025
1 parent 4b874b8 commit 018dc1a
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 9 deletions.
6 changes: 6 additions & 0 deletions conformance_tests/tools/metrics/src/test_metric.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
Expand Down
3 changes: 1 addition & 2 deletions utils/test_harness/tools/include/test_harness_metric.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ std::vector<metricGroupInfo_t> get_metric_type_ip_group_info(
std::vector<metricGroupInfo_t>
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<zet_metric_group_handle_t>
Expand Down
23 changes: 16 additions & 7 deletions utils/test_harness/tools/src/test_harness_metric.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ std::vector<metricGroupInfo_t> optimize_metric_group_info_list(
std::vector<metricGroupInfo_t>
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) {
Expand All @@ -295,12 +295,8 @@ get_metric_group_info(ze_device_handle_t device,
std::vector<zet_metric_group_handle_t> metricGroupHandles =
get_metric_group_handles(device);

if (useConcurrentMetricGroups) {
metricGroupHandles =
get_concurrent_metric_group(device, metricGroupHandles);
}

std::vector<metricGroupInfo_t> matchedGroupsInfo;
std::vector<zet_metric_group_handle_t> concurrentMetricGroupHandles;

for (auto metricGroupHandle : metricGroupHandles) {
zet_metric_group_properties_t metricGroupProp = {};
Expand All @@ -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<metricGroupInfo_t> concurrentMatchedGroupsInfo;

for (auto groupsInfo : matchedGroupsInfo) {
if (count(concurrentMetricGroupHandles.begin(),
concurrentMetricGroupHandles.end(),
groupsInfo.metricGroupHandle)) {
concurrentMatchedGroupsInfo.push_back(groupsInfo);
}
}

return concurrentMatchedGroupsInfo;
}

std::vector<metricGroupInfo_t> get_metric_type_ip_group_info(
Expand Down

0 comments on commit 018dc1a

Please sign in to comment.