From 9e0c40a78a6d230b895e1f78c23ee26a9d6f5d50 Mon Sep 17 00:00:00 2001 From: Andi Heinrich Date: Tue, 19 Apr 2016 15:19:36 +0200 Subject: [PATCH] bugfix in PyCudaHandler merge and split operations The attribute call to gpudata is done by pycuda inside the function, no need to do it outside the function. --- brainstorm/handlers/pycuda_handler.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/brainstorm/handlers/pycuda_handler.py b/brainstorm/handlers/pycuda_handler.py index 8019fca..6fb6e95 100644 --- a/brainstorm/handlers/pycuda_handler.py +++ b/brainstorm/handlers/pycuda_handler.py @@ -318,7 +318,7 @@ def merge_tt(self, a, b, out): assert(a.shape[-1] + b.shape[-1] == out.shape[-1]) n = int(np.prod(out.shape[:-1])) grid, block = self._get_gridsize(n) - _merge_impl(a.gpudata, b.gpudata, out.gpudata, + _merge_impl(a, b, out, np.int32(n), np.int32(a.shape[-1]), np.int32(b.shape[-1]), block=block, grid=grid) @@ -358,7 +358,7 @@ def split_add_tt(self, x, out_a, out_b): assert(out_a.shape[-1] + out_b.shape[-1] == x.shape[-1]) n = int(np.prod(x.shape[:-1])) grid, block = self._get_gridsize(n) - _split_add_impl(x.gpudata, out_a.gpudata, out_b.gpudata, + _split_add_impl(x, out_a, out_b, np.int32(n), np.int32(out_a.shape[-1]), np.int32(out_b.shape[-1]), block=block, grid=grid)