Skip to content
Snippets Groups Projects
Commit 98f072ff authored by Dominik Thoennes's avatar Dominik Thoennes
Browse files

some fixes for hyteg

parent f8ea9fc4
Branches
No related tags found
No related merge requests found
......@@ -228,7 +228,8 @@ class CBackend:
def _print_LoopOverCoordinate(self, node):
counter_symbol = node.loop_counter_name
start = f"int {counter_symbol} = {self.sympy_printer.doprint(node.start)}"
condition = f"{counter_symbol} < {self.sympy_printer.doprint(node.stop)}"
condition = f"{self.sympy_printer.doprint(node.relational(node.loop_counter_symbol, node.stop))}"
#condition = f"{counter_symbol} < {self.sympy_printer.doprint(node.stop)}"
update = f"{counter_symbol} += {self.sympy_printer.doprint(node.step)}"
loop_str = f"for ({start}; {condition}; {update})"
......@@ -412,6 +413,8 @@ class CustomSympyPrinter(CCodePrinter):
return f"(1 << ({self._print(expr.args[0])}))"
elif expr.func == int_div:
return f"(({self._print(expr.args[0])}) / ({self._print(expr.args[1])}))"
elif expr.func == post_increment:
return f"({self._print(expr.args[0])})"
else:
name = expr.name if hasattr(expr, 'name') else expr.__class__.__name__
arg_str = ', '.join(self._print(a) for a in expr.args)
......
......@@ -59,7 +59,11 @@ class int_div(IntegerFunctionTwoArgsMixIn):
# noinspection PyPep8Naming
class int_power_of_2(IntegerFunctionTwoArgsMixIn):
class int_power_of_2(sp.Function):
pass
# noinspection PyPep8Naming
class post_increment(sp.Function):
pass
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment