Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions devito/operator/operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,12 @@ def __new__(cls, expressions, **kwargs):
cls._check_kwargs(**kwargs)
expressions = cls._sanitize_exprs(expressions, **kwargs)

# Hook for retrieval of preexisting operators
# TODO: should this emit timing info if an operator is retrieved
maybe_op = cls._retrieve_op(expressions, **kwargs)
if maybe_op:
return maybe_op

# Lower to a JIT-compilable object
with timed_region('op-compile') as r:
op = cls._build(expressions, **kwargs)
Expand Down Expand Up @@ -211,6 +217,10 @@ def _sanitize_exprs(cls, expressions, **kwargs):

return expressions

@classmethod
def _retrieve_op(cls, expressions, **kwargs):
return

@classmethod
def _build(cls, expressions, **kwargs):
# Python- (i.e., compile-) and C-level (i.e., run-time) performance
Expand Down
3 changes: 3 additions & 0 deletions devito/types/equation.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ def xreplace(self, rules):
return self.func(self.lhs.xreplace(rules), self.rhs.xreplace(rules))

def __str__(self):
if self._subdomain is not None:
return (f"{self.__class__.__name__}({self.lhs}, {self.rhs},"
f" subdomain={self._subdomain})")
return f"{self.__class__.__name__}({self.lhs}, {self.rhs})"

__repr__ = __str__
Expand Down
Loading