Comply to Python formatting
Signed-off-by: colramos-amd <colramos@amd.com>
[ROCm/rocprofiler-compute commit: 4d8383b439]
This commit is contained in:
@@ -342,7 +342,7 @@ def gen_counter_list(formula):
|
|||||||
"GFLOPs": None,
|
"GFLOPs": None,
|
||||||
}
|
}
|
||||||
|
|
||||||
built_in_counter=[
|
built_in_counter = [
|
||||||
"lds",
|
"lds",
|
||||||
"grd",
|
"grd",
|
||||||
"wgr",
|
"wgr",
|
||||||
@@ -351,7 +351,7 @@ def gen_counter_list(formula):
|
|||||||
"sgpr",
|
"sgpr",
|
||||||
"scr",
|
"scr",
|
||||||
"BeginNs",
|
"BeginNs",
|
||||||
"EndNs"
|
"EndNs",
|
||||||
]
|
]
|
||||||
|
|
||||||
visited = False
|
visited = False
|
||||||
@@ -367,7 +367,7 @@ def gen_counter_list(formula):
|
|||||||
for node in ast.walk(tree):
|
for node in ast.walk(tree):
|
||||||
if isinstance(node, ast.Name):
|
if isinstance(node, ast.Name):
|
||||||
val = str(node.id)[:-4] if str(node.id).endswith("_sum") else str(node.id)
|
val = str(node.id)[:-4] if str(node.id).endswith("_sum") else str(node.id)
|
||||||
if (val.isupper() and val not in function_filter):
|
if val.isupper() and val not in function_filter:
|
||||||
counters.append(val)
|
counters.append(val)
|
||||||
visited = True
|
visited = True
|
||||||
if val in built_in_counter:
|
if val in built_in_counter:
|
||||||
|
|||||||
@@ -257,19 +257,16 @@ def pmc_perf_split(workload_dir):
|
|||||||
|
|
||||||
|
|
||||||
def update_pmc_bucket(
|
def update_pmc_bucket(
|
||||||
counters,
|
counters, save_file, soc, pmc_list=None, stext=None, workload_perfmon_dir=None
|
||||||
save_file,
|
):
|
||||||
soc,
|
|
||||||
pmc_list=None,
|
|
||||||
stext=None,
|
|
||||||
workload_perfmon_dir=None
|
|
||||||
):
|
|
||||||
# Verify inputs.
|
# Verify inputs.
|
||||||
# If save_file is True, we're being called internally, from perfmon_coalesce
|
# If save_file is True, we're being called internally, from perfmon_coalesce
|
||||||
# Else we're being called externally, from rocomni
|
# Else we're being called externally, from rocomni
|
||||||
detected_extermal_call = False
|
detected_extermal_call = False
|
||||||
if save_file and (stext is None or workload_perfmon_dir is None):
|
if save_file and (stext is None or workload_perfmon_dir is None):
|
||||||
raise ValueError("stext and workload_perfmon_dir must be specified if save_file is True")
|
raise ValueError(
|
||||||
|
"stext and workload_perfmon_dir must be specified if save_file is True"
|
||||||
|
)
|
||||||
if pmc_list is None:
|
if pmc_list is None:
|
||||||
detected_extermal_call = True
|
detected_extermal_call = True
|
||||||
pmc_list = dict(
|
pmc_list = dict(
|
||||||
@@ -389,7 +386,9 @@ def perfmon_coalesce(pmc_files_list, workload_dir, soc):
|
|||||||
|
|
||||||
# Utilitze helper function once a list of counters has be extracted
|
# Utilitze helper function once a list of counters has be extracted
|
||||||
save_file = True
|
save_file = True
|
||||||
pmc_list = update_pmc_bucket(counters, save_file, soc, pmc_list, stext, workload_perfmon_dir)
|
pmc_list = update_pmc_bucket(
|
||||||
|
counters, save_file, soc, pmc_list, stext, workload_perfmon_dir
|
||||||
|
)
|
||||||
|
|
||||||
# add a timestamp file
|
# add a timestamp file
|
||||||
fd = open(workload_perfmon_dir + "/timestamps.txt", "w")
|
fd = open(workload_perfmon_dir + "/timestamps.txt", "w")
|
||||||
@@ -434,7 +433,6 @@ def perfmon_emit(pmc_list, soc, save_file=True, workload_dir=None):
|
|||||||
else:
|
else:
|
||||||
batches = []
|
batches = []
|
||||||
|
|
||||||
|
|
||||||
tcc2_index = 0
|
tcc2_index = 0
|
||||||
for iter in range(niter):
|
for iter in range(niter):
|
||||||
# Prefix
|
# Prefix
|
||||||
|
|||||||
Reference in New Issue
Block a user