diff --git a/dace/codegen/targets/cpu.py b/dace/codegen/targets/cpu.py index d39ae5fc9d..0b48b60c25 100644 --- a/dace/codegen/targets/cpu.py +++ b/dace/codegen/targets/cpu.py @@ -1513,7 +1513,7 @@ def make_restrict(expr: str) -> str: ] arguments += [ f'{node.sdfg.symbols[aname].as_arg(aname)}' for aname in sorted(node.symbol_mapping.keys()) - if aname not in sdfg.constants + if aname not in sdfg.constants and aname in self._frame.free_symbols(node.sdfg) ] arguments = ', '.join(arguments) return f'void {sdfg_label}({arguments}) {{' @@ -1523,8 +1523,8 @@ def generate_nsdfg_call(self, sdfg, state, node, memlet_references, sdfg_label, if state_struct: prepend = ['__state'] args = ', '.join(prepend + [argval for _, _, argval in memlet_references] + [ - cpp.sym2cpp(symval) - for symname, symval in sorted(node.symbol_mapping.items()) if symname not in sdfg.constants + cpp.sym2cpp(symval) for symname, symval in sorted(node.symbol_mapping.items()) + if symname not in sdfg.constants and symname in self._frame.free_symbols(node.sdfg) ]) return f'{sdfg_label}({args});'