summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2022-11-07 02:13:26 -0500
committerMarek Olšák <marek.olsak@amd.com>2022-11-14 15:14:36 -0500
commitac33696863687aa8f06eb43f816629f0945cfdcc (patch)
tree265586f2f62cec5d815e22f36084b9ddc16a03ed
parent47ded5b3cbfb3d54152a843d0e2b5fa635112f1f (diff)
si-report.py: compare the number of shader outputs
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
-rwxr-xr-xsi-report.py27
1 files changed, 20 insertions, 7 deletions
diff --git a/si-report.py b/si-report.py
index a5ec294..2bf8049 100755
--- a/si-report.py
+++ b/si-report.py
@@ -88,6 +88,8 @@ class si_stats:
('scratch_size', 'Scratch size', 'dwords per thread'),
('code_size', 'Code Size', 'bytes'),
('maxwaves', 'Max Waves', ''),
+ ('outputs', 'Outputs', ''),
+ ('patchoutputs', 'Patch Outputs', ''),
]
def __init__(self):
@@ -184,6 +186,11 @@ class si_parser(object):
re.compile(
r"^Shader Stats: SGPRS: ([0-9]+) VGPRS: ([0-9]+) Code Size: ([0-9]+) "+
r"LDS: ([0-9]+) Scratch: ([0-9]+) Max Waves: ([0-9]+) Spilled SGPRs: "+
+ r"([0-9]+) Spilled VGPRs: ([0-9]+) PrivMem VGPRs: ([0-9]+) Outputs: ([0-9]+) "+
+ r"PatchOutputs: ([0-9]+)"),
+ re.compile(
+ r"^Shader Stats: SGPRS: ([0-9]+) VGPRS: ([0-9]+) Code Size: ([0-9]+) "+
+ r"LDS: ([0-9]+) Scratch: ([0-9]+) Max Waves: ([0-9]+) Spilled SGPRs: "+
r"([0-9]+) Spilled VGPRs: ([0-9]+) PrivMem VGPRs: ([0-9]+)"),
re.compile(
r"^Shader Stats: SGPRS: ([0-9]+) VGPRS: ([0-9]+) Code Size: ([0-9]+) "+
@@ -216,12 +223,14 @@ class si_parser(object):
self._stats = si_stats()
self._stats.sgprs = int(match.group(1))
self._stats.vgprs = int(match.group(2))
- self._stats.spilled_sgprs = int(match.group(7))
- self._stats.spilled_vgprs = int(match.group(8))
- self._stats.privmem_vgprs = int(match.group(9)) if match.lastindex >= 9 else 0
self._stats.code_size = int(match.group(3))
self._stats.scratch_size = int(match.group(5)) / (64 * 4)
self._stats.maxwaves = int(match.group(6))
+ self._stats.spilled_sgprs = int(match.group(7))
+ self._stats.spilled_vgprs = int(match.group(8))
+ self._stats.privmem_vgprs = int(match.group(9)) if match.lastindex >= 9 else 0
+ self._stats.outputs = int(match.group(10)) if match.lastindex >= 10 else 0
+ self._stats.patchoutputs = int(match.group(11)) if match.lastindex >= 11 else 0
old_stats = self._stats
self._stats = None
return old_stats
@@ -507,7 +516,7 @@ class grouped_stats:
name)
def print_percentages(self, name):
- print " {:6}{:6}{}{}{}{}{}{}{}{}".format(
+ print " {:6}{:6}{}{}{}{}{}{}{}{}{}{}".format(
name,
self.num_shaders,
format_percent_change(self.before.sgprs, self.after.sgprs),
@@ -517,10 +526,12 @@ class grouped_stats:
format_percent_change(self.before.privmem_vgprs, self.after.privmem_vgprs),
format_percent_change(self.before.scratch_size, self.after.scratch_size),
format_percent_change(self.before.code_size, self.after.code_size),
- format_percent_change(self.before.maxwaves, self.after.maxwaves, more_is_better = True))
+ format_percent_change(self.before.maxwaves, self.after.maxwaves, more_is_better = True),
+ format_percent_change(self.before.outputs, self.after.outputs),
+ format_percent_change(self.before.patchoutputs, self.after.patchoutputs))
def print_percentages_end(self, name, align, legend):
- print "| {:{app_width}} |{:{shader_width}}|{}|{}|{}|{}|{}|{}|{}|{}|".format(
+ print "| {:{app_width}} |{:{shader_width}}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|".format(
name,
self.num_shaders,
format_percent_change(self.before.sgprs, self.after.sgprs, min_width=len(legend[1])),
@@ -531,6 +542,8 @@ class grouped_stats:
format_percent_change(self.before.scratch_size, self.after.scratch_size, min_width=len(legend[6])),
format_percent_change(self.before.code_size, self.after.code_size, min_width=len(legend[7])),
format_percent_change(self.before.maxwaves, self.after.maxwaves, min_width=len(legend[8]), more_is_better = True),
+ format_percent_change(self.before.outputs, self.after.outputs, min_width=len(legend[9])),
+ format_percent_change(self.before.patchoutputs, self.after.patchoutputs, min_width=len(legend[10])),
app_width=align,
shader_width=len(legend[0]))
@@ -715,7 +728,7 @@ def print_tables(before_all_results, after_all_results):
# percentages
longest_app_name = max(longest_app_name, len("PERCENTAGE DELTAS"))
title = "| {:^{width}} |".format("PERCENTAGE DELTAS", width=longest_app_name)
- legend = ["{:>9} ".format(s) for s in ["Shaders", "SGPRs", "VGPRs", "SpillSGPR", "SpillVGPR", "PrivVGPR", "Scratch", "CodeSize", "MaxWaves"]]
+ legend = ["{:>9} ".format(s) for s in ["Shaders", "SGPRs", "VGPRs", "SpillSGPR", "SpillVGPR", "PrivVGPR", "Scratch", "CodeSize", "MaxWaves", "Outputs", "PatchOuts"]]
header = title + "|".join(legend) + "|"
print_yellow(header)
print("|".join(["-" * len(a) for a in (header).split("|")]))