summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Marie <alexandre.marie@synchrotron-soleil.fr>2019-07-05 16:52:20 +0200
committerPicca Frédéric-Emmanuel <picca@debian.org>2019-10-19 13:19:44 +0200
commit5580560a7e7a0f54fd580f3a03ee04a6386e3aab (patch)
treeed29c84493b9b3ccc2de9e00e69cdb55c6e98d6a
parent7c345d92a58a5a796e652aaa6f0dd49f0139e932 (diff)
Tests if openCL can be used
Gbp-Pq: Name 0006-Tests-if-openCL-can-be-used.patch
-rw-r--r--silx/opencl/common.py9
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):