Skip to content

Commit 4891ec1

Browse files
committed
compiler: Tweak nofuse mode
1 parent f5ce43a commit 4891ec1

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

devito/passes/clusters/misc.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,6 @@ def callback(self, cgroups, prefix):
135135
# Toposort to maximize fusion
136136
if self.toposort:
137137
clusters = self._toposort(cgroups, prefix)
138-
if self.toposort == 'nofuse':
139-
return [clusters]
140138
else:
141139
clusters = ClusterGroup(cgroups)
142140

@@ -146,6 +144,13 @@ def callback(self, cgroups, prefix):
146144
g = list(group)
147145

148146
for maybe_fusible in self._apply_heuristics(g):
147+
if self.toposort == 'nofuse':
148+
# Special case: we retain the ClusterGroup to maximize the
149+
# effectiveness of the toposort at the next stage, but we
150+
# do not actually fuse anything
151+
processed.append(ClusterGroup(maybe_fusible, prefix))
152+
continue
153+
149154
try:
150155
# Perform fusion
151156
processed.append(Cluster.from_clusters(*maybe_fusible))

0 commit comments

Comments
 (0)