Skip to content

Commit

Permalink
WIP: scalar to symbol quickfix
Browse files Browse the repository at this point in the history
  • Loading branch information
Roman Cattaneo committed Nov 4, 2024
1 parent 636811d commit e824ffc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dace/transformation/passes/scalar_to_symbol.py
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,7 @@ def apply_pass(self, sdfg: SDFG, _: Dict[Any, Any]) -> Set[str]:
integers_only = self.integers_only

to_promote = find_promotable_scalars(sdfg, transients_only=transients_only, integers_only=integers_only)
promoted = set()
if ignore:
to_promote -= ignore
if len(to_promote) == 0:
Expand All @@ -640,7 +641,7 @@ def apply_pass(self, sdfg: SDFG, _: Dict[Any, Any]) -> Set[str]:
scalar_nodes = [n for n in state.nodes() if isinstance(n, nodes.AccessNode) and n.data in to_promote]
# Step 2: Assignment tasklets
for node in scalar_nodes:
if state.in_degree(node) == 0:
if node.data in promoted or state.in_degree(node) == 0:
continue
in_edge = state.in_edges(node)[0]
input = in_edge.src
Expand Down Expand Up @@ -681,6 +682,7 @@ def apply_pass(self, sdfg: SDFG, _: Dict[Any, Any]) -> Set[str]:

# Clean up all nodes after assignment was transferred
new_state.remove_nodes_from(new_state.nodes())
promoted.add(node.data)

# Step 3: Scalar reads
remove_scalar_reads(sdfg, {k: k for k in to_promote})
Expand Down

0 comments on commit e824ffc

Please sign in to comment.