From 8e2e131075b23f55db5da5d8fd82c237c553e6d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20M=C3=BCller?= <147368808+philip-paul-mueller@users.noreply.github.com> Date: Thu, 22 Feb 2024 23:06:07 +0100 Subject: [PATCH] Fixed an issue in the Memlet duplication verification. (#1526) 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 Co-authored-by: alexnick83 <31545860+alexnick83@users.noreply.github.com> --- dace/sdfg/validation.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dace/sdfg/validation.py b/dace/sdfg/validation.py index 95a8850e48..f7cb7310d1 100644 --- a/dace/sdfg/validation.py +++ b/dace/sdfg/validation.py @@ -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)