Skip to content

Commit

Permalink
tests: Add op.apply() for operators execution
Browse files Browse the repository at this point in the history
  • Loading branch information
georgebisbas committed Apr 2, 2021
1 parent 017b601 commit fd20d19
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/test_skewing.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pytest

from sympy import Add, cos, sin, sqrt # noqa
from sympy import Max, Add, cos, sin, sqrt # noqa

from devito.core.autotuning import options # noqa
from devito import Function, TimeFunction, Grid, Operator, Eq # noqa
Expand Down Expand Up @@ -31,6 +31,7 @@ def test_skewed_bounds(self, expr, expected):
eqn = eval(expr)
# List comprehension would need explicit locals/globals mappings to eval
op = Operator(eqn, opt=('blocking', {'skewing': True}))
op.apply(time_M=5)
iters = FindNodes(Iteration).visit(op)
time_iter = [i for i in iters if i.dim.is_Time]
assert len(time_iter) == 1
Expand Down Expand Up @@ -78,7 +79,7 @@ def test_no_sequential(self, expr, expected):
eqn = eval(expr)
# List comprehension would need explicit locals/globals mappings to eval
op = Operator(eqn, opt=('blocking', {'skewing': True}))

op.apply()
iters = FindNodes(Iteration).visit(op)
time_iter = [i for i in iters if i.dim.is_Time]
assert len(time_iter) == 0
Expand Down Expand Up @@ -121,6 +122,7 @@ def test_skewing_codegen(self, expr, expected, skewing, blockinner):
# List comprehension would need explicit locals/globals mappings to eval
op = Operator(eqn, opt=('blocking', {'blocklevels': 0, 'skewing': skewing,
'blockinner': blockinner}))
op.apply(time_M=5)

iters = FindNodes(Iteration).visit(op)

Expand Down

0 comments on commit fd20d19

Please sign in to comment.