Skip to content

Commit

Permalink
tests: rename opts
Browse files Browse the repository at this point in the history
  • Loading branch information
georgebisbas committed Apr 6, 2021
1 parent 8a05b87 commit 09848be
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
6 changes: 3 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,6 @@ def pytest_runtest_call(item):

# A list of optimization options/pipelines to be used in testing
# regarding spatial and/or temporal blocking.
pipelines_tiling = ['advanced',
('advanced', {'skewing': True}),
('advanced', {'skewing': True, 'blockinner': True})]
opts_tiling = ['advanced',
('advanced', {'skewing': True}),
('advanced', {'skewing': True, 'blockinner': True})]
3 changes: 2 additions & 1 deletion tests/test_autotuner.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pytest
import numpy as np

from conftest import skipif
from conftest import skipif, opts_tiling
from devito import Grid, TimeFunction, Eq, Operator, configuration, switchconfig
from devito.data import LEFT
from devito.core.autotuning import options # noqa
Expand Down Expand Up @@ -263,6 +263,7 @@ def test_multiple_blocking():
assert len(op._state['autotuning'][0]['tuned']) == 5


@pytest.mark.parametrize('opt', opts_tiling)
@pytest.mark.parametrize('opt_options', [{'skewing': False}, {'skewing': True}])
def test_hierarchical_blocking(opt_options):
grid = Grid(shape=(64, 64, 64))
Expand Down
14 changes: 7 additions & 7 deletions tests/test_dimension.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from sympy import And
import pytest

from conftest import skipif, pipelines_tiling
from conftest import skipif, opts_tiling
from devito import (ConditionalDimension, Grid, Function, TimeFunction, SparseFunction, # noqa
Eq, Operator, Constant, Dimension, SubDimension, switchconfig,
SubDomain, Lt, Le, Gt, Ge, Ne, Buffer)
Expand Down Expand Up @@ -47,7 +47,7 @@ def test_multi_buffer_long_time(self):

class TestSubDimension(object):

@pytest.mark.parametrize('opt', pipelines_tiling)
@pytest.mark.parametrize('opt', opts_tiling)
def test_interior(self, opt):
"""
Tests application of an Operator consisting of a single equation
Expand Down Expand Up @@ -98,7 +98,7 @@ def test_domain_vs_interior(self):
assert np.all(u.data[1, :, :, -1] == 1)
assert np.all(u.data[1, 1:3, 1:3, 1:3] == 3)

@pytest.mark.parametrize('opt', pipelines_tiling)
@pytest.mark.parametrize('opt', opts_tiling)
def test_subdim_middle(self, opt):
"""
Tests that instantiating SubDimensions using the classmethod
Expand Down Expand Up @@ -140,7 +140,7 @@ def test_symbolic_size(self):
xright = SubDimension.right(name='xright', parent=x, thickness=thickness)
assert xright.symbolic_size == xright.thickness.right[0]

@pytest.mark.parametrize('opt', pipelines_tiling)
@pytest.mark.parametrize('opt', opts_tiling)
def test_bcs(self, opt):
"""
Tests application of an Operator consisting of multiple equations
Expand Down Expand Up @@ -290,7 +290,7 @@ def test_iteration_property_vector(self, exprs, expected):
vectorized = [i.dim.name for i in iterations if i.is_Vectorized]
assert set(vectorized) == set(expected)

@pytest.mark.parametrize('opt', pipelines_tiling)
@pytest.mark.parametrize('opt', opts_tiling)
def test_subdimmiddle_parallel(self, opt):
"""
Tests application of an Operator consisting of a subdimension
Expand Down Expand Up @@ -489,7 +489,7 @@ def test_arrays_defined_over_subdims(self):
# "ValueError: No value found for parameter xi_size"
op()

@pytest.mark.parametrize('opt', pipelines_tiling)
@pytest.mark.parametrize('opt', opts_tiling)
def test_expandingbox_like(self, opt):
"""
Make sure SubDimensions aren't an obstacle to expanding boxes.
Expand Down Expand Up @@ -588,7 +588,7 @@ def test_basic_shuffles(self):
assert np.all([np.allclose(usave.data[i], i*factor)
for i in range((nt+factor-1)//factor)])

@pytest.mark.parametrize('opt', pipelines_tiling)
@pytest.mark.parametrize('opt', opts_tiling)
def test_spacial_subsampling(self, opt):
"""
Test conditional dimension for the spatial ones.
Expand Down
4 changes: 2 additions & 2 deletions tests/test_subdomains.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import numpy as np
from math import floor

from conftest import pipelines_tiling
from conftest import opts_tiling
from devito import (Grid, Function, TimeFunction, Eq, solve, Operator, SubDomain,
SubDomainSet, Dimension)
from devito.ir import FindNodes, Expression
Expand Down Expand Up @@ -160,7 +160,7 @@ def define(self, dimensions):

assert u0.data.all() == u1.data.all() == u2.data.all() == u3.data.all()

@pytest.mark.parametrize('opt', pipelines_tiling)
@pytest.mark.parametrize('opt', opts_tiling)
def test_iterate_NDomains(self, opt):
"""
Test that a set of subdomains are iterated upon correctly.
Expand Down

0 comments on commit 09848be

Please sign in to comment.