Skip to content
Snippets Groups Projects
Commit 0880c439 authored by Frederik Hennig's avatar Frederik Hennig
Browse files

naming of iteration slice

parent da6ad3a5
No related branches found
No related tags found
1 merge request!405Various GPU-related and some general fixes.
Pipeline #67843 passed
......@@ -100,7 +100,7 @@ class AstFactory:
return self.parse_index(cast(IndexParsable, idx))
def parse_slice(
self, slic: int | slice, upper_limit: Any | None = None
self, iter_slice: int | slice, upper_limit: Any | None = None
) -> tuple[PsExpression, PsExpression, PsExpression]:
"""Parse a slice to obtain start, stop and step expressions for a loop or iteration space dimension.
......@@ -115,20 +115,20 @@ class AstFactory:
The `step` member of the slice, if it is constant, must be positive.
Args:
slic: The iteration slice
iter_slice: The iteration slice
upper_limit: Optionally, the upper iteration limit
"""
if isinstance(slic, int):
slic = slice(slic, slic + 1)
if isinstance(iter_slice, int):
iter_slice = slice(iter_slice, iter_slice + 1)
start = self._parse_any_index(slic.start if slic.start is not None else 0)
start = self._parse_any_index(iter_slice.start if iter_slice.start is not None else 0)
stop = (
self._parse_any_index(slic.stop)
if slic.stop is not None
self._parse_any_index(iter_slice.stop)
if iter_slice.stop is not None
else self._parse_any_index(upper_limit)
)
step = self._parse_any_index(slic.step if slic.step is not None else 1)
step = self._parse_any_index(iter_slice.step if iter_slice.step is not None else 1)
if isinstance(start, PsConstantExpr) and start.constant.value < 0:
if upper_limit is None:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment