Skip to content

Commit 3d85383

Browse files
committed
compiler: Tweak topo-fusion
1 parent a8d15b7 commit 3d85383

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

devito/passes/clusters/misc.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -310,16 +310,14 @@ def choose_element(queue, scheduled):
310310
# Process the `strict` part of the key
311311
candidates = [i for i in queue if m[i].itintervals == k.itintervals]
312312

313-
if k.guards:
314-
compatible = [i for i in candidates if m[i].guards == k.guards]
315-
candidates = compatible or candidates
313+
compatible = [i for i in candidates if m[i].guards == k.guards]
314+
candidates = compatible or candidates
316315

317-
if k.syncs:
318-
compatible = [i for i in candidates if m[i].syncs == k.syncs]
319-
candidates = compatible or candidates
316+
compatible = [i for i in candidates if m[i].syncs == k.syncs]
317+
candidates = compatible or candidates
320318

321319
# Process the `weak` part of the key
322-
for i in reversed(range(len(k.weak) + 1)):
320+
for i in range(len(k.weak), -1, -1):
323321
choosable = [e for e in candidates if m[e].weak[:i] == k.weak[:i]]
324322
try:
325323
# Ensure stability

0 commit comments

Comments
 (0)