Skip to content

Commit

Permalink
yask: Add SIMD tests
Browse files Browse the repository at this point in the history
  • Loading branch information
FabioLuporini committed Sep 23, 2017
1 parent cf00d19 commit df8ebb9
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion tests/test_yask.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from devito import (Operator, DenseData, TimeData, PointData,
time, t, x, y, z, configuration, clear_cache) # noqa
from devito.dle import retrieve_iteration_tree # noqa
from devito.yask import arch_mapper, yask_configuration # noqa
from devito.yask.wrappers import YaskGrid, contexts # noqa

# For the acoustic wave test
Expand Down Expand Up @@ -130,8 +131,15 @@ class TestOperatorSimple(object):
def setup_class(cls):
clear_cache()

@pytest.fixture(scope='class', autouse=True)
def reset_isa(self):
"""Force back to NO-SIMD after each test, as some tests may optionally
switch on SIMD."""
yask_configuration['develop-mode'] = True

@pytest.mark.parametrize("space_order", [0, 1, 2])
def test_increasing_halo_wo_ofs(self, space_order):
@pytest.mark.parametrize("nosimd", [True, False])
def test_increasing_halo_wo_ofs(self, space_order, nosimd):
"""
Apply the trivial equation ``u[t+1,x,y,z] = u[t,x,y,z] + 1`` and check
that increasing space orders lead to proportionately larger halo regions,
Expand All @@ -156,6 +164,9 @@ def test_increasing_halo_wo_ofs(self, space_order):
And so on and so forth.
"""
# SIMD on/off
yask_configuration['develop-mode'] = nosimd

u = TimeData(name='yu4D', shape=(16, 16, 16), dimensions=(x, y, z),
space_order=space_order)
u.data.with_halo[:] = 0.
Expand Down

0 comments on commit df8ebb9

Please sign in to comment.