keep dependency paths as generators instead of lists

This commit is contained in:
JanLJL
2021-04-17 12:46:44 +02:00
parent b033b3b7aa
commit 607d459569

View File

@@ -88,11 +88,12 @@ class KernelDG(nx.DiGraph):
loopcarried_deps = [] loopcarried_deps = []
paths = [] paths = []
for instr in kernel: for instr in kernel:
paths += list(nx.algorithms.simple_paths.all_simple_paths( paths.append(nx.algorithms.simple_paths.all_simple_paths(
dg, instr.line_number, instr.line_number + offset)) dg, instr.line_number, instr.line_number + offset))
paths_set = set() paths_set = set()
for path in paths: for path_gen in paths:
for path in path_gen:
lat_sum = 0.0 lat_sum = 0.0
# extend path by edge bound latencies (e.g., store-to-load latency) # extend path by edge bound latencies (e.g., store-to-load latency)
lat_path = [] lat_path = []