From b1868d358d0e11e3bf41224c642c0e4017500fc7 Mon Sep 17 00:00:00 2001 From: George Bisbas Date: Wed, 18 Oct 2023 12:59:22 +0100 Subject: [PATCH] compiler: add mode to IG creation, rebase on 2208 --- devito/ir/support/space.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/devito/ir/support/space.py b/devito/ir/support/space.py index 00c454590ea..c89db653117 100644 --- a/devito/ir/support/space.py +++ b/devito/ir/support/space.py @@ -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) @@ -399,7 +399,9 @@ 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) + assert len(modes) <= 1 + try: mode = modes.pop() except KeyError: @@ -500,7 +502,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))