Re: [PATCH v6 6/8] libstdc++: Implement layout_stride from mdspan.

2025-06-09 Thread Luc Grosheintz
Same style error. On 6/4/25 16:58, Luc Grosheintz wrote: Implements the remaining parts of layout_left and layout_right; and all of layout_stride. The implementation of layout_stride::mapping::is_exhaustive applies the following change to the standard: 4266. layout_stride::mapping should

Re: [PATCH v6 4/8] libstdc++: Implement layout_right from mdspan.

2025-06-09 Thread Luc Grosheintz
If not committed yet, there's a style error, see below. On 6/4/25 16:58, Luc Grosheintz wrote: 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 (la

Re: [PATCH v1] libstdc++: Implement default_accessor from mdspan.

2025-06-06 Thread Luc Grosheintz
On 6/6/25 14:12, Tomasz Kaminski wrote: On Thu, Jun 5, 2025 at 4:31 PM Luc Grosheintz wrote: libstdc++-v3/ChangeLog: * include/std/mdspan (default_accessor): New class. * src/c++23/std.cc.in: Register default_accessor. * testsuite/23_containers/mdspan

Re: [PATCH v6 9/8] libstdc++: Uglify __mapping_alike template parameter and fix test and typo in comment.

2025-06-06 Thread Luc Grosheintz
On 6/5/25 17:18, Tomasz Kamiński wrote: When the static assert was generated from instantiations of default member initializer of class B, the error was not generated for B<1, std::layout_left, std::layout_left> case, only when -D_GLIBCXX_DEBUG was set. Changing B calls to functions fixes that

[PATCH v1] libstdc++: Implement default_accessor from mdspan.

2025-06-05 Thread Luc Grosheintz
libstdc++-v3/ChangeLog: * include/std/mdspan (default_accessor): New class. * src/c++23/std.cc.in: Register default_accessor. * testsuite/23_containers/mdspan/default_accessor.cc: New test. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/std/mdspan

Re: [PATCH v6 3/8] libstdc++: Add tests for layout_left.

2025-06-05 Thread Luc Grosheintz
On 6/5/25 10:18, Tomasz Kaminski wrote: On Wed, Jun 4, 2025 at 5:15 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 v6 3/8] libstdc++: Add tests for layout_left.

2025-06-04 Thread Luc Grosheintz
. * testsuite/23_containers/mdspan/layouts/ctors.cc: New test. * testsuite/23_containers/mdspan/layouts/empty.cc: New test. * testsuite/23_containers/mdspan/layouts/mapping.cc: New test. Signed-off-by: Luc Grosheintz --- .../mdspan/layouts/class_mandate_neg.cc | 36

Re: [PATCH v5 7/8] libstdc++: Add tests for layout_stride.

2025-06-04 Thread Luc Grosheintz
On 6/4/25 15:38, Tomasz Kaminski wrote: On Wed, Jun 4, 2025 at 2:19 PM Tomasz Kaminski wrote: On Wed, Jun 4, 2025 at 2:05 PM Luc Grosheintz wrote: On 6/4/25 13:19, Tomasz Kaminski wrote: Ah, sorry I got confused in the review suggestions, and latter when checking the code. What I

[PATCH v6 1/8] libstdc++: Improve naming, whitespace and silence warnings for extents.

2025-06-04 Thread Luc Grosheintz
: Fix two instances of whitespace errors: `for(` -> `for (`. * include/testsuite/23_containers/mdspan/extents/ctor_default.cc: Fix integer comparison with cmp_equal. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/std/mdspan |

[PATCH v6 8/8] libstdc++: Make layout_left(layout_stride) noexcept.

2025-06-04 Thread Luc Grosheintz
: Luc Grosheintz --- libstdc++-v3/include/std/mdspan | 3 +- .../23_containers/mdspan/layouts/ctors.cc | 33 --- 2 files changed, 16 insertions(+), 20 deletions(-) diff --git a/libstdc++-v3/include/std/mdspan b/libstdc++-v3/include/std/mdspan index fe182c35a55

[PATCH v6 7/8] libstdc++: Add tests for layout_stride.

2025-06-04 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 v6 6/8] libstdc++: Implement layout_stride from mdspan.

2025-06-04 Thread Luc Grosheintz
://cplusplus.github.io/LWG/issue4266 The preconditions for layout_stride(extents, strides) are not checked. libstdc++-v3/ChangeLog: * include/std/mdspan (layout_stride): New class. * src/c++23/std.cc.in: Add layout_stride. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/std/mdspan | 249

[PATCH v6 0/8] Implement layouts from mdspan.

2025-06-04 Thread Luc Grosheintz
of OMapping::extents_type in layout_stride and associated neg tests. Thank you for the review of v5. Luc Grosheintz (8): libstdc++: Improve naming, whitespace and silence warnings for extents. libstdc++: Implement layout_left from mdspan. libstdc++: Add tests for layout_left

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

2025-06-04 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. * src/c++23/std.cc.in: Add layout_left. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/std/mdspan

[PATCH v6 4/8] libstdc++: Implement layout_right from mdspan.

2025-06-04 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. * src/c++23/std.cc.in: Add layout_right. Signed-off-by: Luc Grosh

[PATCH v6 5/8] libstdc++: Add tests for layout_right.

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

Re: [PATCH v5 7/8] libstdc++: Add tests for layout_stride.

2025-06-04 Thread Luc Grosheintz
Wed, Jun 4, 2025 at 1:09 PM Luc Grosheintz wrote: On 6/3/25 15:24, Tomasz Kaminski wrote: On Fri, May 30, 2025 at 6:44 PM Luc Grosheintz Implements the tests for layout_stride and for the features of the other two layouts that depend on layout_stride. libstdc++-v3/ChangeLog: * testsu

Re: [PATCH v5 6/8] libstdc++: Implement layout_stride from mdspan.

2025-06-04 Thread Luc Grosheintz
On 6/3/25 14:49, Tomasz Kaminski wrote: On Fri, May 30, 2025 at 6:47 PM Luc Grosheintz wrote: Implements the remaining parts of layout_left and layout_right; and all of layout_stride. The implementation of layout_stride::mapping::is_exhaustive applies the following change to the standard

Re: [PATCH v5 7/8] libstdc++: Add tests for layout_stride.

2025-06-04 Thread Luc Grosheintz
On 6/3/25 15:24, Tomasz Kaminski wrote: On Fri, May 30, 2025 at 6:44 PM Luc Grosheintz wrote: Implements the tests for layout_stride and for the features of the other two layouts that depend on layout_stride. libstdc++-v3/ChangeLog: * testsuite/23_containers/mdspan/layouts

Re: [PATCH v5 3/8] libstdc++: Add tests for layout_left.

2025-06-04 Thread Luc Grosheintz
On 6/3/25 15:10, Tomasz Kaminski wrote: On Tue, Jun 3, 2025 at 2:50 PM Luc Grosheintz wrote: On 6/3/25 14:31, Tomasz Kaminski wrote: On Mon, Jun 2, 2025 at 9:07 AM Luc Grosheintz wrote: On 5/30/25 18:42, Luc Grosheintz wrote: Implements a suite of tests for the currently

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

2025-06-03 Thread Luc Grosheintz
,1,cxx23 I have a feeling I should have been updating this file (and maybe regenerate a file). This might be a reason for a fixup for std::extents and a v6 for the layouts. On 6/3/25 18:50, Luc Grosheintz wrote: Thank you Tomasz for the round of review. IIUC we have several cases of if there

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

2025-06-03 Thread Luc Grosheintz
Thank you Tomasz for the round of review. IIUC we have several cases of if there's a v6, please change this, and no mandatory changes. Would you like me to submit a v6? On 5/30/25 18:42, Luc Grosheintz wrote: The discussion for v4 is here: https://gcc.gnu.org/pipermail/libstdc++/202

Re: [PATCH v5 3/8] libstdc++: Add tests for layout_left.

2025-06-03 Thread Luc Grosheintz
On 6/3/25 14:31, Tomasz Kaminski wrote: On Mon, Jun 2, 2025 at 9:07 AM Luc Grosheintz wrote: On 5/30/25 18:42, 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

Re: [PATCH v5 3/8] libstdc++: Add tests for layout_left.

2025-06-02 Thread Luc Grosheintz
On 5/30/25 18:42, 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/ChangeLog: * testsuite/23_containers/mdspan/layouts

[PATCH v5 6/8] libstdc++: Implement layout_stride from mdspan.

2025-05-30 Thread Luc Grosheintz
://cplusplus.github.io/LWG/issue4266 The preconditions for layout_stride(extents, strides) are not checked. libstdc++-v3/ChangeLog: * include/std/mdspan (layout_stride): New class. * src/c++23/std.cc.in: Add layout_stride. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/std/mdspan | 245

[PATCH v5 4/8] libstdc++: Implement layout_right from mdspan.

