kokkos / kokkos/mdspan

Layout mappings and submdspan must take index resp. slice types convertible to index_type

Open
#411 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
507
Forks
87
Avg merge
15h 27m
Merged PRs (30d)
2

Description

The Standard layout mappings' operator() accept arguments that are not integers, as long as

  • they are convertible to index_type, and
  • index_type is nothrow-constructible from them.

See e.g., [mdspan.layout.left.obs] 2. Also, submdspan accepts as a valid slice type any argument that models convertible_to<index_type>. However, the current reference mdspan implementation cannot handle either of these cases.

I have a branch that implements D3663R2 (if you enable a CMake option MDSPAN_ENABLE_P3663 that defaults to OFF). In that branch, I have a commit that fixes this bug (also for the non-D3663R2 case). The commit also adds regression tests for both layout mapping indexing and submdspan slicing.

@youyu3 This may be relevant to your interests.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the linked commit d77b1a74b20efdf5cf06765438968d87cb3d15d4 and its regression tests for layout mapping indexing and submdspan slicing. Run the relevant test suite with and without MDSPAN_ENABLE_P3663; done means both convertible index and slice types are handled in each configuration.

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
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.