* [Bug libstdc++/110512] C++20 random access iterators run sequentially with PSTL
2023-07-01 18:00 [Bug libstdc++/110512] New: C++20 random access iterators run sequentially with PSTL gonzalo.gadeschi at gmail dot com
@ 2023-07-01 20:08 ` redi at gcc dot gnu.org
2023-07-01 20:11 ` redi at gcc dot gnu.org
` (9 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: redi at gcc dot gnu.org @ 2023-07-01 20:08 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110512
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
I think this is the correct behaviour according to the standard. We have other
bug reports about C++20 iterators used with STL algos and containers, which
again, are working as required by the standard.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/110512] C++20 random access iterators run sequentially with PSTL
2023-07-01 18:00 [Bug libstdc++/110512] New: C++20 random access iterators run sequentially with PSTL gonzalo.gadeschi at gmail dot com
2023-07-01 20:08 ` [Bug libstdc++/110512] " redi at gcc dot gnu.org
@ 2023-07-01 20:11 ` redi at gcc dot gnu.org
2023-07-02 9:30 ` gonzalo.gadeschi at gmail dot com
` (8 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: redi at gcc dot gnu.org @ 2023-07-01 20:11 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110512
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
See Also| |https://gcc.gnu.org/bugzill
| |a/show_bug.cgi?id=100070
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
See PR 100070. This is basically the same issue, but for PSTL.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/110512] C++20 random access iterators run sequentially with PSTL
2023-07-01 18:00 [Bug libstdc++/110512] New: C++20 random access iterators run sequentially with PSTL gonzalo.gadeschi at gmail dot com
2023-07-01 20:08 ` [Bug libstdc++/110512] " redi at gcc dot gnu.org
2023-07-01 20:11 ` redi at gcc dot gnu.org
@ 2023-07-02 9:30 ` gonzalo.gadeschi at gmail dot com
2023-07-02 10:24 ` redi at gcc dot gnu.org
` (7 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: gonzalo.gadeschi at gmail dot com @ 2023-07-02 9:30 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110512
--- Comment #3 from gnzlbg <gonzalo.gadeschi at gmail dot com> ---
@Jonathan What is missing in https://wg21.link/p2408 to enable the PSTL to use
the iterator concept for the iota_view::iterator such that the PSTL may run the
above in parallel?
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/110512] C++20 random access iterators run sequentially with PSTL
2023-07-01 18:00 [Bug libstdc++/110512] New: C++20 random access iterators run sequentially with PSTL gonzalo.gadeschi at gmail dot com
` (2 preceding siblings ...)
2023-07-02 9:30 ` gonzalo.gadeschi at gmail dot com
@ 2023-07-02 10:24 ` redi at gcc dot gnu.org
2023-07-18 12:29 ` gonzalo.gadeschi at gmail dot com
` (6 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: redi at gcc dot gnu.org @ 2023-07-02 10:24 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110512
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2023-07-02
Ever confirmed|0 |1
Blocks| |106749
--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Oh I forgot we approved that one
Referenced Bugs:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106749
[Bug 106749] Implement C++23 library features
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/110512] C++20 random access iterators run sequentially with PSTL
2023-07-01 18:00 [Bug libstdc++/110512] New: C++20 random access iterators run sequentially with PSTL gonzalo.gadeschi at gmail dot com
` (3 preceding siblings ...)
2023-07-02 10:24 ` redi at gcc dot gnu.org
@ 2023-07-18 12:29 ` gonzalo.gadeschi at gmail dot com
2024-01-09 23:15 ` redi at gcc dot gnu.org
` (5 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: gonzalo.gadeschi at gmail dot com @ 2023-07-18 12:29 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110512
--- Comment #5 from gnzlbg <gonzalo.gadeschi at gmail dot com> ---
The patch for this bug in libc++ has been reviewed:
https://reviews.llvm.org/D154305
I've submitted a patch for the same issue to libstdc++:
https://gcc.gnu.org/pipermail/libstdc++/2023-July/056266.html
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/110512] C++20 random access iterators run sequentially with PSTL
2023-07-01 18:00 [Bug libstdc++/110512] New: C++20 random access iterators run sequentially with PSTL gonzalo.gadeschi at gmail dot com
` (4 preceding siblings ...)
2023-07-18 12:29 ` gonzalo.gadeschi at gmail dot com
@ 2024-01-09 23:15 ` redi at gcc dot gnu.org
2024-01-09 23:38 ` redi at gcc dot gnu.org
` (4 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: redi at gcc dot gnu.org @ 2024-01-09 23:15 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110512
--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> ---
The proposed change will compile very slowly, something like this would be
better:
--- a/libstdc++-v3/include/pstl/execution_impl.h
+++ b/libstdc++-v3/include/pstl/execution_impl.h
@@ -19,13 +19,24 @@ namespace __pstl
{
namespace __internal
{
+#if __glibcxx_concepts
+template<typename _Iter>
+ concept __is_random_access_iter
+ = std::is_base_of_v<std::random_access_iterator_tag,
+ std::__iter_category_t<_Iter>>
+ || std::random_access_iterator<_Iter>;
+template <typename... _IteratorTypes>
+ using __are_random_access_iterators
+ = std::bool_constant<(__is_random_access_iter<_IteratorTypes> && ...)>;
+#else
template <typename _IteratorTag, typename... _IteratorTypes>
using __are_iterators_of = std::conjunction<
std::is_base_of<_IteratorTag, typename
std::iterator_traits<std::decay_t<_IteratorTypes>>::iterator_category>...>;
template <typename... _IteratorTypes>
using __are_random_access_iterators =
__are_iterators_of<std::random_access_iterator_tag, _IteratorTypes...>;
+#endif
struct __serial_backend_tag
{
This uses the libstdc++ helper __iter_category_t but since we no longer need to
sync with upstream, that seems fine.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/110512] C++20 random access iterators run sequentially with PSTL
2023-07-01 18:00 [Bug libstdc++/110512] New: C++20 random access iterators run sequentially with PSTL gonzalo.gadeschi at gmail dot com
` (5 preceding siblings ...)
2024-01-09 23:15 ` redi at gcc dot gnu.org
@ 2024-01-09 23:38 ` redi at gcc dot gnu.org
2024-01-10 10:43 ` redi at gcc dot gnu.org
` (3 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: redi at gcc dot gnu.org @ 2024-01-09 23:38 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110512
--- Comment #7 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Actually, if we don't care about upstream any more, we can improve the
pre-C++20 version too:
template <typename... _IteratorTypes>
using __are_random_access_iterators
= std::__or_<std::is_base_of<std::random_access_iterator_tag,
std::__iter_category_t<_IteratorTypes>>...>;
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/110512] C++20 random access iterators run sequentially with PSTL
2023-07-01 18:00 [Bug libstdc++/110512] New: C++20 random access iterators run sequentially with PSTL gonzalo.gadeschi at gmail dot com
` (6 preceding siblings ...)
2024-01-09 23:38 ` redi at gcc dot gnu.org
@ 2024-01-10 10:43 ` redi at gcc dot gnu.org
2024-01-10 11:06 ` redi at gcc dot gnu.org
` (2 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: redi at gcc dot gnu.org @ 2024-01-10 10:43 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110512
--- Comment #8 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #7)
> = std::__or_<std::is_base_of<std::random_access_iterator_tag,
Oops, that should be __and_ of course.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/110512] C++20 random access iterators run sequentially with PSTL
2023-07-01 18:00 [Bug libstdc++/110512] New: C++20 random access iterators run sequentially with PSTL gonzalo.gadeschi at gmail dot com
` (7 preceding siblings ...)
2024-01-10 10:43 ` redi at gcc dot gnu.org
@ 2024-01-10 11:06 ` redi at gcc dot gnu.org
2024-01-11 22:50 ` redi at gcc dot gnu.org
2024-05-07 7:41 ` rguenth at gcc dot gnu.org
10 siblings, 0 replies; 12+ messages in thread
From: redi at gcc dot gnu.org @ 2024-01-10 11:06 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110512
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Target Milestone|--- |14.0
Assignee|unassigned at gcc dot gnu.org |redi at gcc dot gnu.org
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/110512] C++20 random access iterators run sequentially with PSTL
2023-07-01 18:00 [Bug libstdc++/110512] New: C++20 random access iterators run sequentially with PSTL gonzalo.gadeschi at gmail dot com
` (8 preceding siblings ...)
2024-01-10 11:06 ` redi at gcc dot gnu.org
@ 2024-01-11 22:50 ` redi at gcc dot gnu.org
2024-05-07 7:41 ` rguenth at gcc dot gnu.org
10 siblings, 0 replies; 12+ messages in thread
From: redi at gcc dot gnu.org @ 2024-01-11 22:50 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110512
--- Comment #9 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Patch posted for review:
https://gcc.gnu.org/pipermail/gcc-patches/2024-January/642732.html
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/110512] C++20 random access iterators run sequentially with PSTL
2023-07-01 18:00 [Bug libstdc++/110512] New: C++20 random access iterators run sequentially with PSTL gonzalo.gadeschi at gmail dot com
` (9 preceding siblings ...)
2024-01-11 22:50 ` redi at gcc dot gnu.org
@ 2024-05-07 7:41 ` rguenth at gcc dot gnu.org
10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-05-07 7:41 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110512
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|14.0 |14.2
--- Comment #10 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 14.1 is being released, retargeting bugs to GCC 14.2.
^ permalink raw reply [flat|nested] 12+ messages in thread