is_strided in layout_stride::mapping fails with extent 1 along a rank
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 29
- Forks
- 26
- PR merge metrics
- No merged PRs in 30d
Description
Replicating layout_right as in test_layouts.cpp with layout_strided by setting
(extents 5,4,3,2,1, strides 24,6,2,1,1) is expected to generate a contiguous layout.
However, is_strided returns erroneously "false".
The issue arises because the sorting of strides with a permutation vector is now ambiguous at
https://github.com/ORNL/cpp-proposals-pub/blob/f8bf21b653d2424d40b9411ee532641f8c1c2e28/P0009/reference-implementation/include/experimental/bits/layouts.hpp#L272
In the following
This leads to the return of "false" because the wrong extent is used for comparison.
This only arises if one extent is 1, because only then, two strides would be the same.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with test_layouts.cpp and the layout_strided implementation in include/experimental/bits/layouts.hpp, especially the stride sorting around lines 272 and 285. Reproduce the extents and strides from the issue, then verify that is_strided reports the layout as contiguous when an extent is 1. Done means the regression case passes without changing behavior for other layouts.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 38/100