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
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
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
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
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/
/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
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
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
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
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
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
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,
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
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:
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
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
.
(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
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::_
/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
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
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
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
/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
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
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
.
(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
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
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
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.
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
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
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.
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
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
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
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::_
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)
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
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
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
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
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 |
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_
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
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
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
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
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
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
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
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 ++
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
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
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
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
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
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
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
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 +++
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
/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
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
): 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
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
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
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
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
): 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
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
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
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
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
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:
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
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
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
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:
/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
/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
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]
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
.
(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
): 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 ++-
_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
: 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
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
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
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 ++
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
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>
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>
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
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
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
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}
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
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
(__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 +---
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
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 - 100 of 352 matches
Mail list logo