Issaquah (Feb 2023) P2642 presentation
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 29
- Forks
- 26
- PR merge metrics
- No merged PRs in 30d
Description
P2642 (padded mdspan layouts)
Use cases
-
Overaligned access to the beginning of each contiguous segment of elements
-
Representing column-major or row-major matrices whose stride is greater than the number of rows
-
"Pitched allocations*
-
Critical use case for matrix algorithms; the layout of BLAS and LAPACK
-
Use case for padding_stride=0 (at compile time)
Leftmost (for layout_left_padded; rightmost for layout_right_padded)
extent is zero at compile time: extents<Integral, 0, ...>.
template<int Value>
using Int = integral_constant<int, Value>;
layout_left::mapping<extents<int, 0, 10>> mapping{};
mdspan m{nullptr, mapping};
auto m_sub = submdspan(m, tuple{Int<0>{}, Int<0>{}}, full_extent);
Before P2642, m_sub would have mapping type
layout_stride::mapping<extents<int, 0, 10>>.
After P2642, m_sub would have mapping type
layout_left_padded<0>::mapping<extents<int, 0, 10>>.
Errata
-
.extents()returns by value, not by const reference-
[mdspan.layout.reqmts] specifies that
.extents()returnsconst extents_type&, butlayout_{left,right}_padded::mapping::extentsin P2642 returnsextents_type. -
layout_{left,right}_padded::mappingdoes not store the user'sextentsobject-
It stores the "padded extents"
-
Effectively a "
layout_{left,right}of a bigger array"
-
-
Fix: Change to return
const extents_type&; rely on lifetime extension
-
-
Specification of
layout_left_padded<ps>::mapping(const layout_left_padded<ps>::mapping<OtherExtents>&)converting constructors andoperator==may need adjustments, so that the spec as written can deduce the inputpadding_stridetemplate argument. (See comments below.)- Consider adding a public member to
layout_{left,right}_padded::mappingso users can get thepadding_stridetemplate argument without needing to write a traits class
- Consider adding a public member to
Implementation
PR 237 in https://github.com/kokkos/mdspan
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 by reading the P2642 use cases and errata in this issue, then review implementation PR 237 in the kokkos/mdspan repository. The issue discusses presentation material and specification corrections, but does not identify files, tests, or a clear completion condition.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100