summaryrefslogtreecommitdiff
path: root/libcxx
diff options
context:
space:
mode:
authorNikolas Klauser <n_klauser@apple.com>2023-05-09 11:51:40 -0700
committerNikolas Klauser <n_klauser@apple.com>2023-05-10 09:23:13 -0700
commitf041b3472a87a828ea3364fc2e9adfeac9763681 (patch)
treedfeddb16d190c9ec00814a1a16fa5e1a5052a0c0 /libcxx
parentb21909c0fc6adc62c2077037fcc8eec5f7cdbdd7 (diff)
downloadllvm-f041b3472a87a828ea3364fc2e9adfeac9763681.tar.gz
[libc++][PSTL] Move the remaining configuration into __config
Reviewed By: ldionne, #libc Spies: sstefan1, jplehr, arichardson, libcxx-commits, miyuki Differential Revision: https://reviews.llvm.org/D150217
Diffstat (limited to 'libcxx')
-rw-r--r--libcxx/include/CMakeLists.txt1
-rw-r--r--libcxx/include/__config40
-rw-r--r--libcxx/include/__pstl/internal/algorithm_fwd.h3
-rw-r--r--libcxx/include/__pstl/internal/algorithm_impl.h2
-rw-r--r--libcxx/include/__pstl/internal/execution_defs.h3
-rw-r--r--libcxx/include/__pstl/internal/execution_impl.h2
-rw-r--r--libcxx/include/__pstl/internal/glue_algorithm_defs.h2
-rw-r--r--libcxx/include/__pstl/internal/glue_algorithm_impl.h3
-rw-r--r--libcxx/include/__pstl/internal/glue_memory_defs.h3
-rw-r--r--libcxx/include/__pstl/internal/glue_memory_impl.h2
-rw-r--r--libcxx/include/__pstl/internal/glue_numeric_defs.h2
-rw-r--r--libcxx/include/__pstl/internal/glue_numeric_impl.h3
-rw-r--r--libcxx/include/__pstl/internal/memory_impl.h2
-rw-r--r--libcxx/include/__pstl/internal/numeric_fwd.h3
-rw-r--r--libcxx/include/__pstl/internal/numeric_impl.h2
-rw-r--r--libcxx/include/__pstl/internal/parallel_backend.h2
-rw-r--r--libcxx/include/__pstl/internal/parallel_backend_serial.h3
-rw-r--r--libcxx/include/__pstl/internal/parallel_backend_tbb.h2
-rw-r--r--libcxx/include/__pstl/internal/parallel_backend_utils.h3
-rw-r--r--libcxx/include/__pstl/internal/parallel_impl.h3
-rw-r--r--libcxx/include/__pstl/internal/pstl_config.h55
-rw-r--r--libcxx/include/__pstl/internal/unseq_backend_simd.h2
-rw-r--r--libcxx/include/__pstl/internal/utils.h2
-rw-r--r--libcxx/utils/data/ignore_format.txt1
24 files changed, 61 insertions, 85 deletions
diff --git a/libcxx/include/CMakeLists.txt b/libcxx/include/CMakeLists.txt
index 4929501a700c..9222b5284464 100644
--- a/libcxx/include/CMakeLists.txt
+++ b/libcxx/include/CMakeLists.txt
@@ -533,7 +533,6 @@ set(files
__pstl/internal/parallel_backend_tbb.h
__pstl/internal/parallel_backend_utils.h
__pstl/internal/parallel_impl.h
- __pstl/internal/pstl_config.h
__pstl/internal/unseq_backend_simd.h
__pstl/internal/utils.h
__pstl_algorithm
diff --git a/libcxx/include/__config b/libcxx/include/__config
index 43af83220e85..b08646b2465f 100644
--- a/libcxx/include/__config
+++ b/libcxx/include/__config
@@ -1271,6 +1271,46 @@ _LIBCPP_BEGIN_NAMESPACE_STD _LIBCPP_END_NAMESPACE_STD
# define _LIBCPP_WORKAROUND_OBJCXX_COMPILER_INTRINSICS
# endif
+// TODO: Make this a proper configuration option
+#define _PSTL_PAR_BACKEND_SERIAL
+
+#define _PSTL_PRAGMA(x) _Pragma(# x)
+
+// Enable SIMD for compilers that support OpenMP 4.0
+#if (defined(_OPENMP) && _OPENMP >= 201307)
+
+# define _PSTL_UDR_PRESENT
+# define _PSTL_PRAGMA_SIMD _PSTL_PRAGMA(omp simd)
+# define _PSTL_PRAGMA_DECLARE_SIMD _PSTL_PRAGMA(omp declare simd)
+# define _PSTL_PRAGMA_SIMD_REDUCTION(PRM) _PSTL_PRAGMA(omp simd reduction(PRM))
+# define _PSTL_PRAGMA_SIMD_SCAN(PRM) _PSTL_PRAGMA(omp simd reduction(inscan, PRM))
+# define _PSTL_PRAGMA_SIMD_INCLUSIVE_SCAN(PRM) _PSTL_PRAGMA(omp scan inclusive(PRM))
+# define _PSTL_PRAGMA_SIMD_EXCLUSIVE_SCAN(PRM) _PSTL_PRAGMA(omp scan exclusive(PRM))
+
+// Declaration of reduction functor, where
+// NAME - the name of the functor
+// OP - type of the callable object with the reduction operation
+// omp_in - refers to the local partial result
+// omp_out - refers to the final value of the combiner operator
+// omp_priv - refers to the private copy of the initial value
+// omp_orig - refers to the original variable to be reduced
+# define _PSTL_PRAGMA_DECLARE_REDUCTION(NAME, OP) \
+ _PSTL_PRAGMA(omp declare reduction(NAME:OP : omp_out(omp_in)) initializer(omp_priv = omp_orig))
+
+#else // (defined(_OPENMP) && _OPENMP >= 201307)
+
+# define _PSTL_PRAGMA_SIMD
+# define _PSTL_PRAGMA_DECLARE_SIMD
+# define _PSTL_PRAGMA_SIMD_REDUCTION(PRM)
+# define _PSTL_PRAGMA_SIMD_SCAN(PRM)
+# define _PSTL_PRAGMA_SIMD_INCLUSIVE_SCAN(PRM)
+# define _PSTL_PRAGMA_SIMD_EXCLUSIVE_SCAN(PRM)
+# define _PSTL_PRAGMA_DECLARE_REDUCTION(NAME, OP)
+
+#endif // (defined(_OPENMP) && _OPENMP >= 201307)
+
+#define _PSTL_USE_NONTEMPORAL_STORES_IF_ALLOWED
+
#endif // __cplusplus
#endif // _LIBCPP___CONFIG
diff --git a/libcxx/include/__pstl/internal/algorithm_fwd.h b/libcxx/include/__pstl/internal/algorithm_fwd.h
index 4f6d73103ec8..ba350392c2ac 100644
--- a/libcxx/include/__pstl/internal/algorithm_fwd.h
+++ b/libcxx/include/__pstl/internal/algorithm_fwd.h
@@ -10,12 +10,11 @@
#ifndef _PSTL_ALGORITHM_FWD_H
#define _PSTL_ALGORITHM_FWD_H
+#include <__config>
#include <iterator>
#include <type_traits>
#include <utility>
-#include "pstl_config.h"
-
namespace __pstl {
namespace __internal {
diff --git a/libcxx/include/__pstl/internal/algorithm_impl.h b/libcxx/include/__pstl/internal/algorithm_impl.h
index 1f51651065f2..c01e5f5c8726 100644
--- a/libcxx/include/__pstl/internal/algorithm_impl.h
+++ b/libcxx/include/__pstl/internal/algorithm_impl.h
@@ -11,6 +11,7 @@
#define _PSTL_ALGORITHM_IMPL_H
#include <__assert>
+#include <__config>
#include <algorithm>
#include <functional>
#include <iterator>
@@ -22,7 +23,6 @@
#include "parallel_backend.h"
#include "parallel_backend_utils.h"
#include "parallel_impl.h"
-#include "pstl_config.h"
#include "unseq_backend_simd.h"
namespace __pstl {
diff --git a/libcxx/include/__pstl/internal/execution_defs.h b/libcxx/include/__pstl/internal/execution_defs.h
index 6abd1ff32938..5992f0e4a375 100644
--- a/libcxx/include/__pstl/internal/execution_defs.h
+++ b/libcxx/include/__pstl/internal/execution_defs.h
@@ -10,12 +10,11 @@
#ifndef _PSTL_EXECUTION_POLICY_DEFS_H
#define _PSTL_EXECUTION_POLICY_DEFS_H
+#include <__config>
#include <__type_traits/decay.h>
#include <__type_traits/enable_if.h>
#include <__type_traits/integral_constant.h>
-#include "pstl_config.h"
-
#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17
namespace __pstl {
diff --git a/libcxx/include/__pstl/internal/execution_impl.h b/libcxx/include/__pstl/internal/execution_impl.h
index 51ec104db282..7a1aea560338 100644
--- a/libcxx/include/__pstl/internal/execution_impl.h
+++ b/libcxx/include/__pstl/internal/execution_impl.h
@@ -10,13 +10,13 @@
#ifndef _PSTL_EXECUTION_IMPL_H
#define _PSTL_EXECUTION_IMPL_H
+#include <__config>
#include <__iterator/iterator_traits.h>
#include <__type_traits/conditional.h>
#include <__type_traits/conjunction.h>
#include <__type_traits/is_base_of.h>
#include "execution_defs.h"
-#include "pstl_config.h"
#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17
diff --git a/libcxx/include/__pstl/internal/glue_algorithm_defs.h b/libcxx/include/__pstl/internal/glue_algorithm_defs.h
index f751802b47a1..82bb3f508d5a 100644
--- a/libcxx/include/__pstl/internal/glue_algorithm_defs.h
+++ b/libcxx/include/__pstl/internal/glue_algorithm_defs.h
@@ -10,11 +10,11 @@
#ifndef _PSTL_GLUE_ALGORITHM_DEFS_H
#define _PSTL_GLUE_ALGORITHM_DEFS_H
+#include <__config>
#include <functional>
#include <iterator>
#include "execution_defs.h"
-#include "pstl_config.h"
namespace std {
diff --git a/libcxx/include/__pstl/internal/glue_algorithm_impl.h b/libcxx/include/__pstl/internal/glue_algorithm_impl.h
index 3d207185401b..db62705233b9 100644
--- a/libcxx/include/__pstl/internal/glue_algorithm_impl.h
+++ b/libcxx/include/__pstl/internal/glue_algorithm_impl.h
@@ -10,10 +10,9 @@
#ifndef _PSTL_GLUE_ALGORITHM_IMPL_H
#define _PSTL_GLUE_ALGORITHM_IMPL_H
+#include <__config>
#include <functional>
-#include "pstl_config.h"
-
#include "algorithm_fwd.h"
#include "execution_defs.h"
#include "numeric_fwd.h" /* count and count_if use __pattern_transform_reduce */
diff --git a/libcxx/include/__pstl/internal/glue_memory_defs.h b/libcxx/include/__pstl/internal/glue_memory_defs.h
index 735754602837..4e8581cfdb80 100644
--- a/libcxx/include/__pstl/internal/glue_memory_defs.h
+++ b/libcxx/include/__pstl/internal/glue_memory_defs.h
@@ -10,8 +10,9 @@
#ifndef _PSTL_GLUE_MEMORY_DEFS_H
#define _PSTL_GLUE_MEMORY_DEFS_H
+#include <__config>
+
#include "execution_defs.h"
-#include "pstl_config.h"
namespace std {
diff --git a/libcxx/include/__pstl/internal/glue_memory_impl.h b/libcxx/include/__pstl/internal/glue_memory_impl.h
index e65d6947dabe..b645ba3fca10 100644
--- a/libcxx/include/__pstl/internal/glue_memory_impl.h
+++ b/libcxx/include/__pstl/internal/glue_memory_impl.h
@@ -10,7 +10,7 @@
#ifndef _PSTL_GLUE_MEMORY_IMPL_H
#define _PSTL_GLUE_MEMORY_IMPL_H
-#include "pstl_config.h"
+#include <__config>
#include "algorithm_fwd.h"
#include "execution_defs.h"
diff --git a/libcxx/include/__pstl/internal/glue_numeric_defs.h b/libcxx/include/__pstl/internal/glue_numeric_defs.h
index 40e020262473..9ce35e362c5b 100644
--- a/libcxx/include/__pstl/internal/glue_numeric_defs.h
+++ b/libcxx/include/__pstl/internal/glue_numeric_defs.h
@@ -10,10 +10,10 @@
#ifndef _PSTL_GLUE_NUMERIC_DEFS_H
#define _PSTL_GLUE_NUMERIC_DEFS_H
+#include <__config>
#include <iterator>
#include "execution_defs.h"
-#include "pstl_config.h"
namespace std {
// [reduce]
diff --git a/libcxx/include/__pstl/internal/glue_numeric_impl.h b/libcxx/include/__pstl/internal/glue_numeric_impl.h
index 492319131943..d8666716e818 100644
--- a/libcxx/include/__pstl/internal/glue_numeric_impl.h
+++ b/libcxx/include/__pstl/internal/glue_numeric_impl.h
@@ -10,10 +10,9 @@
#ifndef _PSTL_GLUE_NUMERIC_IMPL_H
#define _PSTL_GLUE_NUMERIC_IMPL_H
+#include <__config>
#include <functional>
-#include "pstl_config.h"
-
#include "execution_impl.h"
#include "numeric_fwd.h"
#include "utils.h"
diff --git a/libcxx/include/__pstl/internal/memory_impl.h b/libcxx/include/__pstl/internal/memory_impl.h
index 1967d5d7b735..5315ccd9a344 100644
--- a/libcxx/include/__pstl/internal/memory_impl.h
+++ b/libcxx/include/__pstl/internal/memory_impl.h
@@ -10,9 +10,9 @@
#ifndef _PSTL_MEMORY_IMPL_H
#define _PSTL_MEMORY_IMPL_H
+#include <__config>
#include <iterator>
-#include "pstl_config.h"
#include "unseq_backend_simd.h"
namespace __pstl {
diff --git a/libcxx/include/__pstl/internal/numeric_fwd.h b/libcxx/include/__pstl/internal/numeric_fwd.h
index ccf7b634b2f0..258a925f663e 100644
--- a/libcxx/include/__pstl/internal/numeric_fwd.h
+++ b/libcxx/include/__pstl/internal/numeric_fwd.h
@@ -10,11 +10,10 @@
#ifndef _PSTL_NUMERIC_FWD_H
#define _PSTL_NUMERIC_FWD_H
+#include <__config>
#include <type_traits>
#include <utility>
-#include "pstl_config.h"
-
namespace __pstl {
namespace __internal {
diff --git a/libcxx/include/__pstl/internal/numeric_impl.h b/libcxx/include/__pstl/internal/numeric_impl.h
index 7c852d7b0825..f26be1d985e4 100644
--- a/libcxx/include/__pstl/internal/numeric_impl.h
+++ b/libcxx/include/__pstl/internal/numeric_impl.h
@@ -11,12 +11,12 @@
#define _PSTL_NUMERIC_IMPL_H
#include <__assert>
+#include <__config>
#include <iterator>
#include <type_traits>
#include <numeric>
#include "parallel_backend.h"
-#include "pstl_config.h"
#include "execution_impl.h"
#include "unseq_backend_simd.h"
#include "algorithm_fwd.h"
diff --git a/libcxx/include/__pstl/internal/parallel_backend.h b/libcxx/include/__pstl/internal/parallel_backend.h
index a584df17c39f..9c30ee142746 100644
--- a/libcxx/include/__pstl/internal/parallel_backend.h
+++ b/libcxx/include/__pstl/internal/parallel_backend.h
@@ -10,7 +10,7 @@
#ifndef _PSTL_PARALLEL_BACKEND_H
#define _PSTL_PARALLEL_BACKEND_H
-#include "pstl_config.h"
+#include <__config>
#if defined(_PSTL_PAR_BACKEND_SERIAL)
# include "parallel_backend_serial.h"
diff --git a/libcxx/include/__pstl/internal/parallel_backend_serial.h b/libcxx/include/__pstl/internal/parallel_backend_serial.h
index 10c0630fbd5d..8d12451cd9e6 100644
--- a/libcxx/include/__pstl/internal/parallel_backend_serial.h
+++ b/libcxx/include/__pstl/internal/parallel_backend_serial.h
@@ -10,12 +10,11 @@
#ifndef _PSTL_PARALLEL_BACKEND_SERIAL_H
#define _PSTL_PARALLEL_BACKEND_SERIAL_H
+#include <__config>
#include <__memory/allocator.h>
#include <__pstl/internal/execution_impl.h>
#include <__utility/forward.h>
-#include "pstl_config.h"
-
#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17
namespace __pstl
diff --git a/libcxx/include/__pstl/internal/parallel_backend_tbb.h b/libcxx/include/__pstl/internal/parallel_backend_tbb.h
index 3bee7e2764e1..41fe9d846017 100644
--- a/libcxx/include/__pstl/internal/parallel_backend_tbb.h
+++ b/libcxx/include/__pstl/internal/parallel_backend_tbb.h
@@ -11,10 +11,10 @@
#define _PSTL_PARALLEL_BACKEND_TBB_H
#include <__assert>
+#include <__config>
#include <algorithm>
#include <type_traits>
-#include "pstl_config.h"
#include "parallel_backend_utils.h"
// Bring in minimal required subset of Intel TBB
diff --git a/libcxx/include/__pstl/internal/parallel_backend_utils.h b/libcxx/include/__pstl/internal/parallel_backend_utils.h
index b27d1ef2b1ce..032a0479ec7e 100644
--- a/libcxx/include/__pstl/internal/parallel_backend_utils.h
+++ b/libcxx/include/__pstl/internal/parallel_backend_utils.h
@@ -11,13 +11,12 @@
#define _PSTL_PARALLEL_BACKEND_UTILS_H
#include <__assert>
+#include <__config>
#include <__iterator/iterator_traits.h>
#include <__memory/addressof.h>
#include "utils.h"
-#include "pstl_config.h"
-
namespace __pstl
{
diff --git a/libcxx/include/__pstl/internal/parallel_impl.h b/libcxx/include/__pstl/internal/parallel_impl.h
index 19ec508cfa29..c0e9545d9222 100644
--- a/libcxx/include/__pstl/internal/parallel_impl.h
+++ b/libcxx/include/__pstl/internal/parallel_impl.h
@@ -10,10 +10,9 @@
#ifndef _PSTL_PARALLEL_IMPL_H
#define _PSTL_PARALLEL_IMPL_H
-#include "pstl_config.h"
-
#include <__atomic/atomic.h>
#include <__atomic/memory_order.h>
+#include <__config>
#include <__pstl/internal/parallel_backend.h>
#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17
diff --git a/libcxx/include/__pstl/internal/pstl_config.h b/libcxx/include/__pstl/internal/pstl_config.h
deleted file mode 100644
index 763d1399764a..000000000000
--- a/libcxx/include/__pstl/internal/pstl_config.h
+++ /dev/null
@@ -1,55 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef _PSTL_CONFIG_H
-#define _PSTL_CONFIG_H
-
-#include <__config>
-
-// TODO: Make this a proper configuration option
-#define _PSTL_PAR_BACKEND_SERIAL
-
-#define _PSTL_PRAGMA(x) _Pragma(# x)
-
-// Enable SIMD for compilers that support OpenMP 4.0
-#if (defined(_OPENMP) && _OPENMP >= 201307)
-
-# define _PSTL_UDR_PRESENT
-# define _PSTL_PRAGMA_SIMD _PSTL_PRAGMA(omp simd)
-# define _PSTL_PRAGMA_DECLARE_SIMD _PSTL_PRAGMA(omp declare simd)
-# define _PSTL_PRAGMA_SIMD_REDUCTION(PRM) _PSTL_PRAGMA(omp simd reduction(PRM))
-# define _PSTL_PRAGMA_SIMD_SCAN(PRM) _PSTL_PRAGMA(omp simd reduction(inscan, PRM))
-# define _PSTL_PRAGMA_SIMD_INCLUSIVE_SCAN(PRM) _PSTL_PRAGMA(omp scan inclusive(PRM))
-# define _PSTL_PRAGMA_SIMD_EXCLUSIVE_SCAN(PRM) _PSTL_PRAGMA(omp scan exclusive(PRM))
-
-// Declaration of reduction functor, where
-// NAME - the name of the functor
-// OP - type of the callable object with the reduction operation
-// omp_in - refers to the local partial result
-// omp_out - refers to the final value of the combiner operator
-// omp_priv - refers to the private copy of the initial value
-// omp_orig - refers to the original variable to be reduced
-# define _PSTL_PRAGMA_DECLARE_REDUCTION(NAME, OP) \
- _PSTL_PRAGMA(omp declare reduction(NAME:OP : omp_out(omp_in)) initializer(omp_priv = omp_orig))
-
-#else // (defined(_OPENMP) && _OPENMP >= 201307)
-
-# define _PSTL_PRAGMA_SIMD
-# define _PSTL_PRAGMA_DECLARE_SIMD
-# define _PSTL_PRAGMA_SIMD_REDUCTION(PRM)
-# define _PSTL_PRAGMA_SIMD_SCAN(PRM)
-# define _PSTL_PRAGMA_SIMD_INCLUSIVE_SCAN(PRM)
-# define _PSTL_PRAGMA_SIMD_EXCLUSIVE_SCAN(PRM)
-# define _PSTL_PRAGMA_DECLARE_REDUCTION(NAME, OP)
-
-#endif // (defined(_OPENMP) && _OPENMP >= 201307)
-
-#define _PSTL_USE_NONTEMPORAL_STORES_IF_ALLOWED
-
-#endif /* _PSTL_CONFIG_H */
diff --git a/libcxx/include/__pstl/internal/unseq_backend_simd.h b/libcxx/include/__pstl/internal/unseq_backend_simd.h
index c68a5b99806f..80e5424b2a6e 100644
--- a/libcxx/include/__pstl/internal/unseq_backend_simd.h
+++ b/libcxx/include/__pstl/internal/unseq_backend_simd.h
@@ -10,13 +10,13 @@
#ifndef _PSTL_UNSEQ_BACKEND_SIMD_H
#define _PSTL_UNSEQ_BACKEND_SIMD_H
+#include <__config>
#include <__functional/operations.h>
#include <__type_traits/is_arithmetic.h>
#include <__utility/pair.h>
#include <cstddef>
#include <cstdint>
-#include "pstl_config.h"
#include "utils.h"
// This header defines the minimum set of vector routines required
diff --git a/libcxx/include/__pstl/internal/utils.h b/libcxx/include/__pstl/internal/utils.h
index 6a926663772a..92c8d48db5b1 100644
--- a/libcxx/include/__pstl/internal/utils.h
+++ b/libcxx/include/__pstl/internal/utils.h
@@ -10,8 +10,8 @@
#ifndef _PSTL_UTILS_H
#define _PSTL_UTILS_H
+#include <__config>
#include <__exception/terminate.h>
-#include <__pstl/internal/pstl_config.h>
#include <__utility/forward.h>
#include <new>
diff --git a/libcxx/utils/data/ignore_format.txt b/libcxx/utils/data/ignore_format.txt
index b50684a32978..b19f5cf1bf7a 100644
--- a/libcxx/utils/data/ignore_format.txt
+++ b/libcxx/utils/data/ignore_format.txt
@@ -523,7 +523,6 @@ libcxx/include/__pstl/internal/parallel_backend_serial.h
libcxx/include/__pstl/internal/parallel_backend_tbb.h
libcxx/include/__pstl/internal/parallel_backend_utils.h
libcxx/include/__pstl/internal/parallel_impl.h
-libcxx/include/__pstl/internal/pstl_config.h
libcxx/include/__pstl/internal/unseq_backend_simd.h
libcxx/include/__pstl/internal/utils.h
libcxx/include/queue