On Fri, 27 Nov 2026 at 21:43 +0000, Jonathan Wakely wrote:
This adds support for an OpenMP backend, which means that it's possible
to use libgomp to provide parallelism instead of depending on Intel TBB.

This change is an ABI break for the std::execution::xxx_policy tag
types, which were previously defined in ::__pstl::execution::v1 and are
now defined in std::__onedpl::_V1. The types are still just empty tag
types, so don't change size or layout, but it's technically a breaking
change if code depends on the mangled names of those types. The old
names used the non-reserved name "v1" so we need to change that anyway.
We considered the previous pstl implementation to be experimental, which
would allow us to change these types, but I'm not sure how well we
communicated that to users.

Currently the 26_numerics/pstl/numeric_ops/move_only.cc test FAILs, for
a couple of reasons. The upstream oneDPL code doesn't yet support
move-only types, as reported at
https://github.com/uxlfoundation/oneDPL/issues/1955 but I think the test
might be incorrect anyway and so would need to be updated along the
lines of the P0571R2 proposal.

There is already a 2022.14.0 release, so this will need to be updated
again, but it should be a smaller diff next time.

libstdc++-v3/ChangeLog:

        * include/Makefile.am: Add new PSTL headers.
        * include/Makefile.in: Regenerate.
        * include/pstl/algorithm_fwd.h: Update from upstream.
        * include/pstl/algorithm_impl.h: Likewise.
        * include/pstl/execution_defs.h: Likewise.
        * include/pstl/execution_impl.h: Likewise.
        * include/pstl/glue_algorithm_defs.h: Likewise.
        * include/pstl/glue_algorithm_impl.h: Likewise.
        * include/pstl/glue_execution_defs.h: Likewise.
        * include/pstl/glue_memory_defs.h: Likewise.
        * include/pstl/glue_memory_impl.h: Likewise.
        * include/pstl/glue_numeric_defs.h: Likewise.
        * include/pstl/glue_numeric_impl.h: Likewise.
        * include/pstl/memory_impl.h: Likewise.
        * include/pstl/numeric_fwd.h: Likewise.
        * include/pstl/numeric_impl.h: Likewise.
        * include/pstl/parallel_backend.h: Likewise.
        * include/pstl/parallel_backend_serial.h: Likewise.
        * include/pstl/parallel_backend_tbb.h: Likewise.
        * include/pstl/parallel_backend_utils.h: Likewise.
        * include/pstl/parallel_impl.h: Likewise.
        * include/pstl/pstl_config.h: Likewise.
        * include/pstl/unseq_backend_simd.h: Likewise.
        * include/pstl/utils.h: Likewise.
        * include/std/algorithm: Add using declarations for parallel
        algorithms defined in std::__onedpl.
        * include/std/memory: Likewise.
        * include/std/numeric: Likewise.
        * include/std/execution: Fix incorrect macro in condition.
        * testsuite/25_algorithms/pstl/110512.cc: Adjust reference to
        internal implementation detail.
        * testsuite/25_algorithms/pstl/alg_modifying_operations/replace.cc:
        Likewise.
        * testsuite/util/pstl/test_utils.h: Simplify to not depend on
        internal implementation details.
        * include/pstl/algorithm_ranges_impl.h: New file.
        * include/pstl/functional_impl.h: New file.
        * include/pstl/glue_algorithm_ranges_defs.h: New file.
        * include/pstl/glue_algorithm_ranges_impl.h: New file.
        * include/pstl/glue_memory_ranges_impl.h: New file.
        * include/pstl/glue_numeric_ranges_defs.h: New file.
        * include/pstl/glue_numeric_ranges_impl.h: New file.
        * include/pstl/histogram_binhash_utils.h: New file.
        * include/pstl/histogram_extension_defs.h: New file.
        * include/pstl/histogram_impl.h: New file.
        * include/pstl/iterator_defs.h: New file.
        * include/pstl/iterator_impl.h: New file.
        * include/pstl/memory_fwd.h: New file.
        * include/pstl/memory_ranges_impl.h: New file.
        * include/pstl/omp/parallel_for.h: New file.
        * include/pstl/omp/parallel_for_each.h: New file.
        * include/pstl/omp/parallel_invoke.h: New file.
        * include/pstl/omp/parallel_merge.h: New file.
        * include/pstl/omp/parallel_reduce.h: New file.
        * include/pstl/omp/parallel_scan.h: New file.
        * include/pstl/omp/parallel_stable_partial_sort.h: New file.
        * include/pstl/omp/parallel_stable_sort.h: New file.
        * include/pstl/omp/parallel_transform_reduce.h: New file.
        * include/pstl/omp/parallel_transform_scan.h: New file.
        * include/pstl/omp/util.h: New file.
        * include/pstl/onedpl_config.h: New file.
        * include/pstl/parallel_backend_omp.h: New file.
        * include/pstl/parallel_backend_tasq.h: New file.
        * include/pstl/ranges/nanorange.hpp: New file.
        * include/pstl/ranges/nanorange_ext.h: New file.
        * include/pstl/ranges_defs.h: New file.
        * include/pstl/tuple_impl.h: New file.
        * include/pstl/utils_ranges.h: New file.
        * include/pstl/zip_view_impl.h: New file.
---

The patch is too big for the gcc-patches list, so I'm attaching it
compressed with gzip.

Tested x86_64-linux, using both the TBB and OpenMP backends.


Oops, I forgot to include "v2" in [PATCH v2 01/10] in the Subject.
This replaces the series I sent at the end of stage 1.

Reply via email to