From 72e9b47bc14c2297c648f70e146fceb4bd8ebadb Mon Sep 17 00:00:00 2001 From: Stephan Seitz <stephan.seitz@fau.de> Date: Mon, 30 Sep 2019 19:06:28 +0200 Subject: [PATCH] Declare LoopCounterSymbols nonnegative This removed some checks like `ctr1 <= 0` from my kernels --- pystencils/astnodes.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pystencils/astnodes.py b/pystencils/astnodes.py index eb5910f9c..42b7b038c 100644 --- a/pystencils/astnodes.py +++ b/pystencils/astnodes.py @@ -465,11 +465,13 @@ class LoopOverCoordinate(Node): @staticmethod def get_loop_counter_symbol(coordinate_to_loop_over): - return TypedSymbol(LoopOverCoordinate.get_loop_counter_name(coordinate_to_loop_over), 'int') + return TypedSymbol(LoopOverCoordinate.get_loop_counter_name(coordinate_to_loop_over), 'int', nonnegative=True) @staticmethod def get_block_loop_counter_symbol(coordinate_to_loop_over): - return TypedSymbol(LoopOverCoordinate.get_block_loop_counter_name(coordinate_to_loop_over), 'int') + return TypedSymbol(LoopOverCoordinate.get_block_loop_counter_name(coordinate_to_loop_over), + 'int', + nonnegative=True) @property def loop_counter_symbol(self): -- GitLab