diff --git a/osaca/semantics/arch_semantics.py b/osaca/semantics/arch_semantics.py index 50bbce5..8f6b59c 100755 --- a/osaca/semantics/arch_semantics.py +++ b/osaca/semantics/arch_semantics.py @@ -416,9 +416,8 @@ class ArchSemantics(ISASemantics): @staticmethod def get_throughput_sum(kernel): """Get the overall throughput sum separated by port of all instructions of a kernel.""" - tp_sum = reduce( - (lambda x, y: [sum(z) for z in zip(x, y)]), - [instr['port_pressure'] for instr in kernel], - ) - tp_sum = [round(x, 2) for x in tp_sum] + port_pressures = [instr['port_pressure'] for instr in kernel] + # Essentially summing up each columns of port_pressures, where each column is one port + # round is necessary to ensure termination of ArchsSemantics.assign_optimal_throughput + tp_sum = [round(sum(col), 2) for col in zip(*port_pressures)] return tp_sum