2025-05-30 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. * src/c++23/std.cc.in: Add layout_right. Signed-off-by: Luc Grosh

[PATCH v5 5/8] libstdc++: Add tests for layout_right.

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

[PATCH v5 3/8] libstdc++: Add tests for layout_left.

2025-05-30 Thread Luc Grosheintz
. * testsuite/23_containers/mdspan/layouts/ctors.cc: New test. * testsuite/23_containers/mdspan/layouts/empty.cc: New test. * testsuite/23_containers/mdspan/layouts/mapping.cc: New test. Signed-off-by: Luc Grosheintz --- .../mdspan/layouts/class_mandate_neg.cc | 36

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

2025-05-30 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. * src/c++23/std.cc.in: Add layout_left. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/std/mdspan

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

2025-05-30 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 8/8] libstdc++: Make layout_left(layout_stride) noexcept.

2025-05-30 Thread Luc Grosheintz
: Luc Grosheintz --- libstdc++-v3/include/std/mdspan | 3 +- .../23_containers/mdspan/layouts/ctors.cc | 33 --- 2 files changed, 16 insertions(+), 20 deletions(-) diff --git a/libstdc++-v3/include/std/mdspan b/libstdc++-v3/include/std/mdspan index 1250adefc14

[PATCH v5 0/8] Implement layouts from mdspan.

2025-05-30 Thread Luc Grosheintz
of _Extents, * don't comment on deviation. Luc Grosheintz (8): libstdc++: Improve naming, whitespace and silence warnings for extents. libstdc++: Implement layout_left from mdspan. libstdc++: Add tests for layout_left. libstdc++: Implement layout_right from mdspan. libstdc++

[PATCH v5 1/8] libstdc++: Improve naming, whitespace and silence warnings for extents.

2025-05-30 Thread Luc Grosheintz
: Fix two instances of whitespace errors: `for(` -> `for (`. * include/testsuite/23_containers/mdspan/extents/ctor_default.cc: Fix integer comparison with cmp_equal. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/std/mdspan |

Re: [PATCH v4 3/8] libstdc++: Add tests for layout_left.

2025-05-30 Thread Luc Grosheintz
On 5/28/25 14:49, Tomasz Kaminski wrote: On Mon, May 26, 2025 at 4:21 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 v4 7/8] libstdc++: Add tests for layout_stride.

2025-05-30 Thread Luc Grosheintz
On 5/29/25 10:06, Tomasz Kaminski wrote: On Thu, May 29, 2025 at 9:49 AM Tomasz Kaminski wrote: On Mon, May 26, 2025 at 4:25 PM Luc Grosheintz wrote: Implements the tests for layout_stride and for the features of the other two layouts that depend on layout_stride. libstdc++-v3

Re: [PATCH v4 6/8] libstdc++: Implement layout_stride from mdspan.

2025-05-30 Thread Luc Grosheintz
On 5/29/25 10:07, Tomasz Kaminski wrote: On Thu, May 29, 2025 at 9:23 AM Tomasz Kaminski wrote: On Mon, May 26, 2025 at 4:13 PM Luc Grosheintz wrote: Implements the remaining parts of layout_left and layout_right; and all of layout_stride. The implementation of layout_stride

Re: [PATCH v4 6/8] libstdc++: Implement layout_stride from mdspan.

2025-05-30 Thread Luc Grosheintz
On 5/29/25 09:23, Tomasz Kaminski wrote: On Mon, May 26, 2025 at 4:13 PM Luc Grosheintz wrote: Implements the remaining parts of layout_left and layout_right; and all of layout_stride. The implementation of layout_stride::mapping::is_exhaustive applies the following change to the standard

Re: [PATCH v4 4/8] libstdc++: Implement layout_right from mdspan.

2025-05-29 Thread Luc Grosheintz
On 5/28/25 16:22, Tomasz Kaminski wrote: On Mon, May 26, 2025 at 4:15 PM Luc Grosheintz wrote: 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/m

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 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

[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

[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

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 8/8] libstdc++: Make layout_left(layout_stride) noexcept.

2025-05-26 Thread Luc Grosheintz
same choice. libstdc++-v3/ChangeLog: * include/std/mdspan: Strengthen the exception guarantees of layout_left::mapping(layout_stride::mapping). * testsuite/23_containers/mdspan/layouts/ctors.cc: Simplify tests to reflect the change. Signed-off-by: Luc Grosheintz

[PATCH v4 7/8] libstdc++: Add tests for layout_stride.

2025-05-26 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 v4 3/8] libstdc++: Add tests for layout_left.

