Skip to content

Commit

Permalink
Made some fixes to the verification function of the `TranslatedJaxprS…
Browse files Browse the repository at this point in the history
…DFG`.
  • Loading branch information
philip-paul-mueller committed May 3, 2024
1 parent 41eacbe commit e2b496f
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/jace/translator/translated_jaxpr_sdfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,18 @@ class TranslatedJaxprSDFG:
def validate(self) -> bool:
"""Validate the underlying SDFG."""

# To prevent the 'non initialized' data warnings we have to temporary promote the
# input arguments as global.
# To prevent the 'non initialized' data warnings we have to temporary
# promote input and output arguments to globals
promote_to_glob: set[str] = set()
org_trans_state: dict[str, bool] = {}
for var in self.inp_names:
if self.inp_names:
promote_to_glob.update(self.inp_names)
if self.out_names:
promote_to_glob.update(self.out_names)
for var in promote_to_glob:
org_trans_state[var] = self.sdfg.arrays[var].transient
self.sdfg.arrays[var].transient = False

try:
self.sdfg.validate()
finally:
Expand Down

0 comments on commit e2b496f

Please sign in to comment.