Skip to content

fix[cartesian]: Support for data dims of size one in dace backends#2547

Merged
romanc merged 2 commits intoGridTools:mainfrom
romanc:romanc/dace-data-dimension-1d
Mar 24, 2026
Merged

fix[cartesian]: Support for data dims of size one in dace backends#2547
romanc merged 2 commits intoGridTools:mainfrom
romanc:romanc/dace-data-dimension-1d

Conversation

@romanc
Copy link
Contributor

@romanc romanc commented Mar 24, 2026

Description

This PR fixes an issue in the dace backends, where accesses of data dimensions with size one would generate invalid SDFGs. In case an array has size one, there's only one value, so the only valid way to access array a is a[0]. When accessed inside a Tasklet, this access is already fully defined in the Memlet. We were - in addition - adding a slice inside the Tasklet leading to an attempted slice of a scalar and thus an invalid SDFG.

This issue was detected by Charles in the larger work of GF, where there's an array with sizes [__I, __J, 1].

Requirements

  • All fixes and/or new features come with corresponding tests.
  • Important design decisions have been documented in the appropriate ADR inside the docs/development/ADRs/ folder.
    N/A

romanc added 2 commits March 24, 2026 14:50
This PR fixes an issue in the dace backends. Access of data dimensions
with size one would generate invalid SDFGs. In case an array has size
one, there's only one value, so the only valid way to access array `a`
is `a[0]`. When accessed inside a `Tasklet`, this access is already
fully defined in the Memlet.
@romanc romanc marked this pull request as ready for review March 24, 2026 14:57
@romanc romanc requested a review from FlorianDeconinck March 24, 2026 14:57
Copy link
Contributor

@FlorianDeconinck FlorianDeconinck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@romanc romanc merged commit 2e96fc0 into GridTools:main Mar 24, 2026
20 checks passed
@romanc romanc deleted the romanc/dace-data-dimension-1d branch March 24, 2026 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants