From 1bb60e26f34bd7e43ba96034f28632fa07f705dc Mon Sep 17 00:00:00 2001 From: Tal Ben-Nun Date: Sun, 1 Oct 2023 12:46:53 -0700 Subject: [PATCH] Don't pass unused symbols to nested SDFG calls --- dace/codegen/targets/cpu.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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});'