kokkos / kokkos/mdspan

Breaking changes due to C++ committee review

Open
#136 6 comments 1 reaction 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

Hi all,

there are a number of breaking changes upcoming which stem from the intense review mdspan got now that its is nearing inclusion into the C++23 standard. These are described in P2553, P2554, P2604 and P2599.

All of these changes are getting merged into P0009 (the main mdspan paper) as part of the final wording review in LWG.

We created an mdspan-0.3.0 tag before any of this hits the repo.

Extents gets a controllable integral type

https://wg21.link/p2553

This allows (and makes it mandatory) for a user to choose what the underlying integral type is for extents,
a type which can be unsigned or signed.

Before:

template<size_t ... Extents>
class extents;

After

template<class IndexType, size_t ... Extents>
class extents;
Fix up deduction guide from 1D c-arrays.

https://wg21.link/p2554

This changes the behavior of the deduction guide then, constructing from a carray which is convertable to pointer.

Before:

int data[6];
mdspan a(data);
static_assert(a.rank()==0);

mdspan b(data,2,3);
static_assert(b.rank()==2);

After:

int data[6];
mdspan a(data);
static_assert(a.rank()==1);
static_assert(a.static_extents(1)==6);

mdspan b(data,2,3);
static_assert(b.rank()==2);
Renamed members

https://isocpp.org/files/papers/P2604R0.html and https://isocpp.org/files/papers/P2599R1.pdf

  • extents
    • size_type -> index_type
  • mappings:
    • size_type -> index_type
    • is_contiguous -> is_exhaustive
    • is_always_contiguous -> is_always_exhaustive
  • accessors:
    • pointer -> data_handle_type
  • mdspan
    • size_type -> index_type
    • pointer -> data_handle_type
    • data() -> data_handle
    • is_contiguous -> is_exhaustive
    • is_always_contiguous -> is_always_exhaustive

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

Read P2553, P2554, P2604, and P2599, then inspect the extents, mappings, accessors, and mdspan APIs described in the issue. Done means the implementation reflects the listed template, deduction-guide, and member renames and matches the reviewed C++23 wording.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.