dc054eea76
* Adding python script for rocprofv3 * script update * updating script * Fixing script for counter collection tests * Fixing Sanitizer issues * Adding YAML input file support * Fixing counter validation tests * script modifications * Adding missing LD_PRELOAD * doc updates * Adding test for yaml input * updated yaml extension support in doc * backward compatibility * updating scripts * Fixing git history rocprofv3- part1 * Fixing git history rocprofv3- part2 * Fixing rocprofv3 history final * Rebasing PR 860 for json support * Review comments: Parser updates * Removed color encoding and rebasing again * Addressing review comments * removing globals * Update rocprofv3.py - update tests to conform to new argparse requirements - added support for JSON * Slight tweak to update_env for ROCP_OUTPUT_FORMAT * Update rocprofv3.py - Handle ROCPROF_PRELOAD - Add --preload option - Add --kernel-names option * Update rocprofv3.py - Fix update_env handling of prepend/append - Tweak --preload argument --------- Co-authored-by: Jonathan R. Madsen <jonathanrmadsen@gmail.com>
51 lines
1.6 KiB
Python
51 lines
1.6 KiB
Python
import pandas as pd
|
|
import os
|
|
import sys
|
|
import pytest
|
|
|
|
|
|
def test_agent_info(agent_info_input_data):
|
|
logical_node_id = max([int(itr["Logical_Node_Id"]) for itr in agent_info_input_data])
|
|
|
|
assert logical_node_id + 1 == len(agent_info_input_data)
|
|
|
|
for row in agent_info_input_data:
|
|
agent_type = row["Agent_Type"]
|
|
assert agent_type in ("CPU", "GPU")
|
|
if agent_type == "CPU":
|
|
assert int(row["Cpu_Cores_Count"]) > 0
|
|
assert int(row["Simd_Count"]) == 0
|
|
assert int(row["Max_Waves_Per_Simd"]) == 0
|
|
else:
|
|
assert int(row["Cpu_Cores_Count"]) == 0
|
|
assert int(row["Simd_Count"]) > 0
|
|
assert int(row["Max_Waves_Per_Simd"]) > 0
|
|
|
|
|
|
def test_validate_cc_yml_pmc(counter_input_data):
|
|
counter_names = ["SQ_WAVES", "GRBM_COUNT", "GRBM_GUI_ACTIVE"]
|
|
di_list = []
|
|
|
|
for row in counter_input_data:
|
|
assert int(row["Agent_Id"]) > 0
|
|
assert int(row["Queue_Id"]) > 0
|
|
assert int(row["Process_Id"]) > 0
|
|
assert len(row["Kernel_Name"]) > 0
|
|
|
|
assert len(row["Counter_Value"]) > 0
|
|
# assert row["Counter_Name"].contains("SQ_WAVES").all()
|
|
assert row["Counter_Name"] in counter_names
|
|
assert int(row["Counter_Value"]) > 0
|
|
|
|
di_list.append(int(row["Dispatch_Id"]))
|
|
|
|
# # make sure the dispatch ids are unique and ordered
|
|
di_list = list(dict.fromkeys(di_list))
|
|
di_expect = [idx + 1 for idx in range(len(di_list))]
|
|
assert di_expect == di_list
|
|
|
|
|
|
if __name__ == "__main__":
|
|
exit_code = pytest.main(["-x", __file__] + sys.argv[1:])
|
|
sys.exit(exit_code)
|