From df8ebb94454fc18f70918a950c3bdea61e63afc1 Mon Sep 17 00:00:00 2001 From: Fabio Luporini Date: Fri, 22 Sep 2017 18:27:03 +0200 Subject: [PATCH] yask: Add SIMD tests --- tests/test_yask.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/test_yask.py b/tests/test_yask.py index 7339557f0e..b5d2db1c35 100644 --- a/tests/test_yask.py +++ b/tests/test_yask.py @@ -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 @@ -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, @@ -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.