[libcxx-commits] [PATCH] D60480: [WIP] integration of pstl into libc++

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Apr 9 12:32:21 PDT 2019


ldionne marked 2 inline comments as done.
ldionne added a comment.

The purpose of this review is to expose how I plan to integrate the parallel STL into libc++, and to discuss some changes that are desirable in pstl for this to be possible. This is a work in progress, obviously, and it's meant as a concrete support for having discussions.

Concrete changes I think we need to make in pstl:

- Rename all the files to double underscores.
- Move everything that's meant to be included directly by standard library implementations out of `internal/`, since that doesn't make sense. It's not internal, it's the API of PSTL (which is meant to be consumed by standard libraries).
- We could provide the glue definitions and declarations as `.ipp` files that are meant to be included by standard libraries as-is. The Standard library could then define stuff like the namespace in which those declarations are injected, etc.

I also suggest:

- Removing the `<algorithm>` & friends headers from PSTL itself. Those don't belong there, they belong with the standard library.

WDYT @rodgert ?



================
Comment at: libcxx/include/algorithm:5790
+// otherwise just pull in forward declarations.
+#include <pstl/internal/pstl_config.h>
+#if defined(__PSTL_EXECUTION_POLICIES_DEFINED)
----------------
The same pattern is repeated in other files. Basically, we check whether `<execution>` has been included, and if so, then we provide all the definitions. Otherwise, we just provide forward declarations to avoid the compile-time overhead if you just `#include <algorithm>` but don't care about the parallel algorithms.



================
Comment at: libcxx/lib/CMakeLists.txt:125
 
+find_package(ParallelSTL)
+if (NOT TARGET pstl::ParallelSTL)
----------------
The basic idea is that when `ParallelSTL` is installed on the system (or if it's in the tree), we just find it with `find_package` and then declare a dependency on it and everything should work.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D60480/new/

https://reviews.llvm.org/D60480





More information about the libcxx-commits mailing list