Skip to content

Commit

Permalink
Fix assignment to did_break = 1 symbol (but need further investigatio…
Browse files Browse the repository at this point in the history
…ns why this change is needed)
  • Loading branch information
luca-patrignani committed Jun 18, 2024
1 parent 3f1796e commit 1eb3eca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions dace/sdfg/region_inline.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,9 @@ def inline_loop_region(loop: LoopRegion, parent: ControlFlowRegion):
for node in continue_states | connect_to_tail:
parent.add_edge(node, loop_tail_state, InterstateEdge())
for node in break_states:
parent.add_edge(node, end_state, InterstateEdge(assignments={f'did_break_{loop.label}': '1'}))

parent.add_edge(node, end_state, InterstateEdge())
for edge in parent.in_edges(node):
edge.data.assignments[f'did_break_{loop.label}'] = '1'
# Remove the original loop.
parent.remove_node(loop)
if parent.in_degree(end_state) == 0:
Expand Down
1 change: 1 addition & 0 deletions tests/python_frontend/loops_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,7 @@ def while_else(A: dace.float64[2]):
A[1] = 1.0
A[1] = 1.0

while_else.to_sdfg().save("while_else_orig.sdfg")
A = np.array([0.0, 0.0])
expected = np.array([5.0, 1.0])
while_else(A)
Expand Down

0 comments on commit 1eb3eca

Please sign in to comment.