diff --git a/libcxx/utils/ci/buildkite-pipeline.yml b/libcxx/utils/ci/buildkite-pipeline.yml --- a/libcxx/utils/ci/buildkite-pipeline.yml +++ b/libcxx/utils/ci/buildkite-pipeline.yml @@ -521,6 +521,20 @@ limit: 2 timeout_in_minutes: 120 + # TODO: When this is ready, this should become the default and we can remove this job. + - label: "With PSTL support" + command: "libcxx/utils/ci/run-buildbot with-pstl" + artifact_paths: + - "**/test-results.xml" + agents: + queue: "libcxx-builders" + os: "linux" + retry: + automatic: + - exit_status: -1 # Agent was lost + limit: 2 + timeout_in_minutes: 120 + # Other non-testing CI jobs - label: "Benchmarks" command: "libcxx/utils/ci/run-buildbot benchmarks" diff --git a/libcxx/utils/ci/run-buildbot b/libcxx/utils/ci/run-buildbot --- a/libcxx/utils/ci/run-buildbot +++ b/libcxx/utils/ci/run-buildbot @@ -90,7 +90,7 @@ function generate-cmake() { generate-cmake-base \ - -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \ + -DLLVM_ENABLE_RUNTIMES="pstl;libcxx;libcxxabi;libunwind" \ -DLIBCXX_CXX_ABI=libcxxabi \ "${@}" } @@ -398,6 +398,17 @@ -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" check-runtimes ;; +with-pstl) + export CC=clang + export CXX=clang++ + clean + generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx20.cmake" \ + -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \ + -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" \ + -DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE \ + -DLIBCXX_ENABLE_PARALLEL_ALGORITHMS=ON + check-runtimes +;; generic-no-experimental) clean generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-experimental.cmake" \ diff --git a/pstl/include/pstl/internal/algorithm_impl.h b/pstl/include/pstl/internal/algorithm_impl.h --- a/pstl/include/pstl/internal/algorithm_impl.h +++ b/pstl/include/pstl/internal/algorithm_impl.h @@ -26,6 +26,9 @@ _PSTL_HIDE_FROM_ABI_PUSH +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + namespace __pstl { namespace __internal @@ -3814,6 +3817,8 @@ } // namespace __internal } // namespace __pstl +_LIBCPP_POP_MACROS + _PSTL_HIDE_FROM_ABI_POP #endif /* _PSTL_ALGORITHM_IMPL_H */ diff --git a/pstl/include/pstl/internal/execution_defs.h b/pstl/include/pstl/internal/execution_defs.h --- a/pstl/include/pstl/internal/execution_defs.h +++ b/pstl/include/pstl/internal/execution_defs.h @@ -49,7 +49,7 @@ constexpr unsequenced_policy unseq{}; // 2.3, Execution policy type trait -template +template struct is_execution_policy : std::false_type { }; @@ -72,8 +72,8 @@ }; #if defined(_PSTL_CPP14_VARIABLE_TEMPLATES_PRESENT) -template -constexpr bool is_execution_policy_v = __pstl::execution::is_execution_policy::value; +template +constexpr bool is_execution_policy_v = __pstl::execution::is_execution_policy<_Tp>::value; #endif } // namespace v1 @@ -81,10 +81,10 @@ namespace __internal { -template +template using __enable_if_execution_policy = - typename std::enable_if<__pstl::execution::is_execution_policy::type>::value, - T>::type; + typename std::enable_if<__pstl::execution::is_execution_policy::type>::value, + _Tp>::type; template struct __serial_tag; diff --git a/pstl/include/pstl/internal/pstl_config.h b/pstl/include/pstl/internal/pstl_config.h --- a/pstl/include/pstl/internal/pstl_config.h +++ b/pstl/include/pstl/internal/pstl_config.h @@ -28,8 +28,8 @@ #endif #if !defined(_PSTL_ASSERT) -# include -# define _PSTL_ASSERT(pred) (assert((pred))) +# include <__assert> +# define _PSTL_ASSERT(pred) (_LIBCPP_ASSERT((pred), "")) #endif // Portability "#pragma" definition