Initial overhaul of Analyze mode. Basic CLI is enabled.
Signed-off-by: colramos-amd <colramos@amd.com>
This commit is contained in:
committed by
Karl W. Schulz
parent
98b18d9f39
commit
57a63b6eb1
+24
-3
@@ -25,6 +25,27 @@
|
||||
import argparse
|
||||
import shutil
|
||||
import os
|
||||
import glob
|
||||
|
||||
def load_avail_arch(omniperf_home):
|
||||
'''
|
||||
Load list of avail archs by checking against defined implementations
|
||||
'''
|
||||
matching_files=glob.glob(os.path.join(omniperf_home, 'omniperf_soc', 'soc_*.py'))
|
||||
supported_arch=[]
|
||||
# Load list of supported archs
|
||||
for filepath in matching_files:
|
||||
filename=os.path.basename(filepath)
|
||||
postfix=filename[len('soc_'):-len('.py')]
|
||||
# print(f"File: {filename}, Postfix: {postfix}")
|
||||
if postfix != "base":
|
||||
supported_arch.append(postfix)
|
||||
return supported_arch
|
||||
def print_avail_arch(avail_arch):
|
||||
ret_str = "\t\tList all available metrics for analysis on specified arch:"
|
||||
for arch in avail_arch:
|
||||
ret_str += "\n\t\t {}".format(arch)
|
||||
return ret_str
|
||||
|
||||
def omniarg_parser(parser, omniperf_home, omniperf_version):
|
||||
# -----------------------------------------
|
||||
@@ -389,8 +410,8 @@ def omniarg_parser(parser, omniperf_home, omniperf_version):
|
||||
analyze_group.add_argument(
|
||||
"--list-metrics",
|
||||
metavar="",
|
||||
choices=["gfx906", "gfx908", "gfx90a"],
|
||||
help="\t\tList all available metrics for analysis on specified arch:\n\t\t gfx906\n\t\t gfx908\n\t\t gfx90a",
|
||||
choices=load_avail_arch(omniperf_home),#["gfx906", "gfx908", "gfx90a"],
|
||||
help=print_avail_arch(load_avail_arch(omniperf_home)),
|
||||
)
|
||||
analyze_group.add_argument(
|
||||
"-k",
|
||||
@@ -483,7 +504,7 @@ def omniarg_parser(parser, omniperf_home, omniperf_version):
|
||||
dest="config_dir",
|
||||
metavar="",
|
||||
help="\t\tSpecify the directory of customized configs.",
|
||||
default=omniperf_home.joinpath("omniperf_analyze/configs"),
|
||||
default=omniperf_home.joinpath("omniperf_soc/configs"),
|
||||
)
|
||||
analyze_advanced_group.add_argument(
|
||||
"--save-dfs",
|
||||
|
||||
Reference in New Issue
Block a user