Skip to content

Commit

Permalink
Don't pass unused symbols to nested SDFG calls
Browse files Browse the repository at this point in the history
  • Loading branch information
tbennun committed Oct 1, 2023
1 parent 3c2fa3f commit 1bb60e2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions dace/codegen/targets/cpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}) {{'
Expand All @@ -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});'

Expand Down

0 comments on commit 1bb60e2

Please sign in to comment.