summaryrefslogtreecommitdiffstats
path: root/pstl/test/support/stdlib
diff options
context:
space:
mode:
Diffstat (limited to 'pstl/test/support/stdlib')
-rw-r--r--pstl/test/support/stdlib/algorithm26
-rw-r--r--pstl/test/support/stdlib/execution50
-rw-r--r--pstl/test/support/stdlib/memory26
-rw-r--r--pstl/test/support/stdlib/numeric26
4 files changed, 128 insertions, 0 deletions
diff --git a/pstl/test/support/stdlib/algorithm b/pstl/test/support/stdlib/algorithm
new file mode 100644
index 00000000000..39e6f7471a6
--- /dev/null
+++ b/pstl/test/support/stdlib/algorithm
@@ -0,0 +1,26 @@
+// -*- C++ -*-
+//===-- algorithm ---------------------------------------------------------===//
+//
+// 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 _TEST_SUPPORT_STDLIB_ALGORITHM
+#define _TEST_SUPPORT_STDLIB_ALGORITHM
+
+#include_next <algorithm>
+
+#include <pstl/internal/pstl_config.h>
+
+#if _PSTL_EXECUTION_POLICIES_DEFINED
+// If <execution> has already been included, pull in implementations
+# include <pstl/internal/glue_algorithm_impl.h>
+#else
+// Otherwise just pull in forward declarations
+# include <pstl/internal/glue_algorithm_defs.h>
+# define _PSTL_ALGORITHM_FORWARD_DECLARED 1
+#endif
+
+#endif /* _TEST_SUPPORT_STDLIB_ALGORITHM */
diff --git a/pstl/test/support/stdlib/execution b/pstl/test/support/stdlib/execution
new file mode 100644
index 00000000000..ad18c450115
--- /dev/null
+++ b/pstl/test/support/stdlib/execution
@@ -0,0 +1,50 @@
+// -*- C++ -*-
+//===-- execution ---------------------------------------------------------===//
+//
+// 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 _TEST_SUPPORT_STDLIB_EXECUTION
+#define _TEST_SUPPORT_STDLIB_EXECUTION
+
+// #include_next <execution> // None of the standard libraries PSTL is built on top have the <execution> header yet.
+
+#include <pstl/internal/pstl_config.h>
+#include <pstl/internal/execution_defs.h>
+
+#define _PSTL_EXECUTION_POLICIES_DEFINED 1
+
+#if _PSTL_ALGORITHM_FORWARD_DECLARED
+# include <pstl/internal/glue_algorithm_impl.h>
+#endif
+
+#if _PSTL_MEMORY_FORWARD_DECLARED
+# include <pstl/internal/glue_memory_impl.h>
+#endif
+
+#if _PSTL_NUMERIC_FORWARD_DECLARED
+# include <pstl/internal/glue_numeric_impl.h>
+#endif
+
+#if _PSTL_CPP17_EXECUTION_POLICIES_PRESENT
+_PSTL_PRAGMA_MESSAGE_POLICIES("The <Parallel STL> execution policies are defined in the namespace __pstl::execution")
+#else
+# include <pstl/internal/glue_execution_defs.h>
+_PSTL_PRAGMA_MESSAGE_POLICIES(
+ "The <Parallel STL> execution policies are injected into the standard namespace std::execution")
+#endif
+
+//TODO: __pstl::execution namespace is injected into the pstl::execution namespace when the implementation is not a part of
+// standard C++ library
+namespace pstl
+{
+namespace execution
+{
+using namespace __pstl::execution;
+}
+} // namespace pstl
+
+#endif /* _TEST_SUPPORT_STDLIB_EXECUTION */
diff --git a/pstl/test/support/stdlib/memory b/pstl/test/support/stdlib/memory
new file mode 100644
index 00000000000..7d110912296
--- /dev/null
+++ b/pstl/test/support/stdlib/memory
@@ -0,0 +1,26 @@
+// -*- C++ -*-
+//===-- memory ------------------------------------------------------------===//
+//
+// 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 _TEST_SUPPORT_STDLIB_MEMORY
+#define _TEST_SUPPORT_STDLIB_MEMORY
+
+#include_next <memory>
+
+#include <pstl/internal/pstl_config.h>
+
+#if _PSTL_EXECUTION_POLICIES_DEFINED
+// If <execution> has already been included, pull in implementations
+# include <pstl/internal/glue_memory_impl.h>
+#else
+// Otherwise just pull in forward declarations
+# include <pstl/internal/glue_memory_defs.h>
+# define _PSTL_MEMORY_FORWARD_DECLARED 1
+#endif
+
+#endif /* _TEST_SUPPORT_STDLIB_MEMORY */
diff --git a/pstl/test/support/stdlib/numeric b/pstl/test/support/stdlib/numeric
new file mode 100644
index 00000000000..8f98bc75464
--- /dev/null
+++ b/pstl/test/support/stdlib/numeric
@@ -0,0 +1,26 @@
+// -*- C++ -*-
+//===-- numeric -----------------------------------------------------------===//
+//
+// 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 _TEST_SUPPORT_STDLIB_NUMERIC
+#define _TEST_SUPPORT_STDLIB_NUMERIC
+
+#include_next <numeric>
+
+#include <pstl/internal/pstl_config.h>
+
+#if _PSTL_EXECUTION_POLICIES_DEFINED
+// If <execution> has already been included, pull in implementations
+# include <pstl/internal/glue_numeric_impl.h>
+#else
+// Otherwise just pull in forward declarations
+# include <pstl/internal/glue_numeric_defs.h>
+# define _PSTL_NUMERIC_FORWARD_DECLARED 1
+#endif
+
+#endif /* _TEST_SUPPORT_STDLIB_NUMERIC */
OpenPOWER on IntegriCloud