[PATCH v1 0/4] Implement extents from the mdspan header.

Luc Grosheintz luc.grosheintz@gmail.com
Tue Apr 15 08:48:12 GMT 2025


The second iteration of this patch series is available here:
https://gcc.gnu.org/pipermail/libstdc++/2025-April/060988.html

Thank you for the reviews.

On 4/9/25 9:23 AM, Luc Grosheintz wrote:
> Hi,
> 
> This is a patch series that implements std::extents from <mdspan>.
> 
> I've never contributed to GCC or libstdc++. Hence, any comments about
> obvious issues, e.g. too few/many tests, not following conventions
> w.r.t. checking prerequisites, use of 'friend class', choice of uglified
> names that could clash with other of our uglified names, etc. will be
> very well received. In a similar vein let me know if you want the patch
> series split differently.
> 
> If you deem this an effective way of implementing <mdspan>, I would work
> on std::layout_*, std::accessor_default and eventually std::mdspan.
> 
> Each commit was tested with 'make check-target-libstdc++-v3' on x86_64.
> 
> Thank you!
> 
> Luc Grosheintz (4):
>    libstdc++: Setup internal FTM for mdspan.
>    libstdc++: Add header mdspan to the build-system.
>    libstdc++: Implement std::extents [PR107761].
>    libstdc++: Add tests for std::extents.
> 
>   libstdc++-v3/doc/doxygen/user.cfg.in          |   1 +
>   libstdc++-v3/include/Makefile.am              |   1 +
>   libstdc++-v3/include/Makefile.in              |   1 +
>   libstdc++-v3/include/bits/version.def         |   9 +
>   libstdc++-v3/include/bits/version.h           |  10 +
>   libstdc++-v3/include/precompiled/stdc++.h     |   4 +
>   libstdc++-v3/include/std/mdspan               | 448 ++++++++++++++++++
>   libstdc++-v3/src/c++23/std.cc.in              |   6 +-
>   .../mdspan/extents/assign_copy.cc             |  26 +
>   .../mdspan/extents/assign_copy_01_neg.cc      |  15 +
>   .../mdspan/extents/class_traits.cc            |  20 +
>   .../23_containers/mdspan/extents/ctor_copy.cc |  34 ++
>   .../mdspan/extents/ctor_copy_01_neg.cc        |  10 +
>   .../mdspan/extents/ctor_copy_02_neg.cc        |  10 +
>   .../mdspan/extents/ctor_copy_constexpr.cc     |  20 +
>   .../mdspan/extents/ctor_copy_implicit_00.cc   |  28 ++
>   .../mdspan/extents/ctor_copy_implicit_01.cc   |  22 +
>   .../extents/ctor_copy_implicit_02_neg.cc      |  10 +
>   .../extents/ctor_copy_implicit_03_neg.cc      |   9 +
>   .../extents/ctor_copy_implicit_04_neg.cc      |   9 +
>   .../mdspan/extents/ctor_ints_00.cc            |  30 ++
>   .../mdspan/extents/ctor_ints_01.cc            |  24 +
>   .../mdspan/extents/ctor_ints_02_neg.cc        |   9 +
>   .../mdspan/extents/ctor_ints_03_neg.cc        |   9 +
>   .../mdspan/extents/ctor_ints_constexpr.cc     |  12 +
>   .../extents/ctor_ints_implicit_00_neg.cc      |   9 +
>   .../extents/ctor_ints_implicit_01_neg.cc      |   9 +
>   .../mdspan/extents/ctor_shape_00.cc           |  35 ++
>   .../mdspan/extents/ctor_shape_01.cc           |  17 +
>   .../mdspan/extents/ctor_shape_02_neg.cc       |  10 +
>   .../mdspan/extents/ctor_shape_03_neg.cc       |  11 +
>   .../mdspan/extents/ctor_shape_constexpr.cc    |  23 +
>   .../mdspan/extents/ctor_shape_implicit_00.cc  |  42 ++
>   .../mdspan/extents/ctor_shape_implicit_01.cc  |  19 +
>   .../extents/ctor_shape_implicit_02_neg.cc     |  11 +
>   .../extents/ctor_shape_implicit_03_neg.cc     |  12 +
>   .../mdspan/extents/ctor_shape_implicit_04.cc  |  24 +
>   .../mdspan/extents/custom_integer.cc          |  86 ++++
>   .../mdspan/extents/deduction_guide_00.cc      |  23 +
>   .../mdspan/extents/deduction_guide_01_neg.cc  |  10 +
>   .../23_containers/mdspan/extents/dextents.cc  |  11 +
>   .../23_containers/mdspan/extents/extent.cc    |  27 ++
>   .../mdspan/extents/index_type.cc              |  14 +
>   .../23_containers/mdspan/extents/ops_eq.cc    |  58 +++
>   .../23_containers/mdspan/extents/rank.cc      |  10 +
>   .../mdspan/extents/rank_dynamic.cc            |  11 +
>   .../mdspan/extents/rank_return_type.cc        |  14 +
>   .../23_containers/mdspan/extents/rank_type.cc |   7 +
>   .../23_containers/mdspan/extents/size_type.cc |  16 +
>   .../23_containers/mdspan/extents/sizeof.cc    |  10 +
>   .../mdspan/extents/static_extent.cc           |  15 +
>   51 files changed, 1310 insertions(+), 1 deletion(-)
>   create mode 100644 libstdc++-v3/include/std/mdspan
>   create mode 100644 libstdc++-v3/testsuite/23_containers/mdspan/extents/assign_copy.cc
>   create mode 100644 libstdc++-v3/testsuite/23_containers/mdspan/extents/assign_copy_01_neg.cc
>   create mode 100644 libstdc++-v3/testsuite/23_containers/mdspan/extents/class_traits.cc
>   create mode 100644 libstdc++-v3/testsuite/23_containers/mdspan/extents/ctor_copy.cc
>   create mode 100644 libstdc++-v3/testsuite/23_containers/mdspan/extents/ctor_copy_01_neg.cc
>   create mode 100644 libstdc++-v3/testsuite/23_containers/mdspan/extents/ctor_copy_02_neg.cc
>   create mode 100644 libstdc++-v3/testsuite/23_containers/mdspan/extents/ctor_copy_constexpr.cc
>   create mode 100644 libstdc++-v3/testsuite/23_containers/mdspan/extents/ctor_copy_implicit_00.cc
>   create mode 100644 libstdc++-v3/testsuite/23_containers/mdspan/extents/ctor_copy_implicit_01.cc
>   create mode 100644 libstdc++-v3/testsuite/23_containers/mdspan/extents/ctor_copy_implicit_02_neg.cc
>   create mode 100644 libstdc++-v3/testsuite/23_containers/mdspan/extents/ctor_copy_implicit_03_neg.cc
>   create mode 100644 libstdc++-v3/testsuite/23_containers/mdspan/extents/ctor_copy_implicit_04_neg.cc
>   create mode 100644 libstdc++-v3/testsuite/23_containers/mdspan/extents/ctor_ints_00.cc
>   create mode 100644 libstdc++-v3/testsuite/23_containers/mdspan/extents/ctor_ints_01.cc
>   create mode 100644 libstdc++-v3/testsuite/23_containers/mdspan/extents/ctor_ints_02_neg.cc
>   create mode 100644 libstdc++-v3/testsuite/23_containers/mdspan/extents/ctor_ints_03_neg.cc
>   create mode 100644 libstdc++-v3/testsuite/23_containers/mdspan/extents/ctor_ints_constexpr.cc
>   create mode 100644 libstdc++-v3/testsuite/23_containers/mdspan/extents/ctor_ints_implicit_00_neg.cc
>   create mode 100644 libstdc++-v3/testsuite/23_containers/mdspan/extents/ctor_ints_implicit_01_neg.cc
>   create mode 100644 libstdc++-v3/testsuite/23_containers/mdspan/extents/ctor_shape_00.cc
>   create mode 100644 libstdc++-v3/testsuite/23_containers/mdspan/extents/ctor_shape_01.cc
>   create mode 100644 libstdc++-v3/testsuite/23_containers/mdspan/extents/ctor_shape_02_neg.cc
>   create mode 100644 libstdc++-v3/testsuite/23_containers/mdspan/extents/ctor_shape_03_neg.cc
>   create mode 100644 libstdc++-v3/testsuite/23_containers/mdspan/extents/ctor_shape_constexpr.cc
>   create mode 100644 libstdc++-v3/testsuite/23_containers/mdspan/extents/ctor_shape_implicit_00.cc
>   create mode 100644 libstdc++-v3/testsuite/23_containers/mdspan/extents/ctor_shape_implicit_01.cc
>   create mode 100644 libstdc++-v3/testsuite/23_containers/mdspan/extents/ctor_shape_implicit_02_neg.cc
>   create mode 100644 libstdc++-v3/testsuite/23_containers/mdspan/extents/ctor_shape_implicit_03_neg.cc
>   create mode 100644 libstdc++-v3/testsuite/23_containers/mdspan/extents/ctor_shape_implicit_04.cc
>   create mode 100644 libstdc++-v3/testsuite/23_containers/mdspan/extents/custom_integer.cc
>   create mode 100644 libstdc++-v3/testsuite/23_containers/mdspan/extents/deduction_guide_00.cc
>   create mode 100644 libstdc++-v3/testsuite/23_containers/mdspan/extents/deduction_guide_01_neg.cc
>   create mode 100644 libstdc++-v3/testsuite/23_containers/mdspan/extents/dextents.cc
>   create mode 100644 libstdc++-v3/testsuite/23_containers/mdspan/extents/extent.cc
>   create mode 100644 libstdc++-v3/testsuite/23_containers/mdspan/extents/index_type.cc
>   create mode 100644 libstdc++-v3/testsuite/23_containers/mdspan/extents/ops_eq.cc
>   create mode 100644 libstdc++-v3/testsuite/23_containers/mdspan/extents/rank.cc
>   create mode 100644 libstdc++-v3/testsuite/23_containers/mdspan/extents/rank_dynamic.cc
>   create mode 100644 libstdc++-v3/testsuite/23_containers/mdspan/extents/rank_return_type.cc
>   create mode 100644 libstdc++-v3/testsuite/23_containers/mdspan/extents/rank_type.cc
>   create mode 100644 libstdc++-v3/testsuite/23_containers/mdspan/extents/size_type.cc
>   create mode 100644 libstdc++-v3/testsuite/23_containers/mdspan/extents/sizeof.cc
>   create mode 100644 libstdc++-v3/testsuite/23_containers/mdspan/extents/static_extent.cc
> 



More information about the Libstdc++ mailing list