Skip to content

Commit 0aa1c2a

Browse files
committed
compiler: Enhance ClusterGroup
1 parent d0379ba commit 0aa1c2a

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

devito/ir/clusters/cluster.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -655,6 +655,12 @@ def __hash__(self):
655655
def concatenate(cls, *cgroups):
656656
return list(chain(*cgroups))
657657

658+
def rebuild(self, **kwargs):
659+
clusters = kwargs.get('clusters', self)
660+
ispace = kwargs.get('ispace', self.ispace)
661+
662+
return self.__class__(clusters, ispace=ispace)
663+
658664
@cached_property
659665
def exprs(self):
660666
return flatten(c.exprs for c in self)
@@ -663,6 +669,10 @@ def exprs(self):
663669
def scope(self):
664670
return Scope(exprs=self.exprs)
665671

672+
@cached_property
673+
def functions(self):
674+
return self.scope.functions
675+
666676
@cached_property
667677
def ispace(self):
668678
return self._ispace

0 commit comments

Comments
 (0)