Skip to content

Commit f2c54c3

Browse files
committed
compiler: Start work on hook for operator lookup
1 parent 58df797 commit f2c54c3

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

devito/operator/operator.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,12 @@ def __new__(cls, expressions, **kwargs):
182182
cls._check_kwargs(**kwargs)
183183
expressions = cls._sanitize_exprs(expressions, **kwargs)
184184

185+
# Hook for retrieval of preexisting operators
186+
# TODO: should this emit timing info if an operator is retrieved
187+
maybe_op = cls._retrieve_op(expressions, **kwargs)
188+
if maybe_op:
189+
return maybe_op
190+
185191
# Lower to a JIT-compilable object
186192
with timed_region('op-compile') as r:
187193
op = cls._build(expressions, **kwargs)
@@ -211,6 +217,10 @@ def _sanitize_exprs(cls, expressions, **kwargs):
211217

212218
return expressions
213219

220+
@classmethod
221+
def _retrieve_opt(cls, expressions, **kwargs):
222+
return
223+
214224
@classmethod
215225
def _build(cls, expressions, **kwargs):
216226
# Python- (i.e., compile-) and C-level (i.e., run-time) performance

0 commit comments

Comments
 (0)