Skip to content

Commit c59664d

Browse files
committed
compiler: Simplify fission
1 parent 85e7304 commit c59664d

1 file changed

Lines changed: 8 additions & 10 deletions

File tree

devito/passes/clusters/misc.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from itertools import groupby, product
22

33
from devito.ir.clusters import Queue, cluster_pass
4-
from devito.ir.support import SEPARABLE, SEQUENTIAL, Scope
4+
from devito.ir.support import SEPARABLE, Scope
55
from devito.passes.clusters.utils import in_critical_region
66
from devito.symbolics import pow_to_mul
77
from devito.tools import Stamp, flatten, frozendict, timed_pass
@@ -123,7 +123,7 @@ def callback(self, clusters, prefix):
123123
d = prefix[-1].dim
124124

125125
# Do not waste time if definitely illegal
126-
if any(SEQUENTIAL in c.properties[d] for c in clusters):
126+
if any(c.properties.is_sequential(d) for c in clusters):
127127
return clusters
128128

129129
# Do not waste time if definitely nothing to do
@@ -136,17 +136,16 @@ def callback(self, clusters, prefix):
136136
return clusters
137137

138138
processed = []
139-
for (it, guards), g in groupby(clusters, key=lambda c: self._key(c, prefix)):
139+
for it, g in groupby(clusters, key=lambda c: self._key(c, prefix)):
140140
group = list(g)
141141

142142
try:
143-
test0 = any(SEQUENTIAL in c.properties[it.dim] for c in group)
143+
test0 = any(c.properties.is_sequential(it.dim) for c in group)
144144
except AttributeError:
145-
# `it` is None because `c`'s IterationSpace has no `d` Dimension,
146-
# hence `key = (it, guards) = (None, guards)`
145+
# `it` is None because `c`'s IterationSpace has no `d` Dimension
147146
test0 = True
148147

149-
if test0 or guards:
148+
if test0:
150149
# Heuristic: no gain from fissioning if unable to ultimately
151150
# increase the number of collapsible iteration spaces, hence give up
152151
processed.extend(group)
@@ -164,11 +163,10 @@ def _key(self, c, prefix):
164163
dims = tuple(i.dim for i in prefix)
165164

166165
it = c.ispace[index]
167-
guards = frozendict({d: v for d, v in c.guards.items() if d in dims})
168166

169-
return (it, guards)
167+
return it
170168
except IndexError:
171-
return (None, c.guards)
169+
return None
172170

173171

174172
@timed_pass()

0 commit comments

Comments
 (0)