Skip to content

Commit

Permalink
Make sure that the intermediate transient access nodes are not removed
Browse files Browse the repository at this point in the history
if they are used elsewhere.
  • Loading branch information
pratyai committed Oct 16, 2024
1 parent 7f9333c commit 19525ef
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dace/transformation/dataflow/map_fusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,12 +283,14 @@ def apply(self, graph: SDFGState, sdfg: SDFG):
intermediate_nodes.add(dst)
assert isinstance(dst, nodes.AccessNode)

# Check if an access node refers to non transient memory, or transient
# Check if an access node refers to non-transient memory, or transient
# is used at another location (cannot erase)
do_not_erase = set()
for node in intermediate_nodes:
if sdfg.arrays[node.data].transient is False:
do_not_erase.add(node)
elif len([n for n in sdfg.data_nodes() if n.data == node.data]) > 1:
do_not_erase.add(node)
else:
for edge in graph.in_edges(node):
if edge.src != first_exit:
Expand Down

0 comments on commit 19525ef

Please sign in to comment.