From c6ee3841476c86e4ddfa2eb0cbb557c40f056482 Mon Sep 17 00:00:00 2001 From: Alexandre Marie Date: Fri, 5 Jul 2019 16:52:20 +0200 Subject: Tests if openCL can be used Gbp-Pq: Name 0006-Tests-if-openCL-can-be-used.patch --- silx/opencl/common.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/silx/opencl/common.py b/silx/opencl/common.py index 1f9df50..73cf676 100644 --- a/silx/opencl/common.py +++ b/silx/opencl/common.py @@ -60,7 +60,14 @@ else: logger.warning("Unable to import pyOpenCl. Please install it from: http://pypi.python.org/pypi/pyopencl") pyopencl = None else: - import pyopencl.array as array + try: + pyopencl.get_platforms() + except pyopencl.LogicError: + logger.warning("The module pyOpenCL has been imported but can't be used here") + pyopencl = None + else: + import pyopencl.array as array + mf = pyopencl.mem_flags if pyopencl is None: class mf(object): -- cgit v1.2.3