Re: [PATCH v1 0/4] libstdc++: Implement first part of submdspan.

2025-10-03 Thread Luc Grosheintz
On 10/3/25 12:09 PM, Tomasz Kaminski wrote: On Thu, Oct 2, 2025 at 11:34 AM Luc Grosheintz wrote: This patch series contains everything up to submdspan_extents and implements them as described in N5014, i.e. without P3663. The reasons to not include P3663 are: - Doing both allows us

Re: [PATCH v2 0/5] libstdc++: Implement std::layout_left_padded.

2025-10-02 Thread Luc Grosheintz
Noo! These have already been sent and reviewed. Please IGNORE. On 9/23/25 3:07 PM, Luc Grosheintz wrote: Changes since v1: - Use cmp_* when comparing two integers of differnt types. - Remove the FTM submdspan and replace it with an unofficial purely internal FTM called padded_layouts

[PATCH v1 0/4] libstdc++: Implement first part of submdspan.

2025-10-02 Thread Luc Grosheintz
e the range checks of slices (more can be done at compile-time). - We could easily revert P3663 if needed. Luc Grosheintz (4): libstdc++: Implement strided_slice from . [PR110352] libstdc++: Implement full_extent_t. [PR110352] libstdc++: Implement submdspan_mapping_result. [PR11

[PATCH v1 3/4] libstdc++: Implement submdspan_mapping_result. [PR110352]

2025-10-02 Thread Luc Grosheintz
Implement the class submdspan_mapping_result and add it to the std module. PR libstdc++/110352 libstdc++-v3/ChangeLog: * include/std/mdspan (submdspan_mapping_result): New class. * src/c++23/std.cc.in (submdspan_mapping_result): Add. Signed-off-by: Luc Grosheintz

[PATCH v1 4/4] libstdc++: Implement submdspan_extents. [PR110352]

2025-10-02 Thread Luc Grosheintz
w function. * testsuite/23_containers/mdspan/int_like.h: Add StructuralInt. * testsuite/23_containers/mdspan/submdspan/submdspan_extents.cc: New test. * testsuite/23_containers/mdspan/submdspan/submdspan_extents_neg.cc: New test. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/

[PATCH v1 1/4] libstdc++: Implement strided_slice from . [PR110352]

2025-10-02 Thread Luc Grosheintz
/mdspan (strided_slice): New class. * src/c++23/std.cc.in (strided_slice): Add. * testsuite/23_containers/mdspan/submdspan/strided_slice.cc: New test. * testsuite/23_containers/mdspan/submdspan/strided_slice_neg.cc: New test. Signed-off-by: Luc Grosheintz --- libstdc++-v3

[PATCH v1 2/4] libstdc++: Implement full_extent_t. [PR110352]

2025-10-02 Thread Luc Grosheintz
Add the class and updates the std module. PR libstdc++/110352 libstdc++-v3/ChangeLog: * include/std/mdspan (full_extent_t): New class. * src/c++23/std.cc.in (full_extent_t): Add. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/std/mdspan | 7 +++ libstdc

Re: [PATCH v5 1/2] libstdc++: Implement std::layout_left_padded [PR110352].

2025-09-30 Thread Luc Grosheintz
On 9/30/25 10:14 AM, Tomasz Kamiński wrote: From: Luc Grosheintz This commit adds a new layout layout_left_padded as standardized in N5014. It adds a purely internal feature testing macro padded_layouts and registers layout_left_padded in the std module. This commit implements LWG4372

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

2025-09-26 Thread Luc Grosheintz
On 9/26/25 2:22 PM, Tomasz Kaminski wrote: On Tue, Sep 23, 2025 at 3:23 PM Luc Grosheintz wrote: This commit adds a new layout layout_left_padded as standardized in N5014 but with one deviation.It adds a purely internal feature testing macro padded_layouts and registers layout_left_padded

Re: [PATCH v3 4/4] libstdc++: Implement layout_right_padded.

2025-09-26 Thread Luc Grosheintz
On 9/26/25 9:45 AM, Tomasz Kaminski wrote: On Tue, Sep 23, 2025 at 3:41 PM Luc Grosheintz wrote: This commit adds the right padded layout as described in N5014, with LWG4372 (dynamic padding value) and LWG4314 (move in operator()). libstdc++-v3/ChangeLog: * include/std/mdspan

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

2025-09-26 Thread Luc Grosheintz
On 9/26/25 9:21 AM, Tomasz Kaminski wrote: On Tue, Sep 23, 2025 at 3:23 PM Luc Grosheintz wrote: This commit adds a new layout layout_left_padded as standardized in N5014 but with one deviation.It adds a purely internal feature testing macro padded_layouts and registers layout_left_padded

Re: [PATCH v3 4/4] libstdc++: Implement layout_right_padded.

2025-09-26 Thread Luc Grosheintz
indings. Is there a reasonably easy way to make it work now? My most desparate attempt was a hard-coded: constexpr auto [...I] = std::tuple{std::cw<0>, ..., std::cw}; which failed, because it can't get the I in a constexpr manner. On 9/25/25 1:20 PM, Tomasz Kaminski wrote: On Tue,

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

2025-09-25 Thread Luc Grosheintz
Okay, I I'm through, two or three question further down. Nice idea with the tag type! I'm happy the constraints could be removed safely. (I'll hold off with sending v4.) Thank you, Luc On 9/25/25 1:06 PM, Tomasz Kaminski wrote: On Tue, Sep 23, 2025 at 3:23 PM Luc Grosheintz

Re: [PATCH v3 0/4] libstdc++: Implement padded layouts.

2025-09-25 Thread Luc Grosheintz
you prefer avoiding another revision. Thank you, I've started reading through them. I'll start making all changes locally; but wait with posting v4. Please let me know when you consider the review round completed. Regards, Tomasz On Tue, Sep 23, 2025 at 3:32 PM Luc Grosheintz wrote:

[PATCH v3 1/4] libstdc++: Prepare mapping layout tests for padded layouts.

2025-09-23 Thread Luc Grosheintz
test. Signed-off-by: Luc Grosheintz --- .../23_containers/mdspan/layouts/empty.cc | 144 +- .../23_containers/mdspan/layouts/mapping.cc | 132 ++-- 2 files changed, 158 insertions(+), 118 deletions(-) diff --git a/libstdc++-v3/testsuite/23_containers/mdspan

[PATCH v2 2/5] libstdc++: Fix bug in layout mapping tests.

2025-09-23 Thread Luc Grosheintz
libstdc++-v3/ChangeLog: * testsuite/23_containers/mdspan/layouts/mapping.cc (test_stride_1d): Fix test. Signed-off-by: Luc Grosheintz --- libstdc++-v3/testsuite/23_containers/mdspan/layouts/mapping.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libstdc

[PATCH v2 3/5] libstdc++: Prepare mapping layout tests for left padded.

2025-09-23 Thread Luc Grosheintz
. (test_stride_3d): Ditto. Signed-off-by: Luc Grosheintz --- .../23_containers/mdspan/layouts/mapping.cc | 119 +++--- 1 file changed, 75 insertions(+), 44 deletions(-) diff --git a/libstdc++-v3/testsuite/23_containers/mdspan/layouts/mapping.cc b/libstdc++-v3/testsuite/23_containers/mdspan

[PATCH v2 0/5] libstdc++: Implement std::layout_left_padded.

2025-09-23 Thread Luc Grosheintz
stride). I also noticed that some of the changes can be split into separate commits. Luc Grosheintz (5): libstdc++: Refactor layout mapping tests to use a concept. libstdc++: Fix bug in layout mapping tests. libstdc++: Prepare mapping layout tests for left padded. libstdc++: Refactor __mdspan::_

[PATCH v3 4/4] libstdc++: Implement layout_right_padded.

2025-09-23 Thread Luc Grosheintz
/mdspan/layouts/padded.cc: Ditto. * testsuite/23_containers/mdspan/layouts/padded_neg.cc: Ditto. * testsuite/23_containers/mdspan/layouts/padded_traits.h: Ditto. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/std/mdspan | 263 ++ libstdc++-v3/src

[PATCH v2] libstdc++: Move test for __cpp_lib_not_fn to version.cc

2025-09-23 Thread Luc Grosheintz
testsuite/20_util/function_objects/not_fn/nttp.cc: Move test of feature testing macro to version.cc * testsuite/20_util/function_objects/not_fn/version.cc: New test. Signed-off-by: Luc Grosheintz --- .../testsuite/20_util/function_objects/not_fn/nttp.cc | 6 -- .../20_util/functi

Re: [PATCH v1] libstdc++: Move test for __cpp_lib_not_fn to after #include.

2025-09-23 Thread Luc Grosheintz
On 9/23/25 1:49 PM, Jonathan Wakely wrote: On Tue, 23 Sept 2025 at 12:11, Luc Grosheintz wrote: When running the tests without pre-compiled headers (--disable-libstdcxx-pch), the test fails, because the feature testing macro (FTM) isn't defined yet. This commit moves checking the F

Re: [PATCH v2 0/5] libstdc++: Implement std::layout_left_padded.

2025-09-21 Thread Luc Grosheintz
On 9/11/25 3:58 PM, Luc Grosheintz wrote: On 9/11/25 14:41, Tomasz Kaminski wrote: On Thu, Sep 11, 2025 at 1:50 PM Luc Grosheintz wrote: Changes since v1:    - Use cmp_* when comparing two integers of differnt types.    - Remove the FTM submdspan and replace it with an unofficial

[PATCH v2 4/5] libstdc++: Refactor __mdspan::__static_quotient.

2025-09-20 Thread Luc Grosheintz
/ChangeLog: * include/std/mdspan (__static_quotient): New overload. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/std/mdspan | 19 ++- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/libstdc++-v3/include/std/mdspan b/libstdc++-v3/include/std/mdspan index

Re: [PATCH v4 1/2] libstdc++: Implement constant_wrapper, cw from P2781R9.

2025-09-20 Thread Luc Grosheintz
On 9/9/25 2:15 PM, Tomasz Kaminski wrote: On Tue, Sep 9, 2025 at 12:45 PM Jonathan Wakely wrote: On Fri, 5 Sept 2025 at 08:14, Tomasz Kamiński wrote: From: Luc Grosheintz This is a partial implementation of P2781R9. It adds std::cw and std::constant_wrapper, but doesn't m

Re: [PATCH v2 5/5] libstdc++: Implement std::layout_left_padded.

2025-09-20 Thread Luc Grosheintz
On 9/11/25 16:07, Tomasz Kaminski wrote: On Thu, Sep 11, 2025 at 1:46 PM Luc Grosheintz wrote: This commit adds a new layout layout_left_padded as standardized in N5014 but with one deviation. It includes checking of all mandates and prerequisites. It adds a purely internal feature testing

[PATCH v2 3/5] libstdc++: Prepare mapping layout tests for left padded.

2025-09-20 Thread Luc Grosheintz
. (test_stride_3d): Ditto. Signed-off-by: Luc Grosheintz --- .../23_containers/mdspan/layouts/mapping.cc | 119 +++--- 1 file changed, 75 insertions(+), 44 deletions(-) diff --git a/libstdc++-v3/testsuite/23_containers/mdspan/layouts/mapping.cc b/libstdc++-v3/testsuite/23_containers/mdspan

Re: [PATCH v1] libstdc++: Rename _S-prefixed identifiers in .

2025-09-19 Thread Luc Grosheintz
On 9/10/25 11:24 AM, Jonathan Wakely wrote: On Wed, 10 Sept 2025 at 09:44, Jonathan Wakely wrote: On Wed, 10 Sept 2025 at 07:49, Luc Grosheintz wrote: In libstdc++ the prefix _S is used for static members only. In there's several type aliases that also used the prefix _S. They no

Re: [PATCH v1] libstdc++: Implement std::layout_left_padded.

2025-09-17 Thread Luc Grosheintz
On 9/8/25 10:12 PM, Luc Grosheintz wrote: I decided to deviate once (described in detail in the commit message). Without this deviation writing tests is very clumsy and sometimes not possible, e.g. when mixing uint8_t and dynamic padding values to check mandates w.r.t. representability

[PATCH v2 5/5] libstdc++: Implement std::layout_left_padded.

2025-09-15 Thread Luc Grosheintz
suite/23_containers/mdspan/layouts/padded_neg.cc: Ditto. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/bits/version.def | 10 + libstdc++-v3/include/bits/version.h | 9 + libstdc++-v3/include/std/mdspan | 522 ++- libstdc++-v3/src/c++23/std.

[PATCH v2 1/5] libstdc++: Refactor layout mapping tests to use a concept.

2025-09-12 Thread Luc Grosheintz
youts/mapping.cc (has_static_is_exhaustive): New concept. (test_mapping_properties): Update test. Signed-off-by: Luc Grosheintz --- .../testsuite/23_containers/mdspan/layouts/mapping.cc | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/libstdc

Re: [PATCH v1] libstdc++: Implement std::layout_left_padded.

2025-09-11 Thread Luc Grosheintz
On 9/9/25 15:54, Tomasz Kaminski wrote: On Mon, Sep 8, 2025 at 10:14 PM Luc Grosheintz wrote: I decided to deviate once (described in detail in the commit message). Without this deviation writing tests is very clumsy and sometimes not possible, e.g. when mixing uint8_t and dynamic padding

Re: [PATCH v2 5/5] libstdc++: Implement std::layout_left_padded.

2025-09-11 Thread Luc Grosheintz
On 9/11/25 17:05, Luc Grosheintz wrote: Static checks already cover this. but what if `_M_exents is completely dynamic, e.g.   std::extents{128, 4} I see, we can constexpr if the check away for fully static extents.

[PATCH v1] libstdc++: Rename _S-prefixed identifiers in .

2025-09-11 Thread Luc Grosheintz
ssage. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/std/mdspan | 33 ++- .../23_containers/mdspan/class_mandate_neg.cc | 2 +- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/libstdc++-v3/include/std/mdspan b/libstdc++-v3/include/std/mdspan

Re: [PATCH v2 0/5] libstdc++: Implement std::layout_left_padded.

2025-09-11 Thread Luc Grosheintz
On 9/11/25 14:41, Tomasz Kaminski wrote: On Thu, Sep 11, 2025 at 1:50 PM Luc Grosheintz wrote: Changes since v1: - Use cmp_* when comparing two integers of differnt types. - Remove the FTM submdspan and replace it with an unofficial purely internal FTM called padded_layouts

[PATCH v2 2/5] libstdc++: Fix bug in layout mapping tests.

2025-09-11 Thread Luc Grosheintz
libstdc++-v3/ChangeLog: * testsuite/23_containers/mdspan/layouts/mapping.cc (test_stride_1d): Fix test. Signed-off-by: Luc Grosheintz --- libstdc++-v3/testsuite/23_containers/mdspan/layouts/mapping.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libstdc

[PATCH v2 0/5] libstdc++: Implement std::layout_left_padded.

2025-09-11 Thread Luc Grosheintz
stride). I also noticed that some of the changes can be split into separate commits. Luc Grosheintz (5): libstdc++: Refactor layout mapping tests to use a concept. libstdc++: Fix bug in layout mapping tests. libstdc++: Prepare mapping layout tests for left padded. libstdc++: Refactor __mdspan::_

Re: [PATCH v1] libstdc++: Implement std::layout_left_padded.

2025-09-11 Thread Luc Grosheintz
On 9/11/25 9:40 AM, Tomasz Kaminski wrote: - The tests contain a function: constexpr bool is_same_mapping(const auto& lhs, const auto& rhs) // ... for (size_t i = 0; i < lhs.extents().rank(); ++i)

Re: [PATCH v1] libstdc++: Implement std::layout_left_padded.

2025-09-11 Thread Luc Grosheintz
On 9/9/25 9:48 AM, Tomasz Kaminski wrote: On Mon, Sep 8, 2025 at 10:14 PM Luc Grosheintz wrote: I decided to deviate once (described in detail in the commit message). Without this deviation writing tests is very clumsy and sometimes not possible, e.g. when mixing uint8_t and dynamic

Re: [PATCH v1] libstdc++: Implement std::layout_left_padded.

2025-09-10 Thread Luc Grosheintz
On 9/9/25 12:00 PM, Tomasz Kaminski wrote: On Mon, Sep 8, 2025 at 10:14 PM Luc Grosheintz wrote: I decided to deviate once (described in detail in the commit message). Without this deviation writing tests is very clumsy and sometimes not possible, e.g. when mixing uint8_t and dynamic

[PATCH v2] libstdc++: Rename _S-prefixed identifiers in .

2025-09-10 Thread Luc Grosheintz
e new error message. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/std/mdspan | 34 +-- .../23_containers/mdspan/class_mandate_neg.cc | 2 +- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/libstdc++-v3/include/std/mdspan b/libstdc++-v3/in

[PATCH v2] libstdc++: Convertibility of rank == 0 layouts, LWG4272.

2025-09-09 Thread Luc Grosheintz
new behavior. * testsuite/23_containers/mdspan/layouts/padded.cc: Update test for new behavior. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/std/mdspan | 15 +++- .../23_containers/mdspan/layouts/ctors.cc | 82 +++ .../23_containers/mdspan/layouts/padd

[PATCH v1] libstdc++: Implement std::layout_left_padded.

2025-09-08 Thread Luc Grosheintz
te/23_containers/mdspan/layouts/debug/padded_neg.cc: New test. * testsuite/23_containers/mdspan/layouts/padded.cc: New test. * testsuite/23_containers/mdspan/layouts/padded_neg.cc: New test. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/bits/version.def |

Re: [PATCH v1] libstdc++: Apply LWG4351 to CTAD of span/mdspan.

2025-09-08 Thread Luc Grosheintz
On 9/7/25 5:34 PM, Jonathan Wakely wrote: On Sat, 6 Sept 2025 at 14:12, Luc Grosheintz wrote: The concept __integral_constant_like doesn't consider traits with a boolean member `value` as an integer constant. This is done to reject various completely unrelated traits like is_

Re: [PATCH v2 2/3] libstdc++: Implement constant_wrapper, cw from P2781R9.

2025-09-07 Thread Luc Grosheintz
On 9/4/25 11:40, Tomasz Kaminski wrote: On Wed, Sep 3, 2025 at 4:54 PM Luc Grosheintz wrote: On 9/2/25 13:45, Tomasz Kaminski wrote: On Tue, Sep 2, 2025 at 10:07 AM Luc Grosheintz This is a partial implementation of P2781R9. It adds std::cw and std::constant_wrapper, but doesn't m

[PATCH v3 0/2] libstdc++: Implement the constant_wrapper paper P2781R9.

2025-09-07 Thread Luc Grosheintz
Removed adl.cc because instantiate.cc is a better test of the ADL behaviour. Luc Grosheintz (2): libstdc++: Implement constant_wrapper, cw from P2781R9. libstdc++: Adjust span/mdspan CTAD for P2781R9. libstdc++-v3/include/bits/version.def | 8 + libstdc++-v3/include/bits/version.h

Re: [PATCH v3 2/2] libstdc++: Adjust span/mdspan CTAD for P2781R9.

2025-09-06 Thread Luc Grosheintz
On 9/5/25 19:58, Jonathan Wakely wrote: On Fri, 5 Sept 2025 at 16:26, Jonathan Wakely wrote: On Thu, 4 Sept 2025 at 13:22, Luc Grosheintz wrote: A usecase for P2781R9 is more ergonomic creation of span and mdspan with mixed static and dynamic extents, e.g.: span(ptr, cw&l

[PATCH v1] libstdc++: Apply LWG4351 to CTAD of span/mdspan.

2025-09-06 Thread Luc Grosheintz
g if _Tp::value is boolean. * testsuite/23_containers/mdspan/extents/misc.cc: Update test. * testsuite/23_containers/mdspan/mdspan.cc: Ditto. * testsuite/23_containers/span/deduction.cc: Ditto. Signed-off-by: Luc Grosheintz --- libstdc++-v3/i

Re: [PATCH v3 0/2] libstdc++: Implement the constant_wrapper paper P2781R9.

2025-09-05 Thread Luc Grosheintz
the patches merged. On Thu, Sep 4, 2025 at 2:21 PM Luc Grosheintz wrote: The changes since v2 are in the test code: - There's a short test for string literals. I had trouble doing much with them. - Convert commented out invalid code into neg test using static_assert

[PATCH v3 1/2] libstdc++: Implement constant_wrapper, cw from P2781R9.

2025-09-04 Thread Luc Grosheintz
apper/instantiate.cc: New test. * testsuite/20_util/constant_wrapper/op_comma_neg.cc: New test. * testsuite/20_util/constant_wrapper/version.cc: New test. Co-authored-by: Tomasz Kamiński Signed-off-by: Tomasz Kamiński Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/bits/versio

Re: [PATCH v3 1/2] libstdc++: Implement constant_wrapper, cw from P2781R9.

2025-09-04 Thread Luc Grosheintz
On 9/4/25 2:20 PM, Luc Grosheintz wrote: This is a partial implementation of P2781R9. It adds std::cw and std::constant_wrapper, but doesn't modify __integral_constant_like for span/mdspan. libstdc++-v3/ChangeLog: * include/bits/version.def (constant_wrapper): Add. * in

[PATCH v3 2/2] libstdc++: Adjust span/mdspan CTAD for P2781R9.

2025-09-04 Thread Luc Grosheintz
tant_wrapper. * testsuite/23_containers/mdspan/mdspan.cc: Ditto. * testsuite/23_containers/span/deduction.cc: Ditto. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/std/span | 3 ++- .../23_containers/mdspan/extents/misc.cc | 22 ++

Re: [PATCH v2 3/3] libstdc++: Adjust span/mdspan CTAD for P2781R9.

2025-09-03 Thread Luc Grosheintz
On 9/2/25 10:21, Tomasz Kaminski wrote: On Tue, Sep 2, 2025 at 10:15 AM Luc Grosheintz wrote: A usecase for P2781R9 is more ergonomic creation of span and mdspan with mixed static and dynamic extents, e.g.: span(ptr, cw<3>) extents(cw<3>, 5, cw<7>) mdspan

[PATCH v1] libstdc++: Add _GLIBCXX_RESOLVE_LIB_DEFECTS for 4314 in .

2025-09-03 Thread Luc Grosheintz
rator()): Ditto. (layout_stride::mapping::operator()): Ditto. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/std/mdspan | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libstdc++-v3/include/std/mdspan b/libstdc++-v3/include/std/mdspan index 6c7469

Re: [PATCH v2 2/3] libstdc++: Implement constant_wrapper, cw from P2781R9.

2025-09-03 Thread Luc Grosheintz
On 9/2/25 13:45, Tomasz Kaminski wrote: On Tue, Sep 2, 2025 at 10:07 AM Luc Grosheintz wrote: This is a partial implementation of P2781R9. It adds std::cw and std::constant_wrapper, but doesn't modify __integral_constant_like for span/mdspan. libstdc++-v3/ChangeLog: * in

Re: [PATCH v2 2/3] libstdc++: Implement constant_wrapper, cw from P2781R9.

2025-09-03 Thread Luc Grosheintz
Two more comments (see below). On 9/2/25 13:45, Tomasz Kaminski wrote: On Tue, Sep 2, 2025 at 10:07 AM Luc Grosheintz wrote: This is a partial implementation of P2781R9. It adds std::cw and std::constant_wrapper, but doesn't modify __integral_constant_like for span/mdspan. libstdc

Re: [PATCH v2 3/3] libstdc++: Adjust span/mdspan CTAD for P2781R9.

2025-09-03 Thread Luc Grosheintz
On 9/2/25 10:21, Tomasz Kaminski wrote: On Tue, Sep 2, 2025 at 10:15 AM Luc Grosheintz wrote: A usecase for P2781R9 is more ergonomic creation of span and mdspan with mixed static and dynamic extents, e.g.: span(ptr, cw<3>) extents(cw<3>, 5, cw<7>) mdspan

[PATCH v2 2/3] libstdc++: Implement constant_wrapper, cw from P2781R9.

2025-09-02 Thread Luc Grosheintz
apper/instantiate.cc: New test. * testsuite/20_util/constant_wrapper/op_comma_neg.cc: New test. * testsuite/20_util/constant_wrapper/version.cc: New test. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/bits/version.def | 8 + libstdc++-v3/include/bits/version.h

Re: [PATCH v2 2/3] libstdc++: Implement constant_wrapper, cw from P2781R9.

2025-09-02 Thread Luc Grosheintz
On 9/2/25 13:45, Tomasz Kaminski wrote: On Tue, Sep 2, 2025 at 10:07 AM Luc Grosheintz wrote: This is a partial implementation of P2781R9. It adds std::cw and std::constant_wrapper, but doesn't modify __integral_constant_like for span/mdspan. libstdc++-v3/ChangeLog: * in

[PATCH v2 3/3] libstdc++: Adjust span/mdspan CTAD for P2781R9.

2025-09-02 Thread Luc Grosheintz
tant_wrapper. * testsuite/23_containers/mdspan/mdspan.cc: Ditto. * testsuite/23_containers/span/deduction.cc: Ditto. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/std/span | 3 ++- .../23_containers/mdspan/extents/misc.cc | 20 +++

[PATCH v2 0/3] libstdc++: Implement constant_wrapper, cw from P2781R9.

2025-09-02 Thread Luc Grosheintz
The full paper P2781R9 is implemented in three steps: 1. Prepare libstdc++ by moving internal code we need later. 2. Implement constant_wrapper and cw. 3. Implement the change to the CTAD for span/mdspan. Luc Grosheintz (3): libstdc++: Move _Index_tuple, _Build_index_tuple to . libstdc

[PATCH v2 1/3] libstdc++: Move _Index_tuple, _Build_index_tuple to .

2025-09-02 Thread Luc Grosheintz
/bits/utility.h (_Index_tuple): Move to . (_Build_index_tuple): Ditto. * include/std/type_traits (_Index_tuple): Ditto. (_Build_index_tuple): Ditto. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/bits/utility.h | 20 libstdc++-v3/include/std/t

[PATCH v1][RFC] libstdc++: Implement constant_wrapper, cw from P2781R8.

2025-08-13 Thread Luc Grosheintz
suite/20_util/constant_wrapper/adl.cc: New test. * testsuite/20_util/constant_wrapper/ex.cc: New test. * testsuite/20_util/constant_wrapper/generic.cc: New test. * testsuite/20_util/constant_wrapper/version.cc: New test. Signed-off-by: Luc Grosheintz --- This is a previ

[PATCH v2 2/2] libstdc++: Simplify precomputed partial products in .

2025-08-11 Thread Luc Grosheintz
): Delete. (__fwd_partial_prods): Compute at compile-time in O(rank), not O(rank**2). (__rev_partial_prods): Ditto. (__size): Inline __static_prod. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/std/mdspan | 44 + 1 file

[PATCH v2 0/2] Two cleanup patches for .

2025-08-11 Thread Luc Grosheintz
This second iteration: - fixes the commit message of both patches, - prefers if over multiplying with 1, - use a span instead of a const array&, - use constexpr for __sta_prod. Luc Grosheintz (2): libstdc++: Reduce size static storage for __fwd_prod in mdspan. libstdc++: Simp

[PATCH v2 1/2] libstdc++: Reduce size static storage for __fwd_prod in mdspan.

2025-08-11 Thread Luc Grosheintz
prods): Reduce size of the array by 1 element. 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/mdspan b/libstdc++-v3/include/std/mdspan index 351018a59a5..8f974257e96 100644

Re: [PATCH v1 2/2] libstdc++: Simplify precomputed partial products in .

2025-08-11 Thread Luc Grosheintz
On 8/11/25 15:29, Tomasz Kaminski wrote: On Mon, Aug 11, 2025 at 3:23 PM Luc Grosheintz wrote: Prior to this commit, the partial producs of static extents in was done in a loop that calls a function that computes the partial product. The complexity is quadratic in the rank. This commit

[PATCH v1 1/2] libstdc++: Reduce size static storage for __fwd_prod in mdspan.

2025-08-11 Thread Luc Grosheintz
clude/std/mdspan (__fwd_partial_prods): Reduce size of the array by 1 element. 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/mdspan b/libstdc++-v3/include/std/mdspan

[PATCH v1 2/2] libstdc++: Simplify precomputed partial products in .

2025-08-11 Thread Luc Grosheintz
): Delete. (__fwd_partial_prods): Compute at compile-time in O(rank), not O(rank**2). (__rev_partial_prods): Ditto. (__size): Inline __static_prod. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/std/mdspan | 33 +++-- 1 file

[PATCH v1 0/2] Two cleanup patches for .

2025-08-11 Thread Luc Grosheintz
As part of the review of: we agreed to prepare patches to fix two things: - shrink the size of __fwd_partial_prod, - compute __*_partial_prod in linear time. Luc Grosheintz (2): libstdc++: Reduce size static storage for __fwd_prod in mdspan. libstdc++: Simplify precomputed partial

Re: [PATCH v2 0/8] libstdc++: Sequence of improvements to .

2025-08-05 Thread Luc Grosheintz
On 8/5/25 14:55, Tomasz Kaminski wrote: On Tue, Aug 5, 2025 at 2:49 PM Tomasz Kaminski wrote: On Tue, Aug 5, 2025 at 2:14 PM Luc Grosheintz wrote: On 8/5/25 13:25, Tomasz Kaminski wrote: On Tue, Aug 5, 2025 at 1:14 PM Luc Grosheintz On 8/5/25 10:16, Tomasz Kaminski wrote: Hi

Re: [PATCH v2 0/8] libstdc++: Sequence of improvements to .

2025-08-05 Thread Luc Grosheintz
On 8/5/25 13:25, Tomasz Kaminski wrote: On Tue, Aug 5, 2025 at 1:14 PM Luc Grosheintz wrote: On 8/5/25 10:16, Tomasz Kaminski wrote: Hi, I have posted v3 patches with changes I have made locally for first 6 patches, and I think this series is ready to land, in addition to https

Re: [PATCH v2 0/8] libstdc++: Sequence of improvements to .

2025-08-05 Thread Luc Grosheintz
e_t __sta_prod = __rev_partial_prods<__sta_exts>[__r-1]; // size reduced by one here. return __extents_prod(__exts, __sta_prod, __r + 1, __rank); } Regards, Tomasz On Mon, Aug 4, 2025 at 7:51 PM Luc Grosheintz wrote: On 8/4/25 17:42, Tomasz Kaminski wrote: On Mon, Aug 4, 2

Re: [PATCH v2 3/8] libstdc++: Improve low-rank layout_{left, right}::stride.

2025-08-05 Thread Luc Grosheintz
On 8/5/25 12:44, Tomasz Kaminski wrote: On Tue, Aug 5, 2025 at 12:39 PM Tomasz Kaminski wrote: On Tue, Aug 5, 2025 at 12:33 PM Luc Grosheintz wrote: On 8/5/25 09:36, Tomasz Kaminski wrote: On Sun, Aug 3, 2025 at 11:07 PM Luc Grosheintz < luc.groshei...@gmail.com> wrote:

Re: [PATCH v2 3/8] libstdc++: Improve low-rank layout_{left, right}::stride.

2025-08-05 Thread Luc Grosheintz
On 8/5/25 09:36, Tomasz Kaminski wrote: On Sun, Aug 3, 2025 at 11:07 PM Luc Grosheintz wrote: The methods layout_{left,right}::mapping::stride are defined as \prod_{i = 0}^r E[i] \prod_{i = r+1}^n E[i] This is computed as the product of a precomputed static product and the product

Re: [PATCH v2 3/8] libstdc++: Improve low-rank layout_{left, right}::stride.

2025-08-04 Thread Luc Grosheintz
On 8/4/25 17:26, Tomasz Kaminski wrote: On Sun, Aug 3, 2025 at 11:07 PM Luc Grosheintz wrote: The methods layout_{left,right}::mapping::stride are defined as \prod_{i = 0}^r E[i] \prod_{i = r+1}^n E[i] This is computed as the product of a precomputed static product and the product

Re: [PATCH v2 0/8] libstdc++: Sequence of improvements to .

2025-08-04 Thread Luc Grosheintz
On 8/4/25 17:42, Tomasz Kaminski wrote: On Mon, Aug 4, 2025 at 1:14 PM Tomasz Kaminski wrote: On Mon, Aug 4, 2025 at 1:08 PM Luc Grosheintz wrote: Hi Tomasz, Thank you for the review! Sorry about the missing parens, even after "Ctrl+F"ing each of the emails I can't fi

Re: [PATCH v2 0/8] libstdc++: Sequence of improvements to .

2025-08-04 Thread Luc Grosheintz
n first commits, and they look solid to me, and I haven't noticed anything I would like to change (except parentheses around requires, but I will handle that locally). I will try to do a full review during this week. Regards, Tomasz On Sun, Aug 3, 2025 at 10:59 PM Luc Grosheintz wrote:

[PATCH v4 2/2] libstdc++: Implement aligned_accessor from mdspan [PR120994]

2025-08-04 Thread Luc Grosheintz
/23_containers/mdspan/version.cc: Add test for __cpp_lib_aligned_accessor. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/bits/version.def | 10 libstdc++-v3/include/bits/version.h | 10 libstdc++-v3/include/std/mdspan | 54

[PATCH v4 1/2] libstdc++: Implement is_sufficiently_aligned [PR120994]

2025-08-04 Thread Luc Grosheintz
/is_sufficiently_aligned/1.cc: New test. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/bits/align.h | 16 ++ libstdc++-v3/include/bits/version.def | 8 + libstdc++-v3/include/bits/version.h | 10 ++ libstdc++-v3/include/std/memory

[PATCH v4 0/2] libstdc++: Implement aligned_accessor [P2897R7]

2025-08-04 Thread Luc Grosheintz
ht be safer to also apply the "Improvements" patch series first, since updating std::dims and std::aligned_accessor is much easier than the reverse. Luc Grosheintz (2): libstdc++: Implement is_sufficiently_aligned [PR120994] libstdc++: Implement aligned_accessor from mdspan [PR120994]

[PATCH v2 7/8] libstdc++: Improve extents::operator==.

2025-08-03 Thread Luc Grosheintz
tible_extents<...>) return false; is no longer needed, because the optimizer correctly handles this case. However, it's retained for clarity/certainty. libstdc++-v3/ChangeLog: * include/std/mdspan (extents::operator==): Replace loop with pack expansion. Signed-off-b

[PATCH v2 8/8] libstdc++: Replace numeric_limit with __int_traits in mdspan.

2025-08-03 Thread Luc Grosheintz
. (mdspan::size): Ditto. * testsuite/23_containers/mdspan/extents/class_mandates_neg.cc: Update test with additional diagnostics. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/std/mdspan | 26 ++- .../mdspan/extents/class_mandates_neg.cc

[PATCH v2 5/8] libstdc++: Improve nearly fully dynamic extents in mdspan.

2025-08-03 Thread Luc Grosheintz
): Add arguments __begin and __end. (__fwd_prods): Relax condition for fully-dynamic extents to cover (dyn, ..., dyn, X). (__rev_partial_prods): Analogous for (X, dyn, ..., dyn). Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/std/mdspan | 11 ++-

[PATCH v2 1/8] libstdc++: Reduce template instantiations in .

2025-08-03 Thread Luc Grosheintz
_zero): New overload. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/std/mdspan | 54 ++--- 1 file changed, 36 insertions(+), 18 deletions(-) diff --git a/libstdc++-v3/include/std/mdspan b/libstdc++-v3/include/std/mdspan index 5e79d4bfb59..7b73df8550e 100644

[PATCH v2 4/8] libstdc++: Improve fully dynamic extents in mdspan.

2025-08-03 Thread Luc Grosheintz
: New constexpr if branch to avoid instantiating __fwd_partial_prods. (__mdspan::__rev_prod): Ditto. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/std/mdspan | 64 +++-- 1 file changed, 54 insertions(+), 10 deletions(-) diff --git a/libstdc++-v3/include/std/mdspan

[PATCH v2 3/8] libstdc++: Improve low-rank layout_{left, right}::stride.

2025-08-03 Thread Luc Grosheintz
omputed product, not a partial product. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/std/mdspan | 32 ++-- 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/libstdc++-v3/include/std/mdspan b/libstdc++-v3/include/std/mdspan index dc1b44e

[PATCH v2 6/8] libstdc++: Reduce indirection in extents::extent.

2025-08-03 Thread Luc Grosheintz
mic): New method. (__mdspan::_ExtentsStorage::_M_extent): Use _S_is_dynamic. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/std/mdspan | 35 +++-- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/libstdc++-v3/include/std/mdspan b/lib

[PATCH v2 2/8] libstdc++: Precompute products of static extents.

2025-08-03 Thread Luc Grosheintz
prod and refactored. include/std/mdspan (__mdspan::__fwd_prod): Compute as the product of pre-computed static static and the product of dynamic extents. (__mdspan::__rev_prod): Ditto. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/std/mdspan | 77 ++

[PATCH v2 0/8] libstdc++: Sequence of improvements to .

2025-08-03 Thread Luc Grosheintz
effectiveness of these changes, likely the stronger argument is presented in each commit: a) each change removes needless complexity, b) before/after examples of generated code show the effectiveness. Luc Grosheintz (8): libstdc++: Reduce template instantiations in . libstdc++: Precompute

Re: [PATCH v1 3/6] libstdc++: Improve low-rank layout_{left, right}::stride.

2025-07-30 Thread Luc Grosheintz
On 7/30/25 11:59, Tomasz Kaminski wrote: On Wed, Jul 30, 2025 at 10:56 AM Luc Grosheintz wrote: On 7/28/25 13:04, Tomasz Kaminski wrote: On Mon, Jul 28, 2025 at 10:24 AM Tomasz Kaminski wrote: On Mon, Jul 28, 2025 at 10:03 AM Luc Grosheintz < luc.groshei...@gmail.com>

Re: [PATCH v1 3/6] libstdc++: Improve low-rank layout_{left, right}::stride.

2025-07-30 Thread Luc Grosheintz
On 7/28/25 13:04, Tomasz Kaminski wrote: On Mon, Jul 28, 2025 at 10:24 AM Tomasz Kaminski wrote: On Mon, Jul 28, 2025 at 10:03 AM Luc Grosheintz wrote: On 7/28/25 08:02, Tomasz Kaminski wrote: On Sun, Jul 27, 2025 at 2:47 PM Luc Grosheintz < luc.groshei...@gmail.com>

Re: [PATCH v1 2/6] libstdc++: Precompute products of static extents.

2025-07-28 Thread Luc Grosheintz
n, Jul 27, 2025 at 2:53 PM Luc Grosheintz wrote: Let E denote an multi-dimensional extent; n the rank of E; r = 0, ..., n; E[i] the i-th extent; and D[k] be the (possibly empty) array of dynamic extents. The two partial products for r = 0, ..., n: \prod_{i = 0}^r E[i] (fwd) \prod_{i

Re: [PATCH v1 5/6] libstdc++: Reduce template instantiations in .

2025-07-28 Thread Luc Grosheintz
On 7/28/25 08:13, Tomasz Kaminski wrote: On Sun, Jul 27, 2025 at 2:57 PM Luc Grosheintz wrote: In mdspan related code involving static extents, often the IndexType is part of the template parameters, even though it's not needed. This commit extracts the parts of _ExtentsStorag

Re: [PATCH v1] libstdc++: Refactor tests for mdspan related accessors.

2025-07-28 Thread Luc Grosheintz
On 7/28/25 10:15, Tomasz Kaminski wrote: On Sun, Jul 27, 2025 at 3:38 PM Luc Grosheintz wrote: Versions 1, 2 and 3 of the patch for adding aligned_accessor had a bug in the constraints that allowed conversion of aligned_accessor a = aligned_accessor{}; and prevented the reverse. The

Re: [PATCH v1 3/6] libstdc++: Improve low-rank layout_{left, right}::stride.

2025-07-28 Thread Luc Grosheintz
e indirection E[i] := D[k[i]] is not needed because k[i] == i. Therefore, since the series already had several commits, I chose to leave it for later. On Mon, Jul 28, 2025 at 8:02 AM Tomasz Kaminski wrote: On Sun, Jul 27, 2025 at 2:47 PM Luc Grosheintz wrote: The methods layout_{left,right}

Re: [PATCH v1 3/6] libstdc++: Improve low-rank layout_{left, right}::stride.

2025-07-28 Thread Luc Grosheintz
On 7/28/25 08:02, Tomasz Kaminski wrote: On Sun, Jul 27, 2025 at 2:47 PM Luc Grosheintz wrote: The methods layout_{left,right}::mapping::stride are defined as \prod_{i = 0}^r E[i] \prod_{i = r+1}^n E[i] This is computed as the product of a pre-comupted static product and the

[PATCH v1] libstdc++: Refactor tests for mdspan related accessors.

2025-07-27 Thread Luc Grosheintz
commit allows passing in two different accessors. Enabling it to be reused more widely. libstdc++-v3/ChangeLog: * testsuite/23_containers/mdspan/accessors/generic.cc: Refactor test_ctor. Signed-off-by: Luc Grosheintz --- .../23_containers/mdspan/accessors/generic.cc | 61

[PATCH v1 5/6] libstdc++: Reduce template instantiations in .

2025-07-27 Thread Luc Grosheintz
(__mdspan::__static_prod): Use NTTP for static extents. (__mdspan::_FwdProd): Ditto. (__mdspan::_RevProd): Ditto. (__mdspan::__contains_zero): New overload for const array&. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/std/mdspan | 70 +---

[PATCH v1 4/6] libstdc++: Improve extents::operator==.

2025-07-27 Thread Luc Grosheintz
tible_extents<...>) return false; is no longer needed, because the optimizer correctly handles this case. However, it's retained for clarity/certainty. libstdc++-v3/ChangeLog: * include/std/mdspan (extents::operator==): Replace loop with pack expansion. Signed-off-b

[PATCH v1 3/6] libstdc++: Improve low-rank layout_{left, right}::stride.

2025-07-27 Thread Luc Grosheintz
x27;t require loading any values. libstdc++-v3/ChangeLog: * include/std/mdspan (layout_left::mapping::stride): Optimize for rank <= 2. (layout_right::mapping::stride): Ditto. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/std/mdspan | 14 -- 1 file cha

  1   2   3   4   >