diff --git a/comparison_fixtures.py b/comparison_fixtures.py new file mode 100644 index 0000000000000000000000000000000000000000..4d2be8b9e083b02e5fadeef6b4f1dad1e11feb95 --- /dev/null +++ b/comparison_fixtures.py @@ -0,0 +1,4 @@ +import numpy.linalg as la + +def arrays(a, b): + assert la.norm(a - b, 2)/la.norm(b) < 1e-5 diff --git a/test.py b/test.py index 5db0b73509d167009a80075d8cc12f546efc7d38..198cf24a7ba54c24fb01691910b19403f6dff08d 100644 --- a/test.py +++ b/test.py @@ -15,7 +15,7 @@ from pyopencl.tools import ( # noqa as pytest_generate_tests) import fixtures - +import comparison_fixtures as compare def test_matvec(ctx_factory): a = fixtures.random_array(10, 10) @@ -23,9 +23,10 @@ def test_matvec(ctx_factory): c = fixtures.mult_mat_vec(ctx_factory, a=a, b=b, alpha=1.0) - assert la.norm(a@b - c, 2)/la.norm(c) < 1e-5 + compare.arrays(a@b, c) +@pytest.mark.skip("slow") def test_compute_flux_derivatives(ctx_factory): logging.basicConfig(level="INFO") @@ -46,6 +47,7 @@ def test_compute_flux_derivatives(ctx_factory): metric_jacobians=metric_jacobians) +@pytest.mark.skip("slow") def test_compute_flux_derivatives_gpu(ctx_factory): logging.basicConfig(level="INFO")