Skip to content
Snippets Groups Projects
Commit 3664c9da authored by Stephan Seitz's avatar Stephan Seitz
Browse files

Fix CBackends _print_Function for functions that don't have names

Like LLVM backend's pointer_arithmetic_func
parent e1b452f7
Branches
No related tags found
No related merge requests found
......@@ -5,6 +5,7 @@ import numpy as np
import sympy as sp
from sympy.core import S
from sympy.printing.ccode import C89CodePrinter
from pystencils.astnodes import KernelFunction, Node
from pystencils.cpu.vectorization import vec_all, vec_any
from pystencils.data_types import (
......@@ -385,8 +386,9 @@ class CustomSympyPrinter(CCodePrinter):
elif expr.func == int_div:
return "((%s) / (%s))" % (self._print(expr.args[0]), self._print(expr.args[1]))
else:
name = expr.name if hasattr(expr, 'name') else expr.__class__.__name__
arg_str = ', '.join(self._print(a) for a in expr.args)
return f'{expr.name}({arg_str})'
return f'{name}({arg_str})'
def _typed_number(self, number, dtype):
res = self._print(number)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment