summaryrefslogtreecommitdiff
path: root/debian/patches/0003-fix-unit-test.patch
blob: 4e27e832d05268f5ee69661e82f40041e7ebe02a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
From: =?utf-8?q?Picca_Fr=C3=A9d=C3=A9ric-Emmanuel?=
 <picca@synchrotron-soleil.fr>
Date: Fri, 11 Aug 2017 10:15:26 +0200
Subject: fix unit test

---
 silx/opencl/common.py | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/silx/opencl/common.py b/silx/opencl/common.py
index fcb4efa..e5f23c0 100644
--- a/silx/opencl/common.py
+++ b/silx/opencl/common.py
@@ -59,13 +59,16 @@ else:
     except ImportError:
         logger.warning("Unable to import pyOpenCl. Please install it from: http://pypi.python.org/pypi/pyopencl")
         pyopencl = None
-        class mf(object):
-            WRITE_ONLY = 1
-            READ_ONLY = 1
-            READ_WRITE = 1
     else:
         import pyopencl.array as array
-        mf = pyopencl.mem_flags
+
+if pyopencl is None:
+    class mf(object):
+        WRITE_ONLY = 1
+        READ_ONLY = 1
+        READ_WRITE = 1
+else:
+    mf = pyopencl.mem_flags
 
 
 FLOP_PER_CORE = {"GPU": 64,  # GPU, Fermi at least perform 64 flops per cycle/multicore, G80 were at 24 or 48 ...