Skip to content

Commit

Permalink
Avoid src_subset and dst_subset in another place within memlet.py.
Browse files Browse the repository at this point in the history
These subset accesses are entirely symmetric, so no need to know the orientation.

Generally, the library internally should not rely on possibly uninitialized / partially initialized states (or at least explicitly handle such cases).
  • Loading branch information
pratyai committed Oct 23, 2024
1 parent cf5b549 commit 81dc75c
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions dace/memlet.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,20 +561,18 @@ def used_symbols(self, all_symbols: bool, edge=None) -> Set[str]:
view_edge = True

if not view_edge:
if self.src_subset:
result |= self.src_subset.free_symbols

if self.dst_subset:
result |= self.dst_subset.free_symbols
if self.subset:
result |= self.subset.free_symbols
if self.other_subset:
result |= self.other_subset.free_symbols
else:
# View edges do not require the end of the range nor strides
if self.src_subset:
for rb, _, _ in self.src_subset.ndrange():
if self.subset:
for rb, _, _ in self.subset.ndrange():
if symbolic.issymbolic(rb):
result |= set(map(str, rb.free_symbols))

if self.dst_subset:
for rb, _, _ in self.dst_subset.ndrange():
if self.other_subset:
for rb, _, _ in self.other_subset.ndrange():
if symbolic.issymbolic(rb):
result |= set(map(str, rb.free_symbols))

Expand Down

0 comments on commit 81dc75c

Please sign in to comment.