diff --git a/dace/codegen/targets/framecode.py b/dace/codegen/targets/framecode.py index 1845f3b692..cd3e9222a3 100644 --- a/dace/codegen/targets/framecode.py +++ b/dace/codegen/targets/framecode.py @@ -896,7 +896,7 @@ def generate_code(self, # Allocate outer-level transients self.allocate_arrays_in_scope(sdfg, sdfg, sdfg, global_stream, callsite_stream) - global_args = sdfg.arglist() + outside_symbols = sdfg.free_symbols # Define constants as top-level-allocated for cname, (ctype, _) in sdfg.constants_prop.items(): @@ -956,7 +956,7 @@ def generate_code(self, self.dispatcher.defined_vars.add(isvarName, disp.DefinedType.Scalar, isvarType.ctype) else: # If the variable is passed as an input argument to the SDFG, do not need to declare it - if isvarName not in global_args: + if isvarName not in outside_symbols: callsite_stream.write('%s;\n' % (isvar.as_arg(with_types=True, name=isvarName)), sdfg) self.dispatcher.defined_vars.add(isvarName, disp.DefinedType.Scalar, isvarType.ctype) callsite_stream.write('\n', sdfg)