Commit Graph

11 Commits

Author SHA1 Message Date
Ruslan Arutyunyan 843c12d6a0 [libc++][pstl] Implement tag dispatching mechanism for Parallel STL
Implement the mechanism that simplifies the execution policy/iterator
category dispatching and allows to implement customizations for
the parallel algorithms with adding custom tags

Reviewed By: rodgert, MikeDvorskiy

Differential Revision: https://reviews.llvm.org/D104492
2022-01-28 04:09:51 +03:00
Louis Dionne 3b9a1bb1af [pstl] Fix -Wundef errors in the test suite 2021-05-26 15:24:49 -04:00
Dvorskiy, Mikhail 5b0502dff5 [pstl] A fix for move placement-new (and destroy) allocated objects from raw memory.
https://reviews.llvm.org/D74123

The fix affects follow algorithms:
remove_if, unique, rotate, inplace_merge, partial_sort_copy, set_union, set_intersection, set_difference, set_symmetric_difference.

For "is_trivial" types there are no problems with "creating objects/clean-up"
For non-trivial types the algo results are also correct, but possible incorrect copying/moving "operator=" calls "by raw memory" within one of mentioned algo or incorrect destructor calls in the end of algo.
2020-05-18 17:00:13 +03:00
Louis Dionne 01963cec9b [NFC][pstl] Run clang-format on the sources, including the tests
llvm-svn: 366492
2019-07-18 20:22:28 +00:00
Louis Dionne 050b804b13 [pstl] Disable workarounds for broken ICC versions when using Clang
llvm-svn: 363726
2019-06-18 19:48:52 +00:00
Louis Dionne 5c4c44310a [pstl] Remove various warnings in the pstl headers and tests
- unused parameter warnings
- don't use single-letter template parameter names, like we do in libc++
- sign-comparison warnings
- unused variables in the tests
- unused local typedefs in the tests
- the use of #include_next
- field reordering in the tests
- unused lambda captures

Note that the rationale for why the static_casts to unsigned are OK is
that last - first must always be non-negative, since [first, last) is
a valid range.

llvm-svn: 362148
2019-05-30 20:46:31 +00:00
Louis Dionne 65a422c81c [pstl] Make the default backend be the serial backend and always provide parallel policies
Summary:
Before this change, the default backend was TBB but one could disable
anything related to TBB by removing the parallel policies. This change
uses the serial backend by default and removes the ability to disable
parallel policies, which is not useful anymore.

Reviewers: rodgert, MikeDvorskiy

Subscribers: mgorny, jkorous, dexonsmith, jdoerfert, libcxx-commits

Differential Revision: https://reviews.llvm.org/D59792

llvm-svn: 359134
2019-04-24 20:12:36 +00:00
Louis Dionne 4d88b17b3f [pstl] Remove the stdlib headers from the PSTL and move them to the tests
Summary:
PSTL should not provide those headers since they belong to the standard
library. Instead, we define a dummy standard library in the tests that
provides those headers.

Reviewers: rodgert, MikeDvorskiy

Subscribers: mgorny, jkorous, dexonsmith, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D60535

llvm-svn: 358497
2019-04-16 14:38:08 +00:00
Louis Dionne 3dee12e4a5 [pstl] Move to single underscore-capital for macros and include guards
Summary: Per the LLVM convention.

Reviewers: rodgert

Subscribers: jkorous, dexonsmith, jdoerfert, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D60521

llvm-svn: 358131
2019-04-10 19:51:40 +00:00
Louis Dionne 0408a7892e [pstl] Uglify internal names of the library
llvm-svn: 357203
2019-03-28 19:10:32 +00:00
Louis Dionne 3b62047b8b Restructure test suite to follow libc++ standard layout
Summary: Subsumes changes requested in https://reviews.llvm.org/D59110

Reviewers: EricWF, ldionne

Subscribers: mgorny, krytarowski, jfb, jdoerfert, libcxx-commits

Differential Revision: https://reviews.llvm.org/D59856

llvm-svn: 357124
2019-03-27 21:28:24 +00:00