From 6a9b444aa5dae952e1632919e75aba3fed0cad2b Mon Sep 17 00:00:00 2001 From: "Rebecca N. Palmer" Date: Sun, 5 Aug 2018 22:22:20 +0100 Subject: [PATCH] Skip tests not supported by the current hardware --- test/test_clrandom.py | 3 +++ test/test_wrapper.py | 1 + 2 files changed, 4 insertions(+) diff --git a/test/test_clrandom.py b/test/test_clrandom.py index 2846e24c..0cd572d0 100644 --- a/test/test_clrandom.py +++ b/test/test_clrandom.py @@ -31,6 +31,7 @@ import pyopencl.clrandom as clrandom from pyopencl.tools import ( # noqa pytest_generate_tests_for_pyopencl as pytest_generate_tests) +from pyopencl.characterize import has_double_support try: import faulthandler @@ -59,6 +60,8 @@ def make_ranlux_generator(cl_ctx): cltypes.float4]) def test_clrandom_dtypes(ctx_factory, rng_class, dtype): cl_ctx = ctx_factory() + if dtype == np.float64 and not has_double_support(cl_ctx.devices[0]): + pytest.skip("double precision not supported on this device") rng = rng_class(cl_ctx) size = 10 diff --git a/test/test_wrapper.py b/test/test_wrapper.py index 118eee74..a17866fa 100644 --- a/test/test_wrapper.py +++ b/test/test_wrapper.py @@ -953,6 +953,7 @@ def test_coarse_grain_svm(ctx_factory): dev = ctx.devices[0] has_svm = (ctx._get_cl_version() >= (2, 0) and + ctx.devices[0]._get_cl_version() >= (2, 0) and cl.get_cl_header_version() >= (2, 0)) if dev.platform.name == "Portable Computing Language": -- GitLab