[python-dtcwt] 165/497: fix incorrect work shap calculation for 1-d arrays

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Tue Jul 21 18:06:01 UTC 2015


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to branch debian/sid
in repository python-dtcwt.

commit c5aac573e61b1dcba02fb8e48472be42810bd922
Author: Rich Wareham <rjw57 at cam.ac.uk>
Date:   Fri Nov 8 16:25:08 2013 +0000

    fix incorrect work shap calculation for 1-d arrays
---
 dtcwt/opencl/lowlevel.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dtcwt/opencl/lowlevel.py b/dtcwt/opencl/lowlevel.py
index 64544f0..6f5b375 100644
--- a/dtcwt/opencl/lowlevel.py
+++ b/dtcwt/opencl/lowlevel.py
@@ -200,10 +200,10 @@ def _apply_kernel(X, h, kern, output, axis=0, elementstep=1, extra_kernel_args=N
 
     # Work out optimum group size
     if work_shape.shape[0] >= 2 and np.all(work_shape[:2] > 1):
-        local_shape = (int(np.floor(np.sqrt(queue.device.max_work_group_size))),) * 2 + (1,)
-        local_shape = local_shape[:len(output.shape)]
+        local_shape = (int(np.floor(np.sqrt(queue.device.max_work_group_size))),) * 2 + (1,1,)
     else:
         local_shape = (queue.device.max_work_group_size, 1, 1)
+    local_shape = local_shape[:len(work_shape)]
 
     global_shape = list(int(np.ceil(x/float(y))*y) for x, y in zip(work_shape, local_shape))
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/python-dtcwt.git



More information about the debian-science-commits mailing list