Skip to content

Commit

Permalink
Fix incorrect input/output of nested dace programs (#1615)
Browse files Browse the repository at this point in the history
  • Loading branch information
phschaad authored Jul 8, 2024
1 parent 8643f9a commit 54b2fa1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions dace/frontend/python/newast.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand Down

0 comments on commit 54b2fa1

Please sign in to comment.