2025-05-26 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 | 286

[PATCH v4 5/8] libstdc++: Add tests for layout_right.

2025-05-26 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 v4 6/8] libstdc++: Implement layout_stride from mdspan.

2025-05-26 Thread Luc Grosheintz
://cplusplus.github.io/LWG/issue4266 libstdc++-v3/ChangeLog: * include/std/mdspan(layout_stride): New class. * src/c++23/std.cc.in: Add layout_right. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/std/mdspan | 229 ++- libstdc++-v3/src/c++23/std.cc.in | 3 +- 2

[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

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

2025-05-26 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. * src/c++23/std.cc.in: Add layout_left. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/std/mdspan

[PATCH v4 4/8] libstdc++: Implement layout_right from mdspan.

2025-05-26 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. * src/c++23/std.cc.in: Add layout_right. Signed-off-by: Luc Grosh

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

2025-05-26 Thread Luc Grosheintz
__dynamic_extents_prod Thank you Tomasz for all the great reviews! Luc Grosheintz (8): libstdc++: Improve naming and whitespace for extents. libstdc++: Implement layout_left from mdspan. libstdc++: Add tests for layout_left. libstdc++: Implement layout_right from mdspan. libstdc++: Add tests for

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

2025-05-26 Thread Luc Grosheintz
On 5/26/25 13:53, Tomasz Kaminski wrote: On Mon, May 26, 2025 at 1:32 PM Luc Grosheintz wrote: On 5/26/25 11:43, Tomasz Kaminski wrote: On Mon, May 26, 2025 at 11:35 AM Luc Grosheintz < luc.groshei...@gmail.com> wrote: On 5/22/25 15:21, Tomasz Kaminski wrote: For the stri

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

2025-05-26 Thread Luc Grosheintz
On 5/26/25 11:43, Tomasz Kaminski wrote: On Mon, May 26, 2025 at 11:35 AM Luc Grosheintz wrote: 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

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] libstdc++: Fix bug in default ctor of extents.

2025-05-24 Thread Luc Grosheintz
. * testsuite/23_containers/mdspan/extents/ctor_default.cc: New test. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/std/mdspan | 2 +- .../mdspan/extents/ctor_default.cc| 41 +++ 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644

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

2025-05-23 Thread Luc Grosheintz
s, because it felt non-uniform (I don't like remembering special cases) and a little error prone. Let me know if you see it differently and would like me to add a default template argument to handle the case Extents == OExtents. Regards, Tomasz On Thu, May 22, 2025 at 2:21 PM Tomasz Kamin

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

2025-05-22 Thread Luc Grosheintz
On 5/22/25 14:37, Tomasz Kaminski wrote: On Wed, May 21, 2025 at 12:04 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: Luc

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

2025-05-22 Thread Luc Grosheintz
on in std.cc.in & I'll squash the first three commits. I'll send v4 later this afternoon, please let me know if you're still reviewing (so I don't make the same mistake again). On 5/22/25 12:43, Tomasz Kaminski wrote: On Wed, May 21, 2025 at 11:53 AM Luc Grosheintz wrote: I

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

2025-05-21 Thread Luc Grosheintz
It's missing the "registration" of the three new classes in std.cc.in. On 5/21/25 11:40, Luc Grosheintz wrote: Follows up on: https://gcc.gnu.org/pipermail/libstdc++/2025-May/061535.html To improve naming conventions, this series includes three new commits: * Two co

[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 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 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 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 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 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 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 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 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 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

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

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-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 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

[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 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 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

[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 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

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 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 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 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 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 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

[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 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 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 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 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 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

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

2025-05-15 Thread Luc Grosheintz
On 5/15/25 5:12 PM, Jonathan Wakely wrote: On Thu, 15 May 2025 at 16:12, Jonathan Wakely wrote: On Thu, 15 May 2025 at 16:11, Luc Grosheintz wrote: Without would make sense to me, because whenever I wrote an identifier with _ I felt like I was presenting the user with a name that they

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

2025-05-15 Thread Luc Grosheintz
. to 15. toukok. 2025 klo 13.20 Jonathan Wakely kirjoitti: On Thu, 15 May 2025 at 11:14, Jonathan Wakely wrote: On Wed, 14 May 2025 at 20:18, Luc Grosheintz wrote: The standard states that the IndexType must be a signed or unsigned integer. This mandate was implemented using `std::is_int

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 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 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

  1   2   >