Re: [PATCH v1 3/4] libstdc++: Implement std::extents [PR107761].

2025-04-10 Thread Luc Grosheintz
On 4/9/25 9:23 AM, Luc Grosheintz wrote: This implements std::extents from according to N4950 and contains partial progress towards PR107761. If an extent changes its type, there's a precondition in the standard, that the value is representable in the target integer type. This commit u

[PATCH v1 4/4] libstdc++: Add tests for std::extents.

2025-04-10 Thread Luc Grosheintz
test. * testsuite/23_containers/mdspan/extents/static_extent.cc: New test. Signed-off-by: Luc Grosheintz --- .../mdspan/extents/assign_copy.cc | 26 ++ .../mdspan/extents/assign_copy_01_neg.cc | 15 .../mdspan/extents/class_traits.cc

[PATCH v1 2/4] libstdc++: Add header mdspan to the build-system.

2025-04-09 Thread Luc Grosheintz
. * include/std/mdspan: New file. Signed-off-by: Luc Grosheintz --- libstdc++-v3/doc/doxygen/user.cfg.in | 1 + libstdc++-v3/include/Makefile.am | 1 + libstdc++-v3/include/Makefile.in | 1 + libstdc++-v3/include/precompiled/stdc++.h | 4 ++ libstdc++-v3/include/std/mdspan

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

2025-04-09 Thread Luc Grosheintz
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.

[PATCH v1 3/4] libstdc++: Implement std::extents [PR107761].

2025-04-09 Thread Luc Grosheintz
PR libstdc++/107761 libstdc++-v3/ChangeLog: * include/std/mdspan (extents): New class. * src/c++23/std.cc.in: Add 'using std::extents'. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/std/mdspan | 400 +++ libstdc++-v3/src/c++

Re: [PATCH v3 3/4] libstdc++: Implement std::extents [PR107761].

2025-04-17 Thread Luc Grosheintz
On 4/17/25 2:31 PM, Tomasz Kaminski wrote: On Thu, Apr 17, 2025 at 2:21 PM Tomasz Kaminski wrote: On Thu, Apr 17, 2025 at 1:44 PM Tomasz Kaminski wrote: On Thu, Apr 17, 2025 at 1:18 PM Luc Grosheintz wrote: This implements std::extents from

[PATCH v4 1/4] libstdc++: Setup internal FTM for mdspan.

2025-04-18 Thread Luc Grosheintz
feature testing macro __glibcxx_mdspan. * include/bits/version.h: Regenerate. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/bits/version.def | 9 + libstdc++-v3/include/bits/version.h | 9 + 2 files changed, 18 insertions(+) diff --git a/libstdc++-v3

[PATCH v4 2/4] libstdc++: Add header mdspan to the build-system.

2025-04-18 Thread Luc Grosheintz
. * include/std/mdspan: New file. Signed-off-by: Luc Grosheintz --- libstdc++-v3/doc/doxygen/user.cfg.in | 1 + libstdc++-v3/include/Makefile.am | 1 + libstdc++-v3/include/Makefile.in | 1 + libstdc++-v3/include/precompiled/stdc++.h | 1 + libstdc++-v3/include/std/mdspan

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

2025-04-18 Thread Luc Grosheintz
std::extents. 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

[PATCH v4 4/4] libstdc++: Add tests for std::extents.

2025-04-18 Thread Luc Grosheintz
test. * testsuite/23_containers/mdspan/extents/misc.cc: New test. Signed-off-by: Luc Grosheintz --- .../mdspan/extents/class_mandates_neg.cc | 8 + .../23_containers/mdspan/extents/ctor_copy.cc | 82 +++ .../23_containers/mdspan/extents/ctor_ints.cc | 62 + .../mdspan/ex

[PATCH v4 3/4] libstdc++: Implement std::extents [PR107761].

2025-04-18 Thread Luc Grosheintz
* include/std/mdspan (extents): New class. * src/c++23/std.cc.in: Add 'using std::extents'. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/std/mdspan | 249 +++ libstdc++-v3/src/c++23/std.cc.in | 6 +- 2 files changed, 254 insertions(+

Re: [PATCH v2 3/4] libstdc++: Implement std::extents [PR107761].

2025-04-15 Thread Luc Grosheintz
Thank you! I left two comments. Everything not commented on, I'll just incorporate into the next iteration. On 4/15/25 11:18 AM, Tomasz Kaminski wrote: On Tue, Apr 15, 2025 at 10:43 AM Luc Grosheintz wrote: This implements std::extents from according to N4950 and contains pa

Re: [PATCH v4 0/4] Implement extents from the mdspan header.

2025-04-18 Thread Luc Grosheintz
venient to the reviewers and maintainers. On 4/18/25 1:29 PM, Luc Grosheintz wrote: This is the fourth interation and replaces: https://gcc.gnu.org/pipermail/libstdc++/2025-April/061046.html Changes since v3: * Use `_S_` prefix for static member functions. * Use consteval to reduce

Re: [PATCH v5 02/10] libstdc++: Add header mdspan to the build-system.

2025-04-30 Thread Luc Grosheintz
On 4/29/25 3:11 PM, Jonathan Wakely wrote: On Tue, 29 Apr 2025 at 13:59, Luc Grosheintz wrote: Creates a nearly empty header mdspan and adds it to the build-system and Doxygen config file. libstdc++-v3/ChangeLog: * doc/doxygen/user.cfg.in: Add . * include/Makefile.am

Re: [PATCH v5 03/10] libstdc++: Implement std::extents [PR107761].

2025-04-30 Thread Luc Grosheintz
On 4/30/25 4:37 AM, Tomasz Kaminski wrote: On Tue, Apr 29, 2025 at 11:52 PM Jonathan Wakely wrote: On Tue, 29 Apr 2025 at 14:55, Tomasz Kaminski wrote: On Tue, Apr 29, 2025 at 2:55 PM Luc Grosheintz wrote: This implements std::extents from according to N4950 and contains partial

[PATCH v6 1/4] libstdc++: Setup internal FTM for mdspan.

2025-04-30 Thread Luc Grosheintz
feature testing macro __glibcxx_mdspan. * include/bits/version.h: Regenerate. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/bits/version.def | 9 + libstdc++-v3/include/bits/version.h | 9 + 2 files changed, 18 insertions(+) diff --git a/libstdc++-v3

[PATCH v6 2/4] libstdc++: Add header mdspan to the build-system.

2025-04-30 Thread Luc Grosheintz
. * include/std/mdspan: New file. Signed-off-by: Luc Grosheintz --- libstdc++-v3/doc/doxygen/user.cfg.in | 1 + libstdc++-v3/include/Makefile.am | 1 + libstdc++-v3/include/Makefile.in | 1 + libstdc++-v3/include/precompiled/stdc++.h | 1 + libstdc++-v3/include/std/mdspan

[PATCH v6 4/4] libstdc++: Add tests for std::extents.

2025-04-30 Thread Luc Grosheintz
test. * testsuite/23_containers/mdspan/extents/misc.cc: New test. Signed-off-by: Luc Grosheintz --- .../mdspan/extents/class_mandates_neg.cc | 8 + .../23_containers/mdspan/extents/ctor_copy.cc | 82 +++ .../23_containers/mdspan/extents/ctor_ints.cc | 62 + .../mdspan/ex

[PATCH v6 3/4] libstdc++: Implement std::extents [PR107761].

2025-04-30 Thread Luc Grosheintz
* include/std/mdspan (extents): New class. * src/c++23/std.cc.in: Add 'using std::extents'. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/std/mdspan | 261 +++ libstdc++-v3/src/c++23/std.cc.in | 9 +- 2 files changed, 269 insertions(+

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

2025-04-30 Thread Luc Grosheintz
This is the sixth interation and replaces: https://gcc.gnu.org/pipermail/libstdc++/2025-April/061190.html Changes since v5: * Removed superfluous braces. * Fixed std.cc.in * Fixed Copyright statement. Any layout related code has been removed from this patch series. Luc Grosheintz (4): libstdc

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

2025-04-17 Thread Luc Grosheintz
The `v1` in the subject line is a copy-paste error while creating the subject line. This is the preceding patch series: https://gcc.gnu.org/pipermail/libstdc++/2025-April/060988.html On 4/17/25 1:16 PM, Luc Grosheintz wrote: The following changes were made since v2: * Implement the missing

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

2025-04-17 Thread Luc Grosheintz
two patches of the series haven't changed since v2. 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.c

[PATCH v3 4/4] libstdc++: Add tests for std::extents.

2025-04-17 Thread Luc Grosheintz
test. * testsuite/23_containers/mdspan/extents/ctor_ints.cc: New test. * testsuite/23_containers/mdspan/extents/ctor_shape.cc: New test. * testsuite/23_containers/mdspan/extents/custom_integer.cc: New test. * testsuite/23_containers/mdspan/extents/misc.cc: New test. Signed-off-by

[PATCH v3 2/4] libstdc++: Add header mdspan to the build-system.

2025-04-17 Thread Luc Grosheintz
. * include/std/mdspan: New file. Signed-off-by: Luc Grosheintz --- libstdc++-v3/doc/doxygen/user.cfg.in | 1 + libstdc++-v3/include/Makefile.am | 1 + libstdc++-v3/include/Makefile.in | 1 + libstdc++-v3/include/precompiled/stdc++.h | 1 + libstdc++-v3/include/std/mdspan

Re: [PATCH v3 3/4] libstdc++: Implement std::extents [PR107761].

2025-04-17 Thread Luc Grosheintz
Thank you for another excellent review! On 4/17/25 1:44 PM, Tomasz Kaminski wrote: On Thu, Apr 17, 2025 at 1:18 PM Luc Grosheintz wrote: This implements std::extents from according to N4950 and contains partial progress towards PR107761. If an extent changes its type

[PATCH v3 1/4] libstdc++: Setup internal FTM for mdspan.

2025-04-17 Thread Luc Grosheintz
feature testing macro __glibcxx_mdspan. * include/bits/version.h: Regenerate. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/bits/version.def | 9 + libstdc++-v3/include/bits/version.h | 9 + 2 files changed, 18 insertions(+) diff --git a/libstdc++-v3

Re: [PATCH v5 05/10] libstdc++: Implement layout_left from mdspan.

2025-05-06 Thread Luc Grosheintz
left_base, and they will be inherited, as only copy/move constructors are shadowed. On Tue, May 6, 2025 at 9:11 AM Tomasz Kaminski wrote: On Mon, May 5, 2025 at 9:20 PM Luc Grosheintz wrote: On 5/5/25 9:44 AM, Tomasz Kaminski wrote: On Sat, May 3, 2025 at 2:39 PM Luc Grosheintz < lu

Re: [PATCH v5 05/10] libstdc++: Implement layout_left from mdspan.

2025-05-05 Thread Luc Grosheintz
On 5/5/25 9:44 AM, Tomasz Kaminski wrote: On Sat, May 3, 2025 at 2:39 PM Luc Grosheintz wrote: On 4/30/25 7:13 AM, Tomasz Kaminski wrote: Hi, As we will be landing patches for extends, this will become a separate patch series. I would prefer, if you could commit per layout, and start

Re: [PATCH v5 05/10] libstdc++: Implement layout_left from mdspan.

2025-05-06 Thread Luc Grosheintz
On 5/6/25 1:56 PM, Tomasz Kaminski wrote: On Tue, May 6, 2025 at 1:39 PM Luc Grosheintz wrote: On 5/6/25 11:28 AM, Tomasz Kaminski wrote: For better reference, here is illustration of the design I was thinking about: https://godbolt.org/z/7aTcM8fz4 I would also consider having

[PATCH v2 3/4] libstdc++: Implement std::extents [PR107761].

2025-04-15 Thread Luc Grosheintz
PR libstdc++/107761 libstdc++-v3/ChangeLog: * include/std/mdspan (extents): New class. * src/c++23/std.cc.in: Add 'using std::extents'. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/std/mdspan | 304 +++ libstdc++-v3/src/c++

Re: [PATCH v1 4/4] libstdc++: Add tests for std::extents.

2025-04-10 Thread Luc Grosheintz
diff --git a/libstdc++-v3/testsuite/23_containers/mdspan/extents/assign_copy_01_neg.cc b/libstdc++-v3/testsuite/23_containers/mdspan/extents/assign_copy_01_neg.cc new file mode 100644 index 000..8a514f2207b --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/mdspan/extents/assign_co

[PATCH v1 1/4] libstdc++: Setup internal FTM for mdspan.

2025-04-10 Thread Luc Grosheintz
feature testing macro __glibcxx_mdspan. * include/bits/version.h: Regenerate. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/bits/version.def | 9 + libstdc++-v3/include/bits/version.h | 10 ++ 2 files changed, 19 insertions(+) diff --git a/libstdc++-v3

[PATCH v2 4/4] libstdc++: Add tests for std::extents.

2025-04-15 Thread Luc Grosheintz
suite/23_containers/mdspan/extents/extent.cc: New test. * testsuite/23_containers/mdspan/extents/ops_eq.cc: New test. Signed-off-by: Luc Grosheintz --- .../23_containers/mdspan/extents/assign.cc| 29 ++ .../mdspan/extents/class_properties.cc| 62 + .../23_containers/m

[PATCH v2 1/4] libstdc++: Setup internal FTM for mdspan.

2025-04-15 Thread Luc Grosheintz
feature testing macro __glibcxx_mdspan. * include/bits/version.h: Regenerate. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/bits/version.def | 9 + libstdc++-v3/include/bits/version.h | 9 + 2 files changed, 18 insertions(+) diff --git a/libstdc++-v3

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

2025-04-15 Thread Luc Grosheintz
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 . I've never contributed to G

[PATCH v2 2/4] libstdc++: Add header mdspan to the build-system.

2025-04-15 Thread Luc Grosheintz
. * include/std/mdspan: New file. Signed-off-by: Luc Grosheintz --- libstdc++-v3/doc/doxygen/user.cfg.in | 1 + libstdc++-v3/include/Makefile.am | 1 + libstdc++-v3/include/Makefile.in | 1 + libstdc++-v3/include/precompiled/stdc++.h | 1 + libstdc++-v3/include/std/mdspan

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

2025-04-15 Thread Luc Grosheintz
c++-v3`. Thank you Tomasz Kaminski and Jonathan Wakely for your helpful review! 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. libst

[PATCH v5 01/10] libstdc++: Setup internal FTM for mdspan.

2025-04-29 Thread Luc Grosheintz
feature testing macro __glibcxx_mdspan. * include/bits/version.h: Regenerate. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/bits/version.def | 9 + libstdc++-v3/include/bits/version.h | 9 + 2 files changed, 18 insertions(+) diff --git a/libstdc++-v3

[PATCH v5 07/10] libstdc++: Implement layout_right from mdspan.

2025-04-29 Thread Luc Grosheintz
Implement the parts of layout_left that depend on layout_right; and the parts of layout_right that don't depend on layout_stride. libstdc++/ChangeLog: * include/std/mdspan (layout_right): New class. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/std/mdspan

[PATCH v5 00/10] Implement extents and layouts from the mdspan header.

2025-04-29 Thread Luc Grosheintz
nted a slightly different check, that satisfies the layout mapping requirements, but also return true for the example provided above. [0]: https://eel.is/c++draft/mdspan.layout#stride.obs-5.2 Thank you Tomasz for the excellent review of v4. Luc Grosheintz (10): libstdc++: Setup internal

[PATCH v5 03/10] libstdc++: Implement std::extents [PR107761].

2025-04-29 Thread Luc Grosheintz
* include/std/mdspan (extents): New class. * src/c++23/std.cc.in: Add 'using std::extents'. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/std/mdspan | 262 +++ libstdc++-v3/src/c++23/std.cc.in | 6 +- 2 files changed, 267 insertions(+

[PATCH v5 08/10] libstdc++: Add tests for layout_right.

2025-04-29 Thread Luc Grosheintz
layout_right and the interaction with layout_left. * testsuite/23_containers/mdspan/layouts/mapping.cc: ditto. Signed-off-by: Luc Grosheintz --- .../mdspan/layouts/class_mandate_neg.cc | 1 + .../23_containers/mdspan/layouts/ctors.cc | 90

[PATCH v5 04/10] libstdc++: Add tests for std::extents.

2025-04-29 Thread Luc Grosheintz
test. * testsuite/23_containers/mdspan/extents/misc.cc: New test. Signed-off-by: Luc Grosheintz --- .../mdspan/extents/class_mandates_neg.cc | 8 + .../23_containers/mdspan/extents/ctor_copy.cc | 82 +++ .../23_containers/mdspan/extents/ctor_ints.cc | 62 + .../mdspan/ex

[PATCH v5 05/10] libstdc++: Implement layout_left from mdspan.

2025-04-29 Thread Luc Grosheintz
Implements the parts of layout_left that don't depend on any of the other layouts. libstdc++/ChangeLog: * include/std/mdspan (layout_left): New class. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/std/mdspan | 179 1 file changed

[PATCH v5 09/10] libstdc++: Implement layout_stride from mdspan.

2025-04-29 Thread Luc Grosheintz
Implements the remaining parts of layout_left and layout_right; and all of layout_stride. libstdc++/ChangeLog: * include/std/mdspan(layout_stride): New class. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/std/mdspan | 227 1 file changed, 227

[PATCH v5 06/10] libstdc++: Add tests for layout_left.

2025-04-29 Thread Luc Grosheintz
. * testsuite/23_containers/mdspan/layouts/ctors.cc: New test. * testsuite/23_containers/mdspan/layouts/mapping.cc: New test. Signed-off-by: Luc Grosheintz --- .../mdspan/layouts/class_mandate_neg.cc | 21 + .../23_containers/mdspan/layouts/ctors.cc | 132 +++ .../23_containers

[PATCH v5 10/10] libstdc++: Add tests for layout_stride.

2025-04-29 Thread Luc Grosheintz
/ctors.cc: Add test for layout_stride and the interaction with other layouts. * testsuite/23_containers/mdspan/layouts/mapping.cc: Ditto. * testsuite/23_containers/mdspan/layouts/stride.cc: New test. Signed-off-by: Luc Grosheintz --- .../mdspan/layouts/class_mandate_neg.cc

[PATCH v5 02/10] libstdc++: Add header mdspan to the build-system.

2025-04-29 Thread Luc Grosheintz
. * include/std/mdspan: New file. Signed-off-by: Luc Grosheintz --- libstdc++-v3/doc/doxygen/user.cfg.in | 1 + libstdc++-v3/include/Makefile.am | 1 + libstdc++-v3/include/Makefile.in | 1 + libstdc++-v3/include/precompiled/stdc++.h | 1 + libstdc++-v3/include/std/mdspan

Re: [PATCH v5 05/10] libstdc++: Implement layout_left from mdspan.

2025-05-03 Thread Luc Grosheintz
d to change the implementation. Maybe you could explain a little what and why you don't like the admittedly very brute-force implementation. On Tue, Apr 29, 2025 at 2:56 PM Luc Grosheintz wrote: Implements the parts of layout_left that don't depend on any of the other layouts. libstdc+

Re: [PATCH v5 05/10] libstdc++: Implement layout_left from mdspan.

2025-05-03 Thread Luc Grosheintz
ric implementation that you can use in yours. Please also include a comment explaining that we are deviating from standard text here. On Tue, Apr 29, 2025 at 2:56 PM Luc Grosheintz wrote: Implements the parts of layout_left that don't depend on any of the other layouts. libstdc+

Re: [PATCH v5 05/10] libstdc++: Implement layout_left from mdspan.

2025-05-03 Thread Luc Grosheintz
layout::mapping> The last one is a generic implementation that you can use in yours. Please also include a comment explaining that we are deviating from standard text here. On Tue, Apr 29, 2025 at 2:56 PM Luc Grosheintz wrote: Implements the parts of layout_left that don't depend on any

Re: [PATCH v5 05/10] libstdc++: Implement layout_left from mdspan.

2025-05-03 Thread Luc Grosheintz
Rank1_mapping_base> const&); }; }; template requires sizeof..(_Ext) > = 2 struct layout::mapping> The last one is a generic implementation that you can use in yours. Please also include a comment explaining that we are deviating from standard text here. On Tue, Apr 29, 2025 at 2:56 PM Luc Groshe

[PATCH v3 3/4] libstdc++: Implement std::extents [PR107761].

2025-04-18 Thread Luc Grosheintz
* include/std/mdspan (extents): New class. * src/c++23/std.cc.in: Add 'using std::extents'. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/std/mdspan | 249 +++ libstdc++-v3/src/c++23/std.cc.in | 6 +- 2 files changed, 254 insertions(+

Re: [PATCH v4 3/4] libstdc++: Implement std::extents [PR107761].

2025-04-18 Thread Luc Grosheintz
On 4/18/25 2:00 PM, Tomasz Kaminski wrote: On Fri, Apr 18, 2025 at 1:43 PM Luc Grosheintz <mailto:luc.groshei...@gmail.com>> wrote: This implements std::extents from according to N4950 and contains partial progress towards PR107761. If an extent changes its type,

Re: [PATCH v4 3/4] libstdc++: Implement std::extents [PR107761].

2025-04-19 Thread Luc Grosheintz
On 4/18/25 7:47 PM, Luc Grosheintz wrote: On 4/18/25 2:00 PM, Tomasz Kaminski wrote: On Fri, Apr 18, 2025 at 1:43 PM Luc Grosheintz mailto:luc.groshei...@gmail.com>> wrote:     This implements std::extents from according to N4950 and     contains partial progress towards PR

Re: [PATCH v5 05/10] libstdc++: Implement layout_left from mdspan.

2025-05-07 Thread Luc Grosheintz
On 5/6/25 2:47 PM, Tomasz Kaminski wrote: On Tue, May 6, 2025 at 1:39 PM Luc Grosheintz wrote: On 5/6/25 11:28 AM, Tomasz Kaminski wrote: For better reference, here is illustration of the design I was thinking about: https://godbolt.org/z/7aTcM8fz4 I would also consider having

Re: [PATCH v5 05/10] libstdc++: Implement layout_left from mdspan.

2025-05-13 Thread Luc Grosheintz
h the flat implementation. Please let me know if there's more that be checked. Regards, Tomasz On Mon, May 12, 2025 at 5:17 PM Luc Grosheintz wrote: On 5/9/25 8:16 AM, Tomasz Kaminski wrote: The test I would perform would be : std::layout_left::mapping> l0; std::layout_right:mapping&g

Re: [PATCH v5 05/10] libstdc++: Implement layout_left from mdspan.

2025-05-12 Thread Luc Grosheintz
On 5/9/25 8:16 AM, Tomasz Kaminski wrote: The test I would perform would be : std::layout_left::mapping> l0; std::layout_right:mapping> r0; // stride bool all_unique() { return l0.is_unique(); return r0.is_unique(); } And we should have only one is_unique symbol. but with a lot more d

Re: [PATCH v1] libstdc++: Fix class mandate for extents.

2025-05-14 Thread Luc Grosheintz
https://eel.is/c++draft/basic.fundamental#11 https://eel.is/c++draft/meta#tab:meta.unary.cat-row-4 On 5/14/25 9:13 PM, Luc Grosheintz wrote: The standard states that the IndexType must be a signed or unsigned integer. This mandate was implemented using `std::is_integral_v`. Which also inc

[PATCH v1] libstdc++: Fix class mandate for extents.

2025-05-14 Thread Luc Grosheintz
The standard states that the IndexType must be a signed or unsigned integer. This mandate was implemented using `std::is_integral_v`. Which also includes (among others) char and bool, which neither signed nor unsigned integers. libstdc++-v3/ChangeLog: * include/std/mdspan: Implement the m

Re: [PATCH v1 5/6] libstdc++: Implement layout_stride from mdspan.

2025-05-20 Thread Luc Grosheintz
On 5/20/25 10:24 AM, Tomasz Kaminski wrote: On Sun, May 18, 2025 at 10:16 PM Luc Grosheintz wrote: Implements the remaining parts of layout_left and layout_right; and all of layout_stride. libstdc++-v3/ChangeLog: * include/std/mdspan(layout_stride): New class. Signed-off-by

Re: [PATCH v1 5/6] libstdc++: Implement layout_stride from mdspan.

2025-05-20 Thread Luc Grosheintz
On 5/20/25 10:48 AM, Tomasz Kaminski wrote: On Tue, May 20, 2025 at 10:45 AM Luc Grosheintz wrote: On 5/20/25 10:24 AM, Tomasz Kaminski wrote: On Sun, May 18, 2025 at 10:16 PM Luc Grosheintz < luc.groshei...@gmail.com> wrote: Implements the remaining parts of layout_le

Re: [PATCH v1 5/6] libstdc++: Implement layout_stride from mdspan.

2025-05-20 Thread Luc Grosheintz
On 5/20/25 11:40 AM, Tomasz Kaminski wrote: On Tue, May 20, 2025 at 11:20 AM Luc Grosheintz wrote: On 5/20/25 10:48 AM, Tomasz Kaminski wrote: On Tue, May 20, 2025 at 10:45 AM Luc Grosheintz < luc.groshei...@gmail.com> wrote: On 5/20/25 10:24 AM, Tomasz Kaminski wrote:

Re: [PATCH v2 1/6] libstdc++: Implement layout_left from mdspan.

2025-05-20 Thread Luc Grosheintz
On 5/20/25 4:07 PM, Tomasz Kaminski wrote: On Tue, May 20, 2025 at 3:16 PM Luc Grosheintz wrote: Implements the parts of layout_left that don't depend on any of the other layouts. libstdc++-v3/ChangeLog: * include/std/mdspan (layout_left): New class. Signed-off-by

[PATCH v2 6/6] libstdc++: Add tests for layout_stride.

2025-05-20 Thread Luc Grosheintz
/ctors.cc: Add test for layout_stride and the interaction with other layouts. * testsuite/23_containers/mdspan/layouts/mapping.cc: Ditto. * testsuite/23_containers/mdspan/layouts/stride.cc: New test. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/std/mdspan

[PATCH v2 3/6] libstdc++: Implement layout_right from mdspan.

2025-05-20 Thread Luc Grosheintz
Implement the parts of layout_left that depend on layout_right; and the parts of layout_right that don't depend on layout_stride. libstdc++-v3/ChangeLog: * include/std/mdspan (layout_right): New class. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/std/mdspan

[PATCH v2 0/6] Implement layouts from mdspan.

2025-05-20 Thread Luc Grosheintz
precondition in layout_{left,right}(layout_stride) using `*this == __other`. * Twice: Use lambda instead of *_impl function. * Various smaller improvements to the tests. Luc Grosheintz (6): libstdc++: Implement layout_left from mdspan. libstdc++: Add tests for layout_left. libstdc

[PATCH v2 5/6] libstdc++: Implement layout_stride from mdspan.

2025-05-20 Thread Luc Grosheintz
Implements the remaining parts of layout_left and layout_right; and all of layout_stride. libstdc++-v3/ChangeLog: * include/std/mdspan(layout_stride): New class. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/std/mdspan | 211 +++- 1 file changed

Re: [PATCH v1 2/6] libstdc++: Add tests for layout_left.

2025-05-20 Thread Luc Grosheintz
On 5/19/25 2:56 PM, Tomasz Kaminski wrote: On Sun, May 18, 2025 at 10:14 PM Luc Grosheintz wrote: Implements a suite of tests for the currently implemented parts of layout_left. The individual tests are templated over the layout type, to allow reuse as more layouts are added. libstdc++-v3

[PATCH v2 4/6] libstdc++: Add tests for layout_right.

2025-05-20 Thread Luc Grosheintz
layout_right and the interaction with layout_left. * testsuite/23_containers/mdspan/layouts/mapping.cc: ditto. Signed-off-by: Luc Grosheintz --- .../mdspan/layouts/class_mandate_neg.cc | 1 + .../23_containers/mdspan/layouts/ctors.cc | 64

[PATCH v2 2/6] libstdc++: Add tests for layout_left.

2025-05-20 Thread Luc Grosheintz
. * testsuite/23_containers/mdspan/layouts/ctors.cc: New test. * testsuite/23_containers/mdspan/layouts/mapping.cc: New test. Signed-off-by: Luc Grosheintz --- .../mdspan/layouts/class_mandate_neg.cc | 22 + .../23_containers/mdspan/layouts/ctors.cc | 238

[PATCH v2 1/6] libstdc++: Implement layout_left from mdspan.

2025-05-20 Thread Luc Grosheintz
Implements the parts of layout_left that don't depend on any of the other layouts. libstdc++-v3/ChangeLog: * include/std/mdspan (layout_left): New class. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/std/mdspan | 309 +++- 1 file changed

Re: [PATCH v1 2/6] libstdc++: Add tests for layout_left.

2025-05-20 Thread Luc Grosheintz
On 5/19/25 2:56 PM, Tomasz Kaminski wrote: On Sun, May 18, 2025 at 10:14 PM Luc Grosheintz wrote: Implements a suite of tests for the currently implemented parts of layout_left. The individual tests are templated over the layout type, to allow reuse as more layouts are added. libstdc++-v3

Re: [PATCH v1 1/6] libstdc++: Implement layout_left from mdspan.

2025-05-20 Thread Luc Grosheintz
On 5/19/25 1:46 PM, Tomasz Kaminski wrote: On Sun, May 18, 2025 at 10:11 PM Luc Grosheintz wrote: Implements the parts of layout_left that don't depend on any of the other layouts. libstdc++-v3/ChangeLog: * include/std/mdspan (layout_left): New class. Signed-off-by

Re: [PATCH v2 1/6] libstdc++: Implement layout_left from mdspan.

2025-05-20 Thread Luc Grosheintz
On 5/20/25 17:44, Tomasz Kaminski wrote: On Tue, May 20, 2025 at 4:30 PM Luc Grosheintz wrote: On 5/20/25 4:07 PM, Tomasz Kaminski wrote: On Tue, May 20, 2025 at 3:16 PM Luc Grosheintz Implements the parts of layout_left that don't depend on any of the other layouts. libstdc

Re: [PATCH v2 1/6] libstdc++: Implement layout_left from mdspan.

2025-05-21 Thread Luc Grosheintz
On 5/21/25 08:29, Tomasz Kaminski wrote: On Tue, May 20, 2025 at 3:16 PM Luc Grosheintz wrote: Implements the parts of layout_left that don't depend on any of the other layouts. libstdc++-v3/ChangeLog: * include/std/mdspan (layout_left): New class. Signed-off-by: Luc Grosh

[PATCH v3 2/9] libstdc++: Rename extents::_M_dynamic_extents.

2025-05-21 Thread Luc Grosheintz
_M_dynamic_extents to _M_exts. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/std/mdspan | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libstdc++-v3/include/std/mdspan b/libstdc++-v3/include/std/mdspan index e937040900a..a8ec0b159e6 100644 --- a/libstdc++-v3/include/std

[PATCH v3 0/9] Implement layouts from mdspan.

2025-05-21 Thread Luc Grosheintz
bit more obvious. Additionally, there's numerous changes planned that might make one of the two functions much more verbose. Luc Grosheintz (9): libstdc++: Rename _ExtentsStorage::_M_dynamic_extents. libstdc++: Rename extents::_M_dynamic_extents. libstdc++: Cleanup formatting i

[PATCH v3 1/9] libstdc++: Rename _ExtentsStorage::_M_dynamic_extents.

2025-05-21 Thread Luc Grosheintz
-by: Luc Grosheintz --- libstdc++-v3/include/std/mdspan | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libstdc++-v3/include/std/mdspan b/libstdc++-v3/include/std/mdspan index 47cfa405e44..e937040900a 100644 --- a/libstdc++-v3/include/std/mdspan +++ b/libstdc++-v3

[PATCH v3 4/9] libstdc++: Implement layout_left from mdspan.

2025-05-21 Thread Luc Grosheintz
Implements the parts of layout_left that don't depend on any of the other layouts. libstdc++-v3/ChangeLog: * include/std/mdspan (layout_left): New class. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/std/mdspan | 307 +++- 1 file changed

[PATCH v3 3/9] libstdc++: Cleanup formatting in mdspan.

2025-05-21 Thread Luc Grosheintz
libstdc++-v3/ChangeLog: * include/std/mdspan: Fix two instances of whitespace errors: `for(` -> `for (`. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/std/mdspan | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libstdc++-v3/include/std/mdspa

[PATCH v3 8/9] libstdc++: Implement layout_stride from mdspan.

2025-05-21 Thread Luc Grosheintz
Implements the remaining parts of layout_left and layout_right; and all of layout_stride. libstdc++-v3/ChangeLog: * include/std/mdspan(layout_stride): New class. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/std/mdspan | 216 +++- 1 file changed

[PATCH v3 9/9] libstdc++: Add tests for layout_stride.

2025-05-21 Thread Luc Grosheintz
/ctors.cc: Add test for layout_stride and the interaction with other layouts. * testsuite/23_containers/mdspan/layouts/mapping.cc: Ditto. * testsuite/23_containers/mdspan/layouts/stride.cc: New test. Signed-off-by: Luc Grosheintz --- .../mdspan/layouts/class_mandate_neg.cc

[PATCH v3 6/9] libstdc++: Implement layout_right from mdspan.

2025-05-21 Thread Luc Grosheintz
Implement the parts of layout_left that depend on layout_right; and the parts of layout_right that don't depend on layout_stride. libstdc++-v3/ChangeLog: * include/std/mdspan (layout_right): New class. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/std/mdspan

[PATCH v3 5/9] libstdc++: Add tests for layout_left.

2025-05-21 Thread Luc Grosheintz
. * testsuite/23_containers/mdspan/layouts/ctors.cc: New test. * testsuite/23_containers/mdspan/layouts/mapping.cc: New test. Signed-off-by: Luc Grosheintz --- .../mdspan/layouts/class_mandate_neg.cc | 22 + .../23_containers/mdspan/layouts/ctors.cc | 238

[PATCH v3 7/9] libstdc++: Add tests for layout_right.

2025-05-21 Thread Luc Grosheintz
layout_right and the interaction with layout_left. * testsuite/23_containers/mdspan/layouts/mapping.cc: ditto. Signed-off-by: Luc Grosheintz --- .../mdspan/layouts/class_mandate_neg.cc | 1 + .../23_containers/mdspan/layouts/ctors.cc | 64

[PATCH v1 4/6] libstdc++: Add tests for layout_right.

2025-05-18 Thread Luc Grosheintz
layout_right and the interaction with layout_left. * testsuite/23_containers/mdspan/layouts/mapping.cc: ditto. Signed-off-by: Luc Grosheintz --- .../mdspan/layouts/class_mandate_neg.cc | 1 + .../23_containers/mdspan/layouts/ctors.cc | 64

[PATCH v1 2/6] libstdc++: Add tests for layout_left.

2025-05-18 Thread Luc Grosheintz
. * testsuite/23_containers/mdspan/layouts/ctors.cc: New test. * testsuite/23_containers/mdspan/layouts/mapping.cc: New test. Signed-off-by: Luc Grosheintz --- .../mdspan/layouts/class_mandate_neg.cc | 22 + .../23_containers/mdspan/layouts/ctors.cc | 258

[PATCH v1 0/6] Implement layouts from mdspan.

2025-05-18 Thread Luc Grosheintz
require implementing a formula that doesn't require returning true in all cases. Luc Grosheintz (6): libstdc++: Implement layout_left from mdspan. libstdc++: Add tests for layout_left. libstdc++: Implement layout_right from mdspan. libstdc++: Add tests for layout_right. li

[PATCH v1 3/6] libstdc++: Implement layout_right from mdspan.

2025-05-18 Thread Luc Grosheintz
Implement the parts of layout_left that depend on layout_right; and the parts of layout_right that don't depend on layout_stride. libstdc++-v3/ChangeLog: * include/std/mdspan (layout_right): New class. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/std/mdspan

[PATCH v1 6/6] libstdc++: Add tests for layout_stride.

2025-05-18 Thread Luc Grosheintz
/ctors.cc: Add test for layout_stride and the interaction with other layouts. * testsuite/23_containers/mdspan/layouts/mapping.cc: Ditto. * testsuite/23_containers/mdspan/layouts/stride.cc: New test. Signed-off-by: Luc Grosheintz --- .../mdspan/layouts/class_mandate_neg.cc

[PATCH v1 1/6] libstdc++: Implement layout_left from mdspan.

2025-05-18 Thread Luc Grosheintz
Implements the parts of layout_left that don't depend on any of the other layouts. libstdc++-v3/ChangeLog: * include/std/mdspan (layout_left): New class. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/std/mdspan | 240 1 file changed

[PATCH v1 5/6] libstdc++: Implement layout_stride from mdspan.

2025-05-18 Thread Luc Grosheintz
Implements the remaining parts of layout_left and layout_right; and all of layout_stride. libstdc++-v3/ChangeLog: * include/std/mdspan(layout_stride): New class. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/std/mdspan | 219 +++- 1 file changed

Re: [PATCH v3 0/9] Implement layouts from mdspan.

2025-05-26 Thread Luc Grosheintz
On 5/22/25 15:21, Tomasz Kaminski wrote: For the stride and product computation, we should perform them in Extent::size_type, not index_type. The latter may be signed, and we may hit UB in multiplying non-zero extents, before reaching the zero. Then I observe the following issues: 1. When

[PATCH v1 0/1] Add error message to cmp_* and in_range.

2025-05-26 Thread Luc Grosheintz
from here 3. static_assert(false) On regular builds with g++ the error message mentions the static_assert(__is_standard_integer), and is much less cryptic. Please ignore if this is intended behaviour. Tested on x86_64 with: make check-target-libstdc++-v3 (in a no PCH build). Luc Groshein

[PATCH v1 1/1] libstdc++: Improve diagnostic message for `cmp_*` and `in_range`.

2025-05-26 Thread Luc Grosheintz
Without the message, the compiler output can be very short, e.g. as short as a `required from here`. If the output includes the line of code that trigges the static_assert, the user might interpret it as "must be a standard integer", which is incorrect, because that term doesn't cover extended inte

Re: [PATCH v1 0/1] Add error message to cmp_* and in_range.

2025-05-27 Thread Luc Grosheintz
On 5/27/25 14:34, Jonathan Wakely wrote: On Tue, 27 May 2025 at 07:51, Luc Grosheintz wrote: While reading the compiler output of make check-target-libstdc++-v3 for buggy code, e.g. cmp_equal(1.0, 1.0), the error message was very short, and I saw no hint that neither of the two

Re: [PATCH v4 0/8] Implement layouts from mdspan.

2025-05-27 Thread Luc Grosheintz
Since, I believe now we're through the larger questions about how to implement layouts. If reviewing all three over and over is too painful, it might now make sense to split the patch into separate patches, one per layout. On 5/26/25 16:04, Luc Grosheintz wrote: This follows up on:

Re: [PATCH v4 2/8] libstdc++: Implement layout_left from mdspan.

2025-05-26 Thread Luc Grosheintz
On 5/26/25 18:17, Tomasz Kaminski wrote: On Mon, May 26, 2025 at 4:15 PM Luc Grosheintz wrote: Implements the parts of layout_left that don't depend on any of the other layouts. libstdc++-v3/ChangeLog: * include/std/mdspan (layout_left): New class. * src/c++23/std.

[PATCH v4 1/8] libstdc++: Improve naming and whitespace for extents.

2025-05-26 Thread Luc Grosheintz
: Fix two instances of whitespace errors: `for(` -> `for (`. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/std/mdspan | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/libstdc++-v3/include/std/mdspan b/libstdc++-v3/include/std/mds

  1   2   3   >