From 4b34c96c8f10d0fa3d6fee0eec6e39517e73e76c Mon Sep 17 00:00:00 2001
From: Martin Bauer <martin.bauer@fau.de>
Date: Fri, 9 Nov 2018 08:34:53 +0100
Subject: [PATCH] Pass field information (shape,stride) as single elements
 instead of arr

- small (length < 5) arrays with shape and stride information had to be
  memcpy'd to the GPU before every kernel call
- instead of passing the information as arrays, the single elements are
  passed
- leads to more function arguments, but simplifies GPU kernel calls

-> changes in all backends required
---
 updatekernels.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/updatekernels.py b/updatekernels.py
index 3eacdbbe..1dfb9e6a 100644
--- a/updatekernels.py
+++ b/updatekernels.py
@@ -56,9 +56,9 @@ def create_stream_pull_only_kernel(stencil, numpy_arr=None, src_field_name="src"
 
     dim = len(stencil[0])
     if numpy_arr is None:
-        src = Field.create_generic(src_field_name, dim, index_dimensions=1,
+        src = Field.create_generic(src_field_name, dim, index_shape=(len(stencil),),
                                    layout=generic_layout, dtype=generic_field_type)
-        dst = Field.create_generic(dst_field_name, dim, index_dimensions=1,
+        dst = Field.create_generic(dst_field_name, dim,  index_shape=(len(stencil),),
                                    layout=generic_layout, dtype=generic_field_type)
     else:
         src = Field.create_from_numpy_array(src_field_name, numpy_arr, index_dimensions=1)
-- 
GitLab