From 54b2fa1dc5f2a62083a9665fda0c650e7c0a0bab Mon Sep 17 00:00:00 2001 From: Philipp Schaad Date: Mon, 8 Jul 2024 17:44:14 +0200 Subject: [PATCH] Fix incorrect input/output of nested dace programs (#1615) --- dace/frontend/python/newast.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dace/frontend/python/newast.py b/dace/frontend/python/newast.py index 5269f1cf83..02dc92cc9c 100644 --- a/dace/frontend/python/newast.py +++ b/dace/frontend/python/newast.py @@ -253,7 +253,7 @@ def parse_dace_program(name: str, # Make safe replacements def repl_callback(repldict): - for state in sdfg.nodes(): + for state in sdfg.states(): for name, new_name in repldict.items(): state.replace(name, new_name) for name, new_name in repldict.items(): @@ -1615,7 +1615,7 @@ def _inject_consume_memlets(self, dec, entry, inputs, internal_node, sdfg, state # Inject to internal tasklet if not dec.endswith('scope'): injected_node_count = 0 - for s in sdfg.nodes(): + for s in sdfg.states(): for n in s.nodes(): if isinstance(n, nodes.Tasklet): n.add_in_connector(stream_elem) @@ -3678,7 +3678,7 @@ def _parse_function_arg(self, arg: ast.AST): def _is_inputnode(self, sdfg: SDFG, name: str): visited_data = set() - for state in sdfg.nodes(): + for state in sdfg.states(): visited_state_data = set() for node in state.nodes(): if isinstance(node, nodes.AccessNode) and node.data == name: @@ -3688,7 +3688,7 @@ def _is_inputnode(self, sdfg: SDFG, name: str): visited_data = visited_data.union(visited_state_data) def _is_outputnode(self, sdfg: SDFG, name: str): - for state in sdfg.nodes(): + for state in sdfg.states(): for node in state.nodes(): if isinstance(node, nodes.AccessNode) and node.data == name: if state.in_degree(node) > 0: