Commit Graph

79 Commits

Author SHA1 Message Date
Nikolas Klauser
9c4717af22 [libc++][PSTL][NFC] Fix the naming in the SIMD backend
Reviewed By: ldionne, #libc

Spies: sstefan1, jplehr, libcxx-commits, miyuki

Differential Revision: https://reviews.llvm.org/D149787
2023-05-04 09:14:56 -07:00
Tom Stellard
603c286334 Bump the trunk major version to 17 2023-01-24 22:57:27 -08:00
Tom Stellard
809855b56f Bump the trunk major version to 16 2022-07-26 21:34:45 -07:00
Nikolas Klauser
64748efc27 [libc++] Use _LIBCPP_ASSERT by default for _PSTL_ASSERTions
Reviewed By: ldionne, #libc

Spies: jwakely, rodgert, libcxx-commits

Differential Revision: https://reviews.llvm.org/D125634
2022-05-20 16:58:21 +02:00
Tom Stellard
a2601c9887 Bump the trunk major version to 15 2022-02-01 23:54:52 -08:00
Ruslan Arutyunyan
d01d91d1ae [libc++][pstl][NFC] Remove usage of std::result_of from Parallel STL
std::result_of creates problems when building with C++20 because it's
deprecated there.

The solution is to remove it and get return value type for a function
with decltype.

Substitute std::invoke_result for std::result_of is unnecessary because
we don't have std::invoke semantics within the function - we don't work
with pointer-to-member's.

Reviewed by: ldionne, MikeDvorskiy, #libc

Differential Revision: https://reviews.llvm.org/D118457
2022-01-31 22:24:51 +03:00
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
Ruslan Arutyunyan
f824bb0e36 [pstl] Fix incorrect usage of std::invoke_result
std::invoke_result takes function object type and arguments separately
(unlike std::result_of) so, std::invoke_result_t<F()> usage is
incorrect.

On the other hand, we don't need std::invoke() semantics here at all. So
just simplifying the code without extra dependency and use trailing
return type as the fix.

Reviewed By: MikeDvorskiy

Differential Revision: https://reviews.llvm.org/D114624
2021-11-26 17:29:08 +03:00
Mikhail Dvorskiy
8f5cb64c71 [pstl] A hot fix for a reduction parallel pattern of OpenMP backend
Reviewed By: nadiasvertex, ldionne

Differential Revision: https://reviews.llvm.org/D112125
2021-10-27 18:52:41 +03:00
Mikhail Dvorskiy
05a4b0d605 [pstl] A hot compilation fix for MacOS, OpenMP backend; + full qualified names for some internal functions
Reviewed By: nadiasvertex, ldionne

Differential Revision: https://reviews.llvm.org/D112528
2021-10-27 13:09:57 +03:00
Mikhail Dvorskiy
6069a6a504 [pstl] Initial implementation of OpenMP backend, on behalf of Christopher Nelson nadiasvertex@gmail.com
Phabricator Review:
https://reviews.llvm.org/D99836

A couple of parallel patterns still remains serial - "Parallel partial sort", and "Parallel transform scan" - there are //TODOs in the code.
2021-10-15 15:36:07 +03:00
Tom Stellard
08c766a731 Bump the trunk major version to 14
and clear the release notes.
2021-07-27 21:58:25 -07:00
Louis Dionne
c4823cc5db [pstl] Workaround more errors in the test suite 2021-05-26 15:45:01 -04:00
Louis Dionne
3b9a1bb1af [pstl] Fix -Wundef errors in the test suite 2021-05-26 15:24:49 -04:00
Mikhail Dvorskiy
2903934faa [pstl] A hot fix for
Commit 5856f202
by Mikhail Dvorskiy, 02/13/2021 08:28 PM
parent f515ca89

Iterator types renaming: ForwardIterator -> RandomAccessIterator; for parallel patterns/bricks

https://reviews.llvm.org/D96266
2021-03-04 17:39:52 +03:00
Louis Dionne
053146a690 [pstl] Fix broken policy_traits and clean up unused code
https://llvm.org/PR47602
https://llvm.org/PR47601

Differential Revision: https://reviews.llvm.org/D97808
2021-03-03 11:32:14 -05:00
Mikhail Dvorskiy
5856f20205 [pstl] Iterator types renaming: ForwardIterator -> RandomAccessIterator; for parallel patterns/bricks
https://reviews.llvm.org/D96266
2021-02-13 20:28:50 +03:00
Tom Stellard
5369517d20 Bump the trunk major version to 13
and clear the release notes.
2021-01-26 19:37:55 -08:00
Thomas Rodgers
2e15f4ac57 [pstl] Replace direct use of assert() with _PSTL_ASSERT
Standard libraries may (libstdc++ in particular) forbid direct use of
assert()/<cassert> in library code.

Differential Revision: https://reviews.llvm.org/D60249
2020-11-02 18:35:54 -05:00
Dvorskiy, Mikhail
0b2e0e80d9 [pstl] Support Threading Building Blocks 2020 (oneTBB) for "tbb" parallel backend.
After the changes the "tbb" parallel backend will work with old TBB versions(TBB_INTERFACE_VERSION <= 12000) and new ones (TBB 2020 and greater)

More about oneTBB:
https://github.com/oneapi-src/oneTBB

Phabricator Review:
https://reviews.llvm.org/D87380
2020-09-14 14:21:54 +03:00
Hans Wennborg
7ab7b979d2 Bump the trunk major version to 12
and clear the release notes.
2020-07-15 12:05:05 +02:00
Louis Dionne
26b0a23084 [pstl] Fix a few errors when running PSTL tests through the libc++ test suite 2020-07-08 14:39:16 -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
Ismail Pazarbasi
f1f37b7f01 [pstl] Added missing double-underscore prefixes to some types
Summary:
Some of the `move_` types were used with leading double-underscores, but
they were declared without `__` prefix.

This patch adds double-underscores to all `move_` types, and their uses.

Reviewers: MikeDvorskiy, ldionne, EricWF, rodgert, #libc

Reviewed By: MikeDvorskiy, ldionne, #libc

Subscribers: dexonsmith, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D78040
2020-04-15 22:06:58 +02:00
Mikhail Dvorskiy
36b8d02c8d [pstl] A hot fix for exclusive_scan (+ lost enable_if in declaration)
It fixes an ambiguity issue in case of a user has a custom policy and
calls a version of exclusive_scan with binary operation.

Differential Revision: https://reviews.llvm.org/D62719
2020-03-17 16:22:24 -04:00
Thomas Rodgers
b4c3a76d8f [pstl] Clean up parameter uglifications
Summary: These were overlooked on an earlier uglification pass.

Differential Revision: https://reviews.llvm.org/D60595
2020-03-09 09:16:14 -04:00
Dvorskiy, Mikhail
e484c1759d [pstl] A cleanup fix for sort parallel algorithm.
When one of sub-ranges has not been move constructed into a raw buffer, we should not call clean up for that sub-range. Instead of store detailed info about raw buffer history, the fix does the cleanup a sub-range after each moving the sub-range back.

https://reviews.llvm.org/D73779
2020-03-05 11:27:32 +03:00
Hans Wennborg
5852475e2c Bump the trunk major version to 11
and clear the release notes.
2020-01-15 13:38:01 +01:00
Louis Dionne
1b6d6e595b [pstl] Allow customizing whether per-TU insulation is provided
Like we do in libc++, PSTL needs the ability to constrain
ABI-unstable symbols to each translation unit. This is OFF by
default (like for libc++), because most people don't care about
this and there is a cost associated to enabling the option (code
bloat because templates are not deduped across TUs).

I'm using '#pragma clang attribute push' to avoid marking each
declaration with an attribute, which quickly becomes difficult
to maintain.

llvm-svn: 368684
2019-08-13 12:49:00 +00:00
Louis Dionne
09a7a627af [NFC][pstl] Run clang-format
We really need to do that consistently when applying patches.

llvm-svn: 368312
2019-08-08 17:10:45 +00:00
Louis Dionne
2153607379 [pstl] Remove stray semicolon
llvm-svn: 368302
2019-08-08 14:49:28 +00:00
Louis Dionne
a8a436ef95 [pstl] Error out when the backend is left unspecified
Instead of silently falling back to the serial backend, it's better if
we fail loudly when the parallel backend is left unspecified. Since we
have a __pstl_config_site header, a backend should always be specified.

