summaryrefslogtreecommitdiff
path: root/debian/patches/0006-Tests-if-openCL-can-be-used.patch
diff options
context:
space:
mode:
authorAlexandre Marie <alexandre.marie@synchrotron-soleil.fr>2019-07-05 16:53:08 +0200
committerAlexandre Marie <alexandre.marie@synchrotron-soleil.fr>2019-07-05 16:53:08 +0200
commit8ff15764a99df31a5d75e1e19a89b413408cfcc2 (patch)
treece3b7925bdce33294daa71ff6cf0b85a0e82386b /debian/patches/0006-Tests-if-openCL-can-be-used.patch
parent488cf9a749ac24122e94b194808ae766d46d0c1d (diff)
Added test on openCL's use
Diffstat (limited to 'debian/patches/0006-Tests-if-openCL-can-be-used.patch')
-rw-r--r--debian/patches/0006-Tests-if-openCL-can-be-used.patch28
1 files changed, 28 insertions, 0 deletions
diff --git a/debian/patches/0006-Tests-if-openCL-can-be-used.patch b/debian/patches/0006-Tests-if-openCL-can-be-used.patch
new file mode 100644
index 0000000..69ba42f
--- /dev/null
+++ b/debian/patches/0006-Tests-if-openCL-can-be-used.patch
@@ -0,0 +1,28 @@
+From: Alexandre Marie <alexandre.marie@synchrotron-soleil.fr>
+Date: Fri, 5 Jul 2019 16:52:20 +0200
+Subject: Tests if openCL can be used
+
+---
+ 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 17c67d1..421a35a 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):