Skip to content

Commit

Permalink
compiler: add mode to IG creation, rebase on 2208
Browse files Browse the repository at this point in the history
  • Loading branch information
georgebisbas committed Oct 18, 2023
1 parent e96bb5e commit 1a5341f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions devito/ir/support/space.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ def zero(self):
return Interval(self.dim, 0, 0, self.stamp)

def ceil(self, o):
if o.is_Null:
if not self.is_compatible(o):
return self._rebuild()
return Interval(self.dim, self.lower, o.upper, self.stamp)

Expand Down Expand Up @@ -399,7 +399,12 @@ def generate(cls, op, *interval_groups, relations=None):
relations.update(set().union(*[ig.relations for ig in interval_groups]))

modes = set(ig.mode for ig in interval_groups)

# try:
assert len(modes) <= 1
# except:
# import pdb;pdb.set_trace()

try:
mode = modes.pop()
except KeyError:
Expand Down Expand Up @@ -500,7 +505,7 @@ def zero(self, d=None):
def ceil(self, o=None):
d = self.dimensions if o is None else as_tuple(o.dim)
return IntervalGroup([i.ceil(o) if i.dim in d else i for i in self],
relations=self.relations)
relations=self.relations, mode=self.mode)

def lift(self, d=None, v=None):
d = set(self.dimensions if d is None else as_tuple(d))
Expand Down

0 comments on commit 1a5341f

Please sign in to comment.