Skip to content

Commit

Permalink
compiler: update
Browse files Browse the repository at this point in the history
  • Loading branch information
georgebisbas committed Nov 24, 2023
1 parent 2fa4880 commit 09daaea
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions devito/ir/clusters/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,15 +358,17 @@ def dspace(self):
# Dimension-centric view of the data space
intervals = IntervalGroup.generate('union', *parts.values())

# 'union' may have resulted in intervals stricter than needed
# e.g. issue #2235. We relax the upper interval with the upper
# from not mapped parts
# 'union' may consume intervals (values) from keys that have dimensions
# not mapped to intervals e.g. issue #2235, resulting in reduced
# iteration size. Here, we relax this mapped upper interval, by
# intersecting intervals with matching only dimensions
for f, v in parts.items():
for d in f.dimensions:
for i in v:
# oobs check is not required but helps reduce
# interval reconstruction
if d in oobs and not v[d].is_Null:
intervals = intervals.set_upper(d, v[d].upper)
if i.dim in oobs and i.dim in f.dimensions:
ii = intervals[i.dim].intersection(v[i.dim])
intervals = intervals.set_upper(i.dim, ii.upper)

# E.g., `db0 -> time`, but `xi NOT-> x`
intervals = intervals.promote(lambda d: not d.is_Sub)
Expand Down

0 comments on commit 09daaea

Please sign in to comment.