From 47d0ca934061a11b8b5cb7a05930e61926836ae7 Mon Sep 17 00:00:00 2001
From: Markus Holzer <markus.holzer@fau.de>
Date: Fri, 1 Jul 2022 12:12:40 +0200
Subject: [PATCH] Gpu block size

---
 pystencils/gpucuda/indexing.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/pystencils/gpucuda/indexing.py b/pystencils/gpucuda/indexing.py
index 6f30b0a1c..f74b6e507 100644
--- a/pystencils/gpucuda/indexing.py
+++ b/pystencils/gpucuda/indexing.py
@@ -147,7 +147,8 @@ class BlockIndexing(AbstractIndexing):
             for i in range(len(widths)):
                 factor = div_floor(prod(block_size[:i]), prod(adapted_block_size))
                 adapted_block_size.append(sp.Min(block_size[i] * factor, widths[i]))
-            block_size = tuple(adapted_block_size) + extend_bs
+            extend_adapted_bs = (1,) * (3 - len(adapted_block_size))
+            block_size = tuple(adapted_block_size) + extend_adapted_bs
 
         block_size = tuple(sp.Min(bs, max_bs) for bs, max_bs in zip(block_size, self._maximum_block_size))
         grid = tuple(div_ceil(length, block_size) for length, block_size in zip(widths, block_size))
-- 
GitLab