llvm-svn: 368285
2019-08-08 12:43:13 +00:00
Louis Dionne
bf4808439f [pstl] Add a __pstl_config_site header to record the CMake configuration
This commit adds a __pstl_config_site header that contains the value of
macros specified at CMake configuration time. It works similarly to
libc++'s __config_site header, except we always include it as a separate
file instead of concatenating it to the main configuration header.

It is necessary to thread the includes for that header into libc++'s
lit configuration, otherwise we'd be requiring an installation step
prior to running the test suite.

llvm-svn: 368284
2019-08-08 12:43:04 +00:00
Louis Dionne
956892433f [pstl][libc++] Provide uglified header names for interface headers
For the few (currently four) headers that make up the PSTL's interface
to other Standard Libraries, provide a stable uglified header file that
can be included by those Standard Libraries.

We can then more easily change the internal organization of the PSTL
without having to change the integration with Standard Libraries.

llvm-svn: 368088
2019-08-06 21:11:24 +00:00
Louis Dionne
23f073100d [NFC][pstl] Remove stray semi-colon
llvm-svn: 367928
2019-08-05 21:20:42 +00:00
Eric Fiselier
4ea8ed4135 [pstl] Fully qualify pstl names.
Previously the code used "using namespace __pstl;" at block
scope to introduce these names. This could cause conflicts with
names defined by the standard library. So we should fully qualify
them instead.

llvm-svn: 367468
2019-07-31 19:14:16 +00: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
Hans Wennborg
8f5b44aead Bump the trunk version to 10.0.0svn
and clear the release notes.

llvm-svn: 366427
2019-07-18 11:51:05 +00:00
Louis Dionne
3559fcd114 [pstl] Use std::transform_reduce instead of hand-rolled implementation
llvm-svn: 366233
2019-07-16 17:29:09 +00:00
Louis Dionne
c26e27d802 [NFC] Fix -Wreorder warning in TBB backend
llvm-svn: 366232
2019-07-16 17:29:03 +00:00
Louis Dionne
58864fad39 [pstl] Fix compilation with TBB backend
Some types were not using the right namespace qualification.

llvm-svn: 366208
2019-07-16 13:45:10 +00:00
Louis Dionne
c862ea27b7 [NFC][pstl] Remove unused utility code
llvm-svn: 365346
2019-07-08 16:35:49 +00:00
Louis Dionne
b152f9f392 [pstl] Use a different namespace for each backend
Also, use a single point of customization to set what namespace __par_backend
"points to", which provides a better separation of concerns.

llvm-svn: 365337
2019-07-08 16:05:00 +00:00
Louis Dionne
766accd364 [pstl] Add missing includes
llvm-svn: 365218
2019-07-05 16:05:26 +00:00
Louis Dionne
989cad2476 [pstl] Use utilities from <functional> instead of reinventing the wheel
llvm-svn: 365158
2019-07-04 20:00:39 +00:00
Louis Dionne
d9b7b2d5f7 [NFC][pstl] Do not name each header file in the leading comment
With the renaming that will happen, it's just a pain to maintain the
right names.

llvm-svn: 365156
2019-07-04 19:39:29 +00:00
Louis Dionne
0ca6d390ba [NFC][pstl] Run clang-format
llvm-svn: 365152
2019-07-04 19:04:28 +00:00
Louis Dionne
55227a7b4d [pstl] Make sure we include the pstl_config header in the glue headers
llvm-svn: 365150
2019-07-04 18:19:20 +00:00
Louis Dionne
04c5bc989a [pstl] Default to the serial backend when unspecified
This is a stopgap measure to make it easier to integrate the PSTL into
libc++. In the future, we should have a system similar to what libc++
does, where we specify settings at configuration time and generate a
__config_site header that is part of the PSTL.

llvm-svn: 363958
2019-06-20 17:56:51 +00:00
Louis Dionne
3491119f9b [pstl] Remove warnings in tests and headers
Mostly unused parameter, unused local typedefs and shadowed declarations.
This massaging it necessary if we want to be able to run the tests under
the libc++ lit configuration.

llvm-svn: 363872
2019-06-19 20:15:50 +00:00