Skip to content

Commit

Permalink
Fixed an issue in the Memlet duplication verification. (#1526)
Browse files Browse the repository at this point in the history
It was not considered that an empty memlet has `data` equal to `None`.
However, empty Memlets should not be considered as duplicated data as
they do not move data.

---------

Co-authored-by: Tal Ben-Nun <[email protected]>
Co-authored-by: alexnick83 <[email protected]>
  • Loading branch information
3 people authored Feb 22, 2024
1 parent bc08e9a commit 8e2e131
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dace/sdfg/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,9 @@ def validate_state(state: 'dace.sdfg.SDFGState',
f'Duplicate memlet detected: "{e}". Please copy objects '
'rather than using multiple references to the same one', sdfg, state_id, eid)
references.add(id(e))
if id(e.data) in references:
if e.data.is_empty():
pass
elif id(e.data) in references:
raise InvalidSDFGEdgeError(
f'Duplicate memlet detected: "{e.data}". Please copy objects '
'rather than using multiple references to the same one', sdfg, state_id, eid)
Expand Down

0 comments on commit 8e2e131

Please sign in to comment.