Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pace Fixes 0 #1314

Merged
merged 6 commits into from
Jul 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 11 additions & 7 deletions dace/frontend/python/newast.py
Original file line number Diff line number Diff line change
Expand Up @@ -3655,6 +3655,11 @@ def _parse_sdfg_call(self, funcname: str, func: Union[SDFG, SDFGConvertible], no
# If the symbol is a callback, but is not used in the nested SDFG, skip it
continue

# NOTE: Is it possible that an array in the SDFG's closure is not in the SDFG?
# NOTE: Perhaps its use was simplified/optimized away?
if aname not in sdfg.arrays:
continue

# First, we do an inverse lookup on the already added closure arrays for `arr`.
is_new_arr = True
for k, v in self.nested_closure_arrays.items():
Expand Down Expand Up @@ -3831,6 +3836,12 @@ def _parse_sdfg_call(self, funcname: str, func: Union[SDFG, SDFGConvertible], no
for k, v in argdict.items() if self._is_outputnode(sdfg, k)
}

# If an argument does not register as input nor as output, put it in the inputs.
# This may happen with input arguments that are used to set a promoted scalar.
for k, v in argdict.items():
if k not in inputs.keys() and k not in outputs.keys():
inputs[k] = v

# Add closure to global inputs/outputs (e.g., if processed as part of a map)
for arrname in closure_arrays.keys():
if arrname not in names_to_replace:
Expand All @@ -3842,13 +3853,6 @@ def _parse_sdfg_call(self, funcname: str, func: Union[SDFG, SDFGConvertible], no
if narrname in outputs:
self.outputs[arrname] = (state, outputs[narrname], [])

# If an argument does not register as input nor as output,
# put it in the inputs.
# This may happen with input argument that are used to set
# a promoted scalar.
for k, v in argdict.items():
if k not in inputs.keys() and k not in outputs.keys():
inputs[k] = v
# Unset parent inputs/read accesses that
# turn out to be outputs/write accesses.
for memlet in outputs.values():
Expand Down
3 changes: 3 additions & 0 deletions dace/transformation/passes/array_elimination.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@ def remove_redundant_copies(self, sdfg: SDFG, state: SDFGState, removable_data:
for anode in access_nodes[aname]:
if anode in removed_nodes:
continue
if anode not in state.nodes():
removed_nodes.add(anode)
continue

if state.out_degree(anode) == 1:
succ = state.successors(anode)[0]
Expand Down