Skip to content
Snippets Groups Projects
Commit d2bdba3d authored by Markus Holzer's avatar Markus Holzer
Browse files

Fix guard in indexing

parent bedd8e9f
Branches
No related merge requests found
Pipeline #66295 failed with stages
in 3 minutes and 7 seconds
......@@ -8,7 +8,7 @@ from sympy.core.cache import cacheit
from pystencils.astnodes import Block, Conditional, SympyAssignment
from pystencils.typing import TypedSymbol, create_type
from pystencils.integer_functions import div_ceil, div_floor
from pystencils.integer_functions import div_ceil, div_floor, int_div
from pystencils.sympyextensions import is_integer_sequence, prod
......@@ -224,6 +224,9 @@ class BlockIndexing(AbstractIndexing):
assert len(self._iteration_space) == len(arr_shape), "Iteration space must be equal to the array shape"
numeric_iteration_slice = _get_numeric_iteration_slice(self._iteration_space, arr_shape)
end = [s.stop if s.stop != 0 else 1 for s in numeric_iteration_slice]
for i, s in enumerate(numeric_iteration_slice):
if s.step and s.step != 1:
end[i] = int_div(end[i], s.step)
if self._dim < 4:
conditions = [c < e for c, e in zip(self.coordinates, end)]
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment