Skip to content

Commit

Permalink
compiler: Change SparseFunction guarding to maximize Cluster fusion
Browse files Browse the repository at this point in the history
  • Loading branch information
FabioLuporini committed Jan 28, 2022
1 parent 8bad5ce commit 10d7c13
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions devito/types/sparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -635,8 +635,8 @@ def guard(self, expr=None, offset=0):
ub = sympy.And(p <= d.symbolic_max + offset, evaluate=False)
conditions[p] = sympy.And(lb, ub, evaluate=False)
condition = sympy.And(*conditions.values(), evaluate=False)
cd = ConditionalDimension("%s_g" % self._sparse_dim, self._sparse_dim,
condition=condition)
cd = ConditionalDimension(self._sparse_dim.name, self._sparse_dim,
condition=condition, indirect=True)

if expr is None:
out = self.indexify().xreplace({self._sparse_dim: cd})
Expand Down

0 comments on commit 10d7c13

Please sign in to comment.