diff options
author | Alexandre Marie <alexandre.marie@synchrotron-soleil.fr> | 2019-07-05 16:52:20 +0200 |
---|---|---|
committer | Picca Frédéric-Emmanuel <picca@debian.org> | 2019-07-27 17:17:26 +0200 |
commit | 1a301f41f51194264f088b7784af17f510a88b47 (patch) | |
tree | e37f4ff78be5e11feb83feffd150eb09f95b1196 | |
parent | 4344394dc86c113e4331dc301922b856b983b477 (diff) |
Tests if openCL can be usedarchive/debian/0.11.0+dfsg-1_bpo10+1
Gbp-Pq: Name 0006-Tests-if-openCL-can-be-used.patch
-rw-r--r-- | silx/opencl/common.py | 9 |
1 files changed, 8 insertions, 1 deletions
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): |