mirror-llvm-project/libcxx/include
Michael G. Kazakov 150f33ce28
[libc++][pstl] Implementation of a parallel std::mismatch() based on __pstl::__parallel_find() (#209291)
This PR adds a parallel version of `std::mismatch` as one of the backend
operations.
It also provides an implementation based on `__pstl::__parallel_find()`
which does the heavy lifting.
`libdispatch` and `std_thread` backends expose this implementation under
their backend tags, while the `serial` backend redirects the calls to
the serial `std::mismatch`.

4 flavours of the function are exposed: 3-legged, 3-legged with
predicate, 4-legged, 4-legged with predicate.
3-legged flavours are implemented in the `default` (`composition`)
backend by redirecting the call to the 4-legged flavours.

Included tests check that:

- Semantics of the iterator-only functions is correct.
- Semantics of the predicated functions is correct.
- Custom types are supported by the implementation.
- The functions correctly SFINAE out when the first argument is not an
execution policy.
- The `nodiscard` policy is followed.
- The `noexcept` policy is followed.
- `static_assert` verifies iterators' categories.

Part of #99938.
2026-07-26 22:51:39 +08:00
..
__algorithm [libc++][pstl] Implementation of a parallel std::mismatch() based on __pstl::__parallel_find() (#209291) 2026-07-26 22:51:39 +08:00
__atomic [libc++] Implement P0493R5: Atomic minimum/maximum (#180333) 2026-07-21 19:41:49 +08:00
__bit [libc++] Consistently use version guards outside namespace macros (#181136) 2026-06-29 14:44:44 +02:00
__charconv [libc++] Consistently use version guards outside namespace macros (#181136) 2026-06-29 14:44:44 +02:00
__chrono [libc++][chrono] Implement LWG 4481: Disallow chrono::duration<const T, P> (#207558) 2026-07-08 16:59:53 +08:00
__compare [libc++] Consistently use version guards outside namespace macros (#181136) 2026-06-29 14:44:44 +02:00
__concepts [libc++] Consistently use version guards outside namespace macros (#181136) 2026-06-29 14:44:44 +02:00
__condition_variable [libc++] Consistently use version guards outside namespace macros (#181136) 2026-06-29 14:44:44 +02:00
__configuration [libc++] Don't add #pragma clang attribute with GCC (#206989) 2026-07-22 17:46:13 +02:00
__coroutine
__cstddef [libc++] Consistently use version guards outside namespace macros (#181136) 2026-06-29 14:44:44 +02:00
__cxx03 [libc++] Rename the macro for the LLVM 18 ABI tag used in ranges (#208464) 2026-07-10 10:33:36 +02:00
__debug_utils [libc++] Honor __SANITIZER_DISABLE_CONTAINER_OVERFLOW__ in libc++ (#168955) 2026-01-27 16:04:03 +00:00
__exception [libc++] Add MSVC's implementation of exception_ptr for Windows (#94977) 2026-07-10 11:26:24 -07:00
__expected [libc++] Resolve LWG4366: Heterogeneous comparison of expected may be ill-formed (#185342) 2026-07-01 14:49:31 +08:00
__filesystem [libc++] Introduce implicit and explicit ABI annotations (#193045) 2026-05-08 12:21:31 +02:00
__flat_map [libc++][NFC] Remove unused __key_equiv from flat_multimap and flat_multiset (#175612) 2026-01-13 10:37:24 +01:00
__flat_set [libc++][NFC] Remove unused __key_equiv from flat_multimap and flat_multiset (#175612) 2026-01-13 10:37:24 +01:00
__format [libc++] Consistently use version guards outside namespace macros (#181136) 2026-06-29 14:44:44 +02:00
__functional [libc++] Implement std::function_ref (#186692) 2026-07-25 17:44:55 +01:00
__fwd [libc++] Consistently use version guards outside namespace macros (#181136) 2026-06-29 14:44:44 +02:00
__ios [libc++] Revert undesired [[nodiscard]] added to conversion functions (#173658) 2026-01-08 13:32:11 +08:00
__iterator [libc++][NFC] Remove unused includes from <__iterator/segmented_iterator.h> (#209105) 2026-07-13 14:56:38 +02:00
__locale_dir [libcxx][NFC] Move guards outside namespace (#208089) 2026-07-08 14:06:18 +00:00
__math [libc++] Consistently use version guards outside namespace macros (#181136) 2026-06-29 14:44:44 +02:00
__mdspan [libc++] Backport P3029R1 Better mdspan's CTAD to C++20/23 (#208132) 2026-07-13 22:38:17 +08:00
__memory [libc++][unique_ptr] Implement LWG 4144: Disallow unique_ptr<T&, D> (#209018) 2026-07-13 21:39:06 +03:00
__memory_resource [libc++] Introduce implicit and explicit ABI annotations (#193045) 2026-05-08 12:21:31 +02:00
__mutex [libc++][ThreadSafety] Add thread safety annotations for variadic std::scoped_lock (#204462) 2026-07-07 17:52:56 +02:00
__new [libc++] Introduce implicit and explicit ABI annotations (#193045) 2026-05-08 12:21:31 +02:00
__numeric [libc++][pstl] Default implementation of parallel std::adjacent_difference (#207585) 2026-07-21 07:42:26 -04:00
__ostream [libc++] Introduce implicit and explicit ABI annotations (#193045) 2026-05-08 12:21:31 +02:00
__pstl [libc++][pstl] Implementation of a parallel std::mismatch() based on __pstl::__parallel_find() (#209291) 2026-07-26 22:51:39 +08:00
__random [libc++] Add an ABI flag to optimize mersenne_twister_engine (#206423) 2026-07-05 19:40:43 +02:00
__ranges [libc++][ranges][NFC] Format lazy_split_view (#210644) 2026-07-20 12:23:06 +03:00
__stop_token [libc++] Consistently use version guards outside namespace macros (#181136) 2026-06-29 14:44:44 +02:00
__string
__support [libc++] Port The OpenBSD localization to the new locale API (#194317) 2026-05-19 12:41:42 +02:00
__system_error [libc++] Introduce implicit and explicit ABI annotations (#193045) 2026-05-08 12:21:31 +02:00
__thread [libc++] Add missing include to thread.h (#208740) 2026-07-13 10:53:07 -04:00
__tuple [libc++] Consistently use version guards outside namespace macros (#181136) 2026-06-29 14:44:44 +02:00
__type_traits [libc++] Implement std::function_ref (#186692) 2026-07-25 17:44:55 +01:00
__utility [libc++][cmp][NFC] Fix: Empty namespaces should be avoided (#210624) 2026-07-20 05:47:58 +03:00
__variant [libc++] Consistently use version guards outside namespace macros (#181136) 2026-06-29 14:44:44 +02:00
__vector [libc++] Don't require complete types in vector<T>::empty() (#210754) 2026-07-21 10:21:27 -04:00
experimental [libc++] Consistently use version guards outside namespace macros (#181136) 2026-06-29 14:44:44 +02:00
ext [libc++] Drop transitive includes by default (#195509) 2026-06-05 09:45:49 +02:00
__assert [libc++] Remove full header path from assertion messages (#190060) 2026-04-25 07:01:30 -04:00
__bit_reference [libc++] Treat negative counts in copy_n & friends as no-ops (#207086) 2026-07-15 13:24:03 -04:00
__config Bump version to 24.0.0git (#209473) 2026-07-14 09:21:03 -04:00
__config_site.in [libc++] Add CMake plumbing for _LIBCPP_HAS_THREAD_API_C11 mode. (#188414) 2026-03-25 10:51:31 -07:00
__hash_table [libc++] Fix exception safety of __hash_table::__copy_construct (avoid memory leak) (#201452) 2026-06-10 09:05:56 +02:00
__locale [libc++] Don't make libc++ headers system headers in the modulemap (#205509) 2026-07-01 14:52:50 +02:00
__log_hardening_failure [libc++] Introduce implicit and explicit ABI annotations (#193045) 2026-05-08 12:21:31 +02:00
__mbstate_t.h [libc++] Allow building libc++ using llvm-libc without locale support (#187603) 2026-04-29 13:06:14 -07:00
__node_handle [libc++] Make <set> std::set constexpr as part of P3372R3 (#167241) 2026-07-01 07:20:25 +08:00
__split_buffer [libc++] Add a size-based representation for vector in the unstable ABI (#155330) 2026-07-01 15:12:36 -04:00
__std_mbstate_t.h
__tree [libc++] Make <set> std::set constexpr as part of P3372R3 (#167241) 2026-07-01 07:20:25 +08:00
__undef_macros
__verbose_abort [libc++] Introduce implicit and explicit ABI annotations (#193045) 2026-05-08 12:21:31 +02:00
__verbose_trap [libc++] Consistently use version guards outside namespace macros (#181136) 2026-06-29 14:44:44 +02:00
algorithm [libc++] Drop transitive includes by default (#195509) 2026-06-05 09:45:49 +02:00
any [libc++] Consistently use version guards outside namespace macros (#181136) 2026-06-29 14:44:44 +02:00
array [libc++] Drop transitive includes by default (#195509) 2026-06-05 09:45:49 +02:00
atomic [libc++] Implement P0493R5: Atomic minimum/maximum (#180333) 2026-07-21 19:41:49 +08:00
barrier [libc++] Drop transitive includes by default (#195509) 2026-06-05 09:45:49 +02:00
bit [libc++] Drop transitive includes by default (#195509) 2026-06-05 09:45:49 +02:00
bitset [libc++] Drop transitive includes by default (#195509) 2026-06-05 09:45:49 +02:00
cassert
ccomplex
cctype [libc++] Remove libc++'s own ctype.h (#194615) 2026-05-04 08:28:24 +02:00
cerrno
cfenv [libc++] Remove libc++'s own fenv.h (#194629) 2026-05-04 08:28:45 +02:00
cfloat [libc++] Remove libc++'s <float.h> (#175849) 2026-01-19 15:12:40 -05:00
charconv [libc++] Consistently use version guards outside namespace macros (#181136) 2026-06-29 14:44:44 +02:00
chrono [libc++][chrono] Implement LWG 4481: Disallow chrono::duration<const T, P> (#207558) 2026-07-08 16:59:53 +08:00
cinttypes [libc++] Remove libc++'s own inttypes.h (#193716) 2026-04-30 11:00:29 +02:00
ciso646
climits
clocale
CMakeLists.txt [libc++][pstl] Implementation of a parallel std::mismatch() based on __pstl::__parallel_find() (#209291) 2026-07-26 22:51:39 +08:00
cmath [libc++][math] Add constexpr to std::fpclassify (#210993) 2026-07-26 14:30:25 +08:00
codecvt [libc++] Drop transitive includes by default (#195509) 2026-06-05 09:45:49 +02:00
compare [libc++] Drop transitive includes by default (#195509) 2026-06-05 09:45:49 +02:00
complex [libc++] Drop transitive includes by default (#195509) 2026-06-05 09:45:49 +02:00
complex.h
concepts [libc++] Drop transitive includes by default (#195509) 2026-06-05 09:45:49 +02:00
condition_variable [libc++] Remove <atomic> includes from <stop_token> (#201710) 2026-06-08 09:48:22 +02:00
coroutine [libc++] Drop transitive includes by default (#195509) 2026-06-05 09:45:49 +02:00
csetjmp
csignal
cstdalign
cstdarg
cstdbool
cstddef
cstdint
cstdio
cstdlib
cstring
ctgmath
ctime
cuchar [libc++] Consistently use version guards outside namespace macros (#181136) 2026-06-29 14:44:44 +02:00
cwchar [libc++] Drop transitive includes by default (#195509) 2026-06-05 09:45:49 +02:00
cwctype
deque [libc++] Enable missing allocator constructors in C++11 (#204845) 2026-07-10 07:46:26 +08:00
errno.h
exception [libc++] Drop transitive includes by default (#195509) 2026-06-05 09:45:49 +02:00
execution [libc++] Drop transitive includes by default (#195509) 2026-06-05 09:45:49 +02:00
expected
filesystem [libc++] Drop transitive includes by default (#195509) 2026-06-05 09:45:49 +02:00
flat_map
flat_set
format [libc++] Drop transitive includes by default (#195509) 2026-06-05 09:45:49 +02:00
forward_list [libc++] Enable missing allocator constructors in C++11 (#204845) 2026-07-10 07:46:26 +08:00
fstream [libc++] Optimize standard streams with sync_with_stdio(false) (#209161) 2026-07-23 09:46:47 +02:00
functional [libc++] Implement std::function_ref (#186692) 2026-07-25 17:44:55 +01:00
future [libc++] Use _LIBCPP_KEEP_TRANSITIVE_INCLUDES_LLVM23 in <future> (#207668) 2026-07-06 12:36:19 +02:00
initializer_list [libc++] Consistently use version guards outside namespace macros (#181136) 2026-06-29 14:44:44 +02:00
iomanip [libc++] Drop transitive includes by default (#195509) 2026-06-05 09:45:49 +02:00
ios [libc++] Drop transitive includes by default (#195509) 2026-06-05 09:45:49 +02:00
iosfwd
iostream
istream [libc++] Drop transitive includes by default (#195509) 2026-06-05 09:45:49 +02:00
iterator [libc++] Drop transitive includes by default (#195509) 2026-06-05 09:45:49 +02:00
latch [libc++] Drop transitive includes by default (#195509) 2026-06-05 09:45:49 +02:00
limits [libc++] Drop transitive includes by default (#195509) 2026-06-05 09:45:49 +02:00
list [libc++] Enable missing allocator constructors in C++11 (#204845) 2026-07-10 07:46:26 +08:00
locale [libc++] Drop transitive includes by default (#195509) 2026-06-05 09:45:49 +02:00
map [libc++] Enable missing allocator constructors in C++11 (#204845) 2026-07-10 07:46:26 +08:00
math.h [libc++][math] Add constexpr to std::fpclassify (#210993) 2026-07-26 14:30:25 +08:00
mdspan [libc++] Backport P3029R1 Better mdspan's CTAD to C++20/23 (#208132) 2026-07-13 22:38:17 +08:00
memory [libc++] Drop transitive includes by default (#195509) 2026-06-05 09:45:49 +02:00
memory_resource [libc++] Drop transitive includes by default (#195509) 2026-06-05 09:45:49 +02:00
module.modulemap.in [libc++][pstl] Implementation of a parallel std::mismatch() based on __pstl::__parallel_find() (#209291) 2026-07-26 22:51:39 +08:00
mutex [libc++][ThreadSafety] Add thread safety annotations for variadic std::scoped_lock (#204462) 2026-07-07 17:52:56 +02:00
new [libc++] Drop transitive includes by default (#195509) 2026-06-05 09:45:49 +02:00
numbers [libc++] Drop transitive includes by default (#195509) 2026-06-05 09:45:49 +02:00
numeric [libc++] Drop transitive includes by default (#195509) 2026-06-05 09:45:49 +02:00
optional [libc++] Strengthen optional value constructor noexcept (#202765) 2026-06-16 09:06:36 -07:00
ostream [libc++] Drop transitive includes by default (#195509) 2026-06-05 09:45:49 +02:00
print [libc++] Consistently use version guards outside namespace macros (#181136) 2026-06-29 14:44:44 +02:00
queue [libc++] Drop transitive includes by default (#195509) 2026-06-05 09:45:49 +02:00
random [libc++] Drop transitive includes by default (#195509) 2026-06-05 09:45:49 +02:00
ranges [libc++] Drop transitive includes by default (#195509) 2026-06-05 09:45:49 +02:00
ratio [libc++] Drop transitive includes by default (#195509) 2026-06-05 09:45:49 +02:00
regex [libc++] Drop transitive includes by default (#195509) 2026-06-05 09:45:49 +02:00
scoped_allocator [libc++] Consistently use version guards outside namespace macros (#181136) 2026-06-29 14:44:44 +02:00
semaphore [libc++] Drop transitive includes by default (#195509) 2026-06-05 09:45:49 +02:00
set [libc++] Enable missing allocator constructors in C++11 (#204845) 2026-07-10 07:46:26 +08:00
shared_mutex [libc++][ThreadSafety] Add thread safety annotations for variadic std::scoped_lock (#204462) 2026-07-07 17:52:56 +02:00
source_location [libc++] Consistently use version guards outside namespace macros (#181136) 2026-06-29 14:44:44 +02:00
span [libc++] Backport P3029R1 Better mdspan's CTAD to C++20/23 (#208132) 2026-07-13 22:38:17 +08:00
sstream [libc++] Drop transitive includes by default (#195509) 2026-06-05 09:45:49 +02:00
stack [libc++] Drop transitive includes by default (#195509) 2026-06-05 09:45:49 +02:00
stdatomic.h [libc++] "Always" include_next for non C++ path in stdatomic.h (#178463) 2026-01-30 10:01:51 -05:00
stddef.h
stdexcept [libc++] Drop transitive includes by default (#195509) 2026-06-05 09:45:49 +02:00
stdio.h
stdlib.h
stop_token [libc++] Remove <atomic> includes from <stop_token> (#201710) 2026-06-08 09:48:22 +02:00
streambuf [libc++] Drop transitive includes by default (#195509) 2026-06-05 09:45:49 +02:00
string [libc++] Base string's alignment on __STDCPP_DEFAULT_NEW_ALIGNMENT__ (#171785) 2026-07-03 07:11:04 +02:00
string.h [libc++] Add a missing include in string.h (#135134) 2026-06-19 10:20:30 -04:00
string_view [libc++] Drop transitive includes by default (#195509) 2026-06-05 09:45:49 +02:00
strstream [libc++] Introduce implicit and explicit ABI annotations (#193045) 2026-05-08 12:21:31 +02:00
syncstream [libc++] Don't make libc++ headers system headers in the modulemap (#205509) 2026-07-01 14:52:50 +02:00
system_error [libc++][NFC] Fix synopsis comment for error_condition::message() (#210724) 2026-07-21 07:22:59 -04:00
text_encoding [libc++] Implement P1885R12: <text_encoding> (#141312) 2026-06-25 07:46:11 +08:00
tgmath.h
thread [libc++] Use std::to_chars to format thread::id and canonicalize the representation across platforms (#181624) 2026-07-05 19:36:39 +02:00
tuple [libc++] Consistently use version guards outside namespace macros (#181136) 2026-06-29 14:44:44 +02:00
type_traits
typeindex [libc++] Drop transitive includes by default (#195509) 2026-06-05 09:45:49 +02:00
typeinfo [libc++] Drop transitive includes by default (#195509) 2026-06-05 09:45:49 +02:00
uchar.h
unordered_map [libc++] Enable missing allocator constructors in C++11 (#204845) 2026-07-10 07:46:26 +08:00
unordered_set [libc++] Enable missing allocator constructors in C++11 (#204845) 2026-07-10 07:46:26 +08:00
utility [libc++] Implement P4206R0 Revert string support in std::constant_wrapper (#203338) 2026-06-23 01:17:53 +08:00
valarray [libc++] Drop transitive includes by default (#195509) 2026-06-05 09:45:49 +02:00
variant [libc++] Consistently use version guards outside namespace macros (#181136) 2026-06-29 14:44:44 +02:00
vector [libc++] Enable missing allocator constructors in C++11 (#204845) 2026-07-10 07:46:26 +08:00
version [libc++] Implement std::function_ref (#186692) 2026-07-25 17:44:55 +01:00
wchar.h [libc++] Assume that <wchar.h> in llvm-libc has const-overloads. (#206805) 2026-07-01 08:09:53 -07:00
wctype.h