[libcxx-commits] [pstl] r357203 - [pstl] Uglify internal names of the library
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Mar 28 12:10:33 PDT 2019
Author: ldionne
Date: Thu Mar 28 12:10:32 2019
New Revision: 357203
URL: http://llvm.org/viewvc/llvm-project?rev=357203&view=rev
Log:
[pstl] Uglify internal names of the library
Modified:
pstl/trunk/include/pstl/internal/algorithm_fwd.h
pstl/trunk/include/pstl/internal/algorithm_impl.h
pstl/trunk/include/pstl/internal/execution_defs.h
pstl/trunk/include/pstl/internal/execution_impl.h
pstl/trunk/include/pstl/internal/glue_algorithm_defs.h
pstl/trunk/include/pstl/internal/glue_algorithm_impl.h
pstl/trunk/include/pstl/internal/glue_memory_defs.h
pstl/trunk/include/pstl/internal/glue_memory_impl.h
pstl/trunk/include/pstl/internal/glue_numeric_defs.h
pstl/trunk/include/pstl/internal/glue_numeric_impl.h
pstl/trunk/include/pstl/internal/memory_impl.h
pstl/trunk/include/pstl/internal/numeric_fwd.h
pstl/trunk/include/pstl/internal/numeric_impl.h
pstl/trunk/include/pstl/internal/parallel_backend_tbb.h
pstl/trunk/include/pstl/internal/parallel_backend_utils.h
pstl/trunk/include/pstl/internal/parallel_impl.h
pstl/trunk/include/pstl/internal/unseq_backend_simd.h
pstl/trunk/include/pstl/internal/utils.h
pstl/trunk/test/std/algorithms/alg.modifying.operations/alg.partitions/partition_copy.pass.cpp
pstl/trunk/test/std/algorithms/alg.modifying.operations/replace.pass.cpp
pstl/trunk/test/std/algorithms/alg.sorting/alg.set.operations/includes.pass.cpp
pstl/trunk/test/std/algorithms/alg.sorting/alg.set.operations/set.pass.cpp
pstl/trunk/test/support/utils.h
Modified: pstl/trunk/include/pstl/internal/algorithm_fwd.h
URL: http://llvm.org/viewvc/llvm-project/pstl/trunk/include/pstl/internal/algorithm_fwd.h?rev=357203&r1=357202&r2=357203&view=diff
==============================================================================
--- pstl/trunk/include/pstl/internal/algorithm_fwd.h (original)
+++ pstl/trunk/include/pstl/internal/algorithm_fwd.h Thu Mar 28 12:10:32 2019
@@ -15,7 +15,7 @@
namespace __pstl
{
-namespace internal
+namespace __internal
{
//------------------------------------------------------------------------
@@ -24,29 +24,24 @@ namespace internal
template <class _ForwardIterator, class _Pred>
bool
-brick_any_of(const _ForwardIterator, const _ForwardIterator, _Pred,
- /*__is_vector=*/std::false_type) noexcept;
+__brick_any_of(const _ForwardIterator, const _ForwardIterator, _Pred,
+ /*__is_vector=*/std::false_type) noexcept;
template <class _ForwardIterator, class _Pred>
bool
-brick_any_of(const _ForwardIterator, const _ForwardIterator, _Pred,
- /*__is_vector=*/std::true_type) noexcept;
+__brick_any_of(const _ForwardIterator, const _ForwardIterator, _Pred,
+ /*__is_vector=*/std::true_type) noexcept;
template <class _ExecutionPolicy, class _ForwardIterator, class _Pred, class _IsVector>
-bool pattern_any_of(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _Pred, _IsVector,
- /*parallel=*/std::false_type) noexcept;
+bool
+__pattern_any_of(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _Pred, _IsVector,
+ /*parallel=*/std::false_type) noexcept;
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _ForwardIterator, class _Pred, class _IsVector>
-bool pattern_any_of(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _Pred, _IsVector,
- /*parallel=*/std::true_type);
-#endif
-
-
-#if 0
- // TODO does this even need forwarding?
-template <class _ForwardIterator, class _Size, class _Function>
-_ForwardIterator for_each_n_it_serial(_ForwardIterator, _Size, _Function);
+bool
+__pattern_any_of(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _Pred, _IsVector,
+ /*parallel=*/std::true_type);
#endif
//------------------------------------------------------------------------
@@ -56,31 +51,35 @@ _ForwardIterator for_each_n_it_serial(_F
//------------------------------------------------------------------------
template <class _ForwardIterator, class _Function>
-void brick_walk1(_ForwardIterator, _ForwardIterator, _Function,
- /*vector=*/std::false_type) noexcept;
+void __brick_walk1(_ForwardIterator, _ForwardIterator, _Function,
+ /*vector=*/std::false_type) noexcept;
template <class _RandomAccessIterator, class _Function>
-void brick_walk1(_RandomAccessIterator, _RandomAccessIterator, _Function,
- /*vector=*/std::true_type) noexcept;
+void __brick_walk1(_RandomAccessIterator, _RandomAccessIterator, _Function,
+ /*vector=*/std::true_type) noexcept;
template <class _ExecutionPolicy, class _ForwardIterator, class _Function, class _IsVector>
-void pattern_walk1(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _Function, _IsVector,
- /*parallel=*/std::false_type) noexcept;
+void
+__pattern_walk1(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _Function, _IsVector,
+ /*parallel=*/std::false_type) noexcept;
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _ForwardIterator, class _Function, class _IsVector>
-void pattern_walk1(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _Function, _IsVector,
- /*parallel=*/std::true_type);
+void
+__pattern_walk1(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _Function, _IsVector,
+ /*parallel=*/std::true_type);
#endif
template <class _ExecutionPolicy, class _ForwardIterator, class _Brick>
-void pattern_walk_brick(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _Brick,
- /*parallel=*/std::false_type) noexcept;
+void
+__pattern_walk_brick(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _Brick,
+ /*parallel=*/std::false_type) noexcept;
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _ForwardIterator, class _Brick>
-void pattern_walk_brick(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _Brick,
- /*parallel=*/std::true_type);
+void
+__pattern_walk_brick(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _Brick,
+ /*parallel=*/std::true_type);
#endif
//------------------------------------------------------------------------
@@ -88,31 +87,35 @@ void pattern_walk_brick(_ExecutionPolicy
//------------------------------------------------------------------------
template <class _ForwardIterator, class _Size, class _Function>
-_ForwardIterator brick_walk1_n(_ForwardIterator, _Size, _Function,
- /*_IsVectorTag=*/std::false_type);
+_ForwardIterator __brick_walk1_n(_ForwardIterator, _Size, _Function,
+ /*_IsVectorTag=*/std::false_type);
template <class _RandomAccessIterator, class _DifferenceType, class _Function>
-_RandomAccessIterator brick_walk1_n(_RandomAccessIterator, _DifferenceType, _Function,
- /*vectorTag=*/std::true_type) noexcept;
+_RandomAccessIterator __brick_walk1_n(_RandomAccessIterator, _DifferenceType, _Function,
+ /*vectorTag=*/std::true_type) noexcept;
template <class _ExecutionPolicy, class _ForwardIterator, class _Size, class _Function, class _IsVector>
-_ForwardIterator pattern_walk1_n(_ExecutionPolicy&&, _ForwardIterator, _Size, _Function, _IsVector,
- /*is_parallel=*/std::false_type) noexcept;
+_ForwardIterator
+__pattern_walk1_n(_ExecutionPolicy&&, _ForwardIterator, _Size, _Function, _IsVector,
+ /*is_parallel=*/std::false_type) noexcept;
#if __PSTL_USE_PAR_POLICIES
-template <class _ExecutionPolicy,class _RandomAccessIterator, class _Size, class _Function, class _IsVector>
-_RandomAccessIterator pattern_walk1_n(_ExecutionPolicy&&, _RandomAccessIterator, _Size, _Function, _IsVector,
- /*is_parallel=*/std::true_type);
+template <class _ExecutionPolicy, class _RandomAccessIterator, class _Size, class _Function, class _IsVector>
+_RandomAccessIterator
+__pattern_walk1_n(_ExecutionPolicy&&, _RandomAccessIterator, _Size, _Function, _IsVector,
+ /*is_parallel=*/std::true_type);
#endif
template <class _ExecutionPolicy, class _ForwardIterator, class _Size, class _Brick>
-_ForwardIterator pattern_walk_brick_n(_ExecutionPolicy&&, _ForwardIterator, _Size, _Brick,
- /*is_parallel=*/std::false_type) noexcept;
+_ForwardIterator
+__pattern_walk_brick_n(_ExecutionPolicy&&, _ForwardIterator, _Size, _Brick,
+ /*is_parallel=*/std::false_type) noexcept;
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _RandomAccessIterator, class _Size, class _Brick>
-_RandomAccessIterator pattern_walk_brick_n(_ExecutionPolicy&&, _RandomAccessIterator, _Size, _Brick,
- /*is_parallel=*/std::true_type);
+_RandomAccessIterator
+__pattern_walk_brick_n(_ExecutionPolicy&&, _RandomAccessIterator, _Size, _Brick,
+ /*is_parallel=*/std::true_type);
#endif
//------------------------------------------------------------------------
@@ -122,60 +125,70 @@ _RandomAccessIterator pattern_walk_brick
//------------------------------------------------------------------------
template <class _ForwardIterator1, class _ForwardIterator2, class _Function>
-_ForwardIterator2 brick_walk2(_ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _Function,
- /*vector=*/std::false_type) noexcept;
+_ForwardIterator2 __brick_walk2(_ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _Function,
+ /*vector=*/std::false_type) noexcept;
template <class _ForwardIterator1, class _ForwardIterator2, class _Function>
-_ForwardIterator2 brick_walk2(_ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _Function,
- /*vector=*/std::true_type) noexcept;
+_ForwardIterator2 __brick_walk2(_ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _Function,
+ /*vector=*/std::true_type) noexcept;
template <class _ForwardIterator1, class _Size, class _ForwardIterator2, class _Function>
-_ForwardIterator2 brick_walk2_n(_ForwardIterator1, _Size, _ForwardIterator2, _Function,
- /*vector=*/std::false_type) noexcept;
+_ForwardIterator2 __brick_walk2_n(_ForwardIterator1, _Size, _ForwardIterator2, _Function,
+ /*vector=*/std::false_type) noexcept;
template <class _ForwardIterator1, class _Size, class _ForwardIterator2, class _Function>
-_ForwardIterator2 brick_walk2_n(_ForwardIterator1, _Size, _ForwardIterator2, _Function,
- /*vector=*/std::true_type) noexcept;
+_ForwardIterator2 __brick_walk2_n(_ForwardIterator1, _Size, _ForwardIterator2, _Function,
+ /*vector=*/std::true_type) noexcept;
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Function, class _IsVector>
-_ForwardIterator2 pattern_walk2(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _Function, _IsVector,
- /*parallel=*/std::false_type) noexcept;
+_ForwardIterator2
+__pattern_walk2(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _Function, _IsVector,
+ /*parallel=*/std::false_type) noexcept;
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Function, class _IsVector>
-_ForwardIterator2 pattern_walk2(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _Function, _IsVector,
- /*parallel=*/std::true_type);
+_ForwardIterator2
+__pattern_walk2(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _Function, _IsVector,
+ /*parallel=*/std::true_type);
#endif
-template <class _ExecutionPolicy, class _ForwardIterator1, class _Size, class _ForwardIterator2, class _Function, class _IsVector>
-_ForwardIterator2 pattern_walk2_n(_ExecutionPolicy&&, _ForwardIterator1, _Size, _ForwardIterator2, _Function, _IsVector,
- /*parallel=*/std::false_type) noexcept;
+template <class _ExecutionPolicy, class _ForwardIterator1, class _Size, class _ForwardIterator2, class _Function,
+ class _IsVector>
+_ForwardIterator2
+__pattern_walk2_n(_ExecutionPolicy&&, _ForwardIterator1, _Size, _ForwardIterator2, _Function, _IsVector,
+ /*parallel=*/std::false_type) noexcept;
#if __PSTL_USE_PAR_POLICIES
-template <class _ExecutionPolicy, class _RandomAccessIterator1, class _Size, class _RandomAccessIterator2, class _Function, class _IsVector>
-_RandomAccessIterator2 pattern_walk2_n(_ExecutionPolicy&&, _RandomAccessIterator1, _Size, _RandomAccessIterator2, _Function, _IsVector,
- /*parallel=*/std::true_type);
+template <class _ExecutionPolicy, class _RandomAccessIterator1, class _Size, class _RandomAccessIterator2,
+ class _Function, class _IsVector>
+_RandomAccessIterator2
+__pattern_walk2_n(_ExecutionPolicy&&, _RandomAccessIterator1, _Size, _RandomAccessIterator2, _Function, _IsVector,
+ /*parallel=*/std::true_type);
#endif
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Brick>
-_ForwardIterator2 pattern_walk2_brick(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _Brick,
- /*parallel=*/std::false_type) noexcept;
+_ForwardIterator2
+__pattern_walk2_brick(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _Brick,
+ /*parallel=*/std::false_type) noexcept;
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _RandomAccessIterator1, class _RandomAccessIterator2, class _Brick>
-_RandomAccessIterator2 pattern_walk2_brick(_ExecutionPolicy&&, _RandomAccessIterator1, _RandomAccessIterator1, _RandomAccessIterator2,
- _Brick,
- /*parallel=*/std::true_type);
+_RandomAccessIterator2
+__pattern_walk2_brick(_ExecutionPolicy&&, _RandomAccessIterator1, _RandomAccessIterator1, _RandomAccessIterator2,
+ _Brick,
+ /*parallel=*/std::true_type);
#endif
template <class _ExecutionPolicy, class _ForwardIterator1, class _Size, class _ForwardIterator2, class _Brick>
-_ForwardIterator2 pattern_walk2_brick_n(_ExecutionPolicy&&, _ForwardIterator1, _Size, _ForwardIterator2, _Brick,
- /*parallel=*/std::false_type) noexcept;
+_ForwardIterator2
+__pattern_walk2_brick_n(_ExecutionPolicy&&, _ForwardIterator1, _Size, _ForwardIterator2, _Brick,
+ /*parallel=*/std::false_type) noexcept;
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _RandomAccessIterator1, class _Size, class _RandomAccessIterator2, class _Brick>
-_RandomAccessIterator2 pattern_walk2_brick_n(_ExecutionPolicy&&, _RandomAccessIterator1, _Size, _RandomAccessIterator2, _Brick,
- /*parallel=*/std::true_type);
+_RandomAccessIterator2
+__pattern_walk2_brick_n(_ExecutionPolicy&&, _RandomAccessIterator1, _Size, _RandomAccessIterator2, _Brick,
+ /*parallel=*/std::true_type);
#endif
//------------------------------------------------------------------------
@@ -185,24 +198,27 @@ _RandomAccessIterator2 pattern_walk2_bri
//------------------------------------------------------------------------
template <class _ForwardIterator1, class _ForwardIterator2, class _ForwardIterator3, class _Function>
-_ForwardIterator3 brick_walk3(_ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator3, _Function,
- /*vector=*/std::false_type) noexcept;
+_ForwardIterator3 __brick_walk3(_ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator3, _Function,
+ /*vector=*/std::false_type) noexcept;
template <class _RandomAccessIterator1, class _RandomAccessIterator2, class _RandomAccessIterator3, class _Function>
-_RandomAccessIterator3 brick_walk3(_RandomAccessIterator1, _RandomAccessIterator1, _RandomAccessIterator2,
- _RandomAccessIterator3, _Function,
- /*vector=*/std::true_type) noexcept;
-
-template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _ForwardIterator3, class _Function, class _IsVector>
-_ForwardIterator3 pattern_walk3(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator3, _Function,
- _IsVector,
- /*parallel=*/std::false_type) noexcept;
-
-#if __PSTL_USE_PAR_POLICIES
-template <class _ExecutionPolicy, class _RandomAccessIterator1, class _RandomAccessIterator2, class _RandomAccessIterator3, class _Function,
- class _IsVector>
-_RandomAccessIterator3 pattern_walk3(_ExecutionPolicy&&, _RandomAccessIterator1, _RandomAccessIterator1, _RandomAccessIterator2,
- _RandomAccessIterator3, _Function, _IsVector, /*parallel=*/std::true_type);
+_RandomAccessIterator3 __brick_walk3(_RandomAccessIterator1, _RandomAccessIterator1, _RandomAccessIterator2,
+ _RandomAccessIterator3, _Function,
+ /*vector=*/std::true_type) noexcept;
+
+template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _ForwardIterator3,
+ class _Function, class _IsVector>
+_ForwardIterator3
+__pattern_walk3(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator3,
+ _Function, _IsVector,
+ /*parallel=*/std::false_type) noexcept;
+
+#if __PSTL_USE_PAR_POLICIES
+template <class _ExecutionPolicy, class _RandomAccessIterator1, class _RandomAccessIterator2,
+ class _RandomAccessIterator3, class _Function, class _IsVector>
+_RandomAccessIterator3
+__pattern_walk3(_ExecutionPolicy&&, _RandomAccessIterator1, _RandomAccessIterator1, _RandomAccessIterator2,
+ _RandomAccessIterator3, _Function, _IsVector, /*parallel=*/std::true_type);
#endif
//------------------------------------------------------------------------
@@ -210,21 +226,27 @@ _RandomAccessIterator3 pattern_walk3(_Ex
//------------------------------------------------------------------------
template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
-bool brick_equal(_ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _BinaryPredicate,
- /* IsVector = */ std::false_type) noexcept;
+bool __brick_equal(_ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _BinaryPredicate,
+ /* IsVector = */ std::false_type) noexcept;
template <class _RandomAccessIterator1, class _RandomAccessIterator2, class _BinaryPredicate>
-bool brick_equal(_RandomAccessIterator1, _RandomAccessIterator1, _RandomAccessIterator2, _BinaryPredicate,
- /* is_vector = */ std::true_type) noexcept;
+bool __brick_equal(_RandomAccessIterator1, _RandomAccessIterator1, _RandomAccessIterator2, _BinaryPredicate,
+ /* is_vector = */ std::true_type) noexcept;
-template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate, class _IsVector>
-bool pattern_equal(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _BinaryPredicate, _IsVector,
- /* is_parallel = */ std::false_type) noexcept;
+template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate,
+ class _IsVector>
+bool
+__pattern_equal(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _BinaryPredicate,
+ _IsVector,
+ /* is_parallel = */ std::false_type) noexcept;
#if __PSTL_USE_PAR_POLICIES
-template <class _ExecutionPolicy, class _RandomAccessIterator1, class _RandomAccessIterator2, class _BinaryPredicate, class _IsVector>
-bool pattern_equal(_ExecutionPolicy&&, _RandomAccessIterator1, _RandomAccessIterator1, _RandomAccessIterator2, _BinaryPredicate, _IsVector,
- /*is_parallel=*/std::true_type);
+template <class _ExecutionPolicy, class _RandomAccessIterator1, class _RandomAccessIterator2, class _BinaryPredicate,
+ class _IsVector>
+bool
+__pattern_equal(_ExecutionPolicy&&, _RandomAccessIterator1, _RandomAccessIterator1, _RandomAccessIterator2,
+ _BinaryPredicate, _IsVector,
+ /*is_parallel=*/std::true_type);
#endif
//------------------------------------------------------------------------
@@ -232,21 +254,23 @@ bool pattern_equal(_ExecutionPolicy&&, _
//------------------------------------------------------------------------
template <class _ForwardIterator, class _Predicate>
-_ForwardIterator brick_find_if(_ForwardIterator, _ForwardIterator, _Predicate,
- /*is_vector=*/std::false_type) noexcept;
+_ForwardIterator __brick_find_if(_ForwardIterator, _ForwardIterator, _Predicate,
+ /*is_vector=*/std::false_type) noexcept;
template <class _RandomAccessIterator, class _Predicate>
-_RandomAccessIterator brick_find_if(_RandomAccessIterator, _RandomAccessIterator, _Predicate,
- /*is_vector=*/std::true_type) noexcept;
+_RandomAccessIterator __brick_find_if(_RandomAccessIterator, _RandomAccessIterator, _Predicate,
+ /*is_vector=*/std::true_type) noexcept;
template <class _ExecutionPolicy, class _ForwardIterator, class _Predicate, class _IsVector>
-_ForwardIterator pattern_find_if(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _Predicate, _IsVector,
- /*is_parallel=*/std::false_type) noexcept;
+_ForwardIterator
+__pattern_find_if(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _Predicate, _IsVector,
+ /*is_parallel=*/std::false_type) noexcept;
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _ForwardIterator, class _Predicate, class _IsVector>
-_ForwardIterator pattern_find_if(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _Predicate, _IsVector,
- /*is_parallel=*/std::true_type);
+_ForwardIterator
+__pattern_find_if(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _Predicate, _IsVector,
+ /*is_parallel=*/std::true_type);
#endif
//------------------------------------------------------------------------
@@ -254,25 +278,29 @@ _ForwardIterator pattern_find_if(_Execut
//------------------------------------------------------------------------
template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
-_ForwardIterator1 brick_find_end(_ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2,
- _BinaryPredicate,
- /*__is_vector=*/std::false_type) noexcept;
+_ForwardIterator1 __brick_find_end(_ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2,
+ _BinaryPredicate,
+ /*__is_vector=*/std::false_type) noexcept;
template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
-_ForwardIterator1 brick_find_end(_ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2,
- _BinaryPredicate,
- /*__is_vector=*/std::true_type) noexcept;
+_ForwardIterator1 __brick_find_end(_ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2,
+ _BinaryPredicate,
+ /*__is_vector=*/std::true_type) noexcept;
-template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate, class _IsVector>
-_ForwardIterator1 pattern_find_end(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2,
- _BinaryPredicate, _IsVector,
- /*is_parallel=*/std::false_type) noexcept;
+template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate,
+ class _IsVector>
+_ForwardIterator1
+__pattern_find_end(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2,
+ _BinaryPredicate, _IsVector,
+ /*is_parallel=*/std::false_type) noexcept;
#if __PSTL_USE_PAR_POLICIES
-template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate, class _IsVector>
-_ForwardIterator1 pattern_find_end(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2,
- _BinaryPredicate, _IsVector,
- /*is_parallel=*/std::true_type) noexcept;
+template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate,
+ class _IsVector>
+_ForwardIterator1
+__pattern_find_end(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2,
+ _BinaryPredicate, _IsVector,
+ /*is_parallel=*/std::true_type) noexcept;
#endif
//------------------------------------------------------------------------
@@ -280,23 +308,27 @@ _ForwardIterator1 pattern_find_end(_Exec
//------------------------------------------------------------------------
template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
-_ForwardIterator1 brick_find_first_of(_ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2,
- _BinaryPredicate,
- /*__is_vector=*/std::false_type) noexcept;
+_ForwardIterator1 __brick_find_first_of(_ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2,
+ _BinaryPredicate,
+ /*__is_vector=*/std::false_type) noexcept;
template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
-_ForwardIterator1 brick_find_first_of(_ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2,
- _BinaryPredicate,
- /*__is_vector=*/std::true_type) noexcept;
-
-template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate, class _IsVector>
-_ForwardIterator1 pattern_find_first_of(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2,
- _BinaryPredicate, _IsVector, /*is_parallel=*/std::false_type) noexcept;
+_ForwardIterator1 __brick_find_first_of(_ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2,
+ _BinaryPredicate,
+ /*__is_vector=*/std::true_type) noexcept;
+
+template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate,
+ class _IsVector>
+_ForwardIterator1
+__pattern_find_first_of(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2,
+ _BinaryPredicate, _IsVector, /*is_parallel=*/std::false_type) noexcept;
#if __PSTL_USE_PAR_POLICIES
-template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate, class _IsVector>
-_ForwardIterator1 pattern_find_first_of(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2,
- _BinaryPredicate, _IsVector, /*is_parallel=*/std::true_type) noexcept;
+template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate,
+ class _IsVector>
+_ForwardIterator1
+__pattern_find_first_of(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2,
+ _BinaryPredicate, _IsVector, /*is_parallel=*/std::true_type) noexcept;
#endif
//------------------------------------------------------------------------
@@ -304,25 +336,29 @@ _ForwardIterator1 pattern_find_first_of(
//------------------------------------------------------------------------
template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
-_ForwardIterator1 brick_search(_ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2,
- _BinaryPredicate,
- /*vector=*/std::false_type) noexcept;
+_ForwardIterator1 __brick_search(_ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2,
+ _BinaryPredicate,
+ /*vector=*/std::false_type) noexcept;
template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
-_ForwardIterator1 brick_search(_ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2,
- _BinaryPredicate,
- /*vector=*/std::true_type) noexcept;
+_ForwardIterator1 __brick_search(_ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2,
+ _BinaryPredicate,
+ /*vector=*/std::true_type) noexcept;
-template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate, class _IsVector>
-_ForwardIterator1 pattern_search(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2,
- _BinaryPredicate, _IsVector,
- /*is_parallel=*/std::false_type) noexcept;
+template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate,
+ class _IsVector>
+_ForwardIterator1
+__pattern_search(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2,
+ _BinaryPredicate, _IsVector,
+ /*is_parallel=*/std::false_type) noexcept;
#if __PSTL_USE_PAR_POLICIES
-template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate, class _IsVector>
-_ForwardIterator1 pattern_search(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2,
- _BinaryPredicate, _IsVector,
- /*is_parallel=*/std::true_type) noexcept;
+template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate,
+ class _IsVector>
+_ForwardIterator1
+__pattern_search(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2,
+ _BinaryPredicate, _IsVector,
+ /*is_parallel=*/std::true_type) noexcept;
#endif
//------------------------------------------------------------------------
@@ -331,24 +367,28 @@ _ForwardIterator1 pattern_search(_Execut
template <class _ForwardIterator, class _Size, class _Tp, class _BinaryPredicate>
_ForwardIterator
-brick_search_n(_ForwardIterator, _ForwardIterator, _Size, const _Tp&, _BinaryPredicate,
- /*vector=*/std::false_type) noexcept;
+__brick_search_n(_ForwardIterator, _ForwardIterator, _Size, const _Tp&, _BinaryPredicate,
+ /*vector=*/std::false_type) noexcept;
template <class _ForwardIterator, class _Size, class _Tp, class _BinaryPredicate>
_ForwardIterator
-brick_search_n(_ForwardIterator, _ForwardIterator, _Size, const _Tp&, _BinaryPredicate,
- /*vector=*/std::true_type) noexcept;
+__brick_search_n(_ForwardIterator, _ForwardIterator, _Size, const _Tp&, _BinaryPredicate,
+ /*vector=*/std::true_type) noexcept;
-template <class _ExecutionPolicy, class _ForwardIterator, class _Size, class _Tp, class _BinaryPredicate, class IsVector>
+template <class _ExecutionPolicy, class _ForwardIterator, class _Size, class _Tp, class _BinaryPredicate,
+ class IsVector>
_ForwardIterator
-pattern_search_n(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _Size, const _Tp&, _BinaryPredicate, IsVector,
- /*is_parallel=*/std::false_type) noexcept;
+__pattern_search_n(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _Size, const _Tp&, _BinaryPredicate,
+ IsVector,
+ /*is_parallel=*/std::false_type) noexcept;
#if __PSTL_USE_PAR_POLICIES
-template <class _ExecutionPolicy, class _RandomAccessIterator, class _Size, class _Tp, class _BinaryPredicate, class IsVector>
+template <class _ExecutionPolicy, class _RandomAccessIterator, class _Size, class _Tp, class _BinaryPredicate,
+ class IsVector>
_RandomAccessIterator
-pattern_search_n(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Size, const _Tp&, _BinaryPredicate, IsVector,
- /*is_parallel=*/std::true_type) noexcept;
+__pattern_search_n(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Size, const _Tp&,
+ _BinaryPredicate, IsVector,
+ /*is_parallel=*/std::true_type) noexcept;
#endif
//------------------------------------------------------------------------
@@ -356,97 +396,102 @@ pattern_search_n(_ExecutionPolicy&&, _Ra
//------------------------------------------------------------------------
template <class _ForwardIterator, class _Size, class _OutputIterator>
-_OutputIterator brick_copy_n(_ForwardIterator, _Size, _OutputIterator,
- /*vector=*/std::false_type) noexcept;
+_OutputIterator __brick_copy_n(_ForwardIterator, _Size, _OutputIterator,
+ /*vector=*/std::false_type) noexcept;
template <class _ForwardIterator, class _Size, class _OutputIterator>
-_OutputIterator brick_copy_n(_ForwardIterator, _Size, _OutputIterator,
- /*vector=*/std::true_type) noexcept;
+_OutputIterator __brick_copy_n(_ForwardIterator, _Size, _OutputIterator,
+ /*vector=*/std::true_type) noexcept;
//------------------------------------------------------------------------
// copy
//------------------------------------------------------------------------
template <class _ForwardIterator, class _OutputIterator>
-_OutputIterator brick_copy(_ForwardIterator, _ForwardIterator, _OutputIterator,
- /*vector=*/std::false_type) noexcept;
+_OutputIterator __brick_copy(_ForwardIterator, _ForwardIterator, _OutputIterator,
+ /*vector=*/std::false_type) noexcept;
template <class _RandomAccessIterator, class _OutputIterator>
-_OutputIterator brick_copy(_RandomAccessIterator, _RandomAccessIterator, _OutputIterator,
- /*vector=*/std::true_type) noexcept;
+_OutputIterator __brick_copy(_RandomAccessIterator, _RandomAccessIterator, _OutputIterator,
+ /*vector=*/std::true_type) noexcept;
//------------------------------------------------------------------------
// move
//------------------------------------------------------------------------
template <class _ForwardIterator, class _OutputIterator>
-_OutputIterator brick_move(_ForwardIterator, _ForwardIterator, _OutputIterator,
- /*vector=*/std::false_type) noexcept;
+_OutputIterator __brick_move(_ForwardIterator, _ForwardIterator, _OutputIterator,
+ /*vector=*/std::false_type) noexcept;
template <class _RandomAccessIterator, class _OutputIterator>
-_OutputIterator brick_move(_RandomAccessIterator, _RandomAccessIterator, _OutputIterator,
- /*vector=*/std::true_type) noexcept;
+_OutputIterator __brick_move(_RandomAccessIterator, _RandomAccessIterator, _OutputIterator,
+ /*vector=*/std::true_type) noexcept;
//------------------------------------------------------------------------
// swap_ranges
//------------------------------------------------------------------------
template <class _ForwardIterator, class _OutputIterator>
-_OutputIterator brick_swap_ranges(_ForwardIterator __first, _ForwardIterator __last, _OutputIterator __result,
- /*vector=*/std::false_type) noexcept;
+_OutputIterator
+__brick_swap_ranges(_ForwardIterator __first, _ForwardIterator __last, _OutputIterator __result,
+ /*vector=*/std::false_type) noexcept;
template <class _ForwardIterator, class _OutputIterator>
-_OutputIterator brick_swap_ranges(_ForwardIterator __first, _ForwardIterator __last, _OutputIterator __result,
- /*vector=*/std::true_type) noexcept;
+_OutputIterator
+__brick_swap_ranges(_ForwardIterator __first, _ForwardIterator __last, _OutputIterator __result,
+ /*vector=*/std::true_type) noexcept;
//------------------------------------------------------------------------
// copy_if
//------------------------------------------------------------------------
template <class _ForwardIterator, class _OutputIterator, class _UnaryPredicate>
-_OutputIterator brick_copy_if(_ForwardIterator, _ForwardIterator, _OutputIterator, _UnaryPredicate,
- /*vector=*/std::false_type) noexcept;
+_OutputIterator __brick_copy_if(_ForwardIterator, _ForwardIterator, _OutputIterator, _UnaryPredicate,
+ /*vector=*/std::false_type) noexcept;
template <class _ForwardIterator, class _OutputIterator, class _UnaryPredicate>
-_OutputIterator brick_copy_if(_ForwardIterator, _ForwardIterator, _OutputIterator, _UnaryPredicate,
- /*vector=*/std::true_type) noexcept;
+_OutputIterator __brick_copy_if(_ForwardIterator, _ForwardIterator, _OutputIterator, _UnaryPredicate,
+ /*vector=*/std::true_type) noexcept;
template <class _DifferenceType, class _ForwardIterator, class _UnaryPredicate>
std::pair<_DifferenceType, _DifferenceType>
-brick_calc_mask_1(_ForwardIterator, _ForwardIterator, bool* __restrict, _UnaryPredicate,
- /*vector=*/std::false_type) noexcept;
+__brick_calc_mask_1(_ForwardIterator, _ForwardIterator, bool* __restrict, _UnaryPredicate,
+ /*vector=*/std::false_type) noexcept;
template <class _DifferenceType, class _RandomAccessIterator, class _UnaryPredicate>
std::pair<_DifferenceType, _DifferenceType>
-brick_calc_mask_1(_RandomAccessIterator, _RandomAccessIterator, bool* __restrict, _UnaryPredicate,
- /*vector=*/std::true_type) noexcept;
+__brick_calc_mask_1(_RandomAccessIterator, _RandomAccessIterator, bool* __restrict, _UnaryPredicate,
+ /*vector=*/std::true_type) noexcept;
template <class _ForwardIterator, class _OutputIterator>
void
-brick_copy_by_mask(_ForwardIterator, _ForwardIterator, _OutputIterator, bool*,
- /*vector=*/std::false_type) noexcept;
+__brick_copy_by_mask(_ForwardIterator, _ForwardIterator, _OutputIterator, bool*,
+ /*vector=*/std::false_type) noexcept;
template <class _ForwardIterator, class _OutputIterator>
void
-brick_copy_by_mask(_ForwardIterator, _ForwardIterator, _OutputIterator, bool* __restrict,
- /*vector=*/std::true_type) noexcept;
+__brick_copy_by_mask(_ForwardIterator, _ForwardIterator, _OutputIterator, bool* __restrict,
+ /*vector=*/std::true_type) noexcept;
template <class _ForwardIterator, class _OutputIterator1, class _OutputIterator2>
void
-brick_partition_by_mask(_ForwardIterator, _ForwardIterator, _OutputIterator1, _OutputIterator2, bool*,
- /*vector=*/std::false_type) noexcept;
+__brick_partition_by_mask(_ForwardIterator, _ForwardIterator, _OutputIterator1, _OutputIterator2, bool*,
+ /*vector=*/std::false_type) noexcept;
template <class _RandomAccessIterator, class _OutputIterator1, class _OutputIterator2>
void
-brick_partition_by_mask(_RandomAccessIterator, _RandomAccessIterator, _OutputIterator1, _OutputIterator2, bool*,
- /*vector=*/std::true_type) noexcept;
+__brick_partition_by_mask(_RandomAccessIterator, _RandomAccessIterator, _OutputIterator1, _OutputIterator2, bool*,
+ /*vector=*/std::true_type) noexcept;
template <class _ExecutionPolicy, class _ForwardIterator, class _OutputIterator, class _UnaryPredicate, class _IsVector>
-_OutputIterator pattern_copy_if(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _OutputIterator, _UnaryPredicate, _IsVector,
- /*parallel=*/std::false_type) noexcept;
+_OutputIterator
+__pattern_copy_if(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _OutputIterator, _UnaryPredicate, _IsVector,
+ /*parallel=*/std::false_type) noexcept;
#if __PSTL_USE_PAR_POLICIES
-template <class _ExecutionPolicy, class _RandomAccessIterator, class _OutputIterator, class _UnaryPredicate, class _IsVector>
-_OutputIterator pattern_copy_if(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _OutputIterator, _UnaryPredicate,
- _IsVector, /*parallel=*/std::true_type);
+template <class _ExecutionPolicy, class _RandomAccessIterator, class _OutputIterator, class _UnaryPredicate,
+ class _IsVector>
+_OutputIterator
+__pattern_copy_if(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _OutputIterator, _UnaryPredicate,
+ _IsVector, /*parallel=*/std::true_type);
#endif
//------------------------------------------------------------------------
@@ -455,24 +500,24 @@ _OutputIterator pattern_copy_if(_Executi
template <class _ForwardIterator, class _Predicate>
typename std::iterator_traits<_ForwardIterator>::difference_type
-brick_count(_ForwardIterator, _ForwardIterator, _Predicate,
- /* is_vector = */ std::true_type) noexcept;
+ __brick_count(_ForwardIterator, _ForwardIterator, _Predicate,
+ /* is_vector = */ std::true_type) noexcept;
template <class _ForwardIterator, class _Predicate>
typename std::iterator_traits<_ForwardIterator>::difference_type
-brick_count(_ForwardIterator, _ForwardIterator, _Predicate,
- /* is_vector = */ std::false_type) noexcept;
+ __brick_count(_ForwardIterator, _ForwardIterator, _Predicate,
+ /* is_vector = */ std::false_type) noexcept;
template <class _ExecutionPolicy, class _ForwardIterator, class _Predicate, class _IsVector>
typename std::iterator_traits<_ForwardIterator>::difference_type
-pattern_count(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _Predicate,
- /* is_parallel */ std::false_type, _IsVector) noexcept;
+__pattern_count(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _Predicate,
+ /* is_parallel */ std::false_type, _IsVector) noexcept;
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _ForwardIterator, class _Predicate, class _IsVector>
typename std::iterator_traits<_ForwardIterator>::difference_type
-pattern_count(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _Predicate,
- /* is_parallel */ std::true_type, _IsVector);
+__pattern_count(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _Predicate,
+ /* is_parallel */ std::true_type, _IsVector);
#endif
//------------------------------------------------------------------------
@@ -480,21 +525,23 @@ pattern_count(_ExecutionPolicy&&, _Forwa
//------------------------------------------------------------------------
template <class _ForwardIterator, class _BinaryPredicate>
-_ForwardIterator brick_unique(_ForwardIterator, _ForwardIterator, _BinaryPredicate,
- /*is_vector=*/std::false_type) noexcept;
+_ForwardIterator __brick_unique(_ForwardIterator, _ForwardIterator, _BinaryPredicate,
+ /*is_vector=*/std::false_type) noexcept;
template <class _ForwardIterator, class _BinaryPredicate>
-_ForwardIterator brick_unique(_ForwardIterator, _ForwardIterator, _BinaryPredicate,
- /*is_vector=*/std::true_type) noexcept;
+_ForwardIterator __brick_unique(_ForwardIterator, _ForwardIterator, _BinaryPredicate,
+ /*is_vector=*/std::true_type) noexcept;
template <class _ExecutionPolicy, class _ForwardIterator, class _BinaryPredicate, class _IsVector>
-_ForwardIterator pattern_unique(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _BinaryPredicate, _IsVector,
- /*is_parallel=*/std::false_type) noexcept;
+_ForwardIterator
+__pattern_unique(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _BinaryPredicate, _IsVector,
+ /*is_parallel=*/std::false_type) noexcept;
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _ForwardIterator, class _BinaryPredicate, class _IsVector>
-_ForwardIterator pattern_unique(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _BinaryPredicate, _IsVector,
- /*is_parallel=*/std::true_type) noexcept;
+_ForwardIterator
+__pattern_unique(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _BinaryPredicate, _IsVector,
+ /*is_parallel=*/std::true_type) noexcept;
#endif
//------------------------------------------------------------------------
@@ -502,31 +549,33 @@ _ForwardIterator pattern_unique(_Executi
//------------------------------------------------------------------------
template <class _ForwardIterator, class OutputIterator, class _BinaryPredicate>
-OutputIterator brick_unique_copy(_ForwardIterator, _ForwardIterator, OutputIterator, _BinaryPredicate,
- /*vector=*/std::false_type) noexcept;
+OutputIterator __brick_unique_copy(_ForwardIterator, _ForwardIterator, OutputIterator, _BinaryPredicate,
+ /*vector=*/std::false_type) noexcept;
template <class _RandomAccessIterator, class _OutputIterator, class _BinaryPredicate>
-_OutputIterator brick_unique_copy(_RandomAccessIterator, _RandomAccessIterator, _OutputIterator, _BinaryPredicate,
- /*vector=*/std::true_type) noexcept;
+_OutputIterator __brick_unique_copy(_RandomAccessIterator, _RandomAccessIterator, _OutputIterator, _BinaryPredicate,
+ /*vector=*/std::true_type) noexcept;
template <class _ExecutionPolicy, class _ForwardIterator, class OutputIterator, class _BinaryPredicate, class _IsVector>
-OutputIterator pattern_unique_copy(_ForwardIterator, _ForwardIterator, OutputIterator, _BinaryPredicate, _IsVector,
- /*parallel=*/std::false_type) noexcept;
+OutputIterator __pattern_unique_copy(_ForwardIterator, _ForwardIterator, OutputIterator, _BinaryPredicate, _IsVector,
+ /*parallel=*/std::false_type) noexcept;
template <class _ExecutionPolicy, class _DifferenceType, class _RandomAccessIterator, class _BinaryPredicate>
_DifferenceType
-brick_calc_mask_2(_RandomAccessIterator, _RandomAccessIterator, bool* __restrict, _BinaryPredicate,
- /*vector=*/std::false_type) noexcept;
+__brick_calc_mask_2(_RandomAccessIterator, _RandomAccessIterator, bool* __restrict, _BinaryPredicate,
+ /*vector=*/std::false_type) noexcept;
template <class _DifferenceType, class _RandomAccessIterator, class _BinaryPredicate>
_DifferenceType
-brick_calc_mask_2(_RandomAccessIterator, _RandomAccessIterator, bool* __restrict, _BinaryPredicate,
- /*vector=*/std::true_type) noexcept;
+__brick_calc_mask_2(_RandomAccessIterator, _RandomAccessIterator, bool* __restrict, _BinaryPredicate,
+ /*vector=*/std::true_type) noexcept;
#if __PSTL_USE_PAR_POLICIES
-template <class _ExecutionPolicy, class _RandomAccessIterator, class _OutputIterator, class _BinaryPredicate, class _IsVector>
-_OutputIterator pattern_unique_copy(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _OutputIterator, _BinaryPredicate,
- _IsVector, /*parallel=*/std::true_type);
+template <class _ExecutionPolicy, class _RandomAccessIterator, class _OutputIterator, class _BinaryPredicate,
+ class _IsVector>
+_OutputIterator
+__pattern_unique_copy(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _OutputIterator,
+ _BinaryPredicate, _IsVector, /*parallel=*/std::true_type);
#endif
//------------------------------------------------------------------------
@@ -534,29 +583,31 @@ _OutputIterator pattern_unique_copy(_Exe
//------------------------------------------------------------------------
template <class _BidirectionalIterator>
-void brick_reverse(_BidirectionalIterator, _BidirectionalIterator,
- /*__is_vector=*/std::false_type) noexcept;
+void __brick_reverse(_BidirectionalIterator, _BidirectionalIterator,
+ /*__is_vector=*/std::false_type) noexcept;
template <class _BidirectionalIterator>
-void brick_reverse(_BidirectionalIterator, _BidirectionalIterator,
- /*__is_vector=*/std::true_type) noexcept;
+void __brick_reverse(_BidirectionalIterator, _BidirectionalIterator,
+ /*__is_vector=*/std::true_type) noexcept;
template <class _BidirectionalIterator>
-void brick_reverse(_BidirectionalIterator, _BidirectionalIterator, _BidirectionalIterator,
- /*is_vector=*/std::false_type) noexcept;
+void __brick_reverse(_BidirectionalIterator, _BidirectionalIterator, _BidirectionalIterator,
+ /*is_vector=*/std::false_type) noexcept;
template <class _BidirectionalIterator>
-void brick_reverse(_BidirectionalIterator, _BidirectionalIterator, _BidirectionalIterator,
- /*is_vector=*/std::true_type) noexcept;
+void __brick_reverse(_BidirectionalIterator, _BidirectionalIterator, _BidirectionalIterator,
+ /*is_vector=*/std::true_type) noexcept;
template <class _ExecutionPolicy, class _BidirectionalIterator, class _IsVector>
-void pattern_reverse(_ExecutionPolicy&&, _BidirectionalIterator, _BidirectionalIterator, _IsVector,
- /*is_parallel=*/std::false_type) noexcept;
+void
+__pattern_reverse(_ExecutionPolicy&&, _BidirectionalIterator, _BidirectionalIterator, _IsVector,
+ /*is_parallel=*/std::false_type) noexcept;
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _BidirectionalIterator, class _IsVector>
-void pattern_reverse(_ExecutionPolicy&&, _BidirectionalIterator, _BidirectionalIterator, _IsVector,
- /*is_parallel=*/std::true_type);
+void
+__pattern_reverse(_ExecutionPolicy&&, _BidirectionalIterator, _BidirectionalIterator, _IsVector,
+ /*is_parallel=*/std::true_type);
#endif
//------------------------------------------------------------------------
@@ -564,21 +615,23 @@ void pattern_reverse(_ExecutionPolicy&&,
//------------------------------------------------------------------------
template <class _BidirectionalIterator, class _OutputIterator>
-_OutputIterator brick_reverse_copy(_BidirectionalIterator, _BidirectionalIterator, _OutputIterator,
- /*is_vector=*/std::false_type) noexcept;
+_OutputIterator __brick_reverse_copy(_BidirectionalIterator, _BidirectionalIterator, _OutputIterator,
+ /*is_vector=*/std::false_type) noexcept;
template <class _BidirectionalIterator, class _OutputIterator>
-_OutputIterator brick_reverse_copy(_BidirectionalIterator, _BidirectionalIterator, _OutputIterator,
- /*is_vector=*/std::true_type) noexcept;
+_OutputIterator __brick_reverse_copy(_BidirectionalIterator, _BidirectionalIterator, _OutputIterator,
+ /*is_vector=*/std::true_type) noexcept;
template <class _ExecutionPolicy, class _BidirectionalIterator, class _OutputIterator, class _IsVector>
-_OutputIterator pattern_reverse_copy(_ExecutionPolicy&&, _BidirectionalIterator, _BidirectionalIterator, _OutputIterator, _IsVector,
- /*is_parallel=*/std::false_type) noexcept;
+_OutputIterator
+__pattern_reverse_copy(_ExecutionPolicy&&, _BidirectionalIterator, _BidirectionalIterator, _OutputIterator, _IsVector,
+ /*is_parallel=*/std::false_type) noexcept;
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _BidirectionalIterator, class _OutputIterator, class _IsVector>
-_OutputIterator pattern_reverse_copy(_ExecutionPolicy&&, _BidirectionalIterator, _BidirectionalIterator, _OutputIterator, _IsVector,
- /*is_parallel=*/std::true_type);
+_OutputIterator
+__pattern_reverse_copy(_ExecutionPolicy&&, _BidirectionalIterator, _BidirectionalIterator, _OutputIterator, _IsVector,
+ /*is_parallel=*/std::true_type);
#endif
//------------------------------------------------------------------------
@@ -586,21 +639,23 @@ _OutputIterator pattern_reverse_copy(_Ex
//------------------------------------------------------------------------
template <class _ForwardIterator>
-_ForwardIterator brick_rotate(_ForwardIterator, _ForwardIterator, _ForwardIterator,
- /*is_vector=*/std::false_type) noexcept;
+_ForwardIterator __brick_rotate(_ForwardIterator, _ForwardIterator, _ForwardIterator,
+ /*is_vector=*/std::false_type) noexcept;
template <class _ForwardIterator>
-_ForwardIterator brick_rotate(_ForwardIterator, _ForwardIterator, _ForwardIterator,
- /*is_vector=*/std::true_type) noexcept;
+_ForwardIterator __brick_rotate(_ForwardIterator, _ForwardIterator, _ForwardIterator,
+ /*is_vector=*/std::true_type) noexcept;
template <class _ExecutionPolicy, class _ForwardIterator, class _IsVector>
-_ForwardIterator pattern_rotate(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _ForwardIterator, _IsVector,
- /*is_parallel=*/std::false_type) noexcept;
+_ForwardIterator
+__pattern_rotate(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _ForwardIterator, _IsVector,
+ /*is_parallel=*/std::false_type) noexcept;
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _ForwardIterator, class _IsVector>
-_ForwardIterator pattern_rotate(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _ForwardIterator, _IsVector,
- /*is_parallel=*/std::true_type);
+_ForwardIterator
+__pattern_rotate(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _ForwardIterator, _IsVector,
+ /*is_parallel=*/std::true_type);
#endif
//------------------------------------------------------------------------
@@ -608,21 +663,25 @@ _ForwardIterator pattern_rotate(_Executi
//------------------------------------------------------------------------
template <class _ForwardIterator, class _OutputIterator>
-_OutputIterator brick_rotate_copy(_ForwardIterator, _ForwardIterator, _ForwardIterator, _OutputIterator,
- /*__is_vector=*/std::false_type) noexcept;
+_OutputIterator __brick_rotate_copy(_ForwardIterator, _ForwardIterator, _ForwardIterator, _OutputIterator,
+ /*__is_vector=*/std::false_type) noexcept;
template <class _ForwardIterator, class _OutputIterator>
-_OutputIterator brick_rotate_copy(_ForwardIterator, _ForwardIterator, _ForwardIterator, _OutputIterator,
- /*__is_vector=*/std::true_type) noexcept;
+_OutputIterator __brick_rotate_copy(_ForwardIterator, _ForwardIterator, _ForwardIterator, _OutputIterator,
+ /*__is_vector=*/std::true_type) noexcept;
template <class _ExecutionPolicy, class _ForwardIterator, class _OutputIterator, class _IsVector>
-_OutputIterator pattern_rotate_copy(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _ForwardIterator, _OutputIterator, _IsVector,
- /*is_parallel=*/std::false_type) noexcept;
+_OutputIterator
+__pattern_rotate_copy(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _ForwardIterator, _OutputIterator,
+ _IsVector,
+ /*is_parallel=*/std::false_type) noexcept;
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _ForwardIterator, class _OutputIterator, class _IsVector>
-_OutputIterator pattern_rotate_copy(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _ForwardIterator, _OutputIterator, _IsVector,
- /*is_parallel=*/std::true_type);
+_OutputIterator
+__pattern_rotate_copy(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _ForwardIterator, _OutputIterator,
+ _IsVector,
+ /*is_parallel=*/std::true_type);
#endif
//------------------------------------------------------------------------
@@ -630,21 +689,23 @@ _OutputIterator pattern_rotate_copy(_Exe
//------------------------------------------------------------------------
template <class _ForwardIterator, class _UnaryPredicate>
-bool brick_is_partitioned(_ForwardIterator, _ForwardIterator, _UnaryPredicate,
- /*is_vector=*/std::false_type) noexcept;
+bool __brick_is_partitioned(_ForwardIterator, _ForwardIterator, _UnaryPredicate,
+ /*is_vector=*/std::false_type) noexcept;
template <class _ForwardIterator, class _UnaryPredicate>
-bool brick_is_partitioned(_ForwardIterator, _ForwardIterator, _UnaryPredicate,
- /*is_vector=*/std::true_type) noexcept;
+bool __brick_is_partitioned(_ForwardIterator, _ForwardIterator, _UnaryPredicate,
+ /*is_vector=*/std::true_type) noexcept;
template <class _ExecutionPolicy, class _ForwardIterator, class _UnaryPredicate, class _IsVector>
-bool pattern_is_partitioned(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _UnaryPredicate, _IsVector,
- /*is_parallel=*/std::false_type) noexcept;
+bool
+__pattern_is_partitioned(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _UnaryPredicate, _IsVector,
+ /*is_parallel=*/std::false_type) noexcept;
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _ForwardIterator, class _UnaryPredicate, class _IsVector>
-bool pattern_is_partitioned(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _UnaryPredicate, _IsVector,
- /*is_parallel=*/std::true_type);
+bool
+__pattern_is_partitioned(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _UnaryPredicate, _IsVector,
+ /*is_parallel=*/std::true_type);
#endif
//------------------------------------------------------------------------
@@ -652,21 +713,23 @@ bool pattern_is_partitioned(_ExecutionPo
//------------------------------------------------------------------------
template <class _ForwardIterator, class _UnaryPredicate>
-_ForwardIterator brick_partition(_ForwardIterator, _ForwardIterator, _UnaryPredicate,
- /*is_vector=*/std::false_type) noexcept;
+_ForwardIterator __brick_partition(_ForwardIterator, _ForwardIterator, _UnaryPredicate,
+ /*is_vector=*/std::false_type) noexcept;
template <class _ForwardIterator, class _UnaryPredicate>
-_ForwardIterator brick_partition(_ForwardIterator, _ForwardIterator, _UnaryPredicate,
- /*is_vector=*/std::true_type) noexcept;
+_ForwardIterator __brick_partition(_ForwardIterator, _ForwardIterator, _UnaryPredicate,
+ /*is_vector=*/std::true_type) noexcept;
template <class _ExecutionPolicy, class _ForwardIterator, class _UnaryPredicate, class _IsVector>
-_ForwardIterator pattern_partition(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _UnaryPredicate, _IsVector,
- /*is_parallel=*/std::false_type) noexcept;
+_ForwardIterator
+__pattern_partition(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _UnaryPredicate, _IsVector,
+ /*is_parallel=*/std::false_type) noexcept;
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _ForwardIterator, class _UnaryPredicate, class _IsVector>
-_ForwardIterator pattern_partition(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _UnaryPredicate, _IsVector,
- /*is_parallel=*/std::true_type);
+_ForwardIterator
+__pattern_partition(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _UnaryPredicate, _IsVector,
+ /*is_parallel=*/std::true_type);
#endif
//------------------------------------------------------------------------
@@ -674,23 +737,25 @@ _ForwardIterator pattern_partition(_Exec
//------------------------------------------------------------------------
template <class _BidirectionalIterator, class _UnaryPredicate>
-_BidirectionalIterator brick_stable_partition(_BidirectionalIterator, _BidirectionalIterator, _UnaryPredicate,
- /*__is_vector=*/std::false_type) noexcept;
+_BidirectionalIterator __brick_stable_partition(_BidirectionalIterator, _BidirectionalIterator, _UnaryPredicate,
+ /*__is_vector=*/std::false_type) noexcept;
template <class _BidirectionalIterator, class _UnaryPredicate>
-_BidirectionalIterator brick_stable_partition(_BidirectionalIterator, _BidirectionalIterator, _UnaryPredicate,
- /*__is_vector=*/std::true_type) noexcept;
+_BidirectionalIterator __brick_stable_partition(_BidirectionalIterator, _BidirectionalIterator, _UnaryPredicate,
+ /*__is_vector=*/std::true_type) noexcept;
template <class _ExecutionPolicy, class _BidirectionalIterator, class _UnaryPredicate, class _IsVector>
-_BidirectionalIterator pattern_stable_partition(_ExecutionPolicy&&, _BidirectionalIterator, _BidirectionalIterator, _UnaryPredicate,
- _IsVector,
- /*is_parallelization=*/std::false_type) noexcept;
+_BidirectionalIterator
+__pattern_stable_partition(_ExecutionPolicy&&, _BidirectionalIterator, _BidirectionalIterator, _UnaryPredicate,
+ _IsVector,
+ /*is_parallelization=*/std::false_type) noexcept;
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _BidirectionalIterator, class _UnaryPredicate, class _IsVector>
-_BidirectionalIterator pattern_stable_partition(_ExecutionPolicy&&, _BidirectionalIterator, _BidirectionalIterator, _UnaryPredicate,
- _IsVector,
- /*is_parallelization=*/std::true_type) noexcept;
+_BidirectionalIterator
+__pattern_stable_partition(_ExecutionPolicy&&, _BidirectionalIterator, _BidirectionalIterator, _UnaryPredicate,
+ _IsVector,
+ /*is_parallelization=*/std::true_type) noexcept;
#endif
//------------------------------------------------------------------------
@@ -698,46 +763,47 @@ _BidirectionalIterator pattern_stable_pa
//------------------------------------------------------------------------
template <class _ForwardIterator, class _OutputIterator1, class _OutputIterator2, class _UnaryPredicate>
-std::pair<_OutputIterator1, _OutputIterator2> brick_partition_copy(_ForwardIterator, _ForwardIterator, _OutputIterator1,
- _OutputIterator2, _UnaryPredicate,
- /*is_vector=*/std::false_type) noexcept;
+std::pair<_OutputIterator1, _OutputIterator2>
+ __brick_partition_copy(_ForwardIterator, _ForwardIterator, _OutputIterator1, _OutputIterator2, _UnaryPredicate,
+ /*is_vector=*/std::false_type) noexcept;
template <class _ForwardIterator, class _OutputIterator1, class _OutputIterator2, class _UnaryPredicate>
-std::pair<_OutputIterator1, _OutputIterator2> brick_partition_copy(_ForwardIterator, _ForwardIterator, _OutputIterator1,
- _OutputIterator2, _UnaryPredicate,
- /*is_vector=*/std::true_type) noexcept;
+std::pair<_OutputIterator1, _OutputIterator2>
+ __brick_partition_copy(_ForwardIterator, _ForwardIterator, _OutputIterator1, _OutputIterator2, _UnaryPredicate,
+ /*is_vector=*/std::true_type) noexcept;
-template <class _ExecutionPolicy, class _ForwardIterator, class _OutputIterator1, class _OutputIterator2, class _UnaryPredicate,
- class _IsVector>
+template <class _ExecutionPolicy, class _ForwardIterator, class _OutputIterator1, class _OutputIterator2,
+ class _UnaryPredicate, class _IsVector>
std::pair<_OutputIterator1, _OutputIterator2>
-pattern_partition_copy(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator,
- _OutputIterator1, _OutputIterator2,
- _UnaryPredicate, _IsVector,
- /*is_parallelization=*/std::false_type) noexcept;
+__pattern_partition_copy(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _OutputIterator1, _OutputIterator2,
+ _UnaryPredicate, _IsVector,
+ /*is_parallelization=*/std::false_type) noexcept;
#if __PSTL_USE_PAR_POLICIES
-template <class _ExecutionPolicy, class _RandomAccessIterator, class _OutputIterator1, class _OutputIterator2, class _UnaryPredicate,
- class _IsVector>
+template <class _ExecutionPolicy, class _RandomAccessIterator, class _OutputIterator1, class _OutputIterator2,
+ class _UnaryPredicate, class _IsVector>
std::pair<_OutputIterator1, _OutputIterator2>
-pattern_partition_copy(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator,
- _OutputIterator1, _OutputIterator2,
- _UnaryPredicate, _IsVector,
- /*is_parallelization=*/std::true_type);
+__pattern_partition_copy(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _OutputIterator1,
+ _OutputIterator2, _UnaryPredicate, _IsVector,
+ /*is_parallelization=*/std::true_type);
#endif
//------------------------------------------------------------------------
// sort
//------------------------------------------------------------------------
-template <class _ExecutionPolicy, class _RandomAccessIterator, class _Compare, class _IsVector, class _IsMoveConstructible>
-void pattern_sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare, _IsVector /*is_vector*/,
- /*is_parallel=*/std::false_type, _IsMoveConstructible) noexcept;
+template <class _ExecutionPolicy, class _RandomAccessIterator, class _Compare, class _IsVector,
+ class _IsMoveConstructible>
+void
+__pattern_sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare, _IsVector /*is_vector*/,
+ /*is_parallel=*/std::false_type, _IsMoveConstructible) noexcept;
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _RandomAccessIterator, class _Compare, class _IsVector>
-void pattern_sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare, _IsVector /*is_vector*/,
- /*is_parallel=*/std::true_type,
- /*is_move_constructible=*/std::true_type);
+void
+__pattern_sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare, _IsVector /*is_vector*/,
+ /*is_parallel=*/std::true_type,
+ /*is_move_constructible=*/std::true_type);
#endif
//------------------------------------------------------------------------
@@ -745,13 +811,17 @@ void pattern_sort(_ExecutionPolicy&&, _R
//------------------------------------------------------------------------
template <class _ExecutionPolicy, class _RandomAccessIterator, class _Compare, class _IsVector>
-void pattern_stable_sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare, _IsVector /*is_vector*/,
- /*is_parallel=*/std::false_type) noexcept;
+void
+__pattern_stable_sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare,
+ _IsVector /*is_vector*/,
+ /*is_parallel=*/std::false_type) noexcept;
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _RandomAccessIterator, class _Compare, class _IsVector>
-void pattern_stable_sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare, _IsVector /*is_vector*/,
- /*is_parallel=*/std::true_type);
+void
+__pattern_stable_sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare,
+ _IsVector /*is_vector*/,
+ /*is_parallel=*/std::true_type);
#endif
//------------------------------------------------------------------------
@@ -759,13 +829,17 @@ void pattern_stable_sort(_ExecutionPolic
//------------------------------------------------------------------------
template <class _ExecutionPolicy, class _RandomAccessIterator, class _Compare, class _IsVector>
-void pattern_partial_sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare, _IsVector,
- /*is_parallel=*/std::false_type) noexcept;
+void
+__pattern_partial_sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator,
+ _Compare, _IsVector,
+ /*is_parallel=*/std::false_type) noexcept;
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _RandomAccessIterator, class _Compare, class _IsVector>
-void pattern_partial_sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare, _IsVector,
- /*is_parallel=*/std::true_type);
+void
+__pattern_partial_sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator,
+ _Compare, _IsVector,
+ /*is_parallel=*/std::true_type);
#endif
//------------------------------------------------------------------------
@@ -773,15 +847,17 @@ void pattern_partial_sort(_ExecutionPoli
//------------------------------------------------------------------------
template <class _ExecutionPolicy, class _ForwardIterator, class _RandomAccessIterator, class _Compare, class _IsVector>
-_RandomAccessIterator pattern_partial_sort_copy(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _RandomAccessIterator,
- _RandomAccessIterator, _Compare, _IsVector,
- /*is_parallel=*/std::false_type) noexcept;
+_RandomAccessIterator
+__pattern_partial_sort_copy(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _RandomAccessIterator,
+ _RandomAccessIterator, _Compare, _IsVector,
+ /*is_parallel=*/std::false_type) noexcept;
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _ForwardIterator, class _RandomAccessIterator, class _Compare, class _IsVector>
-_RandomAccessIterator pattern_partial_sort_copy(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _RandomAccessIterator,
- _RandomAccessIterator, _Compare, _IsVector,
- /*is_parallel=*/std::true_type);
+_RandomAccessIterator
+__pattern_partial_sort_copy(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _RandomAccessIterator,
+ _RandomAccessIterator, _Compare, _IsVector,
+ /*is_parallel=*/std::true_type);
#endif
//------------------------------------------------------------------------
@@ -790,37 +866,41 @@ _RandomAccessIterator pattern_partial_so
template <class _ForwardIterator, class _BinaryPredicate>
_ForwardIterator
-brick_adjacent_find(_ForwardIterator, _ForwardIterator, _BinaryPredicate,
- /* IsVector = */ std::true_type, bool) noexcept;
+__brick_adjacent_find(_ForwardIterator, _ForwardIterator, _BinaryPredicate,
+ /* IsVector = */ std::true_type, bool) noexcept;
template <class _ForwardIterator, class _BinaryPredicate>
_ForwardIterator
-brick_adjacent_find(_ForwardIterator, _ForwardIterator, _BinaryPredicate,
- /* IsVector = */ std::false_type, bool) noexcept;
+__brick_adjacent_find(_ForwardIterator, _ForwardIterator, _BinaryPredicate,
+ /* IsVector = */ std::false_type, bool) noexcept;
template <class _ExecutionPolicy, class _ForwardIterator, class _BinaryPredicate, class _IsVector>
_ForwardIterator
-pattern_adjacent_find(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _BinaryPredicate,
- /* is_parallel */ std::false_type, _IsVector, bool) noexcept;
+__pattern_adjacent_find(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _BinaryPredicate,
+ /* is_parallel */ std::false_type, _IsVector, bool) noexcept;
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _RandomAccessIterator, class _BinaryPredicate, class _IsVector>
_RandomAccessIterator
-pattern_adjacent_find(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _BinaryPredicate,
- /* is_parallel */ std::true_type, _IsVector, bool);
+__pattern_adjacent_find(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _BinaryPredicate,
+ /* is_parallel */ std::true_type, _IsVector, bool);
#endif
//------------------------------------------------------------------------
// nth_element
//------------------------------------------------------------------------
template <class _ExecutionPolicy, class _RandomAccessIterator, class _Compare, class _IsVector>
-void pattern_nth_element(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare, _IsVector,
- /*is_parallel=*/std::false_type) noexcept;
+void
+__pattern_nth_element(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare,
+ _IsVector,
+ /*is_parallel=*/std::false_type) noexcept;
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _RandomAccessIterator, class _Compare, class _IsVector>
-void pattern_nth_element(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare, _IsVector,
- /*is_parallel=*/std::true_type) noexcept;
+void
+__pattern_nth_element(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare,
+ _IsVector,
+ /*is_parallel=*/std::true_type) noexcept;
#endif
//------------------------------------------------------------------------
@@ -828,46 +908,46 @@ void pattern_nth_element(_ExecutionPolic
//------------------------------------------------------------------------
template <class _ForwardIterator, class _Tp>
void
-brick_fill(_ForwardIterator, _ForwardIterator, const _Tp&,
- /* __is_vector = */ std::true_type) noexcept;
+__brick_fill(_ForwardIterator, _ForwardIterator, const _Tp&,
+ /* __is_vector = */ std::true_type) noexcept;
template <class _ForwardIterator, class _Tp>
void
-brick_fill(_ForwardIterator, _ForwardIterator, const _Tp&,
- /* __is_vector = */ std::false_type) noexcept;
+__brick_fill(_ForwardIterator, _ForwardIterator, const _Tp&,
+ /* __is_vector = */ std::false_type) noexcept;
template <class _ExecutionPolicy, class _ForwardIterator, class _Tp, class _IsVector>
void
-pattern_fill(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&,
- /*is_parallel=*/std::false_type, _IsVector) noexcept;
+__pattern_fill(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&,
+ /*is_parallel=*/std::false_type, _IsVector) noexcept;
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _ForwardIterator, class _Tp, class _IsVector>
_ForwardIterator
-pattern_fill(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&,
- /*is_parallel=*/std::true_type, _IsVector);
+__pattern_fill(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&,
+ /*is_parallel=*/std::true_type, _IsVector);
#endif
template <class _OutputIterator, class _Size, class _Tp>
_OutputIterator
-brick_fill_n(_OutputIterator, _Size, const _Tp&,
- /* __is_vector = */ std::true_type) noexcept;
+__brick_fill_n(_OutputIterator, _Size, const _Tp&,
+ /* __is_vector = */ std::true_type) noexcept;
template <class _OutputIterator, class _Size, class _Tp>
_OutputIterator
-brick_fill_n(_OutputIterator, _Size, const _Tp&,
- /* __is_vector = */ std::false_type) noexcept;
+__brick_fill_n(_OutputIterator, _Size, const _Tp&,
+ /* __is_vector = */ std::false_type) noexcept;
template <class _ExecutionPolicy, class _OutputIterator, class _Size, class _Tp, class _IsVector>
_OutputIterator
-pattern_fill_n(_ExecutionPolicy&&, _OutputIterator, _Size, const _Tp&,
- /*is_parallel=*/std::false_type, _IsVector) noexcept;
+__pattern_fill_n(_ExecutionPolicy&&, _OutputIterator, _Size, const _Tp&,
+ /*is_parallel=*/std::false_type, _IsVector) noexcept;
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _OutputIterator, class _Size, class _Tp, class _IsVector>
_OutputIterator
-pattern_fill_n(_ExecutionPolicy&&, _OutputIterator, _Size, const _Tp&,
- /*is_parallel=*/std::true_type, _IsVector);
+__pattern_fill_n(_ExecutionPolicy&&, _OutputIterator, _Size, const _Tp&,
+ /*is_parallel=*/std::true_type, _IsVector);
#endif
//------------------------------------------------------------------------
@@ -875,60 +955,66 @@ pattern_fill_n(_ExecutionPolicy&&, _Outp
//------------------------------------------------------------------------
template <class _RandomAccessIterator, class _Generator>
-void brick_generate(_RandomAccessIterator, _RandomAccessIterator, _Generator,
- /* is_vector = */ std::true_type) noexcept;
+void __brick_generate(_RandomAccessIterator, _RandomAccessIterator, _Generator,
+ /* is_vector = */ std::true_type) noexcept;
template <class _ForwardIterator, class _Generator>
-void brick_generate(_ForwardIterator, _ForwardIterator, _Generator,
- /* is_vector = */ std::false_type) noexcept;
+void __brick_generate(_ForwardIterator, _ForwardIterator, _Generator,
+ /* is_vector = */ std::false_type) noexcept;
template <class _ExecutionPolicy, class _ForwardIterator, class _Generator, class _IsVector>
-void pattern_generate(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _Generator,
- /*is_parallel=*/std::false_type, _IsVector) noexcept;
+void
+__pattern_generate(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _Generator,
+ /*is_parallel=*/std::false_type, _IsVector) noexcept;
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _ForwardIterator, class _Generator, class _IsVector>
-_ForwardIterator pattern_generate(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _Generator,
- /*is_parallel=*/std::true_type, _IsVector);
+_ForwardIterator
+__pattern_generate(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _Generator,
+ /*is_parallel=*/std::true_type, _IsVector);
#endif
template <class OutputIterator, class Size, class _Generator>
-OutputIterator brick_generate_n(OutputIterator, Size, _Generator,
- /* is_vector = */ std::true_type) noexcept;
+OutputIterator __brick_generate_n(OutputIterator, Size, _Generator,
+ /* is_vector = */ std::true_type) noexcept;
template <class OutputIterator, class Size, class _Generator>
-OutputIterator brick_generate_n(OutputIterator, Size, _Generator,
- /* is_vector = */ std::false_type) noexcept;
+OutputIterator __brick_generate_n(OutputIterator, Size, _Generator,
+ /* is_vector = */ std::false_type) noexcept;
template <class _ExecutionPolicy, class OutputIterator, class Size, class _Generator, class _IsVector>
-OutputIterator pattern_generate_n(_ExecutionPolicy&&, OutputIterator, Size, _Generator,
- /*is_parallel=*/std::false_type, _IsVector) noexcept;
+OutputIterator
+__pattern_generate_n(_ExecutionPolicy&&, OutputIterator, Size, _Generator,
+ /*is_parallel=*/std::false_type, _IsVector) noexcept;
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class OutputIterator, class Size, class _Generator, class _IsVector>
-OutputIterator pattern_generate_n(_ExecutionPolicy&&, OutputIterator, Size, _Generator,
- /*is_parallel=*/std::true_type, _IsVector);
+OutputIterator
+__pattern_generate_n(_ExecutionPolicy&&, OutputIterator, Size, _Generator,
+ /*is_parallel=*/std::true_type, _IsVector);
#endif
//------------------------------------------------------------------------
// remove
//------------------------------------------------------------------------
template <class _ForwardIterator, class _UnaryPredicate>
-_ForwardIterator brick_remove_if(_ForwardIterator, _ForwardIterator, _UnaryPredicate,
- /* __is_vector = */ std::false_type) noexcept;
+_ForwardIterator __brick_remove_if(_ForwardIterator, _ForwardIterator, _UnaryPredicate,
+ /* __is_vector = */ std::false_type) noexcept;
template <class _RandomAccessIterator, class _UnaryPredicate>
-_RandomAccessIterator brick_remove_if(_RandomAccessIterator, _RandomAccessIterator, _UnaryPredicate,
- /* __is_vector = */ std::true_type) noexcept;
+_RandomAccessIterator __brick_remove_if(_RandomAccessIterator, _RandomAccessIterator, _UnaryPredicate,
+ /* __is_vector = */ std::true_type) noexcept;
template <class _ExecutionPolicy, class _ForwardIterator, class _UnaryPredicate, class _IsVector>
-_ForwardIterator pattern_remove_if(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _UnaryPredicate, _IsVector,
- /*is_parallel*/ std::false_type) noexcept;
+_ForwardIterator
+__pattern_remove_if(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _UnaryPredicate, _IsVector,
+ /*is_parallel*/ std::false_type) noexcept;
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _ForwardIterator, class _UnaryPredicate, class _IsVector>
-_ForwardIterator pattern_remove_if(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _UnaryPredicate, _IsVector,
- /*is_parallel*/ std::true_type) noexcept;
+_ForwardIterator
+__pattern_remove_if(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _UnaryPredicate, _IsVector,
+ /*is_parallel*/ std::true_type) noexcept;
#endif
//------------------------------------------------------------------------
@@ -936,25 +1022,28 @@ _ForwardIterator pattern_remove_if(_Exec
//------------------------------------------------------------------------
template <class _ForwardIterator1, class _ForwardIterator2, class _OutputIterator, class _Compare>
-_OutputIterator brick_merge(_ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2, _OutputIterator,
- _Compare,
- /* __is_vector = */ std::false_type) noexcept;
+_OutputIterator __brick_merge(_ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2,
+ _OutputIterator, _Compare,
+ /* __is_vector = */ std::false_type) noexcept;
template <class _ForwardIterator1, class _ForwardIterator2, class _OutputIterator, class _Compare>
-_OutputIterator brick_merge(_ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2, _OutputIterator,
- _Compare,
- /* __is_vector = */ std::true_type) noexcept;
+_OutputIterator __brick_merge(_ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2,
+ _OutputIterator, _Compare,
+ /* __is_vector = */ std::true_type) noexcept;
-template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _OutputIterator, class _Compare, class _IsVector>
-_OutputIterator pattern_merge(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2,
- _OutputIterator, _Compare, _IsVector, /* is_parallel = */ std::false_type) noexcept;
+template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _OutputIterator,
+ class _Compare, class _IsVector>
+_OutputIterator
+__pattern_merge(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2,
+ _OutputIterator, _Compare, _IsVector, /* is_parallel = */ std::false_type) noexcept;
#if __PSTL_USE_PAR_POLICIES
-template <class _ExecutionPolicy, class _RandomAccessIterator1, class _RandomAccessIterator2, class _OutputIterator, class _Compare,
- class _IsVector>
-_OutputIterator pattern_merge(_ExecutionPolicy&&, _RandomAccessIterator1, _RandomAccessIterator1, _RandomAccessIterator2,
- _RandomAccessIterator2, _OutputIterator, _Compare, _IsVector,
- /* is_parallel = */ std::true_type);
+template <class _ExecutionPolicy, class _RandomAccessIterator1, class _RandomAccessIterator2, class _OutputIterator,
+ class _Compare, class _IsVector>
+_OutputIterator
+__pattern_merge(_ExecutionPolicy&&, _RandomAccessIterator1, _RandomAccessIterator1, _RandomAccessIterator2,
+ _RandomAccessIterator2, _OutputIterator, _Compare, _IsVector,
+ /* is_parallel = */ std::true_type);
#endif
//------------------------------------------------------------------------
@@ -962,21 +1051,25 @@ _OutputIterator pattern_merge(_Execution
//------------------------------------------------------------------------
template <class _BidirectionalIterator, class _Compare>
-void brick_inplace_merge(_BidirectionalIterator, _BidirectionalIterator, _BidirectionalIterator, _Compare,
- /* __is_vector = */ std::false_type) noexcept;
+void __brick_inplace_merge(_BidirectionalIterator, _BidirectionalIterator, _BidirectionalIterator, _Compare,
+ /* __is_vector = */ std::false_type) noexcept;
template <class _BidirectionalIterator, class _Compare>
-void brick_inplace_merge(_BidirectionalIterator, _BidirectionalIterator, _BidirectionalIterator, _Compare,
- /* __is_vector = */ std::true_type) noexcept;
+void __brick_inplace_merge(_BidirectionalIterator, _BidirectionalIterator, _BidirectionalIterator, _Compare,
+ /* __is_vector = */ std::true_type) noexcept;
template <class _ExecutionPolicy, class _BidirectionalIterator, class _Compare, class _IsVector>
-void pattern_inplace_merge(_ExecutionPolicy&&, _BidirectionalIterator, _BidirectionalIterator, _BidirectionalIterator, _Compare, _IsVector,
- /* is_parallel = */ std::false_type) noexcept;
+void
+__pattern_inplace_merge(_ExecutionPolicy&&, _BidirectionalIterator, _BidirectionalIterator, _BidirectionalIterator,
+ _Compare, _IsVector,
+ /* is_parallel = */ std::false_type) noexcept;
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _BidirectionalIterator, class _Compare, class _IsVector>
-void pattern_inplace_merge(_ExecutionPolicy&&, _BidirectionalIterator, _BidirectionalIterator, _BidirectionalIterator, _Compare, _IsVector,
- /*is_parallel=*/std::true_type);
+void
+__pattern_inplace_merge(_ExecutionPolicy&&, _BidirectionalIterator, _BidirectionalIterator, _BidirectionalIterator,
+ _Compare, _IsVector,
+ /*is_parallel=*/std::true_type);
#endif
//------------------------------------------------------------------------
@@ -984,13 +1077,17 @@ void pattern_inplace_merge(_ExecutionPol
//------------------------------------------------------------------------
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Compare, class _IsVector>
-bool pattern_includes(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2, _Compare, _IsVector,
- /*is_parallel=*/std::false_type) noexcept;
+bool
+__pattern_includes(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2,
+ _Compare, _IsVector,
+ /*is_parallel=*/std::false_type) noexcept;
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Compare, class _IsVector>
-bool pattern_includes(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2, _Compare, _IsVector,
- /*is_parallel=*/std::true_type);
+bool
+__pattern_includes(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2,
+ _Compare, _IsVector,
+ /*is_parallel=*/std::true_type);
#endif
//------------------------------------------------------------------------
@@ -998,23 +1095,27 @@ bool pattern_includes(_ExecutionPolicy&&
//------------------------------------------------------------------------
template <class _ForwardIterator1, class _ForwardIterator2, class _OutputIterator, class _Compare>
-_OutputIterator brick_set_union(_ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2,
- _OutputIterator, _Compare,
- /*__is_vector=*/std::false_type) noexcept;
+_OutputIterator __brick_set_union(_ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2,
+ _OutputIterator, _Compare,
+ /*__is_vector=*/std::false_type) noexcept;
template <class _ForwardIterator1, class _ForwardIterator2, class _OutputIterator, class _Compare>
-_OutputIterator brick_set_union(_ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2,
- _OutputIterator, _Compare,
- /*__is_vector=*/std::true_type) noexcept;
-
-template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _OutputIterator, class _Compare, class _IsVector>
-_OutputIterator pattern_set_union(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2,
- _OutputIterator, _Compare, _IsVector, /*is_parallel=*/std::false_type) noexcept;
+_OutputIterator __brick_set_union(_ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2,
+ _OutputIterator, _Compare,
+ /*__is_vector=*/std::true_type) noexcept;
+
+template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _OutputIterator,
+ class _Compare, class _IsVector>
+_OutputIterator
+__pattern_set_union(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2,
+ _OutputIterator, _Compare, _IsVector, /*is_parallel=*/std::false_type) noexcept;
#if __PSTL_USE_PAR_POLICIES
-template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _OutputIterator, class _Compare, class _IsVector>
-_OutputIterator pattern_set_union(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2,
- _OutputIterator, _Compare, _IsVector, /*is_parallel=*/std::true_type);
+template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _OutputIterator,
+ class _Compare, class _IsVector>
+_OutputIterator
+__pattern_set_union(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2,
+ _OutputIterator, _Compare, _IsVector, /*is_parallel=*/std::true_type);
#endif
//------------------------------------------------------------------------
@@ -1022,24 +1123,28 @@ _OutputIterator pattern_set_union(_Execu
//------------------------------------------------------------------------
template <class _ForwardIterator1, class _ForwardIterator2, class _OutputIterator, class _Compare>
-_OutputIterator brick_set_intersection(_ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2,
- _OutputIterator, _Compare,
- /*__is_vector=*/std::false_type) noexcept;
+_OutputIterator __brick_set_intersection(_ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2,
+ _OutputIterator, _Compare,
+ /*__is_vector=*/std::false_type) noexcept;
template <class _ForwardIterator1, class _ForwardIterator2, class _OutputIterator, class _Compare>
-_OutputIterator brick_set_intersection(_ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2,
- _OutputIterator, _Compare,
- /*__is_vector=*/std::true_type) noexcept;
+_OutputIterator __brick_set_intersection(_ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2,
+ _OutputIterator, _Compare,
+ /*__is_vector=*/std::true_type) noexcept;
-template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _OutputIterator, class _Compare, class _IsVector>
-_OutputIterator pattern_set_intersection(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2,
- _OutputIterator, _Compare, _IsVector,
- /*is_parallel=*/std::false_type) noexcept;
+template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _OutputIterator,
+ class _Compare, class _IsVector>
+_OutputIterator
+__pattern_set_intersection(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2,
+ _ForwardIterator2, _OutputIterator, _Compare, _IsVector,
+ /*is_parallel=*/std::false_type) noexcept;
#if __PSTL_USE_PAR_POLICIES
-template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _OutputIterator, class _Compare, class _IsVector>
-_OutputIterator pattern_set_intersection(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2,
- _OutputIterator, _Compare, _IsVector, /*is_parallel=*/std::true_type);
+template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _OutputIterator,
+ class _Compare, class _IsVector>
+_OutputIterator
+__pattern_set_intersection(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2,
+ _ForwardIterator2, _OutputIterator, _Compare, _IsVector, /*is_parallel=*/std::true_type);
#endif
//------------------------------------------------------------------------
@@ -1047,23 +1152,27 @@ _OutputIterator pattern_set_intersection
//------------------------------------------------------------------------
template <class _ForwardIterator1, class _ForwardIterator2, class _OutputIterator, class _Compare>
-_OutputIterator brick_set_difference(_ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2,
- _OutputIterator, _Compare,
- /*__is_vector=*/std::false_type) noexcept;
+_OutputIterator __brick_set_difference(_ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2,
+ _OutputIterator, _Compare,
+ /*__is_vector=*/std::false_type) noexcept;
template <class _ForwardIterator1, class _ForwardIterator2, class _OutputIterator, class _Compare>
-_OutputIterator brick_set_difference(_ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2,
- _OutputIterator, _Compare,
- /*__is_vector=*/std::true_type) noexcept;
-
-template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _OutputIterator, class _Compare, class _IsVector>
-_OutputIterator pattern_set_difference(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2,
- _OutputIterator, _Compare, _IsVector, /*is_parallel=*/std::false_type) noexcept;
+_OutputIterator __brick_set_difference(_ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2,
+ _OutputIterator, _Compare,
+ /*__is_vector=*/std::true_type) noexcept;
+
+template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _OutputIterator,
+ class _Compare, class _IsVector>
+_OutputIterator
+__pattern_set_difference(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2,
+ _OutputIterator, _Compare, _IsVector, /*is_parallel=*/std::false_type) noexcept;
#if __PSTL_USE_PAR_POLICIES
-template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _OutputIterator, class _Compare, class _IsVector>
-_OutputIterator pattern_set_difference(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2,
- _OutputIterator, _Compare, _IsVector, /*is_parallel=*/std::true_type);
+template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _OutputIterator,
+ class _Compare, class _IsVector>
+_OutputIterator
+__pattern_set_difference(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2,
+ _OutputIterator, _Compare, _IsVector, /*is_parallel=*/std::true_type);
#endif
//------------------------------------------------------------------------
@@ -1071,25 +1180,29 @@ _OutputIterator pattern_set_difference(_
//------------------------------------------------------------------------
template <class _ForwardIterator1, class _ForwardIterator2, class _OutputIterator, class _Compare>
-_OutputIterator brick_set_symmetric_difference(_ForwardIterator1, _ForwardIterator1, _ForwardIterator2,
- _ForwardIterator2, _OutputIterator, _Compare,
- /*__is_vector=*/std::false_type) noexcept;
+_OutputIterator __brick_set_symmetric_difference(_ForwardIterator1, _ForwardIterator1, _ForwardIterator2,
+ _ForwardIterator2, _OutputIterator, _Compare,
+ /*__is_vector=*/std::false_type) noexcept;
template <class _ForwardIterator1, class _ForwardIterator2, class _OutputIterator, class _Compare>
-_OutputIterator brick_set_symmetric_difference(_ForwardIterator1, _ForwardIterator1, _ForwardIterator2,
- _ForwardIterator2, _OutputIterator, _Compare,
- /*__is_vector=*/std::true_type) noexcept;
-
-template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _OutputIterator, class _Compare, class _IsVector>
-_OutputIterator pattern_set_symmetric_difference(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2,
- _ForwardIterator2, _OutputIterator, _Compare, _IsVector,
- /*is_parallel=*/std::false_type) noexcept;
+_OutputIterator __brick_set_symmetric_difference(_ForwardIterator1, _ForwardIterator1, _ForwardIterator2,
+ _ForwardIterator2, _OutputIterator, _Compare,
+ /*__is_vector=*/std::true_type) noexcept;
+
+template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _OutputIterator,
+ class _Compare, class _IsVector>
+_OutputIterator
+__pattern_set_symmetric_difference(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2,
+ _ForwardIterator2, _OutputIterator, _Compare, _IsVector,
+ /*is_parallel=*/std::false_type) noexcept;
#if __PSTL_USE_PAR_POLICIES
-template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _OutputIterator, class _Compare, class _IsVector>
-_OutputIterator pattern_set_symmetric_difference(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2,
- _ForwardIterator2, _OutputIterator, _Compare, _IsVector,
- /*is_parallel=*/std::true_type);
+template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _OutputIterator,
+ class _Compare, class _IsVector>
+_OutputIterator
+__pattern_set_symmetric_difference(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2,
+ _ForwardIterator2, _OutputIterator, _Compare, _IsVector,
+ /*is_parallel=*/std::true_type);
#endif
//------------------------------------------------------------------------
@@ -1097,21 +1210,23 @@ _OutputIterator pattern_set_symmetric_di
//------------------------------------------------------------------------
template <class _RandomAccessIterator, class _Compare>
-_RandomAccessIterator brick_is_heap_until(_RandomAccessIterator, _RandomAccessIterator, _Compare,
- /* __is_vector = */ std::false_type) noexcept;
+_RandomAccessIterator __brick_is_heap_until(_RandomAccessIterator, _RandomAccessIterator, _Compare,
+ /* __is_vector = */ std::false_type) noexcept;
template <class _RandomAccessIterator, class _Compare>
-_RandomAccessIterator brick_is_heap_until(_RandomAccessIterator, _RandomAccessIterator, _Compare,
- /* __is_vector = */ std::true_type) noexcept;
+_RandomAccessIterator __brick_is_heap_until(_RandomAccessIterator, _RandomAccessIterator, _Compare,
+ /* __is_vector = */ std::true_type) noexcept;
template <class _ExecutionPolicy, class _RandomAccessIterator, class _Compare, class _IsVector>
-_RandomAccessIterator pattern_is_heap_until(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare, _IsVector,
- /* is_parallel = */ std::false_type) noexcept;
+_RandomAccessIterator
+__pattern_is_heap_until(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare, _IsVector,
+ /* is_parallel = */ std::false_type) noexcept;
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _RandomAccessIterator, class _Compare, class _IsVector>
-_RandomAccessIterator pattern_is_heap_until(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare, _IsVector,
- /* is_parallel = */ std::true_type) noexcept;
+_RandomAccessIterator
+__pattern_is_heap_until(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare, _IsVector,
+ /* is_parallel = */ std::true_type) noexcept;
#endif
//------------------------------------------------------------------------
@@ -1119,21 +1234,23 @@ _RandomAccessIterator pattern_is_heap_un
//------------------------------------------------------------------------
template <typename _ForwardIterator, typename _Compare>
-_ForwardIterator brick_min_element(_ForwardIterator, _ForwardIterator, _Compare,
- /* __is_vector = */ std::false_type) noexcept;
+_ForwardIterator __brick_min_element(_ForwardIterator, _ForwardIterator, _Compare,
+ /* __is_vector = */ std::false_type) noexcept;
template <typename _ForwardIterator, typename _Compare>
-_ForwardIterator brick_min_element(_ForwardIterator, _ForwardIterator, _Compare,
- /* __is_vector = */ std::true_type) noexcept;
+_ForwardIterator __brick_min_element(_ForwardIterator, _ForwardIterator, _Compare,
+ /* __is_vector = */ std::true_type) noexcept;
template <typename _ExecutionPolicy, typename _ForwardIterator, typename _Compare, typename _IsVector>
-_ForwardIterator pattern_min_element(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _Compare, _IsVector,
- /* is_parallel = */ std::false_type) noexcept;
+_ForwardIterator
+__pattern_min_element(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _Compare, _IsVector,
+ /* is_parallel = */ std::false_type) noexcept;
#if __PSTL_USE_PAR_POLICIES
template <typename _ExecutionPolicy, typename _RandomAccessIterator, typename _Compare, typename _IsVector>
-_RandomAccessIterator pattern_min_element(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare, _IsVector,
- /* is_parallel = */ std::true_type);
+_RandomAccessIterator
+__pattern_min_element(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare, _IsVector,
+ /* is_parallel = */ std::true_type);
#endif
//------------------------------------------------------------------------
@@ -1141,27 +1258,23 @@ _RandomAccessIterator pattern_min_elemen
//------------------------------------------------------------------------
template <typename _ForwardIterator, typename _Compare>
-std::pair<_ForwardIterator, _ForwardIterator>
-brick_minmax_element(_ForwardIterator, _ForwardIterator, _Compare,
- /* __is_vector = */ std::false_type) noexcept;
+std::pair<_ForwardIterator, _ForwardIterator> __brick_minmax_element(_ForwardIterator, _ForwardIterator, _Compare,
+ /* __is_vector = */ std::false_type) noexcept;
template <typename _ForwardIterator, typename _Compare>
-std::pair<_ForwardIterator, _ForwardIterator>
-brick_minmax_element(_ForwardIterator, _ForwardIterator, _Compare,
- /* __is_vector = */ std::true_type) noexcept;
+std::pair<_ForwardIterator, _ForwardIterator> __brick_minmax_element(_ForwardIterator, _ForwardIterator, _Compare,
+ /* __is_vector = */ std::true_type) noexcept;
template <typename _ExecutionPolicy, typename _ForwardIterator, typename _Compare, typename _IsVector>
std::pair<_ForwardIterator, _ForwardIterator>
-pattern_minmax_element(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _Compare,
- _IsVector,
- /* is_parallel = */ std::false_type) noexcept;
+__pattern_minmax_element(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _Compare, _IsVector,
+ /* is_parallel = */ std::false_type) noexcept;
#if __PSTL_USE_PAR_POLICIES
template <typename _ExecutionPolicy, typename _ForwardIterator, typename _Compare, typename _IsVector>
std::pair<_ForwardIterator, _ForwardIterator>
-pattern_minmax_element(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _Compare,
- _IsVector,
- /* is_parallel = */ std::true_type);
+__pattern_minmax_element(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _Compare, _IsVector,
+ /* is_parallel = */ std::true_type);
#endif
//------------------------------------------------------------------------
@@ -1169,27 +1282,27 @@ pattern_minmax_element(_ExecutionPolicy&
//------------------------------------------------------------------------
template <class _ForwardIterator1, class _ForwardIterator2, class _Predicate>
-std::pair<_ForwardIterator1, _ForwardIterator2>
-brick_mismatch(_ForwardIterator1, _ForwardIterator1, _ForwardIterator2,
- _ForwardIterator2, _Predicate,
- /* __is_vector = */ std::false_type) noexcept;
+std::pair<_ForwardIterator1, _ForwardIterator2> __brick_mismatch(_ForwardIterator1, _ForwardIterator1,
+ _ForwardIterator2, _ForwardIterator2, _Predicate,
+ /* __is_vector = */ std::false_type) noexcept;
template <class _ForwardIterator1, class _ForwardIterator2, class _Predicate>
-std::pair<_ForwardIterator1, _ForwardIterator2>
-brick_mismatch(_ForwardIterator1, _ForwardIterator1, _ForwardIterator2,
- _ForwardIterator2, _Predicate,
- /* __is_vector = */ std::true_type) noexcept;
+std::pair<_ForwardIterator1, _ForwardIterator2> __brick_mismatch(_ForwardIterator1, _ForwardIterator1,
+ _ForwardIterator2, _ForwardIterator2, _Predicate,
+ /* __is_vector = */ std::true_type) noexcept;
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Predicate, class _IsVector>
std::pair<_ForwardIterator1, _ForwardIterator2>
-pattern_mismatch(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2, _Predicate, _IsVector,
- /* is_parallel = */ std::false_type) noexcept;
+__pattern_mismatch(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2,
+ _Predicate, _IsVector,
+ /* is_parallel = */ std::false_type) noexcept;
#if __PSTL_USE_PAR_POLICIES
-template <class _ExecutionPolicy, class _RandomAccessIterator1, class _RandomAccessIterator2, class _Predicate, class _IsVector>
+template <class _ExecutionPolicy, class _RandomAccessIterator1, class _RandomAccessIterator2, class _Predicate,
+ class _IsVector>
std::pair<_RandomAccessIterator1, _RandomAccessIterator2>
-pattern_mismatch(_ExecutionPolicy&&, _RandomAccessIterator1, _RandomAccessIterator1, _RandomAccessIterator2, _RandomAccessIterator2,
- _Predicate, _IsVector, /* is_parallel = */ std::true_type) noexcept;
+__pattern_mismatch(_ExecutionPolicy&&, _RandomAccessIterator1, _RandomAccessIterator1, _RandomAccessIterator2,
+ _RandomAccessIterator2, _Predicate, _IsVector, /* is_parallel = */ std::true_type) noexcept;
#endif
//------------------------------------------------------------------------
@@ -1197,23 +1310,27 @@ pattern_mismatch(_ExecutionPolicy&&, _Ra
//------------------------------------------------------------------------
template <class _ForwardIterator1, class _ForwardIterator2, class _Compare>
-bool brick_lexicographical_compare(_ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2, _Compare,
- /* __is_vector = */ std::false_type) noexcept;
+bool __brick_lexicographical_compare(_ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2,
+ _Compare,
+ /* __is_vector = */ std::false_type) noexcept;
template <class _ForwardIterator1, class _ForwardIterator2, class _Compare>
-bool brick_lexicographical_compare(_ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2, _Compare,
- /* __is_vector = */ std::true_type) noexcept;
+bool __brick_lexicographical_compare(_ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2,
+ _Compare,
+ /* __is_vector = */ std::true_type) noexcept;
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Compare, class _IsVector>
-bool pattern_lexicographical_compare(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2,
- _Compare, _IsVector, /* is_parallel = */ std::false_type) noexcept;
+bool
+__pattern_lexicographical_compare(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2,
+ _ForwardIterator2, _Compare, _IsVector, /* is_parallel = */ std::false_type) noexcept;
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Compare, class _IsVector>
-bool pattern_lexicographical_compare(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2,
- _Compare, _IsVector, /* is_parallel = */ std::true_type) noexcept;
+bool
+__pattern_lexicographical_compare(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2,
+ _ForwardIterator2, _Compare, _IsVector, /* is_parallel = */ std::true_type) noexcept;
#endif
-} // namespace internal
+} // namespace __internal
} // namespace __pstl
#endif /* __PSTL_algorithm_fwd_H */
Modified: pstl/trunk/include/pstl/internal/algorithm_impl.h
URL: http://llvm.org/viewvc/llvm-project/pstl/trunk/include/pstl/internal/algorithm_impl.h?rev=357203&r1=357202&r2=357203&view=diff
==============================================================================
--- pstl/trunk/include/pstl/internal/algorithm_impl.h (original)
+++ pstl/trunk/include/pstl/internal/algorithm_impl.h Thu Mar 28 12:10:32 2019
@@ -28,7 +28,7 @@
namespace __pstl
{
-namespace internal
+namespace __internal
{
//------------------------------------------------------------------------
@@ -37,39 +37,39 @@ namespace internal
template <class _ForwardIterator, class _Pred>
bool
-brick_any_of(const _ForwardIterator __first, const _ForwardIterator __last, _Pred __pred,
- /*__is_vector=*/std::false_type) noexcept
+__brick_any_of(const _ForwardIterator __first, const _ForwardIterator __last, _Pred __pred,
+ /*__is_vector=*/std::false_type) noexcept
{
return std::any_of(__first, __last, __pred);
};
template <class _ForwardIterator, class _Pred>
bool
-brick_any_of(const _ForwardIterator __first, const _ForwardIterator __last, _Pred __pred,
- /*__is_vector=*/std::true_type) noexcept
+__brick_any_of(const _ForwardIterator __first, const _ForwardIterator __last, _Pred __pred,
+ /*__is_vector=*/std::true_type) noexcept
{
- return unseq_backend::simd_or(__first, __last - __first, __pred);
+ return __unseq_backend::__simd_or(__first, __last - __first, __pred);
};
template <class _ExecutionPolicy, class _ForwardIterator, class _Pred, class _IsVector>
bool
-pattern_any_of(_ExecutionPolicy&&, _ForwardIterator __first, _ForwardIterator __last, _Pred __pred,
- _IsVector __is_vector, /*parallel=*/std::false_type) noexcept
+__pattern_any_of(_ExecutionPolicy&&, _ForwardIterator __first, _ForwardIterator __last, _Pred __pred,
+ _IsVector __is_vector, /*parallel=*/std::false_type) noexcept
{
- return internal::brick_any_of(__first, __last, __pred, __is_vector);
+ return __brick_any_of(__first, __last, __pred, __is_vector);
}
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _ForwardIterator, class _Pred, class _IsVector>
bool
-pattern_any_of(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Pred __pred,
- _IsVector __is_vector, /*parallel=*/std::true_type)
+__pattern_any_of(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Pred __pred,
+ _IsVector __is_vector, /*parallel=*/std::true_type)
{
- return internal::except_handler([&]() {
- return internal::parallel_or(std::forward<_ExecutionPolicy>(__exec), __first, __last,
- [__pred, __is_vector](_ForwardIterator __i, _ForwardIterator __j) {
- return internal::brick_any_of(__i, __j, __pred, __is_vector);
- });
+ return __except_handler([&]() {
+ return __parallel_or(std::forward<_ExecutionPolicy>(__exec), __first, __last,
+ [__pred, __is_vector](_ForwardIterator __i, _ForwardIterator __j) {
+ return __brick_any_of(__i, __j, __pred, __is_vector);
+ });
});
}
#endif
@@ -79,7 +79,7 @@ pattern_any_of(_ExecutionPolicy&& __exec
template <class _ForwardIterator, class _Size, class _Function>
_ForwardIterator
-for_each_n_it_serial(_ForwardIterator __first, _Size __n, _Function __f)
+__for_each_n_it_serial(_ForwardIterator __first, _Size __n, _Function __f)
{
for (; __n > 0; ++__first, --__n)
__f(__first);
@@ -93,48 +93,48 @@ for_each_n_it_serial(_ForwardIterator __
//------------------------------------------------------------------------
template <class _ForwardIterator, class _Function>
void
-brick_walk1(_ForwardIterator __first, _ForwardIterator __last, _Function __f, /*vector=*/std::false_type) noexcept
+__brick_walk1(_ForwardIterator __first, _ForwardIterator __last, _Function __f, /*vector=*/std::false_type) noexcept
{
std::for_each(__first, __last, __f);
}
template <class _RandomAccessIterator, class _Function>
void
-brick_walk1(_RandomAccessIterator __first, _RandomAccessIterator __last, _Function __f,
- /*vector=*/std::true_type) noexcept
+__brick_walk1(_RandomAccessIterator __first, _RandomAccessIterator __last, _Function __f,
+ /*vector=*/std::true_type) noexcept
{
- unseq_backend::simd_walk_1(__first, __last - __first, __f);
+ __unseq_backend::__simd_walk_1(__first, __last - __first, __f);
}
template <class _ExecutionPolicy, class _ForwardIterator, class _Function, class _IsVector>
void
-pattern_walk1(_ExecutionPolicy&&, _ForwardIterator __first, _ForwardIterator __last, _Function __f,
- _IsVector __is_vector,
- /*parallel=*/std::false_type) noexcept
+__pattern_walk1(_ExecutionPolicy&&, _ForwardIterator __first, _ForwardIterator __last, _Function __f,
+ _IsVector __is_vector,
+ /*parallel=*/std::false_type) noexcept
{
- internal::brick_walk1(__first, __last, __f, __is_vector);
+ __brick_walk1(__first, __last, __f, __is_vector);
}
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _ForwardIterator, class _Function, class _IsVector>
void
-pattern_walk1(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Function __f,
- _IsVector __is_vector,
- /*parallel=*/std::true_type)
-{
- internal::except_handler([&]() {
- par_backend::parallel_for(std::forward<_ExecutionPolicy>(__exec), __first, __last,
- [__f, __is_vector](_ForwardIterator __i, _ForwardIterator __j) {
- internal::brick_walk1(__i, __j, __f, __is_vector);
- });
+__pattern_walk1(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Function __f,
+ _IsVector __is_vector,
+ /*parallel=*/std::true_type)
+{
+ __except_handler([&]() {
+ __par_backend::__parallel_for(std::forward<_ExecutionPolicy>(__exec), __first, __last,
+ [__f, __is_vector](_ForwardIterator __i, _ForwardIterator __j) {
+ __brick_walk1(__i, __j, __f, __is_vector);
+ });
});
}
#endif
template <class _ExecutionPolicy, class _ForwardIterator, class _Brick>
void
-pattern_walk_brick(_ExecutionPolicy&&, _ForwardIterator __first, _ForwardIterator __last, _Brick __brick,
- /*parallel=*/std::false_type) noexcept
+__pattern_walk_brick(_ExecutionPolicy&&, _ForwardIterator __first, _ForwardIterator __last, _Brick __brick,
+ /*parallel=*/std::false_type) noexcept
{
__brick(__first, __last);
}
@@ -142,12 +142,12 @@ pattern_walk_brick(_ExecutionPolicy&&, _
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _ForwardIterator, class _Brick>
void
-pattern_walk_brick(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Brick __brick,
- /*parallel=*/std::true_type)
+__pattern_walk_brick(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Brick __brick,
+ /*parallel=*/std::true_type)
{
- internal::except_handler([&]() {
- par_backend::parallel_for(std::forward<_ExecutionPolicy>(__exec), __first, __last,
- [__brick](_ForwardIterator __i, _ForwardIterator __j) { __brick(__i, __j); });
+ __except_handler([&]() {
+ __par_backend::__parallel_for(std::forward<_ExecutionPolicy>(__exec), __first, __last,
+ [__brick](_ForwardIterator __i, _ForwardIterator __j) { __brick(__i, __j); });
});
}
#endif
@@ -157,44 +157,44 @@ pattern_walk_brick(_ExecutionPolicy&& __
//------------------------------------------------------------------------
template <class _ForwardIterator, class _Size, class _Function>
_ForwardIterator
-brick_walk1_n(_ForwardIterator __first, _Size __n, _Function __f, /*_IsVectorTag=*/std::false_type)
+__brick_walk1_n(_ForwardIterator __first, _Size __n, _Function __f, /*_IsVectorTag=*/std::false_type)
{
- return for_each_n_it_serial(__first, __n, [&__f](_ForwardIterator __it) { __f(*__it); }); // calling serial version
+ return __for_each_n_it_serial(__first, __n,
+ [&__f](_ForwardIterator __it) { __f(*__it); }); // calling serial version
}
template <class _RandomAccessIterator, class _DifferenceType, class _Function>
_RandomAccessIterator
-brick_walk1_n(_RandomAccessIterator __first, _DifferenceType __n, _Function __f,
- /*vectorTag=*/std::true_type) noexcept
+__brick_walk1_n(_RandomAccessIterator __first, _DifferenceType __n, _Function __f,
+ /*vectorTag=*/std::true_type) noexcept
{
- return unseq_backend::simd_walk_1(__first, __n, __f);
+ return __unseq_backend::__simd_walk_1(__first, __n, __f);
}
template <class _ExecutionPolicy, class _ForwardIterator, class _Size, class _Function, class _IsVector>
_ForwardIterator
-pattern_walk1_n(_ExecutionPolicy&&, _ForwardIterator __first, _Size __n, _Function __f, _IsVector __is_vector,
- /*is_parallel=*/std::false_type) noexcept
+__pattern_walk1_n(_ExecutionPolicy&&, _ForwardIterator __first, _Size __n, _Function __f, _IsVector __is_vector,
+ /*is_parallel=*/std::false_type) noexcept
{
- return internal::brick_walk1_n(__first, __n, __f, __is_vector);
+ return __brick_walk1_n(__first, __n, __f, __is_vector);
}
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _RandomAccessIterator, class _Size, class _Function, class _IsVector>
_RandomAccessIterator
-pattern_walk1_n(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _Size __n, _Function __f,
- _IsVector __is_vector,
- /*is_parallel=*/std::true_type)
+__pattern_walk1_n(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _Size __n, _Function __f,
+ _IsVector __is_vector,
+ /*is_parallel=*/std::true_type)
{
- internal::pattern_walk1(std::forward<_ExecutionPolicy>(__exec), __first, __first + __n, __f, __is_vector,
- std::true_type());
+ __pattern_walk1(std::forward<_ExecutionPolicy>(__exec), __first, __first + __n, __f, __is_vector, std::true_type());
return __first + __n;
}
#endif
template <class _ExecutionPolicy, class _ForwardIterator, class _Size, class _Brick>
_ForwardIterator
-pattern_walk_brick_n(_ExecutionPolicy&&, _ForwardIterator __first, _Size __n, _Brick __brick,
- /*is_parallel=*/std::false_type) noexcept
+__pattern_walk_brick_n(_ExecutionPolicy&&, _ForwardIterator __first, _Size __n, _Brick __brick,
+ /*is_parallel=*/std::false_type) noexcept
{
return __brick(__first, __n);
}
@@ -202,11 +202,11 @@ pattern_walk_brick_n(_ExecutionPolicy&&,
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _RandomAccessIterator, class _Size, class _Brick>
_RandomAccessIterator
-pattern_walk_brick_n(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _Size __n, _Brick __brick,
- /*is_parallel=*/std::true_type)
+__pattern_walk_brick_n(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _Size __n, _Brick __brick,
+ /*is_parallel=*/std::true_type)
{
- return internal::except_handler([&]() {
- par_backend::parallel_for(
+ return __except_handler([&]() {
+ __par_backend::__parallel_for(
std::forward<_ExecutionPolicy>(__exec), __first, __first + __n,
[__brick](_RandomAccessIterator __i, _RandomAccessIterator __j) { __brick(__i, __j - __i); });
return __first + __n;
@@ -221,8 +221,8 @@ pattern_walk_brick_n(_ExecutionPolicy&&
//------------------------------------------------------------------------
template <class _ForwardIterator1, class _ForwardIterator2, class _Function>
_ForwardIterator2
-brick_walk2(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _Function __f,
- /*vector=*/std::false_type) noexcept
+__brick_walk2(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _Function __f,
+ /*vector=*/std::false_type) noexcept
{
for (; __first1 != __last1; ++__first1, ++__first2)
__f(*__first1, *__first2);
@@ -231,16 +231,16 @@ brick_walk2(_ForwardIterator1 __first1,
template <class _ForwardIterator1, class _ForwardIterator2, class _Function>
_ForwardIterator2
-brick_walk2(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _Function __f,
- /*vector=*/std::true_type) noexcept
+__brick_walk2(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _Function __f,
+ /*vector=*/std::true_type) noexcept
{
- return unseq_backend::simd_walk_2(__first1, __last1 - __first1, __first2, __f);
+ return __unseq_backend::__simd_walk_2(__first1, __last1 - __first1, __first2, __f);
}
template <class _ForwardIterator1, class _Size, class _ForwardIterator2, class _Function>
_ForwardIterator2
-brick_walk2_n(_ForwardIterator1 __first1, _Size __n, _ForwardIterator2 __first2, _Function __f,
- /*vector=*/std::false_type) noexcept
+__brick_walk2_n(_ForwardIterator1 __first1, _Size __n, _ForwardIterator2 __first2, _Function __f,
+ /*vector=*/std::false_type) noexcept
{
for (; __n > 0; --__n, ++__first1, ++__first2)
__f(*__first1, *__first2);
@@ -249,31 +249,32 @@ brick_walk2_n(_ForwardIterator1 __first1
template <class _ForwardIterator1, class _Size, class _ForwardIterator2, class _Function>
_ForwardIterator2
-brick_walk2_n(_ForwardIterator1 __first1, _Size __n, _ForwardIterator2 __first2, _Function __f,
- /*vector=*/std::true_type) noexcept
+__brick_walk2_n(_ForwardIterator1 __first1, _Size __n, _ForwardIterator2 __first2, _Function __f,
+ /*vector=*/std::true_type) noexcept
{
- return unseq_backend::simd_walk_2(__first1, __n, __first2, __f);
+ return __unseq_backend::__simd_walk_2(__first1, __n, __first2, __f);
}
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Function, class _IsVector>
_ForwardIterator2
-pattern_walk2(_ExecutionPolicy&&, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
- _Function __f, _IsVector __is_vector, /*parallel=*/std::false_type) noexcept
+__pattern_walk2(_ExecutionPolicy&&, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
+ _Function __f, _IsVector __is_vector, /*parallel=*/std::false_type) noexcept
{
- return internal::brick_walk2(__first1, __last1, __first2, __f, __is_vector);
+ return __brick_walk2(__first1, __last1, __first2, __f, __is_vector);
}
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Function, class _IsVector>
_ForwardIterator2
-pattern_walk2(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
- _ForwardIterator2 __first2, _Function __f, _IsVector __is_vector, /*parallel=*/std::true_type)
+__pattern_walk2(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
+ _ForwardIterator2 __first2, _Function __f, _IsVector __is_vector, /*parallel=*/std::true_type)
{
- return internal::except_handler([&]() {
- par_backend::parallel_for(std::forward<_ExecutionPolicy>(__exec), __first1, __last1,
- [__f, __first1, __first2, __is_vector](_ForwardIterator1 __i, _ForwardIterator1 __j) {
- internal::brick_walk2(__i, __j, __first2 + (__i - __first1), __f, __is_vector);
- });
+ return __except_handler([&]() {
+ __par_backend::__parallel_for(
+ std::forward<_ExecutionPolicy>(__exec), __first1, __last1,
+ [__f, __first1, __first2, __is_vector](_ForwardIterator1 __i, _ForwardIterator1 __j) {
+ __brick_walk2(__i, __j, __first2 + (__i - __first1), __f, __is_vector);
+ });
return __first2 + (__last1 - __first1);
});
}
@@ -282,26 +283,26 @@ pattern_walk2(_ExecutionPolicy&& __exec,
template <class _ExecutionPolicy, class _ForwardIterator1, class _Size, class _ForwardIterator2, class _Function,
class _IsVector>
_ForwardIterator2
-pattern_walk2_n(_ExecutionPolicy&&, _ForwardIterator1 __first1, _Size n, _ForwardIterator2 __first2, _Function f,
- _IsVector is_vector, /*parallel=*/std::false_type) noexcept
+__pattern_walk2_n(_ExecutionPolicy&&, _ForwardIterator1 __first1, _Size n, _ForwardIterator2 __first2, _Function f,
+ _IsVector is_vector, /*parallel=*/std::false_type) noexcept
{
- return internal::brick_walk2_n(__first1, n, __first2, f, is_vector);
+ return __brick_walk2_n(__first1, n, __first2, f, is_vector);
}
template <class _ExecutionPolicy, class _RandomAccessIterator1, class _Size, class _RandomAccessIterator2,
class _Function, class _IsVector>
_RandomAccessIterator2
-pattern_walk2_n(_ExecutionPolicy&& __exec, _RandomAccessIterator1 __first1, _Size n, _RandomAccessIterator2 __first2,
- _Function f, _IsVector is_vector, /*parallel=*/std::true_type)
+__pattern_walk2_n(_ExecutionPolicy&& __exec, _RandomAccessIterator1 __first1, _Size n, _RandomAccessIterator2 __first2,
+ _Function f, _IsVector is_vector, /*parallel=*/std::true_type)
{
- return internal::pattern_walk2(std::forward<_ExecutionPolicy>(__exec), __first1, __first1 + n, __first2, f,
- is_vector, std::true_type());
+ return __pattern_walk2(std::forward<_ExecutionPolicy>(__exec), __first1, __first1 + n, __first2, f, is_vector,
+ std::true_type());
}
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Brick>
_ForwardIterator2
-pattern_walk2_brick(_ExecutionPolicy&&, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
- _ForwardIterator2 __first2, _Brick __brick, /*parallel=*/std::false_type) noexcept
+__pattern_walk2_brick(_ExecutionPolicy&&, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
+ _ForwardIterator2 __first2, _Brick __brick, /*parallel=*/std::false_type) noexcept
{
return __brick(__first1, __last1, __first2);
}
@@ -309,11 +310,11 @@ pattern_walk2_brick(_ExecutionPolicy&&,
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _RandomAccessIterator1, class _RandomAccessIterator2, class _Brick>
_RandomAccessIterator2
-pattern_walk2_brick(_ExecutionPolicy&& __exec, _RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1,
- _RandomAccessIterator2 __first2, _Brick __brick, /*parallel=*/std::true_type)
+__pattern_walk2_brick(_ExecutionPolicy&& __exec, _RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1,
+ _RandomAccessIterator2 __first2, _Brick __brick, /*parallel=*/std::true_type)
{
- return except_handler([&]() {
- par_backend::parallel_for(
+ return __except_handler([&]() {
+ __par_backend::__parallel_for(
std::forward<_ExecutionPolicy>(__exec), __first1, __last1,
[__first1, __first2, __brick](_RandomAccessIterator1 __i, _RandomAccessIterator1 __j) {
__brick(__i, __j, __first2 + (__i - __first1));
@@ -326,11 +327,11 @@ pattern_walk2_brick(_ExecutionPolicy&& _
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _RandomAccessIterator1, class _Size, class _RandomAccessIterator2, class _Brick>
_RandomAccessIterator2
-pattern_walk2_brick_n(_ExecutionPolicy&& __exec, _RandomAccessIterator1 __first1, _Size __n,
- _RandomAccessIterator2 __first2, _Brick __brick, /*parallel=*/std::true_type)
+__pattern_walk2_brick_n(_ExecutionPolicy&& __exec, _RandomAccessIterator1 __first1, _Size __n,
+ _RandomAccessIterator2 __first2, _Brick __brick, /*parallel=*/std::true_type)
{
- return except_handler([&]() {
- par_backend::parallel_for(
+ return __except_handler([&]() {
+ __par_backend::__parallel_for(
std::forward<_ExecutionPolicy>(__exec), __first1, __first1 + __n,
[__first1, __first2, __brick](_RandomAccessIterator1 __i, _RandomAccessIterator1 __j) {
__brick(__i, __j - __i, __first2 + (__i - __first1));
@@ -342,8 +343,8 @@ pattern_walk2_brick_n(_ExecutionPolicy&&
template <class _ExecutionPolicy, class _ForwardIterator1, class _Size, class _ForwardIterator2, class _Brick>
_ForwardIterator2
-pattern_walk2_brick_n(_ExecutionPolicy&&, _ForwardIterator1 __first1, _Size __n, _ForwardIterator2 __first2,
- _Brick __brick, /*parallel=*/std::false_type) noexcept
+__pattern_walk2_brick_n(_ExecutionPolicy&&, _ForwardIterator1 __first1, _Size __n, _ForwardIterator2 __first2,
+ _Brick __brick, /*parallel=*/std::false_type) noexcept
{
return __brick(__first1, __n, __first2);
}
@@ -355,8 +356,8 @@ pattern_walk2_brick_n(_ExecutionPolicy&&
//------------------------------------------------------------------------
template <class _ForwardIterator1, class _ForwardIterator2, class _ForwardIterator3, class _Function>
_ForwardIterator3
-brick_walk3(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
- _ForwardIterator3 __first3, _Function __f, /*vector=*/std::false_type) noexcept
+__brick_walk3(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
+ _ForwardIterator3 __first3, _Function __f, /*vector=*/std::false_type) noexcept
{
for (; __first1 != __last1; ++__first1, ++__first2, ++__first3)
__f(*__first1, *__first2, *__first3);
@@ -365,35 +366,34 @@ brick_walk3(_ForwardIterator1 __first1,
template <class _RandomAccessIterator1, class _RandomAccessIterator2, class _RandomAccessIterator3, class _Function>
_RandomAccessIterator3
-brick_walk3(_RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1, _RandomAccessIterator2 __first2,
- _RandomAccessIterator3 __first3, _Function __f, /*vector=*/std::true_type) noexcept
+__brick_walk3(_RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1, _RandomAccessIterator2 __first2,
+ _RandomAccessIterator3 __first3, _Function __f, /*vector=*/std::true_type) noexcept
{
- return unseq_backend::simd_walk_3(__first1, __last1 - __first1, __first2, __first3, __f);
+ return __unseq_backend::__simd_walk_3(__first1, __last1 - __first1, __first2, __first3, __f);
}
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _ForwardIterator3,
class _Function, class _IsVector>
_ForwardIterator3
-pattern_walk3(_ExecutionPolicy&&, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
- _ForwardIterator3 __first3, _Function __f, _IsVector __is_vector, /*parallel=*/std::false_type) noexcept
+__pattern_walk3(_ExecutionPolicy&&, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
+ _ForwardIterator3 __first3, _Function __f, _IsVector __is_vector, /*parallel=*/std::false_type) noexcept
{
- return internal::brick_walk3(__first1, __last1, __first2, __first3, __f, __is_vector);
+ return __brick_walk3(__first1, __last1, __first2, __first3, __f, __is_vector);
}
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _RandomAccessIterator1, class _RandomAccessIterator2,
class _RandomAccessIterator3, class _Function, class _IsVector>
_RandomAccessIterator3
-pattern_walk3(_ExecutionPolicy&& __exec, _RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1,
- _RandomAccessIterator2 __first2, _RandomAccessIterator3 __first3, _Function __f, _IsVector __is_vector,
- /*parallel=*/std::true_type)
+__pattern_walk3(_ExecutionPolicy&& __exec, _RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1,
+ _RandomAccessIterator2 __first2, _RandomAccessIterator3 __first3, _Function __f, _IsVector __is_vector,
+ /*parallel=*/std::true_type)
{
- return internal::except_handler([&]() {
- par_backend::parallel_for(
+ return __except_handler([&]() {
+ __par_backend::__parallel_for(
std::forward<_ExecutionPolicy>(__exec), __first1, __last1,
[__f, __first1, __first2, __first3, __is_vector](_RandomAccessIterator1 __i, _RandomAccessIterator1 __j) {
- internal::brick_walk3(__i, __j, __first2 + (__i - __first1), __first3 + (__i - __first1), __f,
- __is_vector);
+ __brick_walk3(__i, __j, __first2 + (__i - __first1), __first3 + (__i - __first1), __f, __is_vector);
});
return __first3 + (__last1 - __first1);
});
@@ -406,43 +406,43 @@ pattern_walk3(_ExecutionPolicy&& __exec,
template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
bool
-brick_equal(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _BinaryPredicate __p,
- /* IsVector = */ std::false_type) noexcept
+__brick_equal(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _BinaryPredicate __p,
+ /* IsVector = */ std::false_type) noexcept
{
return std::equal(__first1, __last1, __first2, __p);
}
template <class _RandomAccessIterator1, class _RandomAccessIterator2, class _BinaryPredicate>
bool
-brick_equal(_RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1, _RandomAccessIterator2 __first2,
- _BinaryPredicate __p, /* is_vector = */ std::true_type) noexcept
+__brick_equal(_RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1, _RandomAccessIterator2 __first2,
+ _BinaryPredicate __p, /* is_vector = */ std::true_type) noexcept
{
- return unseq_backend::simd_first(__first1, __last1 - __first1, __first2, not_pred<_BinaryPredicate>(__p)).first ==
- __last1;
+ return __unseq_backend::__simd_first(__first1, __last1 - __first1, __first2, __not_pred<_BinaryPredicate>(__p))
+ .first == __last1;
}
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate,
class _IsVector>
bool
-pattern_equal(_ExecutionPolicy&&, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
- _BinaryPredicate __p, _IsVector __is_vector, /* is_parallel = */ std::false_type) noexcept
+__pattern_equal(_ExecutionPolicy&&, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
+ _BinaryPredicate __p, _IsVector __is_vector, /* is_parallel = */ std::false_type) noexcept
{
- return internal::brick_equal(__first1, __last1, __first2, __p, __is_vector);
+ return __brick_equal(__first1, __last1, __first2, __p, __is_vector);
}
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _RandomAccessIterator1, class _RandomAccessIterator2, class _BinaryPredicate,
class _IsVector>
bool
-pattern_equal(_ExecutionPolicy&& __exec, _RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1,
- _RandomAccessIterator2 __first2, _BinaryPredicate __p, _IsVector __is_vector,
- /*is_parallel=*/std::true_type)
+__pattern_equal(_ExecutionPolicy&& __exec, _RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1,
+ _RandomAccessIterator2 __first2, _BinaryPredicate __p, _IsVector __is_vector,
+ /*is_parallel=*/std::true_type)
{
- return internal::except_handler([&]() {
- return !internal::parallel_or(
+ return __except_handler([&]() {
+ return !__parallel_or(
std::forward<_ExecutionPolicy>(__exec), __first1, __last1,
[__first1, __first2, __p, __is_vector](_RandomAccessIterator1 __i, _RandomAccessIterator1 __j) {
- return !brick_equal(__i, __j, __first2 + (__i - __first1), __p, __is_vector);
+ return !__brick_equal(__i, __j, __first2 + (__i - __first1), __p, __is_vector);
});
});
}
@@ -453,46 +453,47 @@ pattern_equal(_ExecutionPolicy&& __exec,
//------------------------------------------------------------------------
template <class _ForwardIterator, class _Predicate>
_ForwardIterator
-brick_find_if(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred,
- /*is_vector=*/std::false_type) noexcept
+__brick_find_if(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred,
+ /*is_vector=*/std::false_type) noexcept
{
return std::find_if(__first, __last, __pred);
}
template <class _RandomAccessIterator, class _Predicate>
_RandomAccessIterator
-brick_find_if(_RandomAccessIterator __first, _RandomAccessIterator __last, _Predicate __pred,
- /*is_vector=*/std::true_type) noexcept
+__brick_find_if(_RandomAccessIterator __first, _RandomAccessIterator __last, _Predicate __pred,
+ /*is_vector=*/std::true_type) noexcept
{
typedef typename std::iterator_traits<_RandomAccessIterator>::difference_type _SizeType;
- return unseq_backend::simd_first(
+ return __unseq_backend::__simd_first(
__first, _SizeType(0), __last - __first,
[&__pred](_RandomAccessIterator __it, _SizeType __i) { return __pred(__it[__i]); });
}
template <class _ExecutionPolicy, class _ForwardIterator, class _Predicate, class _IsVector>
_ForwardIterator
-pattern_find_if(_ExecutionPolicy&&, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred,
- _IsVector __is_vector,
- /*is_parallel=*/std::false_type) noexcept
+__pattern_find_if(_ExecutionPolicy&&, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred,
+ _IsVector __is_vector,
+ /*is_parallel=*/std::false_type) noexcept
{
- return internal::brick_find_if(__first, __last, __pred, __is_vector);
+ return __brick_find_if(__first, __last, __pred, __is_vector);
}
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _ForwardIterator, class _Predicate, class _IsVector>
_ForwardIterator
-pattern_find_if(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred,
- _IsVector __is_vector,
- /*is_parallel=*/std::true_type)
+__pattern_find_if(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred,
+ _IsVector __is_vector,
+ /*is_parallel=*/std::true_type)
{
- return internal::except_handler([&]() {
- return internal::parallel_find(std::forward<_ExecutionPolicy>(__exec), __first, __last,
- [__pred, __is_vector](_ForwardIterator __i, _ForwardIterator __j) {
- return internal::brick_find_if(__i, __j, __pred, __is_vector);
- },
- std::less<typename std::iterator_traits<_ForwardIterator>::difference_type>(),
- /*is_first=*/true);
+ return __except_handler([&]() {
+ return __parallel_find(
+ std::forward<_ExecutionPolicy>(__exec), __first, __last,
+ [__pred, __is_vector](_ForwardIterator __i, _ForwardIterator __j) {
+ return __brick_find_if(__i, __j, __pred, __is_vector);
+ },
+ std::less<typename std::iterator_traits<_ForwardIterator>::difference_type>(),
+ /*is_first=*/true);
});
}
#endif
@@ -506,9 +507,9 @@ pattern_find_if(_ExecutionPolicy&& __exe
// b_first determines what occurrence we want to find (first or last)
template <class _RandomAccessIterator1, class _RandomAccessIterator2, class _BinaryPredicate, class _IsVector>
_RandomAccessIterator1
-find_subrange(_RandomAccessIterator1 __first, _RandomAccessIterator1 __last, _RandomAccessIterator1 __global_last,
- _RandomAccessIterator2 __s_first, _RandomAccessIterator2 __s_last, _BinaryPredicate __pred,
- bool __b_first, _IsVector __is_vector) noexcept
+__find_subrange(_RandomAccessIterator1 __first, _RandomAccessIterator1 __last, _RandomAccessIterator1 __global_last,
+ _RandomAccessIterator2 __s_first, _RandomAccessIterator2 __s_last, _BinaryPredicate __pred,
+ bool __b_first, _IsVector __is_vector) noexcept
{
typedef typename std::iterator_traits<_RandomAccessIterator2>::value_type _ValueType;
auto __n2 = __s_last - __s_first;
@@ -527,15 +528,14 @@ find_subrange(_RandomAccessIterator1 __f
while (__first != __last && (__global_last - __first >= __n2))
{
// find position of *s_first in [first, last) (it can be start of subsequence)
- __first = internal::brick_find_if(
- __first, __last, internal::equal_value_by_pred<_ValueType, _BinaryPredicate>(*__s_first, __pred),
- __is_vector);
+ __first = __brick_find_if(__first, __last,
+ __equal_value_by_pred<_ValueType, _BinaryPredicate>(*__s_first, __pred), __is_vector);
// if position that was found previously is the start of subsequence
// then we can exit the loop (b_first == true) or keep the position
// (b_first == false)
if (__first != __last && (__global_last - __first >= __n2) &&
- internal::brick_equal(__s_first + 1, __s_last, __first + 1, __pred, __is_vector))
+ __brick_equal(__s_first + 1, __s_last, __first + 1, __pred, __is_vector))
{
if (__b_first)
{
@@ -563,8 +563,8 @@ find_subrange(_RandomAccessIterator1 __f
template <class _RandomAccessIterator, class _Size, class _Tp, class _BinaryPredicate, class _IsVector>
_RandomAccessIterator
-find_subrange(_RandomAccessIterator __first, _RandomAccessIterator __last, _RandomAccessIterator __global_last,
- _Size __count, const _Tp& __value, _BinaryPredicate __pred, _IsVector __is_vector) noexcept
+__find_subrange(_RandomAccessIterator __first, _RandomAccessIterator __last, _RandomAccessIterator __global_last,
+ _Size __count, const _Tp& __value, _BinaryPredicate __pred, _IsVector __is_vector) noexcept
{
if (__global_last - __first < __count || __count < 1)
{
@@ -572,15 +572,15 @@ find_subrange(_RandomAccessIterator __fi
}
auto __n = __global_last - __first;
- auto __unary_pred = internal::equal_value_by_pred<_Tp, _BinaryPredicate>(__value, __pred);
+ auto __unary_pred = __equal_value_by_pred<_Tp, _BinaryPredicate>(__value, __pred);
while (__first != __last && (__global_last - __first >= __count))
{
- __first = brick_find_if(__first, __last, __unary_pred, __is_vector);
+ __first = __brick_find_if(__first, __last, __unary_pred, __is_vector);
// check that all of elements in [first+1, first+count) equal to value
if (__first != __last && (__global_last - __first >= __count) &&
- !internal::brick_any_of(__first + 1, __first + __count,
- internal::not_pred<decltype(__unary_pred)>(__unary_pred), __is_vector))
+ !__brick_any_of(__first + 1, __first + __count, __not_pred<decltype(__unary_pred)>(__unary_pred),
+ __is_vector))
{
return __first;
}
@@ -598,52 +598,51 @@ find_subrange(_RandomAccessIterator __fi
template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
_ForwardIterator1
-brick_find_end(_ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __s_first,
- _ForwardIterator2 __s_last, _BinaryPredicate __pred, /*__is_vector=*/std::false_type) noexcept
+__brick_find_end(_ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __s_first,
+ _ForwardIterator2 __s_last, _BinaryPredicate __pred, /*__is_vector=*/std::false_type) noexcept
{
return std::find_end(__first, __last, __s_first, __s_last, __pred);
}
template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
_ForwardIterator1
-brick_find_end(_ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __s_first,
- _ForwardIterator2 __s_last, _BinaryPredicate __pred, /*__is_vector=*/std::true_type) noexcept
+__brick_find_end(_ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __s_first,
+ _ForwardIterator2 __s_last, _BinaryPredicate __pred, /*__is_vector=*/std::true_type) noexcept
{
- return internal::find_subrange(__first, __last, __last, __s_first, __s_last, __pred, false, std::true_type());
+ return __find_subrange(__first, __last, __last, __s_first, __s_last, __pred, false, std::true_type());
}
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate,
class _IsVector>
_ForwardIterator1
-pattern_find_end(_ExecutionPolicy&&, _ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __s_first,
- _ForwardIterator2 __s_last, _BinaryPredicate __pred, _IsVector __is_vector,
- /*is_parallel=*/std::false_type) noexcept
+__pattern_find_end(_ExecutionPolicy&&, _ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __s_first,
+ _ForwardIterator2 __s_last, _BinaryPredicate __pred, _IsVector __is_vector,
+ /*is_parallel=*/std::false_type) noexcept
{
- return internal::brick_find_end(__first, __last, __s_first, __s_last, __pred, __is_vector);
+ return __brick_find_end(__first, __last, __s_first, __s_last, __pred, __is_vector);
}
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate,
class _IsVector>
_ForwardIterator1
-pattern_find_end(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last,
- _ForwardIterator2 __s_first, _ForwardIterator2 __s_last, _BinaryPredicate __pred,
- _IsVector __is_vector, /*is_parallel=*/std::true_type) noexcept
+__pattern_find_end(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last,
+ _ForwardIterator2 __s_first, _ForwardIterator2 __s_last, _BinaryPredicate __pred,
+ _IsVector __is_vector, /*is_parallel=*/std::true_type) noexcept
{
if (__last - __first == __s_last - __s_first)
{
- const bool __res = internal::pattern_equal(std::forward<_ExecutionPolicy>(__exec), __first, __last, __s_first,
- __pred, __is_vector, std::true_type());
+ const bool __res = __pattern_equal(std::forward<_ExecutionPolicy>(__exec), __first, __last, __s_first, __pred,
+ __is_vector, std::true_type());
return __res ? __first : __last;
}
else
{
- return except_handler([&]() {
- return internal::parallel_find(
+ return __except_handler([&]() {
+ return __parallel_find(
std::forward<_ExecutionPolicy>(__exec), __first, __last,
- [__last, __s_first, __s_last, __pred, __is_vector](_ForwardIterator1 __i,
- _ForwardIterator1 __j) {
- return internal::find_subrange(__i, __j, __last, __s_first, __s_last, __pred, false, __is_vector);
+ [__last, __s_first, __s_last, __pred, __is_vector](_ForwardIterator1 __i, _ForwardIterator1 __j) {
+ return __find_subrange(__i, __j, __last, __s_first, __s_last, __pred, false, __is_vector);
},
std::greater<typename std::iterator_traits<_ForwardIterator1>::difference_type>(), /*is_first=*/false);
});
@@ -656,43 +655,43 @@ pattern_find_end(_ExecutionPolicy&& __ex
//------------------------------------------------------------------------
template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
_ForwardIterator1
-brick_find_first_of(_ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __s_first,
- _ForwardIterator2 __s_last, _BinaryPredicate __pred, /*__is_vector=*/std::false_type) noexcept
+__brick_find_first_of(_ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __s_first,
+ _ForwardIterator2 __s_last, _BinaryPredicate __pred, /*__is_vector=*/std::false_type) noexcept
{
return std::find_first_of(__first, __last, __s_first, __s_last, __pred);
}
template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
_ForwardIterator1
-brick_find_first_of(_ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __s_first,
- _ForwardIterator2 __s_last, _BinaryPredicate __pred, /*__is_vector=*/std::true_type) noexcept
+__brick_find_first_of(_ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __s_first,
+ _ForwardIterator2 __s_last, _BinaryPredicate __pred, /*__is_vector=*/std::true_type) noexcept
{
- return unseq_backend::simd_find_first_of(__first, __last, __s_first, __s_last, __pred);
+ return __unseq_backend::__simd_find_first_of(__first, __last, __s_first, __s_last, __pred);
}
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate,
class _IsVector>
_ForwardIterator1
-pattern_find_first_of(_ExecutionPolicy&&, _ForwardIterator1 __first, _ForwardIterator1 __last,
- _ForwardIterator2 __s_first, _ForwardIterator2 __s_last, _BinaryPredicate __pred,
- _IsVector __is_vector, /*is_parallel=*/std::false_type) noexcept
+__pattern_find_first_of(_ExecutionPolicy&&, _ForwardIterator1 __first, _ForwardIterator1 __last,
+ _ForwardIterator2 __s_first, _ForwardIterator2 __s_last, _BinaryPredicate __pred,
+ _IsVector __is_vector, /*is_parallel=*/std::false_type) noexcept
{
- return internal::brick_find_first_of(__first, __last, __s_first, __s_last, __pred, __is_vector);
+ return __brick_find_first_of(__first, __last, __s_first, __s_last, __pred, __is_vector);
}
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate,
class _IsVector>
_ForwardIterator1
-pattern_find_first_of(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last,
- _ForwardIterator2 __s_first, _ForwardIterator2 __s_last, _BinaryPredicate __pred,
- _IsVector __is_vector, /*is_parallel=*/std::true_type) noexcept
+__pattern_find_first_of(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last,
+ _ForwardIterator2 __s_first, _ForwardIterator2 __s_last, _BinaryPredicate __pred,
+ _IsVector __is_vector, /*is_parallel=*/std::true_type) noexcept
{
- return except_handler([&]() {
- return internal::parallel_find(
+ return __except_handler([&]() {
+ return __parallel_find(
std::forward<_ExecutionPolicy>(__exec), __first, __last,
[__s_first, __s_last, __pred, __is_vector](_ForwardIterator1 __i, _ForwardIterator1 __j) {
- return internal::brick_find_first_of(__i, __j, __s_first, __s_last, __pred, __is_vector);
+ return __brick_find_first_of(__i, __j, __s_first, __s_last, __pred, __is_vector);
},
std::less<typename std::iterator_traits<_ForwardIterator1>::difference_type>(), /*is_first=*/true);
});
@@ -704,51 +703,52 @@ pattern_find_first_of(_ExecutionPolicy&&
//------------------------------------------------------------------------
template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
_ForwardIterator1
-brick_search(_ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __s_first,
- _ForwardIterator2 __s_last, _BinaryPredicate __pred, /*vector=*/std::false_type) noexcept
+__brick_search(_ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __s_first,
+ _ForwardIterator2 __s_last, _BinaryPredicate __pred, /*vector=*/std::false_type) noexcept
{
return std::search(__first, __last, __s_first, __s_last, __pred);
}
template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
_ForwardIterator1
-brick_search(_ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __s_first,
- _ForwardIterator2 __s_last, _BinaryPredicate __pred, /*vector=*/std::true_type) noexcept
+__brick_search(_ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __s_first,
+ _ForwardIterator2 __s_last, _BinaryPredicate __pred, /*vector=*/std::true_type) noexcept
{
- return internal::find_subrange(__first, __last, __last, __s_first, __s_last, __pred, true, std::true_type());
+ return __find_subrange(__first, __last, __last, __s_first, __s_last, __pred, true, std::true_type());
}
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate,
class _IsVector>
_ForwardIterator1
-pattern_search(_ExecutionPolicy&&, _ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __s_first,
- _ForwardIterator2 __s_last, _BinaryPredicate __pred, _IsVector __is_vector,
- /*is_parallel=*/std::false_type) noexcept
+__pattern_search(_ExecutionPolicy&&, _ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __s_first,
+ _ForwardIterator2 __s_last, _BinaryPredicate __pred, _IsVector __is_vector,
+ /*is_parallel=*/std::false_type) noexcept
{
- return internal::brick_search(__first, __last, __s_first, __s_last, __pred, __is_vector);
+ return __brick_search(__first, __last, __s_first, __s_last, __pred, __is_vector);
}
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate,
class _IsVector>
_ForwardIterator1
-pattern_search(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last,
- _ForwardIterator2 __s_first, _ForwardIterator2 __s_last, _BinaryPredicate __pred, _IsVector __is_vector,
- /*is_parallel=*/std::true_type) noexcept
+__pattern_search(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last,
+ _ForwardIterator2 __s_first, _ForwardIterator2 __s_last, _BinaryPredicate __pred,
+ _IsVector __is_vector,
+ /*is_parallel=*/std::true_type) noexcept
{
if (__last - __first == __s_last - __s_first)
{
- const bool __res = internal::pattern_equal(std::forward<_ExecutionPolicy>(__exec), __first, __last, __s_first,
- __pred, __is_vector, std::true_type());
+ const bool __res = __pattern_equal(std::forward<_ExecutionPolicy>(__exec), __first, __last, __s_first, __pred,
+ __is_vector, std::true_type());
return __res ? __first : __last;
}
else
{
- return except_handler([&]() {
- return internal::parallel_find(
+ return __except_handler([&]() {
+ return __parallel_find(
std::forward<_ExecutionPolicy>(__exec), __first, __last,
[__last, __s_first, __s_last, __pred, __is_vector](_ForwardIterator1 __i, _ForwardIterator1 __j) {
- return internal::find_subrange(__i, __j, __last, __s_first, __s_last, __pred, true, __is_vector);
+ return __find_subrange(__i, __j, __last, __s_first, __s_last, __pred, true, __is_vector);
},
std::less<typename std::iterator_traits<_ForwardIterator1>::difference_type>(), /*is_first=*/true);
});
@@ -761,53 +761,53 @@ pattern_search(_ExecutionPolicy&& __exec
//------------------------------------------------------------------------
template <class _ForwardIterator, class _Size, class _Tp, class _BinaryPredicate>
_ForwardIterator
-brick_search_n(_ForwardIterator __first, _ForwardIterator __last, _Size __count, const _Tp& __value,
- _BinaryPredicate __pred, /*vector=*/std::false_type) noexcept
+__brick_search_n(_ForwardIterator __first, _ForwardIterator __last, _Size __count, const _Tp& __value,
+ _BinaryPredicate __pred, /*vector=*/std::false_type) noexcept
{
return std::search_n(__first, __last, __count, __value, __pred);
}
template <class _ForwardIterator, class _Size, class _Tp, class _BinaryPredicate>
_ForwardIterator
-brick_search_n(_ForwardIterator __first, _ForwardIterator __last, _Size __count, const _Tp& __value,
- _BinaryPredicate __pred, /*vector=*/std::true_type) noexcept
+__brick_search_n(_ForwardIterator __first, _ForwardIterator __last, _Size __count, const _Tp& __value,
+ _BinaryPredicate __pred, /*vector=*/std::true_type) noexcept
{
- return internal::find_subrange(__first, __last, __last, __count, __value, __pred, std::true_type());
+ return __find_subrange(__first, __last, __last, __count, __value, __pred, std::true_type());
}
template <class _ExecutionPolicy, class _ForwardIterator, class _Size, class _Tp, class _BinaryPredicate,
class _IsVector>
_ForwardIterator
-pattern_search_n(_ExecutionPolicy&&, _ForwardIterator __first, _ForwardIterator __last, _Size __count,
- const _Tp& __value, _BinaryPredicate __pred, _IsVector __is_vector,
- /*is_parallel=*/std::false_type) noexcept
+__pattern_search_n(_ExecutionPolicy&&, _ForwardIterator __first, _ForwardIterator __last, _Size __count,
+ const _Tp& __value, _BinaryPredicate __pred, _IsVector __is_vector,
+ /*is_parallel=*/std::false_type) noexcept
{
- return internal::brick_search_n(__first, __last, __count, __value, __pred, __is_vector);
+ return __brick_search_n(__first, __last, __count, __value, __pred, __is_vector);
}
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _RandomAccessIterator, class _Size, class _Tp, class _BinaryPredicate,
class _IsVector>
_RandomAccessIterator
-pattern_search_n(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Size __count,
- const _Tp& __value, _BinaryPredicate __pred, _IsVector __is_vector,
- /*is_parallel=*/std::true_type) noexcept
+__pattern_search_n(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last,
+ _Size __count, const _Tp& __value, _BinaryPredicate __pred, _IsVector __is_vector,
+ /*is_parallel=*/std::true_type) noexcept
{
if (__last - __first == __count)
{
- const bool __result =
- !internal::pattern_any_of(std::forward<_ExecutionPolicy>(__exec), __first, __last,
- [&__value, &__pred](const _Tp& __val) { return !__pred(__val, __value); },
- __is_vector, /*is_parallel*/ std::true_type());
+ const bool __result = !__pattern_any_of(
+ std::forward<_ExecutionPolicy>(__exec), __first, __last,
+ [&__value, &__pred](const _Tp& __val) { return !__pred(__val, __value); }, __is_vector,
+ /*is_parallel*/ std::true_type());
return __result ? __first : __last;
}
else
{
- return except_handler([&__exec, __first, __last, __count, &__value, __pred, __is_vector]() {
- return internal::parallel_find(
+ return __except_handler([&__exec, __first, __last, __count, &__value, __pred, __is_vector]() {
+ return __parallel_find(
std::forward<_ExecutionPolicy>(__exec), __first, __last,
[__last, __count, &__value, __pred, __is_vector](_RandomAccessIterator __i, _RandomAccessIterator __j) {
- return internal::find_subrange(__i, __j, __last, __count, __value, __pred, __is_vector);
+ return __find_subrange(__i, __j, __last, __count, __value, __pred, __is_vector);
},
std::less<typename std::iterator_traits<_RandomAccessIterator>::difference_type>(), /*is_first=*/true);
});
@@ -821,17 +821,17 @@ pattern_search_n(_ExecutionPolicy&& __ex
template <class _ForwardIterator, class _Size, class _OutputIterator>
_OutputIterator
-brick_copy_n(_ForwardIterator __first, _Size __n, _OutputIterator __result, /*vector=*/std::false_type) noexcept
+__brick_copy_n(_ForwardIterator __first, _Size __n, _OutputIterator __result, /*vector=*/std::false_type) noexcept
{
return std::copy_n(__first, __n, __result);
}
template <class _ForwardIterator, class _Size, class _OutputIterator>
_OutputIterator
-brick_copy_n(_ForwardIterator __first, _Size __n, _OutputIterator __result, /*vector=*/std::true_type) noexcept
+__brick_copy_n(_ForwardIterator __first, _Size __n, _OutputIterator __result, /*vector=*/std::true_type) noexcept
{
- return unseq_backend::simd_assign(__first, __n, __result,
- [](_ForwardIterator __first, _OutputIterator __result) { *__result = *__first; });
+ return __unseq_backend::__simd_assign(
+ __first, __n, __result, [](_ForwardIterator __first, _OutputIterator __result) { *__result = *__first; });
}
//------------------------------------------------------------------------
@@ -839,18 +839,18 @@ brick_copy_n(_ForwardIterator __first, _
//------------------------------------------------------------------------
template <class _ForwardIterator, class _OutputIterator>
_OutputIterator
-brick_copy(_ForwardIterator __first, _ForwardIterator __last, _OutputIterator __result,
- /*vector=*/std::false_type) noexcept
+__brick_copy(_ForwardIterator __first, _ForwardIterator __last, _OutputIterator __result,
+ /*vector=*/std::false_type) noexcept
{
return std::copy(__first, __last, __result);
}
template <class _RandomAccessIterator, class _OutputIterator>
_OutputIterator
-brick_copy(_RandomAccessIterator __first, _RandomAccessIterator __last, _OutputIterator __result,
- /*vector=*/std::true_type) noexcept
+__brick_copy(_RandomAccessIterator __first, _RandomAccessIterator __last, _OutputIterator __result,
+ /*vector=*/std::true_type) noexcept
{
- return unseq_backend::simd_assign(
+ return __unseq_backend::__simd_assign(
__first, __last - __first, __result,
[](_RandomAccessIterator __first, _OutputIterator __result) { *__result = *__first; });
}
@@ -860,18 +860,18 @@ brick_copy(_RandomAccessIterator __first
//------------------------------------------------------------------------
template <class _ForwardIterator, class _OutputIterator>
_OutputIterator
-brick_move(_ForwardIterator __first, _ForwardIterator __last, _OutputIterator __result,
- /*vector=*/std::false_type) noexcept
+__brick_move(_ForwardIterator __first, _ForwardIterator __last, _OutputIterator __result,
+ /*vector=*/std::false_type) noexcept
{
return std::move(__first, __last, __result);
}
template <class _RandomAccessIterator, class _OutputIterator>
_OutputIterator
-brick_move(_RandomAccessIterator __first, _RandomAccessIterator __last, _OutputIterator __result,
- /*vector=*/std::true_type) noexcept
+__brick_move(_RandomAccessIterator __first, _RandomAccessIterator __last, _OutputIterator __result,
+ /*vector=*/std::true_type) noexcept
{
- return unseq_backend::simd_assign(
+ return __unseq_backend::__simd_assign(
__first, __last - __first, __result,
[](_RandomAccessIterator __first, _OutputIterator __result) { *__result = std::move(*__first); });
}
@@ -881,20 +881,20 @@ brick_move(_RandomAccessIterator __first
//------------------------------------------------------------------------
template <class _ForwardIterator, class _OutputIterator>
_OutputIterator
-brick_swap_ranges(_ForwardIterator __first, _ForwardIterator __last, _OutputIterator __result,
- /*vector=*/std::false_type) noexcept
+__brick_swap_ranges(_ForwardIterator __first, _ForwardIterator __last, _OutputIterator __result,
+ /*vector=*/std::false_type) noexcept
{
return std::swap_ranges(__first, __last, __result);
}
template <class _ForwardIterator, class _OutputIterator>
_OutputIterator
-brick_swap_ranges(_ForwardIterator __first, _ForwardIterator __last, _OutputIterator __result,
- /*vector=*/std::true_type) noexcept
+__brick_swap_ranges(_ForwardIterator __first, _ForwardIterator __last, _OutputIterator __result,
+ /*vector=*/std::true_type) noexcept
{
using std::iter_swap;
- return unseq_backend::simd_assign(__first, __last - __first, __result,
- iter_swap<_ForwardIterator, _OutputIterator>);
+ return __unseq_backend::__simd_assign(__first, __last - __first, __result,
+ iter_swap<_ForwardIterator, _OutputIterator>);
}
//------------------------------------------------------------------------
@@ -902,34 +902,34 @@ brick_swap_ranges(_ForwardIterator __fir
//------------------------------------------------------------------------
template <class _ForwardIterator, class _OutputIterator, class _UnaryPredicate>
_OutputIterator
-brick_copy_if(_ForwardIterator __first, _ForwardIterator __last, _OutputIterator __result, _UnaryPredicate __pred,
- /*vector=*/std::false_type) noexcept
+__brick_copy_if(_ForwardIterator __first, _ForwardIterator __last, _OutputIterator __result, _UnaryPredicate __pred,
+ /*vector=*/std::false_type) noexcept
{
return std::copy_if(__first, __last, __result, __pred);
}
template <class _ForwardIterator, class _OutputIterator, class _UnaryPredicate>
_OutputIterator
-brick_copy_if(_ForwardIterator __first, _ForwardIterator __last, _OutputIterator __result, _UnaryPredicate __pred,
- /*vector=*/std::true_type) noexcept
+__brick_copy_if(_ForwardIterator __first, _ForwardIterator __last, _OutputIterator __result, _UnaryPredicate __pred,
+ /*vector=*/std::true_type) noexcept
{
#if (__PSTL_MONOTONIC_PRESENT)
- return unseq_backend::simd_copy_if(__first, __last - __first, __result, __pred);
+ return __unseq_backend::__simd_copy_if(__first, __last - __first, __result, __pred);
#else
return std::copy_if(__first, __last, __result, __pred);
#endif
}
-// TODO: Try to use transform_reduce for combining brick_copy_if_phase1 on IsVector.
+// TODO: Try to use transform_reduce for combining __brick_copy_if_phase1 on IsVector.
template <class _DifferenceType, class _ForwardIterator, class _UnaryPredicate>
std::pair<_DifferenceType, _DifferenceType>
-brick_calc_mask_1(_ForwardIterator __first, _ForwardIterator __last, bool* __restrict __mask, _UnaryPredicate __pred,
- /*vector=*/std::false_type) noexcept
+__brick_calc_mask_1(_ForwardIterator __first, _ForwardIterator __last, bool* __restrict __mask, _UnaryPredicate __pred,
+ /*vector=*/std::false_type) noexcept
{
auto __count_true = _DifferenceType(0);
auto __size = __last - __first;
- static_assert(internal::is_random_access_iterator<_ForwardIterator>::value,
+ static_assert(__is_random_access_iterator<_ForwardIterator>::value,
"Pattern-brick error. Should be a random access iterator.");
for (; __first != __last; ++__first, ++__mask)
@@ -945,17 +945,17 @@ brick_calc_mask_1(_ForwardIterator __fir
template <class _DifferenceType, class _RandomAccessIterator, class _UnaryPredicate>
std::pair<_DifferenceType, _DifferenceType>
-brick_calc_mask_1(_RandomAccessIterator __first, _RandomAccessIterator __last, bool* __mask, _UnaryPredicate __pred,
- /*vector=*/std::true_type) noexcept
+__brick_calc_mask_1(_RandomAccessIterator __first, _RandomAccessIterator __last, bool* __mask, _UnaryPredicate __pred,
+ /*vector=*/std::true_type) noexcept
{
- auto __result = unseq_backend::simd_calc_mask_1(__first, __last - __first, __mask, __pred);
+ auto __result = __unseq_backend::__simd_calc_mask_1(__first, __last - __first, __mask, __pred);
return std::make_pair(__result, (__last - __first) - __result);
}
template <class _ForwardIterator, class _OutputIterator, class _Assigner>
void
-brick_copy_by_mask(_ForwardIterator __first, _ForwardIterator __last, _OutputIterator __result, bool* __mask,
- _Assigner __assigner, /*vector=*/std::false_type) noexcept
+__brick_copy_by_mask(_ForwardIterator __first, _ForwardIterator __last, _OutputIterator __result, bool* __mask,
+ _Assigner __assigner, /*vector=*/std::false_type) noexcept
{
for (; __first != __last; ++__first, ++__mask)
{
@@ -969,20 +969,20 @@ brick_copy_by_mask(_ForwardIterator __fi
template <class _ForwardIterator, class _OutputIterator, class _Assigner>
void
-brick_copy_by_mask(_ForwardIterator __first, _ForwardIterator __last, _OutputIterator __result, bool* __restrict __mask,
- _Assigner __assigner, /*vector=*/std::true_type) noexcept
+__brick_copy_by_mask(_ForwardIterator __first, _ForwardIterator __last, _OutputIterator __result,
+ bool* __restrict __mask, _Assigner __assigner, /*vector=*/std::true_type) noexcept
{
#if (__PSTL_MONOTONIC_PRESENT)
- unseq_backend::simd_copy_by_mask(__first, __last - __first, __result, __mask, __assigner);
+ __unseq_backend::__simd_copy_by_mask(__first, __last - __first, __result, __mask, __assigner);
#else
- internal::brick_copy_by_mask(__first, __last, __result, __mask, __assigner, std::false_type());
+ __brick_copy_by_mask(__first, __last, __result, __mask, __assigner, std::false_type());
#endif
}
template <class _ForwardIterator, class _OutputIterator1, class _OutputIterator2>
void
-brick_partition_by_mask(_ForwardIterator __first, _ForwardIterator __last, _OutputIterator1 __out_true,
- _OutputIterator2 __out_false, bool* __mask, /*vector=*/std::false_type) noexcept
+__brick_partition_by_mask(_ForwardIterator __first, _ForwardIterator __last, _OutputIterator1 __out_true,
+ _OutputIterator2 __out_false, bool* __mask, /*vector=*/std::false_type) noexcept
{
for (; __first != __last; ++__first, ++__mask)
{
@@ -1001,58 +1001,58 @@ brick_partition_by_mask(_ForwardIterator
template <class _RandomAccessIterator, class _OutputIterator1, class _OutputIterator2>
void
-brick_partition_by_mask(_RandomAccessIterator __first, _RandomAccessIterator __last, _OutputIterator1 __out_true,
- _OutputIterator2 __out_false, bool* __mask, /*vector=*/std::true_type) noexcept
+__brick_partition_by_mask(_RandomAccessIterator __first, _RandomAccessIterator __last, _OutputIterator1 __out_true,
+ _OutputIterator2 __out_false, bool* __mask, /*vector=*/std::true_type) noexcept
{
#if (__PSTL_MONOTONIC_PRESENT)
- unseq_backend::simd_partition_by_mask(__first, __last - __first, __out_true, __out_false, __mask);
+ __unseq_backend::__simd_partition_by_mask(__first, __last - __first, __out_true, __out_false, __mask);
#else
- internal::brick_partition_by_mask(__first, __last, __out_true, __out_false, __mask, std::false_type());
+ __brick_partition_by_mask(__first, __last, __out_true, __out_false, __mask, std::false_type());
#endif
}
template <class _ExecutionPolicy, class _ForwardIterator, class _OutputIterator, class _UnaryPredicate, class _IsVector>
_OutputIterator
-pattern_copy_if(_ExecutionPolicy&&, _ForwardIterator __first, _ForwardIterator __last, _OutputIterator __result,
- _UnaryPredicate __pred, _IsVector __is_vector, /*parallel=*/std::false_type) noexcept
+__pattern_copy_if(_ExecutionPolicy&&, _ForwardIterator __first, _ForwardIterator __last, _OutputIterator __result,
+ _UnaryPredicate __pred, _IsVector __is_vector, /*parallel=*/std::false_type) noexcept
{
- return internal::brick_copy_if(__first, __last, __result, __pred, __is_vector);
+ return __brick_copy_if(__first, __last, __result, __pred, __is_vector);
}
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _RandomAccessIterator, class _OutputIterator, class _UnaryPredicate,
class _IsVector>
_OutputIterator
-pattern_copy_if(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last,
- _OutputIterator __result, _UnaryPredicate __pred, _IsVector __is_vector, /*parallel=*/std::true_type)
+__pattern_copy_if(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last,
+ _OutputIterator __result, _UnaryPredicate __pred, _IsVector __is_vector, /*parallel=*/std::true_type)
{
typedef typename std::iterator_traits<_RandomAccessIterator>::difference_type _DifferenceType;
const _DifferenceType __n = __last - __first;
if (_DifferenceType(1) < __n)
{
- par_backend::buffer<bool> __mask_buf(__n);
- return except_handler([&__exec, __n, __first, __result, __is_vector, __pred, &__mask_buf]() {
+ __par_backend::__buffer<bool> __mask_buf(__n);
+ return __except_handler([&__exec, __n, __first, __result, __is_vector, __pred, &__mask_buf]() {
bool* __mask = __mask_buf.get();
_DifferenceType __m{};
- par_backend::parallel_strict_scan(
+ __par_backend::parallel_strict_scan(
std::forward<_ExecutionPolicy>(__exec), __n, _DifferenceType(0),
[=](_DifferenceType __i, _DifferenceType __len) { // Reduce
- return brick_calc_mask_1<_DifferenceType>(__first + __i, __first + (__i + __len), __mask + __i,
- __pred, __is_vector)
+ return __brick_calc_mask_1<_DifferenceType>(__first + __i, __first + (__i + __len), __mask + __i,
+ __pred, __is_vector)
.first;
},
std::plus<_DifferenceType>(), // Combine
[=](_DifferenceType __i, _DifferenceType __len, _DifferenceType __initial) { // Scan
- brick_copy_by_mask(__first + __i, __first + (__i + __len), __result + __initial, __mask + __i,
- [](_RandomAccessIterator __x, _OutputIterator __z) { *__z = *__x; },
- __is_vector);
+ __brick_copy_by_mask(
+ __first + __i, __first + (__i + __len), __result + __initial, __mask + __i,
+ [](_RandomAccessIterator __x, _OutputIterator __z) { *__z = *__x; }, __is_vector);
},
[&__m](_DifferenceType __total) { __m = __total; });
return __result + __m;
});
}
// trivial sequence - use serial algorithm
- return brick_copy_if(__first, __last, __result, __pred, __is_vector);
+ return __brick_copy_if(__first, __last, __result, __pred, __is_vector);
}
#endif
@@ -1061,40 +1061,40 @@ pattern_copy_if(_ExecutionPolicy&& __exe
//------------------------------------------------------------------------
template <class _ForwardIterator, class _Predicate>
typename std::iterator_traits<_ForwardIterator>::difference_type
-brick_count(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred,
- /* is_vector = */ std::true_type) noexcept
+__brick_count(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred,
+ /* is_vector = */ std::true_type) noexcept
{
- return unseq_backend::simd_count(__first, __last - __first, __pred);
+ return __unseq_backend::__simd_count(__first, __last - __first, __pred);
}
template <class _ForwardIterator, class _Predicate>
typename std::iterator_traits<_ForwardIterator>::difference_type
-brick_count(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred,
- /* is_vector = */ std::false_type) noexcept
+__brick_count(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred,
+ /* is_vector = */ std::false_type) noexcept
{
return std::count_if(__first, __last, __pred);
}
template <class _ExecutionPolicy, class _ForwardIterator, class _Predicate, class _IsVector>
typename std::iterator_traits<_ForwardIterator>::difference_type
-pattern_count(_ExecutionPolicy&&, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred,
- /* is_parallel */ std::false_type, _IsVector __is_vector) noexcept
+__pattern_count(_ExecutionPolicy&&, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred,
+ /* is_parallel */ std::false_type, _IsVector __is_vector) noexcept
{
- return brick_count(__first, __last, __pred, __is_vector);
+ return __brick_count(__first, __last, __pred, __is_vector);
}
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _ForwardIterator, class _Predicate, class _IsVector>
typename std::iterator_traits<_ForwardIterator>::difference_type
-pattern_count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred,
- /* is_parallel */ std::true_type, _IsVector __is_vector)
+__pattern_count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred,
+ /* is_parallel */ std::true_type, _IsVector __is_vector)
{
typedef typename std::iterator_traits<_ForwardIterator>::difference_type _SizeType;
- return except_handler([&]() {
- return par_backend::parallel_reduce(
+ return __except_handler([&]() {
+ return __par_backend::__parallel_reduce(
std::forward<_ExecutionPolicy>(__exec), __first, __last, _SizeType(0),
[__pred, __is_vector](_ForwardIterator __begin, _ForwardIterator __end, _SizeType __value) -> _SizeType {
- return __value + brick_count(__begin, __end, __pred, __is_vector);
+ return __value + __brick_count(__begin, __end, __pred, __is_vector);
},
std::plus<_SizeType>());
});
@@ -1107,16 +1107,16 @@ pattern_count(_ExecutionPolicy&& __exec,
template <class _ForwardIterator, class _BinaryPredicate>
_ForwardIterator
-brick_unique(_ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __pred,
- /*is_vector=*/std::false_type) noexcept
+__brick_unique(_ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __pred,
+ /*is_vector=*/std::false_type) noexcept
{
return std::unique(__first, __last, __pred);
}
template <class _ForwardIterator, class _BinaryPredicate>
_ForwardIterator
-brick_unique(_ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __pred,
- /*is_vector=*/std::true_type) noexcept
+__brick_unique(_ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __pred,
+ /*is_vector=*/std::true_type) noexcept
{
__PSTL_PRAGMA_MESSAGE("Vectorized algorithm unimplemented, redirected to serial");
return std::unique(__first, __last, __pred);
@@ -1124,14 +1124,14 @@ brick_unique(_ForwardIterator __first, _
template <class _ExecutionPolicy, class _ForwardIterator, class _BinaryPredicate, class _IsVector>
_ForwardIterator
-pattern_unique(_ExecutionPolicy&&, _ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __pred,
- _IsVector __is_vector, /*is_parallel=*/std::false_type) noexcept
+__pattern_unique(_ExecutionPolicy&&, _ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __pred,
+ _IsVector __is_vector, /*is_parallel=*/std::false_type) noexcept
{
- return internal::brick_unique(__first, __last, __pred, __is_vector);
+ return __brick_unique(__first, __last, __pred, __is_vector);
}
#if __PSTL_USE_PAR_POLICIES
-// That function is shared between two algorithms - remove_if (pattern_remove_if) and unique (pattern unique). But a mask calculation is different.
+// That function is shared between two algorithms - remove_if (__pattern_remove_if) and unique (pattern unique). But a mask calculation is different.
// So, a caller passes _CalcMask brick into remove_elements.
template <class _ExecutionPolicy, class _ForwardIterator, class _CalcMask, class _IsVector>
_ForwardIterator
@@ -1141,11 +1141,11 @@ remove_elements(_ExecutionPolicy&& __exe
typedef typename std::iterator_traits<_ForwardIterator>::difference_type _DifferenceType;
typedef typename std::iterator_traits<_ForwardIterator>::value_type _Tp;
_DifferenceType __n = __last - __first;
- par_backend::buffer<bool> __mask_buf(__n);
+ __par_backend::__buffer<bool> __mask_buf(__n);
// 1. find a first iterator that should be removed
- return except_handler([&]() {
+ return __except_handler([&]() {
bool* __mask = __mask_buf.get();
- _DifferenceType __min = par_backend::parallel_reduce(
+ _DifferenceType __min = __par_backend::__parallel_reduce(
std::forward<_ExecutionPolicy>(__exec), _DifferenceType(0), __n, __n,
[__first, __mask, &__calc_mask, __is_vector](_DifferenceType __i, _DifferenceType __j,
_DifferenceType __local_min) -> _DifferenceType {
@@ -1158,8 +1158,8 @@ remove_elements(_ExecutionPolicy&& __exe
return __local_min;
}
// find first iterator that should be removed
- bool* __result =
- brick_find_if(__mask + __i, __mask + __j, [](bool __val) { return !__val; }, __is_vector);
+ bool* __result = __brick_find_if(
+ __mask + __i, __mask + __j, [](bool __val) { return !__val; }, __is_vector);
if (__result - __mask == __j)
{
return __local_min;
@@ -1178,32 +1178,35 @@ remove_elements(_ExecutionPolicy&& __exe
__n -= __min;
__first += __min;
- par_backend::buffer<_Tp> __buf(__n);
+ __par_backend::__buffer<_Tp> __buf(__n);
_Tp* __result = __buf.get();
__mask += __min;
_DifferenceType __m{};
// 2. Elements that doesn't satisfy pred are moved to result
- par_backend::parallel_strict_scan(
+ __par_backend::parallel_strict_scan(
std::forward<_ExecutionPolicy>(__exec), __n, _DifferenceType(0),
[__mask, __is_vector](_DifferenceType __i, _DifferenceType __len) {
- return brick_count(__mask + __i, __mask + __i + __len, [](bool __val) { return __val; }, __is_vector);
+ return __brick_count(
+ __mask + __i, __mask + __i + __len, [](bool __val) { return __val; }, __is_vector);
},
std::plus<_DifferenceType>(),
[=](_DifferenceType __i, _DifferenceType __len, _DifferenceType __initial) {
- brick_copy_by_mask(__first + __i, __first + __i + __len, __result + __initial, __mask + __i,
- [](_ForwardIterator __x, _Tp* __z) {
- invoke_if_else(std::is_trivial<_Tp>(), [&]() { *__z = std::move(*__x); },
- [&]() { ::new (std::addressof(*__z)) _Tp(std::move(*__x)); });
- },
- __is_vector);
+ __brick_copy_by_mask(
+ __first + __i, __first + __i + __len, __result + __initial, __mask + __i,
+ [](_ForwardIterator __x, _Tp* __z) {
+ __invoke_if_else(
+ std::is_trivial<_Tp>(), [&]() { *__z = std::move(*__x); },
+ [&]() { ::new (std::addressof(*__z)) _Tp(std::move(*__x)); });
+ },
+ __is_vector);
},
[&__m](_DifferenceType __total) { __m = __total; });
// 3. Elements from result are moved to [first, last)
- par_backend::parallel_for(std::forward<_ExecutionPolicy>(__exec), __result, __result + __m,
- [__result, __first, __is_vector](_Tp* __i, _Tp* __j) {
- brick_move(__i, __j, __first + (__i - __result), __is_vector);
- });
+ __par_backend::__parallel_for(std::forward<_ExecutionPolicy>(__exec), __result, __result + __m,
+ [__result, __first, __is_vector](_Tp* __i, _Tp* __j) {
+ __brick_move(__i, __j, __first + (__i - __result), __is_vector);
+ });
return __first + __m;
});
}
@@ -1212,8 +1215,8 @@ remove_elements(_ExecutionPolicy&& __exe
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _ForwardIterator, class _BinaryPredicate, class _IsVector>
_ForwardIterator
-pattern_unique(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __pred,
- _IsVector __is_vector, /*is_parallel=*/std::true_type) noexcept
+__pattern_unique(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __pred,
+ _IsVector __is_vector, /*is_parallel=*/std::true_type) noexcept
{
typedef typename std::iterator_traits<_ForwardIterator>::reference _ReferenceType;
@@ -1224,14 +1227,14 @@ pattern_unique(_ExecutionPolicy&& __exec
if (__first + 1 == __last || __first + 2 == __last)
{
// Trivial sequence - use serial algorithm
- return brick_unique(__first, __last, __pred, __is_vector);
+ return __brick_unique(__first, __last, __pred, __is_vector);
}
return remove_elements(
std::forward<_ExecutionPolicy>(__exec), ++__first, __last,
[&__pred, __is_vector](bool* __b, bool* __e, _ForwardIterator __it) {
- brick_walk3(__b, __e, __it - 1, __it,
- [&__pred](bool& __x, _ReferenceType __y, _ReferenceType __z) { __x = !__pred(__y, __z); },
- __is_vector);
+ __brick_walk3(
+ __b, __e, __it - 1, __it,
+ [&__pred](bool& __x, _ReferenceType __y, _ReferenceType __z) { __x = !__pred(__y, __z); }, __is_vector);
},
__is_vector);
}
@@ -1243,19 +1246,19 @@ pattern_unique(_ExecutionPolicy&& __exec
template <class _ForwardIterator, class OutputIterator, class _BinaryPredicate>
OutputIterator
-brick_unique_copy(_ForwardIterator __first, _ForwardIterator __last, OutputIterator __result, _BinaryPredicate __pred,
- /*vector=*/std::false_type) noexcept
+__brick_unique_copy(_ForwardIterator __first, _ForwardIterator __last, OutputIterator __result, _BinaryPredicate __pred,
+ /*vector=*/std::false_type) noexcept
{
return std::unique_copy(__first, __last, __result, __pred);
}
template <class _RandomAccessIterator, class OutputIterator, class _BinaryPredicate>
OutputIterator
-brick_unique_copy(_RandomAccessIterator __first, _RandomAccessIterator __last, OutputIterator __result,
- _BinaryPredicate __pred, /*vector=*/std::true_type) noexcept
+__brick_unique_copy(_RandomAccessIterator __first, _RandomAccessIterator __last, OutputIterator __result,
+ _BinaryPredicate __pred, /*vector=*/std::true_type) noexcept
{
#if (__PSTL_MONOTONIC_PRESENT)
- return unseq_backend::simd_unique_copy(__first, __last - __first, __result, __pred);
+ return __unseq_backend::__simd_unique_copy(__first, __last - __first, __result, __pred);
#else
return std::unique_copy(__first, __last, __result, __pred);
#endif
@@ -1264,16 +1267,16 @@ brick_unique_copy(_RandomAccessIterator
template <class _ExecutionPolicy, class _ForwardIterator, class _OutputIterator, class _BinaryPredicate,
class _IsVector>
_OutputIterator
-pattern_unique_copy(_ExecutionPolicy&&, _ForwardIterator __first, _ForwardIterator __last, _OutputIterator __result,
- _BinaryPredicate __pred, _IsVector __is_vector, /*parallel=*/std::false_type) noexcept
+__pattern_unique_copy(_ExecutionPolicy&&, _ForwardIterator __first, _ForwardIterator __last, _OutputIterator __result,
+ _BinaryPredicate __pred, _IsVector __is_vector, /*parallel=*/std::false_type) noexcept
{
- return internal::brick_unique_copy(__first, __last, __result, __pred, __is_vector);
+ return __brick_unique_copy(__first, __last, __result, __pred, __is_vector);
}
template <class _DifferenceType, class _RandomAccessIterator, class _BinaryPredicate>
_DifferenceType
-brick_calc_mask_2(_RandomAccessIterator __first, _RandomAccessIterator __last, bool* __restrict __mask,
- _BinaryPredicate __pred, /*vector=*/std::false_type) noexcept
+__brick_calc_mask_2(_RandomAccessIterator __first, _RandomAccessIterator __last, bool* __restrict __mask,
+ _BinaryPredicate __pred, /*vector=*/std::false_type) noexcept
{
_DifferenceType __count = 0;
for (; __first != __last; ++__first, ++__mask)
@@ -1286,31 +1289,31 @@ brick_calc_mask_2(_RandomAccessIterator
template <class _DifferenceType, class _RandomAccessIterator, class _BinaryPredicate>
_DifferenceType
-brick_calc_mask_2(_RandomAccessIterator __first, _RandomAccessIterator __last, bool* __restrict __mask,
- _BinaryPredicate __pred, /*vector=*/std::true_type) noexcept
+__brick_calc_mask_2(_RandomAccessIterator __first, _RandomAccessIterator __last, bool* __restrict __mask,
+ _BinaryPredicate __pred, /*vector=*/std::true_type) noexcept
{
- return unseq_backend::simd_calc_mask_2(__first, __last - __first, __mask, __pred);
+ return __unseq_backend::__simd_calc_mask_2(__first, __last - __first, __mask, __pred);
}
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _RandomAccessIterator, class _OutputIterator, class _BinaryPredicate,
class _IsVector>
_OutputIterator
-pattern_unique_copy(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last,
- _OutputIterator __result, _BinaryPredicate __pred, _IsVector __is_vector,
- /*parallel=*/std::true_type)
+__pattern_unique_copy(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last,
+ _OutputIterator __result, _BinaryPredicate __pred, _IsVector __is_vector,
+ /*parallel=*/std::true_type)
{
typedef typename std::iterator_traits<_RandomAccessIterator>::difference_type _DifferenceType;
const _DifferenceType __n = __last - __first;
if (_DifferenceType(2) < __n)
{
- par_backend::buffer<bool> __mask_buf(__n);
+ __par_backend::__buffer<bool> __mask_buf(__n);
if (_DifferenceType(2) < __n)
{
- return internal::except_handler([&__exec, __n, __first, __result, __pred, __is_vector, &__mask_buf]() {
+ return __except_handler([&__exec, __n, __first, __result, __pred, __is_vector, &__mask_buf]() {
bool* __mask = __mask_buf.get();
_DifferenceType __m{};
- par_backend::parallel_strict_scan(
+ __par_backend::parallel_strict_scan(
std::forward<_ExecutionPolicy>(__exec), __n, _DifferenceType(0),
[=](_DifferenceType __i, _DifferenceType __len) -> _DifferenceType { // Reduce
_DifferenceType __extra = 0;
@@ -1323,14 +1326,14 @@ pattern_unique_copy(_ExecutionPolicy&& _
++__i;
++__extra;
}
- return brick_calc_mask_2<_DifferenceType>(__first + __i, __first + (__i + __len), __mask + __i,
- __pred, __is_vector) +
+ return __brick_calc_mask_2<_DifferenceType>(__first + __i, __first + (__i + __len),
+ __mask + __i, __pred, __is_vector) +
__extra;
},
std::plus<_DifferenceType>(), // Combine
[=](_DifferenceType __i, _DifferenceType __len, _DifferenceType __initial) { // Scan
- // Phase 2 is same as for pattern_copy_if
- internal::brick_copy_by_mask(
+ // Phase 2 is same as for __pattern_copy_if
+ __brick_copy_by_mask(
__first + __i, __first + (__i + __len), __result + __initial, __mask + __i,
[](_RandomAccessIterator __x, _OutputIterator __z) { *__z = *__x; }, __is_vector);
},
@@ -1340,7 +1343,7 @@ pattern_unique_copy(_ExecutionPolicy&& _
}
}
// trivial sequence - use serial algorithm
- return brick_unique_copy(__first, __last, __result, __pred, __is_vector);
+ return __brick_unique_copy(__first, __last, __result, __pred, __is_vector);
}
#endif
@@ -1349,30 +1352,30 @@ pattern_unique_copy(_ExecutionPolicy&& _
//------------------------------------------------------------------------
template <class _BidirectionalIterator>
void
-brick_reverse(_BidirectionalIterator __first, _BidirectionalIterator __last, /*__is_vector=*/std::false_type) noexcept
+__brick_reverse(_BidirectionalIterator __first, _BidirectionalIterator __last, /*__is_vector=*/std::false_type) noexcept
{
std::reverse(__first, __last);
}
template <class _BidirectionalIterator>
void
-brick_reverse(_BidirectionalIterator __first, _BidirectionalIterator __last, /*__is_vector=*/std::true_type) noexcept
+__brick_reverse(_BidirectionalIterator __first, _BidirectionalIterator __last, /*__is_vector=*/std::true_type) noexcept
{
typedef typename std::iterator_traits<_BidirectionalIterator>::reference _ReferenceType;
const auto __n = (__last - __first) / 2;
- unseq_backend::simd_walk_2(__first, __n, std::reverse_iterator<_BidirectionalIterator>(__last),
- [](_ReferenceType __x, _ReferenceType __y) {
- using std::swap;
- swap(__x, __y);
- });
+ __unseq_backend::__simd_walk_2(__first, __n, std::reverse_iterator<_BidirectionalIterator>(__last),
+ [](_ReferenceType __x, _ReferenceType __y) {
+ using std::swap;
+ swap(__x, __y);
+ });
}
// this brick is called in parallel version, so we can use iterator arithmetic
template <class _BidirectionalIterator>
void
-brick_reverse(_BidirectionalIterator __first, _BidirectionalIterator __last, _BidirectionalIterator __d_last,
- /*is_vector=*/std::false_type) noexcept
+__brick_reverse(_BidirectionalIterator __first, _BidirectionalIterator __last, _BidirectionalIterator __d_last,
+ /*is_vector=*/std::false_type) noexcept
{
for (--__d_last; __first != __last; ++__first, --__d_last)
{
@@ -1384,36 +1387,37 @@ brick_reverse(_BidirectionalIterator __f
// this brick is called in parallel version, so we can use iterator arithmetic
template <class _BidirectionalIterator>
void
-brick_reverse(_BidirectionalIterator __first, _BidirectionalIterator __last, _BidirectionalIterator __d_last,
- /*is_vector=*/std::true_type) noexcept
+__brick_reverse(_BidirectionalIterator __first, _BidirectionalIterator __last, _BidirectionalIterator __d_last,
+ /*is_vector=*/std::true_type) noexcept
{
typedef typename std::iterator_traits<_BidirectionalIterator>::reference _ReferenceType;
- unseq_backend::simd_walk_2(__first, __last - __first, std::reverse_iterator<_BidirectionalIterator>(__d_last),
- [](_ReferenceType __x, _ReferenceType __y) {
- using std::swap;
- swap(__x, __y);
- });
+ __unseq_backend::__simd_walk_2(__first, __last - __first, std::reverse_iterator<_BidirectionalIterator>(__d_last),
+ [](_ReferenceType __x, _ReferenceType __y) {
+ using std::swap;
+ swap(__x, __y);
+ });
}
template <class _ExecutionPolicy, class _BidirectionalIterator, class _IsVector>
void
-pattern_reverse(_ExecutionPolicy&&, _BidirectionalIterator __first, _BidirectionalIterator __last, _IsVector _is_vector,
- /*is_parallel=*/std::false_type) noexcept
+__pattern_reverse(_ExecutionPolicy&&, _BidirectionalIterator __first, _BidirectionalIterator __last,
+ _IsVector _is_vector,
+ /*is_parallel=*/std::false_type) noexcept
{
- brick_reverse(__first, __last, _is_vector);
+ __brick_reverse(__first, __last, _is_vector);
}
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _BidirectionalIterator, class _IsVector>
void
-pattern_reverse(_ExecutionPolicy&& __exec, _BidirectionalIterator __first, _BidirectionalIterator __last,
- _IsVector __is_vector, /*is_parallel=*/std::true_type)
+__pattern_reverse(_ExecutionPolicy&& __exec, _BidirectionalIterator __first, _BidirectionalIterator __last,
+ _IsVector __is_vector, /*is_parallel=*/std::true_type)
{
- par_backend::parallel_for(
+ __par_backend::__parallel_for(
std::forward<_ExecutionPolicy>(__exec), __first, __first + (__last - __first) / 2,
[__is_vector, __first, __last](_BidirectionalIterator __inner_first, _BidirectionalIterator __inner_last) {
- brick_reverse(__inner_first, __inner_last, __last - (__inner_first - __first), __is_vector);
+ __brick_reverse(__inner_first, __inner_last, __last - (__inner_first - __first), __is_vector);
});
}
#endif
@@ -1424,45 +1428,45 @@ pattern_reverse(_ExecutionPolicy&& __exe
template <class _BidirectionalIterator, class _OutputIterator>
_OutputIterator
-brick_reverse_copy(_BidirectionalIterator __first, _BidirectionalIterator __last, _OutputIterator __d_first,
- /*is_vector=*/std::false_type) noexcept
+__brick_reverse_copy(_BidirectionalIterator __first, _BidirectionalIterator __last, _OutputIterator __d_first,
+ /*is_vector=*/std::false_type) noexcept
{
return std::reverse_copy(__first, __last, __d_first);
}
template <class _BidirectionalIterator, class _OutputIterator>
_OutputIterator
-brick_reverse_copy(_BidirectionalIterator __first, _BidirectionalIterator __last, _OutputIterator __d_first,
- /*is_vector=*/std::true_type) noexcept
+__brick_reverse_copy(_BidirectionalIterator __first, _BidirectionalIterator __last, _OutputIterator __d_first,
+ /*is_vector=*/std::true_type) noexcept
{
typedef typename std::iterator_traits<_BidirectionalIterator>::reference _ReferenceType1;
typedef typename std::iterator_traits<_OutputIterator>::reference _ReferenceType2;
- return unseq_backend::simd_walk_2(std::reverse_iterator<_BidirectionalIterator>(__last), __last - __first,
- __d_first, [](_ReferenceType1 __x, _ReferenceType2 __y) { __y = __x; });
+ return __unseq_backend::__simd_walk_2(std::reverse_iterator<_BidirectionalIterator>(__last), __last - __first,
+ __d_first, [](_ReferenceType1 __x, _ReferenceType2 __y) { __y = __x; });
}
template <class _ExecutionPolicy, class _BidirectionalIterator, class _OutputIterator, class _IsVector>
_OutputIterator
-pattern_reverse_copy(_ExecutionPolicy&&, _BidirectionalIterator __first, _BidirectionalIterator __last,
- _OutputIterator __d_first, _IsVector __is_vector, /*is_parallel=*/std::false_type) noexcept
+__pattern_reverse_copy(_ExecutionPolicy&&, _BidirectionalIterator __first, _BidirectionalIterator __last,
+ _OutputIterator __d_first, _IsVector __is_vector, /*is_parallel=*/std::false_type) noexcept
{
- return internal::brick_reverse_copy(__first, __last, __d_first, __is_vector);
+ return __brick_reverse_copy(__first, __last, __d_first, __is_vector);
}
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _BidirectionalIterator, class _OutputIterator, class _IsVector>
_OutputIterator
-pattern_reverse_copy(_ExecutionPolicy&& __exec, _BidirectionalIterator __first, _BidirectionalIterator __last,
- _OutputIterator __d_first, _IsVector __is_vector, /*is_parallel=*/std::true_type)
+__pattern_reverse_copy(_ExecutionPolicy&& __exec, _BidirectionalIterator __first, _BidirectionalIterator __last,
+ _OutputIterator __d_first, _IsVector __is_vector, /*is_parallel=*/std::true_type)
{
auto __len = __last - __first;
- par_backend::parallel_for(std::forward<_ExecutionPolicy>(__exec), __first, __last,
- [__is_vector, __first, __len, __d_first](_BidirectionalIterator __inner_first,
- _BidirectionalIterator __inner_last) {
- brick_reverse_copy(__inner_first, __inner_last,
- __d_first + (__len - (__inner_last - __first)), __is_vector);
- });
+ __par_backend::__parallel_for(std::forward<_ExecutionPolicy>(__exec), __first, __last,
+ [__is_vector, __first, __len, __d_first](_BidirectionalIterator __inner_first,
+ _BidirectionalIterator __inner_last) {
+ __brick_reverse_copy(__inner_first, __inner_last,
+ __d_first + (__len - (__inner_last - __first)), __is_vector);
+ });
return __d_first + __len;
}
#endif
@@ -1472,8 +1476,8 @@ pattern_reverse_copy(_ExecutionPolicy&&
//------------------------------------------------------------------------
template <class _ForwardIterator>
_ForwardIterator
-brick_rotate(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last,
- /*is_vector=*/std::false_type) noexcept
+__brick_rotate(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last,
+ /*is_vector=*/std::false_type) noexcept
{
#if __PSTL_CPP11_STD_ROTATE_BROKEN
std::rotate(__first, __middle, __last);
@@ -1485,8 +1489,8 @@ brick_rotate(_ForwardIterator __first, _
template <class _ForwardIterator>
_ForwardIterator
-brick_rotate(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last,
- /*is_vector=*/std::true_type) noexcept
+__brick_rotate(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last,
+ /*is_vector=*/std::true_type) noexcept
{
auto __n = __last - __first;
auto __m = __middle - __first;
@@ -1504,15 +1508,16 @@ brick_rotate(_ForwardIterator __first, _
{
for (; __last - __first >= __m_2; __first += __m)
{
- unseq_backend::simd_assign(__first, __m, __first + __m, iter_swap<_ForwardIterator, _ForwardIterator>);
+ __unseq_backend::__simd_assign(__first, __m, __first + __m,
+ iter_swap<_ForwardIterator, _ForwardIterator>);
}
}
else
{
for (; __last - __first >= __m_2; __last -= __m)
{
- unseq_backend::simd_assign(__last - __m, __m, __last - __m_2,
- iter_swap<_ForwardIterator, _ForwardIterator>);
+ __unseq_backend::__simd_assign(__last - __m, __m, __last - __m_2,
+ iter_swap<_ForwardIterator, _ForwardIterator>);
}
}
__is_left = !__is_left;
@@ -1525,67 +1530,66 @@ brick_rotate(_ForwardIterator __first, _
template <class _ExecutionPolicy, class _ForwardIterator, class _IsVector>
_ForwardIterator
-pattern_rotate(_ExecutionPolicy&&, _ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last,
- _IsVector __is_vector, /*is_parallel=*/std::false_type) noexcept
+__pattern_rotate(_ExecutionPolicy&&, _ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last,
+ _IsVector __is_vector, /*is_parallel=*/std::false_type) noexcept
{
- return internal::brick_rotate(__first, __middle, __last, __is_vector);
+ return __brick_rotate(__first, __middle, __last, __is_vector);
}
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _ForwardIterator, class _IsVector>
_ForwardIterator
-pattern_rotate(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last,
- _IsVector __is_vector, /*is_parallel=*/std::true_type)
+__pattern_rotate(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __middle,
+ _ForwardIterator __last, _IsVector __is_vector, /*is_parallel=*/std::true_type)
{
typedef typename std::iterator_traits<_ForwardIterator>::value_type _Tp;
auto __n = __last - __first;
auto __m = __middle - __first;
if (__m <= __n / 2)
{
- par_backend::buffer<_Tp> __buf(__n - __m);
- return except_handler([&__exec, __n, __m, __first, __middle, __last, __is_vector, &__buf]() {
+ __par_backend::__buffer<_Tp> __buf(__n - __m);
+ return __except_handler([&__exec, __n, __m, __first, __middle, __last, __is_vector, &__buf]() {
_Tp* __result = __buf.get();
- par_backend::parallel_for(
+ __par_backend::__parallel_for(
std::forward<_ExecutionPolicy>(__exec), __middle, __last,
[__middle, __result, __is_vector](_ForwardIterator __b, _ForwardIterator __e) {
- brick_uninitialized_move(__b, __e, __result + (__b - __middle), __is_vector);
+ __brick_uninitialized_move(__b, __e, __result + (__b - __middle), __is_vector);
});
- par_backend::parallel_for(
- std::forward<_ExecutionPolicy>(__exec), __first, __middle,
- [__last, __middle, __is_vector](_ForwardIterator __b, _ForwardIterator __e) {
- brick_move(__b, __e, __b + (__last - __middle), __is_vector);
- });
-
- par_backend::parallel_for(std::forward<_ExecutionPolicy>(__exec), __result, __result + (__n - __m),
- [__first, __result, __is_vector](_Tp* __b, _Tp* __e) {
- brick_move(__b, __e, __first + (__b - __result), __is_vector);
- });
+ __par_backend::__parallel_for(std::forward<_ExecutionPolicy>(__exec), __first, __middle,
+ [__last, __middle, __is_vector](_ForwardIterator __b, _ForwardIterator __e) {
+ __brick_move(__b, __e, __b + (__last - __middle), __is_vector);
+ });
+
+ __par_backend::__parallel_for(std::forward<_ExecutionPolicy>(__exec), __result, __result + (__n - __m),
+ [__first, __result, __is_vector](_Tp* __b, _Tp* __e) {
+ __brick_move(__b, __e, __first + (__b - __result), __is_vector);
+ });
return __first + (__last - __middle);
});
}
else
{
- par_backend::buffer<_Tp> __buf(__m);
- return except_handler([&__exec, __n, __m, __first, __middle, __last, __is_vector, &__buf]() {
+ __par_backend::__buffer<_Tp> __buf(__m);
+ return __except_handler([&__exec, __n, __m, __first, __middle, __last, __is_vector, &__buf]() {
_Tp* __result = __buf.get();
- par_backend::parallel_for(
- std::forward<_ExecutionPolicy>(__exec), __first, __middle,
- [__first, __result, __is_vector](_ForwardIterator __b, _ForwardIterator __e) {
- brick_uninitialized_move(__b, __e, __result + (__b - __first), __is_vector);
- });
-
- par_backend::parallel_for(
- std::forward<_ExecutionPolicy>(__exec), __middle, __last,
- [__first, __middle, __is_vector](_ForwardIterator __b, _ForwardIterator __e) {
- brick_move(__b, __e, __first + (__b - __middle), __is_vector);
- });
-
- par_backend::parallel_for(std::forward<_ExecutionPolicy>(__exec), __result, __result + __m,
- [__n, __m, __first, __result, __is_vector](_Tp* __b, _Tp* __e) {
- brick_move(__b, __e, __first + ((__n - __m) + (__b - __result)), __is_vector);
- });
+ __par_backend::__parallel_for(std::forward<_ExecutionPolicy>(__exec), __first, __middle,
+ [__first, __result, __is_vector](_ForwardIterator __b, _ForwardIterator __e) {
+ __brick_uninitialized_move(__b, __e, __result + (__b - __first),
+ __is_vector);
+ });
+
+ __par_backend::__parallel_for(std::forward<_ExecutionPolicy>(__exec), __middle, __last,
+ [__first, __middle, __is_vector](_ForwardIterator __b, _ForwardIterator __e) {
+ __brick_move(__b, __e, __first + (__b - __middle), __is_vector);
+ });
+
+ __par_backend::__parallel_for(std::forward<_ExecutionPolicy>(__exec), __result, __result + __m,
+ [__n, __m, __first, __result, __is_vector](_Tp* __b, _Tp* __e) {
+ __brick_move(__b, __e, __first + ((__n - __m) + (__b - __result)),
+ __is_vector);
+ });
return __first + (__last - __middle);
});
@@ -1599,54 +1603,54 @@ pattern_rotate(_ExecutionPolicy&& __exec
template <class _ForwardIterator, class _OutputIterator>
_OutputIterator
-brick_rotate_copy(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last,
- _OutputIterator __result, /*__is_vector=*/std::false_type) noexcept
+__brick_rotate_copy(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last,
+ _OutputIterator __result, /*__is_vector=*/std::false_type) noexcept
{
return std::rotate_copy(__first, __middle, __last, __result);
}
template <class _ForwardIterator, class _OutputIterator>
_OutputIterator
-brick_rotate_copy(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last,
- _OutputIterator __result, /*__is_vector=*/std::true_type) noexcept
+__brick_rotate_copy(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last,
+ _OutputIterator __result, /*__is_vector=*/std::true_type) noexcept
{
- _OutputIterator __res = brick_copy(__middle, __last, __result, std::true_type());
- return brick_copy(__first, __middle, __res, std::true_type());
+ _OutputIterator __res = __brick_copy(__middle, __last, __result, std::true_type());
+ return __brick_copy(__first, __middle, __res, std::true_type());
}
template <class _ExecutionPolicy, class _ForwardIterator, class _OutputIterator, class _IsVector>
_OutputIterator
-pattern_rotate_copy(_ExecutionPolicy&&, _ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last,
- _OutputIterator __result, _IsVector __is_vector, /*is_parallel=*/std::false_type) noexcept
+__pattern_rotate_copy(_ExecutionPolicy&&, _ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last,
+ _OutputIterator __result, _IsVector __is_vector, /*is_parallel=*/std::false_type) noexcept
{
- return internal::brick_rotate_copy(__first, __middle, __last, __result, __is_vector);
+ return __brick_rotate_copy(__first, __middle, __last, __result, __is_vector);
}
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _ForwardIterator, class _OutputIterator, class _IsVector>
_OutputIterator
-pattern_rotate_copy(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __middle,
- _ForwardIterator __last, _OutputIterator __result, _IsVector __is_vector,
- /*is_parallel=*/std::true_type)
+__pattern_rotate_copy(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __middle,
+ _ForwardIterator __last, _OutputIterator __result, _IsVector __is_vector,
+ /*is_parallel=*/std::true_type)
{
- par_backend::parallel_for(
+ __par_backend::__parallel_for(
std::forward<_ExecutionPolicy>(__exec), __first, __last,
[__first, __last, __middle, __result, __is_vector](_ForwardIterator __b, _ForwardIterator __e) {
if (__b > __middle)
{
- brick_copy(__b, __e, __result + (__b - __middle), __is_vector);
+ __brick_copy(__b, __e, __result + (__b - __middle), __is_vector);
}
else
{
_OutputIterator __new_result = __result + ((__last - __middle) + (__b - __first));
if (__e < __middle)
{
- brick_copy(__b, __e, __new_result, __is_vector);
+ __brick_copy(__b, __e, __new_result, __is_vector);
}
else
{
- brick_copy(__b, __middle, __new_result, __is_vector);
- brick_copy(__middle, __e, __result, __is_vector);
+ __brick_copy(__b, __middle, __new_result, __is_vector);
+ __brick_copy(__middle, __e, __result, __is_vector);
}
}
});
@@ -1660,16 +1664,16 @@ pattern_rotate_copy(_ExecutionPolicy&& _
template <class _ForwardIterator, class _UnaryPredicate>
bool
-brick_is_partitioned(_ForwardIterator __first, _ForwardIterator __last, _UnaryPredicate __pred,
- /*is_vector=*/std::false_type) noexcept
+__brick_is_partitioned(_ForwardIterator __first, _ForwardIterator __last, _UnaryPredicate __pred,
+ /*is_vector=*/std::false_type) noexcept
{
return std::is_partitioned(__first, __last, __pred);
}
template <class _ForwardIterator, class _UnaryPredicate>
bool
-brick_is_partitioned(_ForwardIterator __first, _ForwardIterator __last, _UnaryPredicate __pred,
- /*is_vector=*/std::true_type) noexcept
+__brick_is_partitioned(_ForwardIterator __first, _ForwardIterator __last, _UnaryPredicate __pred,
+ /*is_vector=*/std::true_type) noexcept
{
typedef typename std::iterator_traits<_ForwardIterator>::difference_type _SizeType;
if (__first == __last)
@@ -1678,9 +1682,9 @@ brick_is_partitioned(_ForwardIterator __
}
else
{
- _ForwardIterator __result =
- unseq_backend::simd_first(__first, _SizeType(0), __last - __first,
- [&__pred](_ForwardIterator __it, _SizeType __i) { return !__pred(__it[__i]); });
+ _ForwardIterator __result = __unseq_backend::__simd_first(
+ __first, _SizeType(0), __last - __first,
+ [&__pred](_ForwardIterator __it, _SizeType __i) { return !__pred(__it[__i]); });
if (__result == __last)
{
return true;
@@ -1688,24 +1692,24 @@ brick_is_partitioned(_ForwardIterator __
else
{
++__result;
- return !unseq_backend::simd_or(__result, __last - __result, __pred);
+ return !__unseq_backend::__simd_or(__result, __last - __result, __pred);
}
}
}
template <class _ExecutionPolicy, class _ForwardIterator, class _UnaryPredicate, class _IsVector>
bool
-pattern_is_partitioned(_ExecutionPolicy&&, _ForwardIterator __first, _ForwardIterator __last, _UnaryPredicate __pred,
- _IsVector __is_vector, /*is_parallel=*/std::false_type) noexcept
+__pattern_is_partitioned(_ExecutionPolicy&&, _ForwardIterator __first, _ForwardIterator __last, _UnaryPredicate __pred,
+ _IsVector __is_vector, /*is_parallel=*/std::false_type) noexcept
{
- return internal::brick_is_partitioned(__first, __last, __pred, __is_vector);
+ return __brick_is_partitioned(__first, __last, __pred, __is_vector);
}
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _ForwardIterator, class _UnaryPredicate, class _IsVector>
bool
-pattern_is_partitioned(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last,
- _UnaryPredicate __pred, _IsVector __is_vector, /*is_parallel=*/std::true_type)
+__pattern_is_partitioned(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last,
+ _UnaryPredicate __pred, _IsVector __is_vector, /*is_parallel=*/std::true_type)
{
if (__first == __last)
{
@@ -1713,7 +1717,7 @@ pattern_is_partitioned(_ExecutionPolicy&
}
else
{
- return except_handler([&]() {
+ return __except_handler([&]() {
// State of current range:
// broken - current range is not partitioned by pred
// all_true - all elements in current range satisfy pred
@@ -1735,7 +1739,7 @@ pattern_is_partitioned(_ExecutionPolicy&
__true_false, __true_false, __broken, __broken, __all_false, __broken,
__broken, __broken, __true_false, __broken};
- __init = par_backend::parallel_reduce(
+ __init = __par_backend::__parallel_reduce(
std::forward<_ExecutionPolicy>(__exec), __first, __last, __init,
[&__pred, &__table, __is_vector](_ForwardIterator __i, _ForwardIterator __j,
_ReduceType __value) -> _ReduceType {
@@ -1749,11 +1753,11 @@ pattern_is_partitioned(_ExecutionPolicy&
{
// find first element that don't satisfy pred
_ForwardIterator __x =
- brick_find_if(__i + 1, __j, not_pred<_UnaryPredicate>(__pred), __is_vector);
+ __brick_find_if(__i + 1, __j, __not_pred<_UnaryPredicate>(__pred), __is_vector);
if (__x != __j)
{
// find first element after "x" that satisfy pred
- _ForwardIterator __y = brick_find_if(__x + 1, __j, __pred, __is_vector);
+ _ForwardIterator __y = __brick_find_if(__x + 1, __j, __pred, __is_vector);
// if it was found then range isn't partitioned by pred
if (__y != __j)
{
@@ -1773,7 +1777,7 @@ pattern_is_partitioned(_ExecutionPolicy&
{ // if first element doesn't satisfy pred
// then we should find the first element that satisfy pred.
// If we found it then range isn't partitioned by pred
- if (brick_find_if(__i + 1, __j, __pred, __is_vector) != __j)
+ if (__brick_find_if(__i + 1, __j, __pred, __is_vector) != __j)
{
return __broken;
}
@@ -1806,16 +1810,16 @@ pattern_is_partitioned(_ExecutionPolicy&
template <class _ForwardIterator, class _UnaryPredicate>
_ForwardIterator
-brick_partition(_ForwardIterator __first, _ForwardIterator __last, _UnaryPredicate __pred,
- /*is_vector=*/std::false_type) noexcept
+__brick_partition(_ForwardIterator __first, _ForwardIterator __last, _UnaryPredicate __pred,
+ /*is_vector=*/std::false_type) noexcept
{
return std::partition(__first, __last, __pred);
}
template <class _ForwardIterator, class _UnaryPredicate>
_ForwardIterator
-brick_partition(_ForwardIterator __first, _ForwardIterator __last, _UnaryPredicate __pred,
- /*is_vector=*/std::true_type) noexcept
+__brick_partition(_ForwardIterator __first, _ForwardIterator __last, _UnaryPredicate __pred,
+ /*is_vector=*/std::true_type) noexcept
{
__PSTL_PRAGMA_MESSAGE("Vectorized algorithm unimplemented, redirected to serial");
return std::partition(__first, __last, __pred);
@@ -1823,17 +1827,17 @@ brick_partition(_ForwardIterator __first
template <class _ExecutionPolicy, class _ForwardIterator, class _UnaryPredicate, class _IsVector>
_ForwardIterator
-pattern_partition(_ExecutionPolicy&&, _ForwardIterator __first, _ForwardIterator __last, _UnaryPredicate __pred,
- _IsVector __is_vector, /*is_parallel=*/std::false_type) noexcept
+__pattern_partition(_ExecutionPolicy&&, _ForwardIterator __first, _ForwardIterator __last, _UnaryPredicate __pred,
+ _IsVector __is_vector, /*is_parallel=*/std::false_type) noexcept
{
- return internal::brick_partition(__first, __last, __pred, __is_vector);
+ return __brick_partition(__first, __last, __pred, __is_vector);
}
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _ForwardIterator, class _UnaryPredicate, class _IsVector>
_ForwardIterator
-pattern_partition(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _UnaryPredicate __pred,
- _IsVector __is_vector, /*is_parallel=*/std::true_type)
+__pattern_partition(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last,
+ _UnaryPredicate __pred, _IsVector __is_vector, /*is_parallel=*/std::true_type)
{
// partitioned range: elements before pivot satisfy pred (true part),
@@ -1845,12 +1849,11 @@ pattern_partition(_ExecutionPolicy&& __e
_ForwardIterator __end;
};
- return except_handler([&]() {
+ return __except_handler([&]() {
_PartitionRange __init{__last, __last, __last};
// lambda for merging two partitioned ranges to one partitioned range
- auto __reductor = [&__exec, __is_vector](_PartitionRange __val1,
- _PartitionRange __val2) -> _PartitionRange {
+ auto __reductor = [&__exec, __is_vector](_PartitionRange __val1, _PartitionRange __val2) -> _PartitionRange {
auto __size1 = __val1.__end - __val1.__pivot;
auto __size2 = __val2.__pivot - __val2.__begin;
auto __new_begin = __val2.__begin - (__val1.__end - __val1.__begin);
@@ -1864,31 +1867,31 @@ pattern_partition(_ExecutionPolicy&& __e
// then we should swap the false part of left range and last part of true part of right range
else if (__size2 > __size1)
{
- par_backend::parallel_for(
+ __par_backend::__parallel_for(
std::forward<_ExecutionPolicy>(__exec), __val1.__pivot, __val1.__pivot + __size1,
[__val1, __val2, __size1, __is_vector](_ForwardIterator __i, _ForwardIterator __j) {
- brick_swap_ranges(__i, __j, (__val2.__pivot - __size1) + (__i - __val1.__pivot), __is_vector);
+ __brick_swap_ranges(__i, __j, (__val2.__pivot - __size1) + (__i - __val1.__pivot), __is_vector);
});
return {__new_begin, __val2.__pivot - __size1, __val2.__end};
}
// else we should swap the first part of false part of left range and true part of right range
else
{
- par_backend::parallel_for(
+ __par_backend::__parallel_for(
std::forward<_ExecutionPolicy>(__exec), __val1.__pivot, __val1.__pivot + __size2,
[__val1, __val2, __is_vector](_ForwardIterator __i, _ForwardIterator __j) {
- brick_swap_ranges(__i, __j, __val2.__begin + (__i - __val1.__pivot), __is_vector);
+ __brick_swap_ranges(__i, __j, __val2.__begin + (__i - __val1.__pivot), __is_vector);
});
return {__new_begin, __val1.__pivot + __size2, __val2.__end};
}
};
- _PartitionRange __result = par_backend::parallel_reduce(
+ _PartitionRange __result = __par_backend::__parallel_reduce(
std::forward<_ExecutionPolicy>(__exec), __first, __last, __init,
[__pred, __is_vector, __reductor](_ForwardIterator __i, _ForwardIterator __j,
_PartitionRange __value) -> _PartitionRange {
//1. serial partition
- _ForwardIterator __pivot = brick_partition(__i, __j, __pred, __is_vector);
+ _ForwardIterator __pivot = __brick_partition(__i, __j, __pred, __is_vector);
// 2. merging of two ranges (left and right respectively)
return __reductor(__value, {__i, __pivot, __j});
@@ -1905,16 +1908,16 @@ pattern_partition(_ExecutionPolicy&& __e
template <class _BidirectionalIterator, class _UnaryPredicate>
_BidirectionalIterator
-brick_stable_partition(_BidirectionalIterator __first, _BidirectionalIterator __last, _UnaryPredicate __pred,
- /*__is_vector=*/std::false_type) noexcept
+__brick_stable_partition(_BidirectionalIterator __first, _BidirectionalIterator __last, _UnaryPredicate __pred,
+ /*__is_vector=*/std::false_type) noexcept
{
return std::stable_partition(__first, __last, __pred);
}
template <class _BidirectionalIterator, class _UnaryPredicate>
_BidirectionalIterator
-brick_stable_partition(_BidirectionalIterator __first, _BidirectionalIterator __last, _UnaryPredicate __pred,
- /*__is_vector=*/std::true_type) noexcept
+__brick_stable_partition(_BidirectionalIterator __first, _BidirectionalIterator __last, _UnaryPredicate __pred,
+ /*__is_vector=*/std::true_type) noexcept
{
__PSTL_PRAGMA_MESSAGE("Vectorized algorithm unimplemented, redirected to serial");
return std::stable_partition(__first, __last, __pred);
@@ -1922,17 +1925,19 @@ brick_stable_partition(_BidirectionalIte
template <class _ExecutionPolicy, class _BidirectionalIterator, class _UnaryPredicate, class _IsVector>
_BidirectionalIterator
-pattern_stable_partition(_ExecutionPolicy&&, _BidirectionalIterator __first, _BidirectionalIterator __last,
- _UnaryPredicate __pred, _IsVector __is_vector, /*is_parallelization=*/std::false_type) noexcept
+__pattern_stable_partition(_ExecutionPolicy&&, _BidirectionalIterator __first, _BidirectionalIterator __last,
+ _UnaryPredicate __pred, _IsVector __is_vector,
+ /*is_parallelization=*/std::false_type) noexcept
{
- return internal::brick_stable_partition(__first, __last, __pred, __is_vector);
+ return __brick_stable_partition(__first, __last, __pred, __is_vector);
}
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _BidirectionalIterator, class _UnaryPredicate, class _IsVector>
_BidirectionalIterator
-pattern_stable_partition(_ExecutionPolicy&& __exec, _BidirectionalIterator __first, _BidirectionalIterator __last,
- _UnaryPredicate __pred, _IsVector __is_vector, /*is_parallelization=*/std::true_type) noexcept
+__pattern_stable_partition(_ExecutionPolicy&& __exec, _BidirectionalIterator __first, _BidirectionalIterator __last,
+ _UnaryPredicate __pred, _IsVector __is_vector,
+ /*is_parallelization=*/std::true_type) noexcept
{
// partitioned range: elements before pivot satisfy pred (true part),
// elements after pivot don't satisfy pred (false part)
@@ -1943,12 +1948,11 @@ pattern_stable_partition(_ExecutionPolic
_BidirectionalIterator __end;
};
- return except_handler([&]() {
+ return __except_handler([&]() {
_PartitionRange __init{__last, __last, __last};
// lambda for merging two partitioned ranges to one partitioned range
- auto __reductor = [__is_vector](_PartitionRange __val1,
- _PartitionRange __val2) -> _PartitionRange {
+ auto __reductor = [__is_vector](_PartitionRange __val1, _PartitionRange __val2) -> _PartitionRange {
auto __size1 = __val1.__end - __val1.__pivot;
auto __new_begin = __val2.__begin - (__val1.__end - __val1.__begin);
@@ -1961,17 +1965,17 @@ pattern_stable_partition(_ExecutionPolic
// then we should swap the false part of left range and last part of true part of right range
else
{
- brick_rotate(__val1.__pivot, __val2.__begin, __val2.__pivot, __is_vector);
+ __brick_rotate(__val1.__pivot, __val2.__begin, __val2.__pivot, __is_vector);
return {__new_begin, __val2.__pivot - __size1, __val2.__end};
}
};
- _PartitionRange __result = par_backend::parallel_reduce(
+ _PartitionRange __result = __par_backend::__parallel_reduce(
std::forward<_ExecutionPolicy>(__exec), __first, __last, __init,
[&__pred, __is_vector, __reductor](_BidirectionalIterator __i, _BidirectionalIterator __j,
_PartitionRange __value) -> _PartitionRange {
//1. serial stable_partition
- _BidirectionalIterator __pivot = brick_stable_partition(__i, __j, __pred, __is_vector);
+ _BidirectionalIterator __pivot = __brick_stable_partition(__i, __j, __pred, __is_vector);
// 2. merging of two ranges (left and right respectively)
return __reductor(__value, {__i, __pivot, __j});
@@ -1988,19 +1992,19 @@ pattern_stable_partition(_ExecutionPolic
template <class _ForwardIterator, class _OutputIterator1, class _OutputIterator2, class _UnaryPredicate>
std::pair<_OutputIterator1, _OutputIterator2>
-brick_partition_copy(_ForwardIterator __first, _ForwardIterator __last, _OutputIterator1 __out_true,
- _OutputIterator2 __out_false, _UnaryPredicate __pred, /*is_vector=*/std::false_type) noexcept
+__brick_partition_copy(_ForwardIterator __first, _ForwardIterator __last, _OutputIterator1 __out_true,
+ _OutputIterator2 __out_false, _UnaryPredicate __pred, /*is_vector=*/std::false_type) noexcept
{
return std::partition_copy(__first, __last, __out_true, __out_false, __pred);
}
template <class _ForwardIterator, class _OutputIterator1, class _OutputIterator2, class _UnaryPredicate>
std::pair<_OutputIterator1, _OutputIterator2>
-brick_partition_copy(_ForwardIterator __first, _ForwardIterator __last, _OutputIterator1 __out_true,
- _OutputIterator2 __out_false, _UnaryPredicate __pred, /*is_vector=*/std::true_type) noexcept
+__brick_partition_copy(_ForwardIterator __first, _ForwardIterator __last, _OutputIterator1 __out_true,
+ _OutputIterator2 __out_false, _UnaryPredicate __pred, /*is_vector=*/std::true_type) noexcept
{
#if (__PSTL_MONOTONIC_PRESENT)
- return unseq_backend::simd_partition_copy(__first, __last - __first, __out_true, __out_false, __pred);
+ return __unseq_backend::__simd_partition_copy(__first, __last - __first, __out_true, __out_false, __pred);
#else
return std::partition_copy(__first, __last, __out_true, __out_false, __pred);
#endif
@@ -2009,51 +2013,49 @@ brick_partition_copy(_ForwardIterator __
template <class _ExecutionPolicy, class _ForwardIterator, class _OutputIterator1, class _OutputIterator2,
class _UnaryPredicate, class _IsVector>
std::pair<_OutputIterator1, _OutputIterator2>
-pattern_partition_copy(_ExecutionPolicy&&, _ForwardIterator __first, _ForwardIterator __last,
- _OutputIterator1 __out_true, _OutputIterator2 __out_false, _UnaryPredicate __pred,
- _IsVector __is_vector, /*is_parallelization=*/std::false_type) noexcept
+__pattern_partition_copy(_ExecutionPolicy&&, _ForwardIterator __first, _ForwardIterator __last,
+ _OutputIterator1 __out_true, _OutputIterator2 __out_false, _UnaryPredicate __pred,
+ _IsVector __is_vector, /*is_parallelization=*/std::false_type) noexcept
{
- return internal::brick_partition_copy(__first, __last, __out_true, __out_false, __pred, __is_vector);
+ return __brick_partition_copy(__first, __last, __out_true, __out_false, __pred, __is_vector);
}
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _RandomAccessIterator, class _OutputIterator1, class _OutputIterator2,
class _UnaryPredicate, class _IsVector>
std::pair<_OutputIterator1, _OutputIterator2>
-pattern_partition_copy(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last,
- _OutputIterator1 __out_true, _OutputIterator2 __out_false, _UnaryPredicate __pred,
- _IsVector __is_vector, /*is_parallelization=*/std::true_type)
+__pattern_partition_copy(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last,
+ _OutputIterator1 __out_true, _OutputIterator2 __out_false, _UnaryPredicate __pred,
+ _IsVector __is_vector, /*is_parallelization=*/std::true_type)
{
typedef typename std::iterator_traits<_RandomAccessIterator>::difference_type _DifferenceType;
typedef std::pair<_DifferenceType, _DifferenceType> _ReturnType;
const _DifferenceType __n = __last - __first;
if (_DifferenceType(1) < __n)
{
- par_backend::buffer<bool> __mask_buf(__n);
- return internal::except_handler(
- [&__exec, __n, __first, __out_true, __out_false, __is_vector, __pred, &__mask_buf]() {
- bool* __mask = __mask_buf.get();
- _ReturnType __m{};
- par_backend::parallel_strict_scan(
- std::forward<_ExecutionPolicy>(__exec), __n, std::make_pair(_DifferenceType(0), _DifferenceType(0)),
- [=](_DifferenceType __i, _DifferenceType __len) { // Reduce
- return internal::brick_calc_mask_1<_DifferenceType>(__first + __i, __first + (__i + __len),
- __mask + __i, __pred, __is_vector);
- },
- [](const _ReturnType& __x, const _ReturnType& __y) -> _ReturnType {
- return std::make_pair(__x.first + __y.first, __x.second + __y.second);
- }, // Combine
- [=](_DifferenceType __i, _DifferenceType __len, _ReturnType __initial) { // Scan
- internal::brick_partition_by_mask(__first + __i, __first + (__i + __len),
- __out_true + __initial.first, __out_false + __initial.second,
- __mask + __i, __is_vector);
- },
- [&__m](_ReturnType __total) { __m = __total; });
- return std::make_pair(__out_true + __m.first, __out_false + __m.second);
- });
+ __par_backend::__buffer<bool> __mask_buf(__n);
+ return __except_handler([&__exec, __n, __first, __out_true, __out_false, __is_vector, __pred, &__mask_buf]() {
+ bool* __mask = __mask_buf.get();
+ _ReturnType __m{};
+ __par_backend::parallel_strict_scan(
+ std::forward<_ExecutionPolicy>(__exec), __n, std::make_pair(_DifferenceType(0), _DifferenceType(0)),
+ [=](_DifferenceType __i, _DifferenceType __len) { // Reduce
+ return __brick_calc_mask_1<_DifferenceType>(__first + __i, __first + (__i + __len), __mask + __i,
+ __pred, __is_vector);
+ },
+ [](const _ReturnType& __x, const _ReturnType& __y) -> _ReturnType {
+ return std::make_pair(__x.first + __y.first, __x.second + __y.second);
+ }, // Combine
+ [=](_DifferenceType __i, _DifferenceType __len, _ReturnType __initial) { // Scan
+ __brick_partition_by_mask(__first + __i, __first + (__i + __len), __out_true + __initial.first,
+ __out_false + __initial.second, __mask + __i, __is_vector);
+ },
+ [&__m](_ReturnType __total) { __m = __total; });
+ return std::make_pair(__out_true + __m.first, __out_false + __m.second);
+ });
}
// trivial sequence - use serial algorithm
- return internal::brick_partition_copy(__first, __last, __out_true, __out_false, __pred, __is_vector);
+ return __brick_partition_copy(__first, __last, __out_true, __out_false, __pred, __is_vector);
}
#endif
@@ -2064,8 +2066,8 @@ pattern_partition_copy(_ExecutionPolicy&
template <class _ExecutionPolicy, class _RandomAccessIterator, class _Compare, class _IsVector,
class _IsMoveConstructible>
void
-pattern_sort(_ExecutionPolicy&&, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp,
- _IsVector /*is_vector*/, /*is_parallel=*/std::false_type, _IsMoveConstructible) noexcept
+__pattern_sort(_ExecutionPolicy&&, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp,
+ _IsVector /*is_vector*/, /*is_parallel=*/std::false_type, _IsMoveConstructible) noexcept
{
std::sort(__first, __last, __comp);
}
@@ -2073,14 +2075,16 @@ pattern_sort(_ExecutionPolicy&&, _Random
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _RandomAccessIterator, class _Compare, class _IsVector>
void
-pattern_sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp,
- _IsVector /*is_vector*/, /*is_parallel=*/std::true_type, /*is_move_constructible=*/std::true_type)
+__pattern_sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp,
+ _IsVector /*is_vector*/, /*is_parallel=*/std::true_type, /*is_move_constructible=*/std::true_type)
{
- except_handler([&]() {
- par_backend::parallel_stable_sort(std::forward<_ExecutionPolicy>(__exec), __first, __last, __comp,
- [](_RandomAccessIterator __first, _RandomAccessIterator __last,
- _Compare __comp) { std::sort(__first, __last, __comp); },
- __last - __first);
+ __except_handler([&]() {
+ __par_backend::__parallel_stable_sort(
+ std::forward<_ExecutionPolicy>(__exec), __first, __last, __comp,
+ [](_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) {
+ std::sort(__first, __last, __comp);
+ },
+ __last - __first);
});
}
#endif
@@ -2091,8 +2095,8 @@ pattern_sort(_ExecutionPolicy&& __exec,
template <class _ExecutionPolicy, class _RandomAccessIterator, class _Compare, class _IsVector>
void
-pattern_stable_sort(_ExecutionPolicy&&, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp,
- _IsVector /*is_vector*/, /*is_parallel=*/std::false_type) noexcept
+__pattern_stable_sort(_ExecutionPolicy&&, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp,
+ _IsVector /*is_vector*/, /*is_parallel=*/std::false_type) noexcept
{
std::stable_sort(__first, __last, __comp);
}
@@ -2100,13 +2104,13 @@ pattern_stable_sort(_ExecutionPolicy&&,
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _RandomAccessIterator, class _Compare, class _IsVector>
void
-pattern_stable_sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last,
- _Compare __comp, _IsVector /*is_vector*/, /*is_parallel=*/std::true_type)
+__pattern_stable_sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last,
+ _Compare __comp, _IsVector /*is_vector*/, /*is_parallel=*/std::true_type)
{
- internal::except_handler([&]() {
- par_backend::parallel_stable_sort(std::forward<_ExecutionPolicy>(__exec), __first, __last, __comp,
- [](_RandomAccessIterator __first, _RandomAccessIterator __last,
- _Compare __comp) { std::stable_sort(__first, __last, __comp); });
+ __except_handler([&]() {
+ __par_backend::__parallel_stable_sort(std::forward<_ExecutionPolicy>(__exec), __first, __last, __comp,
+ [](_RandomAccessIterator __first, _RandomAccessIterator __last,
+ _Compare __comp) { std::stable_sort(__first, __last, __comp); });
});
}
#endif
@@ -2117,8 +2121,9 @@ pattern_stable_sort(_ExecutionPolicy&& _
template <class _ExecutionPolicy, class _RandomAccessIterator, class _Compare, class _IsVector>
void
-pattern_partial_sort(_ExecutionPolicy&&, _RandomAccessIterator __first, _RandomAccessIterator __middle,
- _RandomAccessIterator __last, _Compare __comp, _IsVector, /*is_parallel=*/std::false_type) noexcept
+__pattern_partial_sort(_ExecutionPolicy&&, _RandomAccessIterator __first, _RandomAccessIterator __middle,
+ _RandomAccessIterator __last, _Compare __comp, _IsVector,
+ /*is_parallel=*/std::false_type) noexcept
{
std::partial_sort(__first, __middle, __last, __comp);
}
@@ -2126,12 +2131,12 @@ pattern_partial_sort(_ExecutionPolicy&&,
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _RandomAccessIterator, class _Compare, class _IsVector>
void
-pattern_partial_sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __middle,
- _RandomAccessIterator __last, _Compare __comp, _IsVector, /*is_parallel=*/std::true_type)
+__pattern_partial_sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __middle,
+ _RandomAccessIterator __last, _Compare __comp, _IsVector, /*is_parallel=*/std::true_type)
{
const auto __n = __middle - __first;
- except_handler([&]() {
- par_backend::parallel_stable_sort(
+ __except_handler([&]() {
+ __par_backend::__parallel_stable_sort(
std::forward<_ExecutionPolicy>(__exec), __first, __last, __comp,
[__n](_RandomAccessIterator __begin, _RandomAccessIterator __end, _Compare __comp) {
if (__n < __end - __begin)
@@ -2150,9 +2155,9 @@ pattern_partial_sort(_ExecutionPolicy&&
template <class _ExecutionPolicy, class _ForwardIterator, class _RandomAccessIterator, class _Compare, class _IsVector>
_RandomAccessIterator
-pattern_partial_sort_copy(_ExecutionPolicy&&, _ForwardIterator __first, _ForwardIterator __last,
- _RandomAccessIterator __d_first, _RandomAccessIterator __d_last, _Compare __comp, _IsVector,
- /*is_parallel=*/std::false_type) noexcept
+__pattern_partial_sort_copy(_ExecutionPolicy&&, _ForwardIterator __first, _ForwardIterator __last,
+ _RandomAccessIterator __d_first, _RandomAccessIterator __d_last, _Compare __comp, _IsVector,
+ /*is_parallel=*/std::false_type) noexcept
{
return std::partial_sort_copy(__first, __last, __d_first, __d_last, __comp);
}
@@ -2160,9 +2165,9 @@ pattern_partial_sort_copy(_ExecutionPoli
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _ForwardIterator, class _RandomAccessIterator, class _Compare, class _IsVector>
_RandomAccessIterator
-pattern_partial_sort_copy(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last,
- _RandomAccessIterator __d_first, _RandomAccessIterator __d_last, _Compare __comp,
- _IsVector __is_vector, /*is_parallel=*/std::true_type)
+__pattern_partial_sort_copy(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last,
+ _RandomAccessIterator __d_first, _RandomAccessIterator __d_last, _Compare __comp,
+ _IsVector __is_vector, /*is_parallel=*/std::true_type)
{
if (__last == __first || __d_last == __d_first)
{
@@ -2170,10 +2175,10 @@ pattern_partial_sort_copy(_ExecutionPoli
}
auto __n1 = __last - __first;
auto __n2 = __d_last - __d_first;
- return except_handler([&]() {
+ return __except_handler([&]() {
if (__n2 >= __n1)
{
- par_backend::parallel_stable_sort(
+ __par_backend::__parallel_stable_sort(
std::forward<_ExecutionPolicy>(__exec), __d_first, __d_first + __n1, __comp,
[__first, __d_first, __is_vector](_RandomAccessIterator __i, _RandomAccessIterator __j,
_Compare __comp) {
@@ -2182,7 +2187,7 @@ pattern_partial_sort_copy(_ExecutionPoli
// 1. Copy elements from input to output
#if !__PSTL_ICC_18_OMP_SIMD_BROKEN
- brick_copy(__i1, __j1, __i, __is_vector);
+ __brick_copy(__i1, __j1, __i, __is_vector);
#else
std::copy(__i1, __j1, __i);
#endif
@@ -2196,32 +2201,33 @@ pattern_partial_sort_copy(_ExecutionPoli
{
typedef typename std::iterator_traits<_ForwardIterator>::value_type _T1;
typedef typename std::iterator_traits<_RandomAccessIterator>::value_type _T2;
- par_backend::buffer<_T1> __buf(__n1);
+ __par_backend::__buffer<_T1> __buf(__n1);
_T1* __r = __buf.get();
- par_backend::parallel_stable_sort(std::forward<_ExecutionPolicy>(__exec), __r, __r + __n1, __comp,
- [__n2, __first, __r](_T1* __i, _T1* __j, _Compare __comp) {
- _ForwardIterator __it = __first + (__i - __r);
-
- // 1. Copy elements from input to raw memory
- for (_T1* __k = __i; __k != __j; ++__k, ++__it)
- {
- ::new (__k) _T2(*__it);
- }
-
- // 2. Sort elements in temporary buffer
- if (__n2 < __j - __i)
- std::partial_sort(__i, __i + __n2, __j, __comp);
- else
- std::sort(__i, __j, __comp);
- },
- __n2);
-
- // 3. Move elements from temporary buffer to output
- par_backend::parallel_for(std::forward<_ExecutionPolicy>(__exec), __r, __r + __n2,
- [__r, __d_first, __is_vector](_T1* __i, _T1* __j) {
- brick_move(__i, __j, __d_first + (__i - __r), __is_vector);
- });
+ __par_backend::__parallel_stable_sort(
+ std::forward<_ExecutionPolicy>(__exec), __r, __r + __n1, __comp,
+ [__n2, __first, __r](_T1* __i, _T1* __j, _Compare __comp) {
+ _ForwardIterator __it = __first + (__i - __r);
+
+ // 1. Copy elements from input to raw memory
+ for (_T1* __k = __i; __k != __j; ++__k, ++__it)
+ {
+ ::new (__k) _T2(*__it);
+ }
+
+ // 2. Sort elements in temporary __buffer
+ if (__n2 < __j - __i)
+ std::partial_sort(__i, __i + __n2, __j, __comp);
+ else
+ std::sort(__i, __j, __comp);
+ },
+ __n2);
+
+ // 3. Move elements from temporary __buffer to output
+ __par_backend::__parallel_for(std::forward<_ExecutionPolicy>(__exec), __r, __r + __n2,
+ [__r, __d_first, __is_vector](_T1* __i, _T1* __j) {
+ __brick_move(__i, __j, __d_first + (__i - __r), __is_vector);
+ });
return __d_first + __n2;
}
});
@@ -2233,40 +2239,40 @@ pattern_partial_sort_copy(_ExecutionPoli
//------------------------------------------------------------------------
template <class _ForwardIterator, class _BinaryPredicate>
_ForwardIterator
-brick_adjacent_find(_ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __pred,
- /* IsVector = */ std::true_type, bool __or_semantic) noexcept
+__brick_adjacent_find(_ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __pred,
+ /* IsVector = */ std::true_type, bool __or_semantic) noexcept
{
- return unseq_backend::simd_adjacent_find(__first, __last, __pred, __or_semantic);
+ return __unseq_backend::__simd_adjacent_find(__first, __last, __pred, __or_semantic);
}
template <class _ForwardIterator, class _BinaryPredicate>
_ForwardIterator
-brick_adjacent_find(_ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __pred,
- /* IsVector = */ std::false_type, bool __or_semantic) noexcept
+__brick_adjacent_find(_ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __pred,
+ /* IsVector = */ std::false_type, bool __or_semantic) noexcept
{
return std::adjacent_find(__first, __last, __pred);
}
template <class _ExecutionPolicy, class _ForwardIterator, class _BinaryPredicate, class _IsVector>
_ForwardIterator
-pattern_adjacent_find(_ExecutionPolicy&&, _ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __pred,
- /* is_parallel */ std::false_type, _IsVector __is_vector, bool __or_semantic) noexcept
+__pattern_adjacent_find(_ExecutionPolicy&&, _ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __pred,
+ /* is_parallel */ std::false_type, _IsVector __is_vector, bool __or_semantic) noexcept
{
- return internal::brick_adjacent_find(__first, __last, __pred, __is_vector, __or_semantic);
+ return __brick_adjacent_find(__first, __last, __pred, __is_vector, __or_semantic);
}
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _RandomAccessIterator, class _BinaryPredicate, class _IsVector>
_RandomAccessIterator
-pattern_adjacent_find(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last,
- _BinaryPredicate __pred, /* is_parallel */ std::true_type, _IsVector __is_vector,
- bool __or_semantic)
+__pattern_adjacent_find(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last,
+ _BinaryPredicate __pred, /* is_parallel */ std::true_type, _IsVector __is_vector,
+ bool __or_semantic)
{
if (__last - __first < 2)
return __last;
- return internal::except_handler([&]() {
- return par_backend::parallel_reduce(
+ return __except_handler([&]() {
+ return __par_backend::__parallel_reduce(
std::forward<_ExecutionPolicy>(__exec), __first, __last, __last,
[__last, __pred, __is_vector, __or_semantic](_RandomAccessIterator __begin, _RandomAccessIterator __end,
_RandomAccessIterator __value) -> _RandomAccessIterator {
@@ -2274,7 +2280,7 @@ pattern_adjacent_find(_ExecutionPolicy&&
// checking (compare_and_swap idiom) its __value at __first.
if (__or_semantic && __value < __last)
{ //found
- par_backend::cancel_execution();
+ __par_backend::__cancel_execution();
return __value;
}
@@ -2289,7 +2295,7 @@ pattern_adjacent_find(_ExecutionPolicy&&
//correct the global result iterator if the "brick" returns a local "__last"
const _RandomAccessIterator __res =
- internal::brick_adjacent_find(__begin, __end, __pred, __is_vector, __or_semantic);
+ __brick_adjacent_find(__begin, __end, __pred, __is_vector, __or_semantic);
if (__res < __end)
__value = __res;
}
@@ -2309,8 +2315,9 @@ pattern_adjacent_find(_ExecutionPolicy&&
template <class _ExecutionPolicy, class _RandomAccessIterator, class _Compare, class _IsVector>
void
-pattern_nth_element(_ExecutionPolicy&&, _RandomAccessIterator __first, _RandomAccessIterator __nth,
- _RandomAccessIterator __last, _Compare __comp, _IsVector, /*is_parallel=*/std::false_type) noexcept
+__pattern_nth_element(_ExecutionPolicy&&, _RandomAccessIterator __first, _RandomAccessIterator __nth,
+ _RandomAccessIterator __last, _Compare __comp, _IsVector,
+ /*is_parallel=*/std::false_type) noexcept
{
std::nth_element(__first, __nth, __last, __comp);
}
@@ -2318,9 +2325,9 @@ pattern_nth_element(_ExecutionPolicy&&,
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _RandomAccessIterator, class _Compare, class _IsVector>
void
-pattern_nth_element(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __nth,
- _RandomAccessIterator __last, _Compare __comp, _IsVector __is_vector,
- /*is_parallel=*/std::true_type) noexcept
+__pattern_nth_element(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __nth,
+ _RandomAccessIterator __last, _Compare __comp, _IsVector __is_vector,
+ /*is_parallel=*/std::true_type) noexcept
{
if (__first == __last || __nth == __last)
{
@@ -2332,9 +2339,10 @@ pattern_nth_element(_ExecutionPolicy&& _
_RandomAccessIterator __x;
do
{
- __x = pattern_partition(std::forward<_ExecutionPolicy>(__exec), __first + 1, __last,
- [&__comp, __first](const _Tp& __x) { return __comp(__x, *__first); }, __is_vector,
- /*is_parallel=*/std::true_type());
+ __x = __pattern_partition(
+ std::forward<_ExecutionPolicy>(__exec), __first + 1, __last,
+ [&__comp, __first](const _Tp& __x) { return __comp(__x, *__first); }, __is_vector,
+ /*is_parallel=*/std::true_type());
--__x;
if (__x != __first)
{
@@ -2368,39 +2376,39 @@ pattern_nth_element(_ExecutionPolicy&& _
//------------------------------------------------------------------------
template <class _ForwardIterator, class _Tp>
void
-brick_fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value,
- /* __is_vector = */ std::true_type) noexcept
+__brick_fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value,
+ /* __is_vector = */ std::true_type) noexcept
{
- unseq_backend::simd_fill_n(__first, __last - __first, __value);
+ __unseq_backend::__simd_fill_n(__first, __last - __first, __value);
}
template <class _ForwardIterator, class _Tp>
void
-brick_fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value,
- /* __is_vector = */ std::false_type) noexcept
+__brick_fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value,
+ /* __is_vector = */ std::false_type) noexcept
{
std::fill(__first, __last, __value);
}
template <class _ExecutionPolicy, class _ForwardIterator, class _Tp, class _IsVector>
void
-pattern_fill(_ExecutionPolicy&&, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value,
- /*is_parallel=*/std::false_type, _IsVector __is_vector) noexcept
+__pattern_fill(_ExecutionPolicy&&, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value,
+ /*is_parallel=*/std::false_type, _IsVector __is_vector) noexcept
{
- internal::brick_fill(__first, __last, __value, __is_vector);
+ __brick_fill(__first, __last, __value, __is_vector);
}
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _ForwardIterator, class _Tp, class _IsVector>
_ForwardIterator
-pattern_fill(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value,
- /*is_parallel=*/std::true_type, _IsVector __is_vector)
+__pattern_fill(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value,
+ /*is_parallel=*/std::true_type, _IsVector __is_vector)
{
- return except_handler([&__exec, __first, __last, &__value, __is_vector]() {
- par_backend::parallel_for(std::forward<_ExecutionPolicy>(__exec), __first, __last,
- [&__value, __is_vector](_ForwardIterator __begin, _ForwardIterator __end) {
- internal::brick_fill(__begin, __end, __value, __is_vector);
- });
+ return __except_handler([&__exec, __first, __last, &__value, __is_vector]() {
+ __par_backend::__parallel_for(std::forward<_ExecutionPolicy>(__exec), __first, __last,
+ [&__value, __is_vector](_ForwardIterator __begin, _ForwardIterator __end) {
+ __brick_fill(__begin, __end, __value, __is_vector);
+ });
return __last;
});
}
@@ -2408,33 +2416,33 @@ pattern_fill(_ExecutionPolicy&& __exec,
template <class _OutputIterator, class _Size, class _Tp>
_OutputIterator
-brick_fill_n(_OutputIterator __first, _Size __count, const _Tp& __value, /* __is_vector = */ std::true_type) noexcept
+__brick_fill_n(_OutputIterator __first, _Size __count, const _Tp& __value, /* __is_vector = */ std::true_type) noexcept
{
- return unseq_backend::simd_fill_n(__first, __count, __value);
+ return __unseq_backend::__simd_fill_n(__first, __count, __value);
}
template <class _OutputIterator, class _Size, class _Tp>
_OutputIterator
-brick_fill_n(_OutputIterator __first, _Size __count, const _Tp& __value, /* __is_vector = */ std::false_type) noexcept
+__brick_fill_n(_OutputIterator __first, _Size __count, const _Tp& __value, /* __is_vector = */ std::false_type) noexcept
{
return std::fill_n(__first, __count, __value);
}
template <class _ExecutionPolicy, class _OutputIterator, class _Size, class _Tp, class _IsVector>
_OutputIterator
-pattern_fill_n(_ExecutionPolicy&&, _OutputIterator __first, _Size __count, const _Tp& __value,
- /*is_parallel=*/std::false_type, _IsVector __is_vector) noexcept
+__pattern_fill_n(_ExecutionPolicy&&, _OutputIterator __first, _Size __count, const _Tp& __value,
+ /*is_parallel=*/std::false_type, _IsVector __is_vector) noexcept
{
- return internal::brick_fill_n(__first, __count, __value, __is_vector);
+ return __brick_fill_n(__first, __count, __value, __is_vector);
}
template <class _ExecutionPolicy, class _OutputIterator, class _Size, class _Tp, class _IsVector>
_OutputIterator
-pattern_fill_n(_ExecutionPolicy&& __exec, _OutputIterator __first, _Size __count, const _Tp& __value,
- /*is_parallel=*/std::true_type, _IsVector __is_vector)
+__pattern_fill_n(_ExecutionPolicy&& __exec, _OutputIterator __first, _Size __count, const _Tp& __value,
+ /*is_parallel=*/std::true_type, _IsVector __is_vector)
{
- return internal::pattern_fill(std::forward<_ExecutionPolicy>(__exec), __first, __first + __count, __value,
- std::true_type(), __is_vector);
+ return __pattern_fill(std::forward<_ExecutionPolicy>(__exec), __first, __first + __count, __value, std::true_type(),
+ __is_vector);
}
//------------------------------------------------------------------------
@@ -2442,39 +2450,39 @@ pattern_fill_n(_ExecutionPolicy&& __exec
//------------------------------------------------------------------------
template <class _RandomAccessIterator, class _Generator>
void
-brick_generate(_RandomAccessIterator __first, _RandomAccessIterator __last, _Generator __g,
- /* is_vector = */ std::true_type) noexcept
+__brick_generate(_RandomAccessIterator __first, _RandomAccessIterator __last, _Generator __g,
+ /* is_vector = */ std::true_type) noexcept
{
- unseq_backend::simd_generate_n(__first, __last - __first, __g);
+ __unseq_backend::__simd_generate_n(__first, __last - __first, __g);
}
template <class _ForwardIterator, class _Generator>
void
-brick_generate(_ForwardIterator __first, _ForwardIterator __last, _Generator __g,
- /* is_vector = */ std::false_type) noexcept
+__brick_generate(_ForwardIterator __first, _ForwardIterator __last, _Generator __g,
+ /* is_vector = */ std::false_type) noexcept
{
std::generate(__first, __last, __g);
}
template <class _ExecutionPolicy, class _ForwardIterator, class _Generator, class _IsVector>
void
-pattern_generate(_ExecutionPolicy&&, _ForwardIterator __first, _ForwardIterator __last, _Generator __g,
- /*is_parallel=*/std::false_type, _IsVector __is_vector) noexcept
+__pattern_generate(_ExecutionPolicy&&, _ForwardIterator __first, _ForwardIterator __last, _Generator __g,
+ /*is_parallel=*/std::false_type, _IsVector __is_vector) noexcept
{
- internal::brick_generate(__first, __last, __g, __is_vector);
+ __brick_generate(__first, __last, __g, __is_vector);
}
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _ForwardIterator, class _Generator, class _IsVector>
_ForwardIterator
-pattern_generate(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Generator __g,
- /*is_parallel=*/std::true_type, _IsVector __is_vector)
+__pattern_generate(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Generator __g,
+ /*is_parallel=*/std::true_type, _IsVector __is_vector)
{
- return internal::except_handler([&]() {
- par_backend::parallel_for(std::forward<_ExecutionPolicy>(__exec), __first, __last,
- [__g, __is_vector](_ForwardIterator __begin, _ForwardIterator __end) {
- internal::brick_generate(__begin, __end, __g, __is_vector);
- });
+ return __except_handler([&]() {
+ __par_backend::__parallel_for(std::forward<_ExecutionPolicy>(__exec), __first, __last,
+ [__g, __is_vector](_ForwardIterator __begin, _ForwardIterator __end) {
+ __brick_generate(__begin, __end, __g, __is_vector);
+ });
return __last;
});
}
@@ -2482,36 +2490,36 @@ pattern_generate(_ExecutionPolicy&& __ex
template <class OutputIterator, class Size, class _Generator>
OutputIterator
-brick_generate_n(OutputIterator __first, Size __count, _Generator __g, /* is_vector = */ std::true_type) noexcept
+__brick_generate_n(OutputIterator __first, Size __count, _Generator __g, /* is_vector = */ std::true_type) noexcept
{
- return unseq_backend::simd_generate_n(__first, __count, __g);
+ return __unseq_backend::__simd_generate_n(__first, __count, __g);
}
template <class OutputIterator, class Size, class _Generator>
OutputIterator
-brick_generate_n(OutputIterator __first, Size __count, _Generator __g, /* is_vector = */ std::false_type) noexcept
+__brick_generate_n(OutputIterator __first, Size __count, _Generator __g, /* is_vector = */ std::false_type) noexcept
{
return std::generate_n(__first, __count, __g);
}
template <class _ExecutionPolicy, class _OutputIterator, class _Size, class _Generator, class _IsVector>
_OutputIterator
-pattern_generate_n(_ExecutionPolicy&&, _OutputIterator __first, _Size __count, _Generator __g,
- /*is_parallel=*/std::false_type, _IsVector __is_vector) noexcept
+__pattern_generate_n(_ExecutionPolicy&&, _OutputIterator __first, _Size __count, _Generator __g,
+ /*is_parallel=*/std::false_type, _IsVector __is_vector) noexcept
{
- return internal::brick_generate_n(__first, __count, __g, __is_vector);
+ return __brick_generate_n(__first, __count, __g, __is_vector);
}
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _OutputIterator, class _Size, class _Generator, class _IsVector>
_OutputIterator
-pattern_generate_n(_ExecutionPolicy&& __exec, _OutputIterator __first, _Size __count, _Generator __g,
- /*is_parallel=*/std::true_type, _IsVector __is_vector)
+__pattern_generate_n(_ExecutionPolicy&& __exec, _OutputIterator __first, _Size __count, _Generator __g,
+ /*is_parallel=*/std::true_type, _IsVector __is_vector)
{
- static_assert(internal::is_random_access_iterator<_OutputIterator>::value,
+ static_assert(__is_random_access_iterator<_OutputIterator>::value,
"Pattern-brick error. Should be a random access iterator.");
- return internal::pattern_generate(std::forward<_ExecutionPolicy>(__exec), __first, __first + __count, __g,
- std::true_type(), __is_vector);
+ return __pattern_generate(std::forward<_ExecutionPolicy>(__exec), __first, __first + __count, __g, std::true_type(),
+ __is_vector);
}
#endif
@@ -2521,19 +2529,19 @@ pattern_generate_n(_ExecutionPolicy&& __
template <class _ForwardIterator, class _UnaryPredicate>
_ForwardIterator
-brick_remove_if(_ForwardIterator __first, _ForwardIterator __last, _UnaryPredicate __pred,
- /* __is_vector = */ std::false_type) noexcept
+__brick_remove_if(_ForwardIterator __first, _ForwardIterator __last, _UnaryPredicate __pred,
+ /* __is_vector = */ std::false_type) noexcept
{
return std::remove_if(__first, __last, __pred);
}
template <class _RandomAccessIterator, class _UnaryPredicate>
_RandomAccessIterator
-brick_remove_if(_RandomAccessIterator __first, _RandomAccessIterator __last, _UnaryPredicate __pred,
- /* __is_vector = */ std::true_type) noexcept
+__brick_remove_if(_RandomAccessIterator __first, _RandomAccessIterator __last, _UnaryPredicate __pred,
+ /* __is_vector = */ std::true_type) noexcept
{
#if __PSTL_MONOTONIC_PRESENT
- return unseq_backend::simd_remove_if(__first, __last - __first, __pred);
+ return __unseq_backend::__simd_remove_if(__first, __last - __first, __pred);
#else
return std::remove_if(__first, __last, __pred);
#endif
@@ -2541,30 +2549,31 @@ brick_remove_if(_RandomAccessIterator __
template <class _ExecutionPolicy, class _ForwardIterator, class _UnaryPredicate, class _IsVector>
_ForwardIterator
-pattern_remove_if(_ExecutionPolicy&&, _ForwardIterator __first, _ForwardIterator __last, _UnaryPredicate __pred,
- _IsVector __is_vector, /*is_parallel*/ std::false_type) noexcept
+__pattern_remove_if(_ExecutionPolicy&&, _ForwardIterator __first, _ForwardIterator __last, _UnaryPredicate __pred,
+ _IsVector __is_vector, /*is_parallel*/ std::false_type) noexcept
{
- return internal::brick_remove_if(__first, __last, __pred, __is_vector);
+ return __brick_remove_if(__first, __last, __pred, __is_vector);
}
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _ForwardIterator, class _UnaryPredicate, class _IsVector>
_ForwardIterator
-pattern_remove_if(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _UnaryPredicate __pred,
- _IsVector __is_vector, /*is_parallel*/ std::true_type) noexcept
+__pattern_remove_if(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last,
+ _UnaryPredicate __pred, _IsVector __is_vector, /*is_parallel*/ std::true_type) noexcept
{
typedef typename std::iterator_traits<_ForwardIterator>::reference _ReferenceType;
if (__first == __last || __first + 1 == __last)
{
// Trivial sequence - use serial algorithm
- return brick_remove_if(__first, __last, __pred, __is_vector);
+ return __brick_remove_if(__first, __last, __pred, __is_vector);
}
return remove_elements(
std::forward<_ExecutionPolicy>(__exec), __first, __last,
[&__pred, __is_vector](bool* __b, bool* __e, _ForwardIterator __it) {
- brick_walk2(__b, __e, __it, [&__pred](bool& __x, _ReferenceType __y) { __x = !__pred(__y); }, __is_vector);
+ __brick_walk2(
+ __b, __e, __it, [&__pred](bool& __x, _ReferenceType __y) { __x = !__pred(__y); }, __is_vector);
},
__is_vector);
}
@@ -2576,18 +2585,18 @@ pattern_remove_if(_ExecutionPolicy&& __e
template <class _ForwardIterator1, class _ForwardIterator2, class _OutputIterator, class _Compare>
_OutputIterator
-brick_merge(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
- _ForwardIterator2 __last2, _OutputIterator __d_first, _Compare __comp,
- /* __is_vector = */ std::false_type) noexcept
+__brick_merge(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
+ _ForwardIterator2 __last2, _OutputIterator __d_first, _Compare __comp,
+ /* __is_vector = */ std::false_type) noexcept
{
return std::merge(__first1, __last1, __first2, __last2, __d_first, __comp);
}
template <class _ForwardIterator1, class _ForwardIterator2, class _OutputIterator, class _Compare>
_OutputIterator
-brick_merge(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
- _ForwardIterator2 __last2, _OutputIterator __d_first, _Compare __comp,
- /* __is_vector = */ std::true_type) noexcept
+__brick_merge(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
+ _ForwardIterator2 __last2, _OutputIterator __d_first, _Compare __comp,
+ /* __is_vector = */ std::true_type) noexcept
{
__PSTL_PRAGMA_MESSAGE("Vectorized algorithm unimplemented, redirected to serial");
return std::merge(__first1, __last1, __first2, __last2, __d_first, __comp);
@@ -2596,26 +2605,26 @@ brick_merge(_ForwardIterator1 __first1,
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _OutputIterator,
class _Compare, class _IsVector>
_OutputIterator
-pattern_merge(_ExecutionPolicy&&, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
- _ForwardIterator2 __last2, _OutputIterator __d_first, _Compare __comp, _IsVector __is_vector,
- /* is_parallel = */ std::false_type) noexcept
+__pattern_merge(_ExecutionPolicy&&, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
+ _ForwardIterator2 __last2, _OutputIterator __d_first, _Compare __comp, _IsVector __is_vector,
+ /* is_parallel = */ std::false_type) noexcept
{
- return internal::brick_merge(__first1, __last1, __first2, __last2, __d_first, __comp, __is_vector);
+ return __brick_merge(__first1, __last1, __first2, __last2, __d_first, __comp, __is_vector);
}
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _RandomAccessIterator1, class _RandomAccessIterator2, class _OutputIterator,
class _Compare, class _IsVector>
_OutputIterator
-pattern_merge(_ExecutionPolicy&& __exec, _RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1,
- _RandomAccessIterator2 __first2, _RandomAccessIterator2 __last2, _OutputIterator __d_first,
- _Compare __comp, _IsVector __is_vector, /* is_parallel = */ std::true_type)
+__pattern_merge(_ExecutionPolicy&& __exec, _RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1,
+ _RandomAccessIterator2 __first2, _RandomAccessIterator2 __last2, _OutputIterator __d_first,
+ _Compare __comp, _IsVector __is_vector, /* is_parallel = */ std::true_type)
{
- par_backend::parallel_merge(
+ __par_backend::__parallel_merge(
std::forward<_ExecutionPolicy>(__exec), __first1, __last1, __first2, __last2, __d_first, __comp,
[__is_vector](_RandomAccessIterator1 __f1, _RandomAccessIterator1 __l1, _RandomAccessIterator2 __f2,
_RandomAccessIterator2 __l2, _OutputIterator __f3,
- _Compare __comp) { return brick_merge(__f1, __l1, __f2, __l2, __f3, __comp, __is_vector); });
+ _Compare __comp) { return __brick_merge(__f1, __l1, __f2, __l2, __f3, __comp, __is_vector); });
return __d_first + (__last1 - __first1) + (__last2 - __first2);
}
#endif
@@ -2625,16 +2634,16 @@ pattern_merge(_ExecutionPolicy&& __exec,
//------------------------------------------------------------------------
template <class _BidirectionalIterator, class _Compare>
void
-brick_inplace_merge(_BidirectionalIterator __first, _BidirectionalIterator __middle, _BidirectionalIterator __last,
- _Compare __comp, /* __is_vector = */ std::false_type) noexcept
+__brick_inplace_merge(_BidirectionalIterator __first, _BidirectionalIterator __middle, _BidirectionalIterator __last,
+ _Compare __comp, /* __is_vector = */ std::false_type) noexcept
{
std::inplace_merge(__first, __middle, __last, __comp);
}
template <class _BidirectionalIterator, class _Compare>
void
-brick_inplace_merge(_BidirectionalIterator __first, _BidirectionalIterator __middle, _BidirectionalIterator __last,
- _Compare __comp, /* __is_vector = */ std::true_type) noexcept
+__brick_inplace_merge(_BidirectionalIterator __first, _BidirectionalIterator __middle, _BidirectionalIterator __last,
+ _Compare __comp, /* __is_vector = */ std::true_type) noexcept
{
__PSTL_PRAGMA_MESSAGE("Vectorized algorithm unimplemented, redirected to serial")
std::inplace_merge(__first, __middle, __last, __comp);
@@ -2642,19 +2651,19 @@ brick_inplace_merge(_BidirectionalIterat
template <class _ExecutionPolicy, class _BidirectionalIterator, class _Compare, class _IsVector>
void
-pattern_inplace_merge(_ExecutionPolicy&&, _BidirectionalIterator __first, _BidirectionalIterator __middle,
- _BidirectionalIterator __last, _Compare __comp, _IsVector __is_vector,
- /* is_parallel = */ std::false_type) noexcept
+__pattern_inplace_merge(_ExecutionPolicy&&, _BidirectionalIterator __first, _BidirectionalIterator __middle,
+ _BidirectionalIterator __last, _Compare __comp, _IsVector __is_vector,
+ /* is_parallel = */ std::false_type) noexcept
{
- internal::brick_inplace_merge(__first, __middle, __last, __comp, __is_vector);
+ __brick_inplace_merge(__first, __middle, __last, __comp, __is_vector);
}
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _BidirectionalIterator, class _Compare, class _IsVector>
void
-pattern_inplace_merge(_ExecutionPolicy&& __exec, _BidirectionalIterator __first, _BidirectionalIterator __middle,
- _BidirectionalIterator __last, _Compare __comp, _IsVector __is_vector,
- /*is_parallel=*/std::true_type)
+__pattern_inplace_merge(_ExecutionPolicy&& __exec, _BidirectionalIterator __first, _BidirectionalIterator __middle,
+ _BidirectionalIterator __last, _Compare __comp, _IsVector __is_vector,
+ /*is_parallel=*/std::true_type)
{
if (__first == __last || __first == __middle || __middle == __last)
{
@@ -2662,32 +2671,34 @@ pattern_inplace_merge(_ExecutionPolicy&&
}
typedef typename std::iterator_traits<_BidirectionalIterator>::value_type _Tp;
auto __n = __last - __first;
- par_backend::buffer<_Tp> __buf(__n);
+ __par_backend::__buffer<_Tp> __buf(__n);
_Tp* __r = __buf.get();
- except_handler([&]() {
+ __except_handler([&]() {
auto __move_values = [](_BidirectionalIterator __x, _Tp* __z) {
- invoke_if_else(std::is_trivial<_Tp>(), [&]() { *__z = std::move(*__x); },
- [&]() { ::new (std::addressof(*__z)) _Tp(std::move(*__x)); });
+ __invoke_if_else(
+ std::is_trivial<_Tp>(), [&]() { *__z = std::move(*__x); },
+ [&]() { ::new (std::addressof(*__z)) _Tp(std::move(*__x)); });
};
auto __move_sequences = [](_BidirectionalIterator __first1, _BidirectionalIterator __last1, _Tp* __first2) {
- return brick_uninitialized_move(__first1, __last1, __first2, _IsVector());
+ return __brick_uninitialized_move(__first1, __last1, __first2, _IsVector());
};
- par_backend::parallel_merge(
+ __par_backend::__parallel_merge(
std::forward<_ExecutionPolicy>(__exec), __first, __middle, __middle, __last, __r, __comp,
[__n, __move_values, __move_sequences](_BidirectionalIterator __f1, _BidirectionalIterator __l1,
_BidirectionalIterator __f2, _BidirectionalIterator __l2, _Tp* __f3,
_Compare __comp) {
- auto __func = par_backend::serial_move_merge<decltype(__move_values), decltype(__move_sequences)>(
+ auto __func = __par_backend::__serial_move_merge<decltype(__move_values), decltype(__move_sequences)>(
__n, __move_values, __move_sequences);
__func(__f1, __l1, __f2, __l2, __f3, __comp);
return __f3 + (__l1 - __f1) + (__l2 - __f2);
});
- par_backend::parallel_for(std::forward<_ExecutionPolicy>(__exec), __r, __r + __n,
- [__r, __first, __is_vector](_Tp* __i, _Tp* __j) {
- brick_move(__i, __j, __first + (__i - __r), __is_vector);
- });
+
+ __par_backend::__parallel_for(std::forward<_ExecutionPolicy>(__exec), __r, __r + __n,
+ [__r, __first, __is_vector](_Tp* __i, _Tp* __j) {
+ __brick_move(__i, __j, __first + (__i - __r), __is_vector);
+ });
});
}
#endif
@@ -2698,9 +2709,9 @@ pattern_inplace_merge(_ExecutionPolicy&&
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Compare, class _IsVector>
bool
-pattern_includes(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
- _ForwardIterator2 __first2, _ForwardIterator2 __last2, _Compare __comp, _IsVector,
- /*is_parallel=*/std::false_type) noexcept
+__pattern_includes(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
+ _ForwardIterator2 __first2, _ForwardIterator2 __last2, _Compare __comp, _IsVector,
+ /*is_parallel=*/std::false_type) noexcept
{
return std::includes(__first1, __last1, __first2, __last2, __comp);
}
@@ -2708,9 +2719,9 @@ pattern_includes(_ExecutionPolicy&& __ex
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Compare, class _IsVector>
bool
-pattern_includes(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
- _ForwardIterator2 __first2, _ForwardIterator2 __last2, _Compare __comp, _IsVector __is_vector,
- /*is_parallel=*/std::true_type)
+__pattern_includes(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
+ _ForwardIterator2 __first2, _ForwardIterator2 __last2, _Compare __comp, _IsVector __is_vector,
+ /*is_parallel=*/std::true_type)
{
if (__first2 >= __last2)
return true;
@@ -2725,8 +2736,8 @@ pattern_includes(_ExecutionPolicy&& __ex
if (__last2 - __first2 == 1)
return !__comp(*__first1, *__first2) && !__comp(*__first2, *__first1);
- return except_handler([&]() {
- return !internal::parallel_or(
+ return __except_handler([&]() {
+ return !__parallel_or(
std::forward<_ExecutionPolicy>(__exec), __first2, __last2,
[__first1, __last1, __first2, __last2, &__comp](_ForwardIterator2 __i, _ForwardIterator2 __j) {
assert(__j > __i);
@@ -2768,9 +2779,9 @@ constexpr auto __set_algo_cut_off = 1000
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _OutputIterator,
class _Compare, class _IsVector, class _SizeFunction, class _SetOP>
_OutputIterator
-parallel_set_op(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
- _ForwardIterator2 __first2, _ForwardIterator2 __last2, _OutputIterator __result, _Compare __comp,
- _SizeFunction __size_func, _SetOP __set_op, _IsVector __is_vector)
+__parallel_set_op(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
+ _ForwardIterator2 __first2, _ForwardIterator2 __last2, _OutputIterator __result, _Compare __comp,
+ _SizeFunction __size_func, _SetOP __set_op, _IsVector __is_vector)
{
typedef typename std::iterator_traits<_ForwardIterator1>::difference_type _DifferenceType;
typedef typename std::iterator_traits<_OutputIterator>::value_type _T;
@@ -2788,18 +2799,18 @@ parallel_set_op(_ExecutionPolicy&& __exe
const _DifferenceType __n1 = __last1 - __first1;
const _DifferenceType __n2 = __last2 - __first2;
- par_backend::buffer<_T> __buf(__size_func(__n1, __n2));
+ __par_backend::__buffer<_T> __buf(__size_func(__n1, __n2));
- return except_handler([&__exec, __n1, __first1, __last1, __first2, __last2, __result, __is_vector, __comp,
- __size_func, __set_op, &__buf]() {
+ return __except_handler([&__exec, __n1, __first1, __last1, __first2, __last2, __result, __is_vector, __comp,
+ __size_func, __set_op, &__buf]() {
auto __buffer = __buf.get();
_DifferenceType __m{};
auto __scan = [=](_DifferenceType, _DifferenceType, const _SetRange& __s) { // Scan
if (!__s.empty())
- brick_move(__buffer + __s.__buf_pos, __buffer + (__s.__buf_pos + __s.__len), __result + __s.__pos,
- __is_vector);
+ __brick_move(__buffer + __s.__buf_pos, __buffer + (__s.__buf_pos + __s.__len), __result + __s.__pos,
+ __is_vector);
};
- par_backend::parallel_strict_scan(
+ __par_backend::parallel_strict_scan(
std::forward<_ExecutionPolicy>(__exec), __n1, _SetRange{0, 0, 0}, //-1, 0},
[=](_DifferenceType __i, _DifferenceType __len) { // Reduce
//[__b; __e) - a subrange of the first sequence, to reduce
@@ -2856,13 +2867,13 @@ parallel_set_op(_ExecutionPolicy&& __exe
#endif
#if __PSTL_USE_PAR_POLICIES
-//a shared parallel pattern for 'pattern_set_union' and 'pattern_set_symmetric_difference'
+//a shared parallel pattern for '__pattern_set_union' and '__pattern_set_symmetric_difference'
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _OutputIterator,
class _Compare, class _SetUnionOp, class _IsVector>
_OutputIterator
-parallel_set_union_op(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
- _ForwardIterator2 __first2, _ForwardIterator2 __last2, _OutputIterator __result, _Compare __comp,
- _SetUnionOp __set_union_op, _IsVector __is_vector)
+__parallel_set_union_op(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
+ _ForwardIterator2 __first2, _ForwardIterator2 __last2, _OutputIterator __result,
+ _Compare __comp, _SetUnionOp __set_union_op, _IsVector __is_vector)
{
typedef typename std::iterator_traits<_ForwardIterator1>::difference_type _DifferenceType;
@@ -2870,21 +2881,21 @@ parallel_set_union_op(_ExecutionPolicy&&
const auto __n2 = __last2 - __first2;
auto copy_range1 = [__is_vector](_ForwardIterator1 __begin, _ForwardIterator1 __end, _OutputIterator __res) {
- return brick_copy(__begin, __end, __res, __is_vector);
+ return __brick_copy(__begin, __end, __res, __is_vector);
};
auto copy_range2 = [__is_vector](_ForwardIterator2 __begin, _ForwardIterator2 __end, _OutputIterator __res) {
- return brick_copy(__begin, __end, __res, __is_vector);
+ return __brick_copy(__begin, __end, __res, __is_vector);
};
// {1} {}: parallel copying just first sequence
if (__n2 == 0)
- return pattern_walk2_brick(std::forward<_ExecutionPolicy>(__exec), __first1, __last1, __result, copy_range1,
- std::true_type());
+ return __pattern_walk2_brick(std::forward<_ExecutionPolicy>(__exec), __first1, __last1, __result, copy_range1,
+ std::true_type());
// {} {2}: parallel copying justmake second sequence
if (__n1 == 0)
- return pattern_walk2_brick(std::forward<_ExecutionPolicy>(__exec), __first2, __last2, __result, copy_range2,
- std::true_type());
+ return __pattern_walk2_brick(std::forward<_ExecutionPolicy>(__exec), __first2, __last2, __result, copy_range2,
+ std::true_type());
// testing whether the sequences are intersected
_ForwardIterator1 __left_bound_seq_1 = lower_bound(__first1, __last1, *__first2, __comp);
@@ -2892,15 +2903,16 @@ parallel_set_union_op(_ExecutionPolicy&&
if (__left_bound_seq_1 == __last1)
{
//{1} < {2}: seq2 is wholly greater than seq1, so, do parallel copying seq1 and seq2
- par_backend::parallel_invoke(std::forward<_ExecutionPolicy>(__exec),
- [=] {
- pattern_walk2_brick(std::forward<_ExecutionPolicy>(__exec), __first1, __last1,
- __result, copy_range1, std::true_type());
- },
- [=] {
- pattern_walk2_brick(std::forward<_ExecutionPolicy>(__exec), __first2, __last2,
- __result + __n1, copy_range2, std::true_type());
- });
+ __par_backend::__parallel_invoke(
+ std::forward<_ExecutionPolicy>(__exec),
+ [=] {
+ __pattern_walk2_brick(std::forward<_ExecutionPolicy>(__exec), __first1, __last1, __result, copy_range1,
+ std::true_type());
+ },
+ [=] {
+ __pattern_walk2_brick(std::forward<_ExecutionPolicy>(__exec), __first2, __last2, __result + __n1,
+ copy_range2, std::true_type());
+ });
return __result + __n1 + __n2;
}
@@ -2910,15 +2922,16 @@ parallel_set_union_op(_ExecutionPolicy&&
if (__left_bound_seq_2 == __last2)
{
//{2} < {1}: seq2 is wholly greater than seq1, so, do parallel copying seq1 and seq2
- par_backend::parallel_invoke(std::forward<_ExecutionPolicy>(__exec),
- [=] {
- pattern_walk2_brick(std::forward<_ExecutionPolicy>(__exec), __first2, __last2,
- __result, copy_range2, std::true_type());
- },
- [=] {
- pattern_walk2_brick(std::forward<_ExecutionPolicy>(__exec), __first1, __last1,
- __result + __n2, copy_range1, std::true_type());
- });
+ __par_backend::__parallel_invoke(
+ std::forward<_ExecutionPolicy>(__exec),
+ [=] {
+ __pattern_walk2_brick(std::forward<_ExecutionPolicy>(__exec), __first2, __last2, __result, copy_range2,
+ std::true_type());
+ },
+ [=] {
+ __pattern_walk2_brick(std::forward<_ExecutionPolicy>(__exec), __first1, __last1, __result + __n2,
+ copy_range1, std::true_type());
+ });
return __result + __n1 + __n2;
}
@@ -2927,18 +2940,18 @@ parallel_set_union_op(_ExecutionPolicy&&
{
auto __res_or = __result;
__result += __m1; //we know proper offset due to [first1; left_bound_seq_1) < [first2; last2)
- par_backend::parallel_invoke(
+ __par_backend::__parallel_invoke(
std::forward<_ExecutionPolicy>(__exec),
//do parallel copying of [first1; left_bound_seq_1)
[=] {
- pattern_walk2_brick(std::forward<_ExecutionPolicy>(__exec), __first1, __left_bound_seq_1, __res_or,
- copy_range1, std::true_type());
+ __pattern_walk2_brick(std::forward<_ExecutionPolicy>(__exec), __first1, __left_bound_seq_1, __res_or,
+ copy_range1, std::true_type());
},
[=, &__result] {
- __result = parallel_set_op(std::forward<_ExecutionPolicy>(__exec), __left_bound_seq_1, __last1,
- __first2, __last2, __result, __comp,
- [](_DifferenceType __n, _DifferenceType __m) { return __n + __m; },
- __set_union_op, __is_vector);
+ __result = __parallel_set_op(
+ std::forward<_ExecutionPolicy>(__exec), __left_bound_seq_1, __last1, __first2, __last2, __result,
+ __comp, [](_DifferenceType __n, _DifferenceType __m) { return __n + __m; }, __set_union_op,
+ __is_vector);
});
return __result;
}
@@ -2949,25 +2962,25 @@ parallel_set_union_op(_ExecutionPolicy&&
{
auto __res_or = __result;
__result += __m2; //we know proper offset due to [first2; left_bound_seq_2) < [first1; last1)
- par_backend::parallel_invoke(
+ __par_backend::__parallel_invoke(
std::forward<_ExecutionPolicy>(__exec),
//do parallel copying of [first2; left_bound_seq_2)
[=] {
- pattern_walk2_brick(std::forward<_ExecutionPolicy>(__exec), __first2, __left_bound_seq_2, __res_or,
- copy_range2, std::true_type());
+ __pattern_walk2_brick(std::forward<_ExecutionPolicy>(__exec), __first2, __left_bound_seq_2, __res_or,
+ copy_range2, std::true_type());
},
[=, &__result] {
- __result = parallel_set_op(std::forward<_ExecutionPolicy>(__exec), __first1, __last1,
- __left_bound_seq_2, __last2, __result, __comp,
- [](_DifferenceType __n, _DifferenceType __m) { return __n + __m; },
- __set_union_op, __is_vector);
+ __result = __parallel_set_op(
+ std::forward<_ExecutionPolicy>(__exec), __first1, __last1, __left_bound_seq_2, __last2, __result,
+ __comp, [](_DifferenceType __n, _DifferenceType __m) { return __n + __m; }, __set_union_op,
+ __is_vector);
});
return __result;
}
- return parallel_set_op(std::forward<_ExecutionPolicy>(__exec), __first1, __last1, __first2, __last2, __result,
- __comp, [](_DifferenceType __n, _DifferenceType __m) { return __n + __m; }, __set_union_op,
- __is_vector);
+ return __parallel_set_op(
+ std::forward<_ExecutionPolicy>(__exec), __first1, __last1, __first2, __last2, __result, __comp,
+ [](_DifferenceType __n, _DifferenceType __m) { return __n + __m; }, __set_union_op, __is_vector);
}
#endif
@@ -2977,18 +2990,18 @@ parallel_set_union_op(_ExecutionPolicy&&
template <class _ForwardIterator1, class _ForwardIterator2, class _OutputIterator, class _Compare>
_OutputIterator
-brick_set_union(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
- _ForwardIterator2 __last2, _OutputIterator __result, _Compare __comp,
- /*__is_vector=*/std::false_type) noexcept
+__brick_set_union(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
+ _ForwardIterator2 __last2, _OutputIterator __result, _Compare __comp,
+ /*__is_vector=*/std::false_type) noexcept
{
return std::set_union(__first1, __last1, __first2, __last2, __result, __comp);
}
template <class _ForwardIterator1, class _ForwardIterator2, class _OutputIterator, class _Compare>
_OutputIterator
-brick_set_union(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
- _ForwardIterator2 __last2, _OutputIterator __result, _Compare __comp,
- /*__is_vector=*/std::true_type) noexcept
+__brick_set_union(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
+ _ForwardIterator2 __last2, _OutputIterator __result, _Compare __comp,
+ /*__is_vector=*/std::true_type) noexcept
{
__PSTL_PRAGMA_MESSAGE("Vectorized algorithm unimplemented, redirected to serial");
return std::set_union(__first1, __last1, __first2, __last2, __result, __comp);
@@ -2997,20 +3010,21 @@ brick_set_union(_ForwardIterator1 __firs
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _OutputIterator,
class _Compare, class _IsVector>
_OutputIterator
-pattern_set_union(_ExecutionPolicy&&, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
- _ForwardIterator2 __last2, _OutputIterator __result, _Compare __comp, _IsVector __is_vector,
- /*is_parallel=*/std::false_type) noexcept
+__pattern_set_union(_ExecutionPolicy&&, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
+ _ForwardIterator2 __first2, _ForwardIterator2 __last2, _OutputIterator __result, _Compare __comp,
+ _IsVector __is_vector,
+ /*is_parallel=*/std::false_type) noexcept
{
- return internal::brick_set_union(__first1, __last1, __first2, __last2, __result, __comp, __is_vector);
+ return __brick_set_union(__first1, __last1, __first2, __last2, __result, __comp, __is_vector);
}
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _OutputIterator,
class _Compare, class _IsVector>
_OutputIterator
-pattern_set_union(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
- _ForwardIterator2 __first2, _ForwardIterator2 __last2, _OutputIterator __result, _Compare __comp,
- _IsVector __is_vector, /*__is_parallel=*/std::true_type)
+__pattern_set_union(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
+ _ForwardIterator2 __first2, _ForwardIterator2 __last2, _OutputIterator __result, _Compare __comp,
+ _IsVector __is_vector, /*__is_parallel=*/std::true_type)
{
const auto __n1 = __last1 - __first1;
@@ -3021,13 +3035,12 @@ pattern_set_union(_ExecutionPolicy&& __e
return std::set_union(__first1, __last1, __first2, __last2, __result, __comp);
typedef typename std::iterator_traits<_OutputIterator>::value_type _T;
- return parallel_set_union_op(std::forward<_ExecutionPolicy>(__exec), __first1, __last1, __first2, __last2, __result,
- __comp,
- [](_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
- _ForwardIterator2 __last2, _T* __result, _Compare __comp) {
- return std::set_union(__first1, __last1, __first2, __last2, __result, __comp);
- },
- __is_vector);
+ return __parallel_set_union_op(
+ std::forward<_ExecutionPolicy>(__exec), __first1, __last1, __first2, __last2, __result, __comp,
+ [](_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _ForwardIterator2 __last2,
+ _T* __result,
+ _Compare __comp) { return std::set_union(__first1, __last1, __first2, __last2, __result, __comp); },
+ __is_vector);
}
#endif
@@ -3037,18 +3050,18 @@ pattern_set_union(_ExecutionPolicy&& __e
template <class _ForwardIterator1, class _ForwardIterator2, class _OutputIterator, class _Compare>
_OutputIterator
-brick_set_intersection(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
- _ForwardIterator2 __last2, _OutputIterator __result, _Compare __comp,
- /*__is_vector=*/std::false_type) noexcept
+__brick_set_intersection(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
+ _ForwardIterator2 __last2, _OutputIterator __result, _Compare __comp,
+ /*__is_vector=*/std::false_type) noexcept
{
return std::set_intersection(__first1, __last1, __first2, __last2, __result, __comp);
}
template <class _ForwardIterator1, class _ForwardIterator2, class _OutputIterator, class _Compare>
_OutputIterator
-brick_set_intersection(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
- _ForwardIterator2 __last2, _OutputIterator __result, _Compare __comp,
- /*__is_vector=*/std::true_type) noexcept
+__brick_set_intersection(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
+ _ForwardIterator2 __last2, _OutputIterator __result, _Compare __comp,
+ /*__is_vector=*/std::true_type) noexcept
{
__PSTL_PRAGMA_MESSAGE("Vectorized algorithm unimplemented, redirected to serial");
return std::set_intersection(__first1, __last1, __first2, __last2, __result, __comp);
@@ -3057,20 +3070,20 @@ brick_set_intersection(_ForwardIterator1
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _OutputIterator,
class _Compare, class _IsVector>
_OutputIterator
-pattern_set_intersection(_ExecutionPolicy&&, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
- _ForwardIterator2 __first2, _ForwardIterator2 __last2, _OutputIterator __result,
- _Compare __comp, _IsVector __is_vector, /*is_parallel=*/std::false_type) noexcept
+__pattern_set_intersection(_ExecutionPolicy&&, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
+ _ForwardIterator2 __first2, _ForwardIterator2 __last2, _OutputIterator __result,
+ _Compare __comp, _IsVector __is_vector, /*is_parallel=*/std::false_type) noexcept
{
- return internal::brick_set_intersection(__first1, __last1, __first2, __last2, __result, __comp, __is_vector);
+ return __brick_set_intersection(__first1, __last1, __first2, __last2, __result, __comp, __is_vector);
}
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _OutputIterator,
class _Compare, class _IsVector>
_OutputIterator
-pattern_set_intersection(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
- _ForwardIterator2 __first2, _ForwardIterator2 __last2, _OutputIterator __result,
- _Compare __comp, _IsVector __is_vector, /*is_parallel=*/std::true_type)
+__pattern_set_intersection(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
+ _ForwardIterator2 __first2, _ForwardIterator2 __last2, _OutputIterator __result,
+ _Compare __comp, _IsVector __is_vector, /*is_parallel=*/std::true_type)
{
typedef typename std::iterator_traits<_OutputIterator>::value_type _T;
typedef typename std::iterator_traits<_ForwardIterator1>::difference_type _DifferenceType;
@@ -3098,21 +3111,21 @@ pattern_set_intersection(_ExecutionPolic
if (__m1 > __set_algo_cut_off)
{
//we know proper offset due to [first1; left_bound_seq_1) < [first2; last2)
- return parallel_set_op(std::forward<_ExecutionPolicy>(__exec), __left_bound_seq_1, __last1, __first2, __last2,
- __result, __comp,
- [](_DifferenceType __n, _DifferenceType __m) { return std::min(__n, __m); },
- [](_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
- _ForwardIterator2 __last2, _T* __result, _Compare __comp) {
- return std::set_intersection(__first1, __last1, __first2, __last2, __result, __comp);
- },
- __is_vector);
+ return __parallel_set_op(
+ std::forward<_ExecutionPolicy>(__exec), __left_bound_seq_1, __last1, __first2, __last2, __result, __comp,
+ [](_DifferenceType __n, _DifferenceType __m) { return std::min(__n, __m); },
+ [](_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
+ _ForwardIterator2 __last2, _T* __result, _Compare __comp) {
+ return std::set_intersection(__first1, __last1, __first2, __last2, __result, __comp);
+ },
+ __is_vector);
}
const auto __m2 = __last2 - __left_bound_seq_2 + __n1;
if (__m2 > __set_algo_cut_off)
{
//we know proper offset due to [first2; left_bound_seq_2) < [first1; last1)
- __result = parallel_set_op(
+ __result = __parallel_set_op(
std::forward<_ExecutionPolicy>(__exec), __first1, __last1, __left_bound_seq_2, __last2, __result, __comp,
[](_DifferenceType __n, _DifferenceType __m) { return std::min(__n, __m); },
[](_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
@@ -3134,18 +3147,18 @@ pattern_set_intersection(_ExecutionPolic
template <class _ForwardIterator1, class _ForwardIterator2, class _OutputIterator, class _Compare>
_OutputIterator
-brick_set_difference(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
- _ForwardIterator2 __last2, _OutputIterator __result, _Compare __comp,
- /*__is_vector=*/std::false_type) noexcept
+__brick_set_difference(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
+ _ForwardIterator2 __last2, _OutputIterator __result, _Compare __comp,
+ /*__is_vector=*/std::false_type) noexcept
{
return std::set_difference(__first1, __last1, __first2, __last2, __result, __comp);
}
template <class _ForwardIterator1, class _ForwardIterator2, class _OutputIterator, class _Compare>
_OutputIterator
-brick_set_difference(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
- _ForwardIterator2 __last2, _OutputIterator __result, _Compare __comp,
- /*__is_vector=*/std::true_type) noexcept
+__brick_set_difference(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
+ _ForwardIterator2 __last2, _OutputIterator __result, _Compare __comp,
+ /*__is_vector=*/std::true_type) noexcept
{
__PSTL_PRAGMA_MESSAGE("Vectorized algorithm unimplemented, redirected to serial");
return std::set_difference(__first1, __last1, __first2, __last2, __result, __comp);
@@ -3154,20 +3167,20 @@ brick_set_difference(_ForwardIterator1 _
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _OutputIterator,
class _Compare, class _IsVector>
_OutputIterator
-pattern_set_difference(_ExecutionPolicy&&, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
- _ForwardIterator2 __first2, _ForwardIterator2 __last2, _OutputIterator __result, _Compare __comp,
- _IsVector __is_vector, /*is_parallel=*/std::false_type) noexcept
+__pattern_set_difference(_ExecutionPolicy&&, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
+ _ForwardIterator2 __first2, _ForwardIterator2 __last2, _OutputIterator __result,
+ _Compare __comp, _IsVector __is_vector, /*is_parallel=*/std::false_type) noexcept
{
- return internal::brick_set_difference(__first1, __last1, __first2, __last2, __result, __comp, __is_vector);
+ return __brick_set_difference(__first1, __last1, __first2, __last2, __result, __comp, __is_vector);
}
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _OutputIterator,
class _Compare, class _IsVector>
_OutputIterator
-pattern_set_difference(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
- _ForwardIterator2 __first2, _ForwardIterator2 __last2, _OutputIterator __result, _Compare __comp,
- _IsVector __is_vector, /*is_parallel=*/std::true_type)
+__pattern_set_difference(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
+ _ForwardIterator2 __first2, _ForwardIterator2 __last2, _OutputIterator __result,
+ _Compare __comp, _IsVector __is_vector, /*is_parallel=*/std::true_type)
{
typedef typename std::iterator_traits<_OutputIterator>::value_type _T;
typedef typename std::iterator_traits<_ForwardIterator1>::difference_type _DifferenceType;
@@ -3181,10 +3194,10 @@ pattern_set_difference(_ExecutionPolicy&
// {1} \ {}: parallel copying just first sequence
if (__n2 == 0)
- return pattern_walk2_brick(
+ return __pattern_walk2_brick(
std::forward<_ExecutionPolicy>(__exec), __first1, __last1, __result,
[__is_vector](_ForwardIterator1 __begin, _ForwardIterator1 __end, _OutputIterator __res) {
- return brick_copy(__begin, __end, __res, __is_vector);
+ return __brick_copy(__begin, __end, __res, __is_vector);
},
std::true_type());
@@ -3192,10 +3205,10 @@ pattern_set_difference(_ExecutionPolicy&
_ForwardIterator1 __left_bound_seq_1 = lower_bound(__first1, __last1, *__first2, __comp);
//{1} < {2}: seq 2 is wholly greater than seq 1, so, parallel copying just first sequence
if (__left_bound_seq_1 == __last1)
- return pattern_walk2_brick(
+ return __pattern_walk2_brick(
std::forward<_ExecutionPolicy>(__exec), __first1, __last1, __result,
[__is_vector](_ForwardIterator1 __begin, _ForwardIterator1 __end, _OutputIterator __res) {
- return brick_copy(__begin, __end, __res, __is_vector);
+ return __brick_copy(__begin, __end, __res, __is_vector);
},
std::true_type());
@@ -3203,21 +3216,21 @@ pattern_set_difference(_ExecutionPolicy&
_ForwardIterator2 __left_bound_seq_2 = lower_bound(__first2, __last2, *__first1, __comp);
//{2} < {1}: seq 1 is wholly greater than seq 2, so, parallel copying just first sequence
if (__left_bound_seq_2 == __last2)
- return pattern_walk2_brick(
+ return __pattern_walk2_brick(
std::forward<_ExecutionPolicy>(__exec), __first1, __last1, __result,
[__is_vector](_ForwardIterator1 __begin, _ForwardIterator1 __end, _OutputIterator __res) {
- return brick_copy(__begin, __end, __res, __is_vector);
+ return __brick_copy(__begin, __end, __res, __is_vector);
},
std::true_type());
if (__n1 + __n2 > __set_algo_cut_off)
- return parallel_set_op(std::forward<_ExecutionPolicy>(__exec), __first1, __last1, __first2, __last2, __result,
- __comp, [](_DifferenceType __n, _DifferenceType __m) { return __n; },
- [](_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
- _ForwardIterator2 __last2, _T* __result, _Compare __comp) {
- return std::set_difference(__first1, __last1, __first2, __last2, __result, __comp);
- },
- __is_vector);
+ return __parallel_set_op(
+ std::forward<_ExecutionPolicy>(__exec), __first1, __last1, __first2, __last2, __result, __comp,
+ [](_DifferenceType __n, _DifferenceType __m) { return __n; },
+ [](_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
+ _ForwardIterator2 __last2, _T* __result,
+ _Compare __comp) { return std::set_difference(__first1, __last1, __first2, __last2, __result, __comp); },
+ __is_vector);
// use serial algorithm
return std::set_difference(__first1, __last1, __first2, __last2, __result, __comp);
@@ -3230,18 +3243,18 @@ pattern_set_difference(_ExecutionPolicy&
template <class _ForwardIterator1, class _ForwardIterator2, class _OutputIterator, class _Compare>
_OutputIterator
-brick_set_symmetric_difference(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
- _ForwardIterator2 __last2, _OutputIterator __result, _Compare __comp,
- /*__is_vector=*/std::false_type) noexcept
+__brick_set_symmetric_difference(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
+ _ForwardIterator2 __last2, _OutputIterator __result, _Compare __comp,
+ /*__is_vector=*/std::false_type) noexcept
{
return std::set_symmetric_difference(__first1, __last1, __first2, __last2, __result, __comp);
}
template <class _ForwardIterator1, class _ForwardIterator2, class _OutputIterator, class _Compare>
_OutputIterator
-brick_set_symmetric_difference(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
- _ForwardIterator2 __last2, _OutputIterator __result, _Compare __comp,
- /*__is_vector=*/std::true_type) noexcept
+__brick_set_symmetric_difference(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
+ _ForwardIterator2 __last2, _OutputIterator __result, _Compare __comp,
+ /*__is_vector=*/std::true_type) noexcept
{
__PSTL_PRAGMA_MESSAGE("Vectorized algorithm unimplemented, redirected to serial");
return std::set_symmetric_difference(__first1, __last1, __first2, __last2, __result, __comp);
@@ -3250,21 +3263,20 @@ brick_set_symmetric_difference(_ForwardI
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _OutputIterator,
class _Compare, class _IsVector>
_OutputIterator
-pattern_set_symmetric_difference(_ExecutionPolicy&&, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
- _ForwardIterator2 __first2, _ForwardIterator2 __last2, _OutputIterator __result,
- _Compare __comp, _IsVector __is_vector, /*is_parallel=*/std::false_type) noexcept
+__pattern_set_symmetric_difference(_ExecutionPolicy&&, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
+ _ForwardIterator2 __first2, _ForwardIterator2 __last2, _OutputIterator __result,
+ _Compare __comp, _IsVector __is_vector, /*is_parallel=*/std::false_type) noexcept
{
- return internal::brick_set_symmetric_difference(__first1, __last1, __first2, __last2, __result, __comp,
- __is_vector);
+ return __brick_set_symmetric_difference(__first1, __last1, __first2, __last2, __result, __comp, __is_vector);
}
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _OutputIterator,
class _Compare, class _IsVector>
_OutputIterator
-pattern_set_symmetric_difference(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
- _ForwardIterator2 __first2, _ForwardIterator2 __last2, _OutputIterator __result,
- _Compare __comp, _IsVector __is_vector, /*is_parallel=*/std::true_type)
+__pattern_set_symmetric_difference(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
+ _ForwardIterator2 __first2, _ForwardIterator2 __last2, _OutputIterator __result,
+ _Compare __comp, _IsVector __is_vector, /*is_parallel=*/std::true_type)
{
const auto __n1 = __last1 - __first1;
@@ -3275,7 +3287,7 @@ pattern_set_symmetric_difference(_Execut
return std::set_symmetric_difference(__first1, __last1, __first2, __last2, __result, __comp);
typedef typename std::iterator_traits<_OutputIterator>::value_type _T;
- return parallel_set_union_op(
+ return __parallel_set_union_op(
std::forward<_ExecutionPolicy>(__exec), __first1, __last1, __first2, __last2, __result, __comp,
[](_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _ForwardIterator2 __last2,
_T* __result, _Compare __comp) {
@@ -3291,37 +3303,37 @@ pattern_set_symmetric_difference(_Execut
template <class _RandomAccessIterator, class _Compare>
_RandomAccessIterator
-brick_is_heap_until(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp,
- /* __is_vector = */ std::false_type) noexcept
+__brick_is_heap_until(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp,
+ /* __is_vector = */ std::false_type) noexcept
{
return std::is_heap_until(__first, __last, __comp);
}
template <class _RandomAccessIterator, class _Compare>
_RandomAccessIterator
-brick_is_heap_until(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp,
- /* __is_vector = */ std::true_type) noexcept
+__brick_is_heap_until(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp,
+ /* __is_vector = */ std::true_type) noexcept
{
if (__last - __first < 2)
return __last;
typedef typename std::iterator_traits<_RandomAccessIterator>::difference_type _SizeType;
- return unseq_backend::simd_first(
+ return __unseq_backend::__simd_first(
__first, _SizeType(0), __last - __first,
[&__comp](_RandomAccessIterator __it, _SizeType __i) { return __comp(__it[(__i - 1) / 2], __it[__i]); });
}
template <class _ExecutionPolicy, class _RandomAccessIterator, class _Compare, class _IsVector>
_RandomAccessIterator
-pattern_is_heap_until(_ExecutionPolicy&&, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp,
- _IsVector __is_vector, /* is_parallel = */ std::false_type) noexcept
+__pattern_is_heap_until(_ExecutionPolicy&&, _RandomAccessIterator __first, _RandomAccessIterator __last,
+ _Compare __comp, _IsVector __is_vector, /* is_parallel = */ std::false_type) noexcept
{
- return internal::brick_is_heap_until(__first, __last, __comp, __is_vector);
+ return __brick_is_heap_until(__first, __last, __comp, __is_vector);
}
template <class _RandomAccessIterator, class _DifferenceType, class _Compare>
_RandomAccessIterator
-is_heap_until_local(_RandomAccessIterator __first, _DifferenceType __begin, _DifferenceType __end, _Compare __comp,
- /* __is_vector = */ std::false_type) noexcept
+__is_heap_until_local(_RandomAccessIterator __first, _DifferenceType __begin, _DifferenceType __end, _Compare __comp,
+ /* __is_vector = */ std::false_type) noexcept
{
_DifferenceType __i = __begin;
for (; __i < __end; ++__i)
@@ -3336,10 +3348,10 @@ is_heap_until_local(_RandomAccessIterato
template <class _RandomAccessIterator, class _DifferenceType, class _Compare>
_RandomAccessIterator
-is_heap_until_local(_RandomAccessIterator __first, _DifferenceType __begin, _DifferenceType __end, _Compare __comp,
- /* __is_vector = */ std::true_type) noexcept
+__is_heap_until_local(_RandomAccessIterator __first, _DifferenceType __begin, _DifferenceType __end, _Compare __comp,
+ /* __is_vector = */ std::true_type) noexcept
{
- return unseq_backend::simd_first(
+ return __unseq_backend::__simd_first(
__first, __begin, __end,
[&__comp](_RandomAccessIterator __it, _DifferenceType __i) { return __comp(__it[(__i - 1) / 2], __it[__i]); });
}
@@ -3347,17 +3359,17 @@ is_heap_until_local(_RandomAccessIterato
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _RandomAccessIterator, class _Compare, class _IsVector>
_RandomAccessIterator
-pattern_is_heap_until(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last,
- _Compare __comp, _IsVector __is_vector, /* is_parallel = */ std::true_type) noexcept
+__pattern_is_heap_until(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last,
+ _Compare __comp, _IsVector __is_vector, /* is_parallel = */ std::true_type) noexcept
{
if (__last - __first < 2)
return __last;
- return internal::except_handler([&]() {
- return internal::parallel_find(
+ return __except_handler([&]() {
+ return __parallel_find(
std::forward<_ExecutionPolicy>(__exec), __first, __last,
[__first, __comp, __is_vector](_RandomAccessIterator __i, _RandomAccessIterator __j) {
- return internal::is_heap_until_local(__first, __i - __first, __j - __first, __comp, __is_vector);
+ return __is_heap_until_local(__first, __i - __first, __j - __first, __comp, __is_vector);
},
std::less<typename std::iterator_traits<_RandomAccessIterator>::difference_type>(), /*is_first=*/true);
});
@@ -3370,19 +3382,19 @@ pattern_is_heap_until(_ExecutionPolicy&&
template <typename _ForwardIterator, typename _Compare>
_ForwardIterator
-brick_min_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp,
- /* __is_vector = */ std::false_type) noexcept
+__brick_min_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp,
+ /* __is_vector = */ std::false_type) noexcept
{
return std::min_element(__first, __last, __comp);
}
template <typename _ForwardIterator, typename _Compare>
_ForwardIterator
-brick_min_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp,
- /* __is_vector = */ std::true_type) noexcept
+__brick_min_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp,
+ /* __is_vector = */ std::true_type) noexcept
{
#if __PSTL_UDR_PRESENT
- return unseq_backend::simd_min_element(__first, __last - __first, __comp);
+ return __unseq_backend::__simd_min_element(__first, __last - __first, __comp);
#else
return std::min_element(__first, __last, __comp);
#endif
@@ -3390,31 +3402,31 @@ brick_min_element(_ForwardIterator __fir
template <typename _ExecutionPolicy, typename _ForwardIterator, typename _Compare, typename _IsVector>
_ForwardIterator
-pattern_min_element(_ExecutionPolicy&&, _ForwardIterator __first, _ForwardIterator __last, _Compare __comp,
- _IsVector __is_vector, /* is_parallel = */ std::false_type) noexcept
+__pattern_min_element(_ExecutionPolicy&&, _ForwardIterator __first, _ForwardIterator __last, _Compare __comp,
+ _IsVector __is_vector, /* is_parallel = */ std::false_type) noexcept
{
- return internal::brick_min_element(__first, __last, __comp, __is_vector);
+ return __brick_min_element(__first, __last, __comp, __is_vector);
}
#if __PSTL_USE_PAR_POLICIES
template <typename _ExecutionPolicy, typename _RandomAccessIterator, typename _Compare, typename _IsVector>
_RandomAccessIterator
-pattern_min_element(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last,
- _Compare __comp, _IsVector __is_vector, /* is_parallel = */ std::true_type)
+__pattern_min_element(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last,
+ _Compare __comp, _IsVector __is_vector, /* is_parallel = */ std::true_type)
{
if (__first == __last)
return __last;
- return internal::except_handler([&]() {
- return par_backend::parallel_reduce(
+ return __except_handler([&]() {
+ return __par_backend::__parallel_reduce(
std::forward<_ExecutionPolicy>(__exec), __first + 1, __last, __first,
[=](_RandomAccessIterator __begin, _RandomAccessIterator __end,
_RandomAccessIterator __init) -> _RandomAccessIterator {
- const _RandomAccessIterator subresult = brick_min_element(__begin, __end, __comp, __is_vector);
- return internal::cmp_iterators_by_values(__init, subresult, __comp);
+ const _RandomAccessIterator subresult = __brick_min_element(__begin, __end, __comp, __is_vector);
+ return __cmp_iterators_by_values(__init, subresult, __comp);
},
[=](_RandomAccessIterator __it1, _RandomAccessIterator __it2) -> _RandomAccessIterator {
- return internal::cmp_iterators_by_values(__it1, __it2, __comp);
+ return __cmp_iterators_by_values(__it1, __it2, __comp);
});
});
}
@@ -3426,19 +3438,19 @@ pattern_min_element(_ExecutionPolicy&& _
template <typename _ForwardIterator, typename _Compare>
std::pair<_ForwardIterator, _ForwardIterator>
-brick_minmax_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp,
- /* __is_vector = */ std::false_type) noexcept
+__brick_minmax_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp,
+ /* __is_vector = */ std::false_type) noexcept
{
return std::minmax_element(__first, __last, __comp);
}
template <typename _ForwardIterator, typename _Compare>
std::pair<_ForwardIterator, _ForwardIterator>
-brick_minmax_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp,
- /* __is_vector = */ std::true_type) noexcept
+__brick_minmax_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp,
+ /* __is_vector = */ std::true_type) noexcept
{
#if __PSTL_UDR_PRESENT
- return unseq_backend::simd_minmax_element(__first, __last - __first, __comp);
+ return __unseq_backend::__simd_minmax_element(__first, __last - __first, __comp);
#else
return std::minmax_element(__first, __last, __comp);
#endif
@@ -3446,36 +3458,36 @@ brick_minmax_element(_ForwardIterator __
template <typename _ExecutionPolicy, typename _ForwardIterator, typename _Compare, typename _IsVector>
std::pair<_ForwardIterator, _ForwardIterator>
-pattern_minmax_element(_ExecutionPolicy&&, _ForwardIterator __first, _ForwardIterator __last, _Compare __comp,
- _IsVector __is_vector, /* is_parallel = */ std::false_type) noexcept
+__pattern_minmax_element(_ExecutionPolicy&&, _ForwardIterator __first, _ForwardIterator __last, _Compare __comp,
+ _IsVector __is_vector, /* is_parallel = */ std::false_type) noexcept
{
- return internal::brick_minmax_element(__first, __last, __comp, __is_vector);
+ return __brick_minmax_element(__first, __last, __comp, __is_vector);
}
#if __PSTL_USE_PAR_POLICIES
template <typename _ExecutionPolicy, typename _ForwardIterator, typename _Compare, typename _IsVector>
std::pair<_ForwardIterator, _ForwardIterator>
-pattern_minmax_element(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Compare __comp,
- _IsVector __is_vector, /* is_parallel = */ std::true_type)
+__pattern_minmax_element(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Compare __comp,
+ _IsVector __is_vector, /* is_parallel = */ std::true_type)
{
if (__first == __last)
return std::make_pair(__first, __first);
- return internal::except_handler([&]() {
+ return __except_handler([&]() {
typedef std::pair<_ForwardIterator, _ForwardIterator> _Result;
- return par_backend::parallel_reduce(
+ return __par_backend::__parallel_reduce(
std::forward<_ExecutionPolicy>(__exec), __first + 1, __last, std::make_pair(__first, __first),
[=](_ForwardIterator __begin, _ForwardIterator __end, _Result __init) -> _Result {
- const _Result __subresult = brick_minmax_element(__begin, __end, __comp, __is_vector);
- return std::make_pair(internal::cmp_iterators_by_values(__subresult.first, __init.first, __comp),
- internal::cmp_iterators_by_values(__init.second, __subresult.second,
- internal::not_pred<_Compare>(__comp)));
+ const _Result __subresult = __brick_minmax_element(__begin, __end, __comp, __is_vector);
+ return std::make_pair(
+ __cmp_iterators_by_values(__subresult.first, __init.first, __comp),
+ __cmp_iterators_by_values(__init.second, __subresult.second, __not_pred<_Compare>(__comp)));
},
[=](_Result __p1, _Result __p2) -> _Result {
return std::make_pair(
- internal::cmp_iterators_by_values(__p1.first, __p2.first, __comp),
- internal::cmp_iterators_by_values(__p2.second, __p1.second, internal::not_pred<_Compare>(__comp)));
+ __cmp_iterators_by_values(__p1.first, __p2.first, __comp),
+ __cmp_iterators_by_values(__p2.second, __p1.second, __not_pred<_Compare>(__comp)));
});
});
}
@@ -3486,8 +3498,8 @@ pattern_minmax_element(_ExecutionPolicy&
//------------------------------------------------------------------------
template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
std::pair<_ForwardIterator1, _ForwardIterator2>
-mismatch_serial(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
- _ForwardIterator2 __last2, _BinaryPredicate __pred)
+__mismatch_serial(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
+ _ForwardIterator2 __last2, _BinaryPredicate __pred)
{
#if __PSTL_CPP14_2RANGE_MISMATCH_EQUAL_PRESENT
return std::mismatch(__first1, __last1, __first2, __last2, __pred);
@@ -3501,45 +3513,45 @@ mismatch_serial(_ForwardIterator1 __firs
template <class _ForwardIterator1, class _ForwardIterator2, class _Predicate>
std::pair<_ForwardIterator1, _ForwardIterator2>
-brick_mismatch(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
- _ForwardIterator2 __last2, _Predicate __pred, /* __is_vector = */ std::false_type) noexcept
+__brick_mismatch(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
+ _ForwardIterator2 __last2, _Predicate __pred, /* __is_vector = */ std::false_type) noexcept
{
- return internal::mismatch_serial(__first1, __last1, __first2, __last2, __pred);
+ return __mismatch_serial(__first1, __last1, __first2, __last2, __pred);
}
template <class _ForwardIterator1, class _ForwardIterator2, class _Predicate>
std::pair<_ForwardIterator1, _ForwardIterator2>
-brick_mismatch(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
- _ForwardIterator2 __last2, _Predicate __pred, /* __is_vector = */ std::true_type) noexcept
+__brick_mismatch(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
+ _ForwardIterator2 __last2, _Predicate __pred, /* __is_vector = */ std::true_type) noexcept
{
auto __n = std::min(__last1 - __first1, __last2 - __first2);
- return unseq_backend::simd_first(__first1, __n, __first2, not_pred<_Predicate>(__pred));
+ return __unseq_backend::__simd_first(__first1, __n, __first2, __not_pred<_Predicate>(__pred));
}
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Predicate, class _IsVector>
std::pair<_ForwardIterator1, _ForwardIterator2>
-pattern_mismatch(_ExecutionPolicy&&, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
- _ForwardIterator2 __last2, _Predicate __pred, _IsVector __is_vector,
- /* is_parallel = */ std::false_type) noexcept
+__pattern_mismatch(_ExecutionPolicy&&, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
+ _ForwardIterator2 __first2, _ForwardIterator2 __last2, _Predicate __pred, _IsVector __is_vector,
+ /* is_parallel = */ std::false_type) noexcept
{
- return internal::brick_mismatch(__first1, __last1, __first2, __last2, __pred, __is_vector);
+ return __brick_mismatch(__first1, __last1, __first2, __last2, __pred, __is_vector);
}
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _RandomAccessIterator1, class _RandomAccessIterator2, class _Predicate,
class _IsVector>
std::pair<_RandomAccessIterator1, _RandomAccessIterator2>
-pattern_mismatch(_ExecutionPolicy&& __exec, _RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1,
- _RandomAccessIterator2 __first2, _RandomAccessIterator2 __last2, _Predicate __pred,
- _IsVector __is_vector, /* is_parallel = */ std::true_type) noexcept
+__pattern_mismatch(_ExecutionPolicy&& __exec, _RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1,
+ _RandomAccessIterator2 __first2, _RandomAccessIterator2 __last2, _Predicate __pred,
+ _IsVector __is_vector, /* is_parallel = */ std::true_type) noexcept
{
- return internal::except_handler([&]() {
+ return __except_handler([&]() {
auto __n = std::min(__last1 - __first1, __last2 - __first2);
- auto __result = internal::parallel_find(
+ auto __result = __parallel_find(
std::forward<_ExecutionPolicy>(__exec), __first1, __first1 + __n,
[__first1, __first2, __pred, __is_vector](_RandomAccessIterator1 __i, _RandomAccessIterator1 __j) {
- return internal::brick_mismatch(__i, __j, __first2 + (__i - __first1), __first2 + (__j - __first1),
- __pred, __is_vector)
+ return __brick_mismatch(__i, __j, __first2 + (__i - __first1), __first2 + (__j - __first1), __pred,
+ __is_vector)
.first;
},
std::less<typename std::iterator_traits<_RandomAccessIterator1>::difference_type>(), /*is_first=*/true);
@@ -3554,16 +3566,17 @@ pattern_mismatch(_ExecutionPolicy&& __ex
template <class _ForwardIterator1, class _ForwardIterator2, class _Compare>
bool
-brick_lexicographical_compare(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
- _ForwardIterator2 __last2, _Compare __comp, /* __is_vector = */ std::false_type) noexcept
+__brick_lexicographical_compare(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
+ _ForwardIterator2 __last2, _Compare __comp,
+ /* __is_vector = */ std::false_type) noexcept
{
return std::lexicographical_compare(__first1, __last1, __first2, __last2, __comp);
}
template <class _ForwardIterator1, class _ForwardIterator2, class _Compare>
bool
-brick_lexicographical_compare(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
- _ForwardIterator2 __last2, _Compare __comp, /* __is_vector = */ std::true_type) noexcept
+__brick_lexicographical_compare(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
+ _ForwardIterator2 __last2, _Compare __comp, /* __is_vector = */ std::true_type) noexcept
{
if (__first2 == __last2)
{ // if second sequence is empty
@@ -3580,7 +3593,7 @@ brick_lexicographical_compare(_ForwardIt
--__last1;
--__last2;
auto __n = std::min(__last1 - __first1, __last2 - __first2);
- std::pair<_ForwardIterator1, _ForwardIterator2> __result = unseq_backend::simd_first(
+ std::pair<_ForwardIterator1, _ForwardIterator2> __result = __unseq_backend::__simd_first(
__first1, __n, __first2, [__comp](const ref_type1 __x, const ref_type2 __y) mutable {
return __comp(__x, __y) || __comp(__y, __x);
});
@@ -3598,19 +3611,19 @@ brick_lexicographical_compare(_ForwardIt
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Compare, class _IsVector>
bool
-pattern_lexicographical_compare(_ExecutionPolicy&&, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
- _ForwardIterator2 __first2, _ForwardIterator2 __last2, _Compare __comp,
- _IsVector __is_vector, /* is_parallel = */ std::false_type) noexcept
+__pattern_lexicographical_compare(_ExecutionPolicy&&, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
+ _ForwardIterator2 __first2, _ForwardIterator2 __last2, _Compare __comp,
+ _IsVector __is_vector, /* is_parallel = */ std::false_type) noexcept
{
- return internal::brick_lexicographical_compare(__first1, __last1, __first2, __last2, __comp, __is_vector);
+ return __brick_lexicographical_compare(__first1, __last1, __first2, __last2, __comp, __is_vector);
}
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Compare, class _IsVector>
bool
-pattern_lexicographical_compare(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
- _ForwardIterator2 __first2, _ForwardIterator2 __last2, _Compare __comp,
- _IsVector __is_vector, /* is_parallel = */ std::true_type) noexcept
+__pattern_lexicographical_compare(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
+ _ForwardIterator2 __first2, _ForwardIterator2 __last2, _Compare __comp,
+ _IsVector __is_vector, /* is_parallel = */ std::true_type) noexcept
{
if (__first2 == __last2)
{ // if second sequence is empty
@@ -3627,14 +3640,15 @@ pattern_lexicographical_compare(_Executi
--__last1;
--__last2;
auto __n = std::min(__last1 - __first1, __last2 - __first2);
- auto __result = internal::parallel_find(
+ auto __result = __parallel_find(
std::forward<_ExecutionPolicy>(__exec), __first1, __first1 + __n,
[__first1, __first2, &__comp, __is_vector](_ForwardIterator1 __i, _ForwardIterator1 __j) {
- return brick_mismatch(__i, __j, __first2 + (__i - __first1), __first2 + (__j - __first1),
- [&__comp](const _RefType1 __x, const _RefType2 __y) {
- return !__comp(__x, __y) && !__comp(__y, __x);
- },
- __is_vector)
+ return __brick_mismatch(
+ __i, __j, __first2 + (__i - __first1), __first2 + (__j - __first1),
+ [&__comp](const _RefType1 __x, const _RefType2 __y) {
+ return !__comp(__x, __y) && !__comp(__y, __x);
+ },
+ __is_vector)
.first;
},
std::less<typename std::iterator_traits<_ForwardIterator1>::difference_type>(), /*is_first=*/true);
@@ -3651,7 +3665,7 @@ pattern_lexicographical_compare(_Executi
}
#endif
-} // namespace internal
+} // namespace __internal
} // namespace __pstl
#endif /* __PSTL_algorithm_impl_H */
Modified: pstl/trunk/include/pstl/internal/execution_defs.h
URL: http://llvm.org/viewvc/llvm-project/pstl/trunk/include/pstl/internal/execution_defs.h?rev=357203&r1=357202&r2=357203&view=diff
==============================================================================
--- pstl/trunk/include/pstl/internal/execution_defs.h (original)
+++ pstl/trunk/include/pstl/internal/execution_defs.h Thu Mar 28 12:10:32 2019
@@ -149,13 +149,13 @@ constexpr bool is_execution_policy_v = i
} // namespace v1
} // namespace execution
-namespace internal
+namespace __internal
{
template <class ExecPolicy, class T>
-using enable_if_execution_policy =
+using __enable_if_execution_policy =
typename std::enable_if<__pstl::execution::is_execution_policy<typename std::decay<ExecPolicy>::type>::value,
T>::type;
-} // namespace internal
+} // namespace __internal
} // namespace __pstl
Modified: pstl/trunk/include/pstl/internal/execution_impl.h
URL: http://llvm.org/viewvc/llvm-project/pstl/trunk/include/pstl/internal/execution_impl.h?rev=357203&r1=357202&r2=357203&view=diff
==============================================================================
--- pstl/trunk/include/pstl/internal/execution_impl.h (original)
+++ pstl/trunk/include/pstl/internal/execution_impl.h Thu Mar 28 12:10:32 2019
@@ -17,7 +17,7 @@
namespace __pstl
{
-namespace internal
+namespace __internal
{
using namespace __pstl::execution;
@@ -25,54 +25,54 @@ using namespace __pstl::execution;
/* predicate */
template <typename _Tp>
-std::false_type lazy_and(_Tp, std::false_type)
+std::false_type __lazy_and(_Tp, std::false_type)
{
return std::false_type{};
};
template <typename _Tp>
inline _Tp
-lazy_and(_Tp __a, std::true_type)
+__lazy_and(_Tp __a, std::true_type)
{
return __a;
}
template <typename _Tp>
-std::true_type lazy_or(_Tp, std::true_type)
+std::true_type __lazy_or(_Tp, std::true_type)
{
return std::true_type{};
};
template <typename _Tp>
inline _Tp
-lazy_or(_Tp __a, std::false_type)
+__lazy_or(_Tp __a, std::false_type)
{
return __a;
}
/* iterator */
template <typename _IteratorType, typename... _OtherIteratorTypes>
-struct is_random_access_iterator
+struct __is_random_access_iterator
{
static constexpr bool value =
- is_random_access_iterator<_IteratorType>::value && is_random_access_iterator<_OtherIteratorTypes...>::value;
+ __is_random_access_iterator<_IteratorType>::value && __is_random_access_iterator<_OtherIteratorTypes...>::value;
typedef std::integral_constant<bool, value> type;
};
template <typename _IteratorType>
-struct is_random_access_iterator<_IteratorType>
+struct __is_random_access_iterator<_IteratorType>
: std::is_same<typename std::iterator_traits<_IteratorType>::iterator_category, std::random_access_iterator_tag>
{
};
/* policy */
template <typename Policy>
-struct policy_traits
+struct __policy_traits
{
};
template <>
-struct policy_traits<sequenced_policy>
+struct __policy_traits<sequenced_policy>
{
typedef std::false_type allow_parallel;
typedef std::false_type allow_unsequenced;
@@ -80,7 +80,7 @@ struct policy_traits<sequenced_policy>
};
template <>
-struct policy_traits<unsequenced_policy>
+struct __policy_traits<unsequenced_policy>
{
typedef std::false_type allow_parallel;
typedef std::true_type allow_unsequenced;
@@ -89,7 +89,7 @@ struct policy_traits<unsequenced_policy>
#if __PSTL_USE_PAR_POLICIES
template <>
-struct policy_traits<parallel_policy>
+struct __policy_traits<parallel_policy>
{
typedef std::true_type allow_parallel;
typedef std::false_type allow_unsequenced;
@@ -97,7 +97,7 @@ struct policy_traits<parallel_policy>
};
template <>
-struct policy_traits<parallel_unsequenced_policy>
+struct __policy_traits<parallel_unsequenced_policy>
{
typedef std::true_type allow_parallel;
typedef std::true_type allow_unsequenced;
@@ -106,50 +106,50 @@ struct policy_traits<parallel_unsequence
#endif
template <typename _ExecutionPolicy>
-using collector_t = typename policy_traits<typename std::decay<_ExecutionPolicy>::type>::collector_type;
+using __collector_t = typename __policy_traits<typename std::decay<_ExecutionPolicy>::type>::__collector_type;
template <typename _ExecutionPolicy>
-using allow_vector = typename internal::policy_traits<typename std::decay<_ExecutionPolicy>::type>::allow_vector;
+using __allow_vector = typename __policy_traits<typename std::decay<_ExecutionPolicy>::type>::__allow_vector;
template <typename _ExecutionPolicy>
-using allow_unsequenced =
- typename internal::policy_traits<typename std::decay<_ExecutionPolicy>::type>::allow_unsequenced;
+using __allow_unsequenced = typename __policy_traits<typename std::decay<_ExecutionPolicy>::type>::__allow_unsequenced;
template <typename _ExecutionPolicy>
-using allow_parallel = typename internal::policy_traits<typename std::decay<_ExecutionPolicy>::type>::allow_parallel;
+using __allow_parallel = typename __policy_traits<typename std::decay<_ExecutionPolicy>::type>::__allow_parallel;
template <typename _ExecutionPolicy, typename... _IteratorTypes>
auto
-is_vectorization_preferred(_ExecutionPolicy&& __exec)
- -> decltype(lazy_and(__exec.__allow_vector(), typename is_random_access_iterator<_IteratorTypes...>::type()))
+__is_vectorization_preferred(_ExecutionPolicy&& __exec)
+ -> decltype(__lazy_and(__exec.__allow_vector(), typename __is_random_access_iterator<_IteratorTypes...>::type()))
{
- return internal::lazy_and(__exec.__allow_vector(), typename is_random_access_iterator<_IteratorTypes...>::type());
+ return __lazy_and(__exec.__allow_vector(), typename __is_random_access_iterator<_IteratorTypes...>::type());
}
template <typename _ExecutionPolicy, typename... _IteratorTypes>
auto
-is_parallelization_preferred(_ExecutionPolicy&& __exec)
- -> decltype(lazy_and(__exec.__allow_parallel(), typename is_random_access_iterator<_IteratorTypes...>::type()))
+__is_parallelization_preferred(_ExecutionPolicy&& __exec)
+ -> decltype(__lazy_and(__exec.__allow_parallel(), typename __is_random_access_iterator<_IteratorTypes...>::type()))
{
- return internal::lazy_and(__exec.__allow_parallel(), typename is_random_access_iterator<_IteratorTypes...>::type());
+ return __lazy_and(__exec.__allow_parallel(), typename __is_random_access_iterator<_IteratorTypes...>::type());
}
template <typename policy, typename... _IteratorTypes>
-struct prefer_unsequenced_tag
+struct __prefer_unsequenced_tag
{
static constexpr bool value =
- allow_unsequenced<policy>::value && is_random_access_iterator<_IteratorTypes...>::value;
+ __allow_unsequenced<policy>::value && __is_random_access_iterator<_IteratorTypes...>::value;
typedef std::integral_constant<bool, value> type;
};
template <typename policy, typename... _IteratorTypes>
-struct prefer_parallel_tag
+struct __prefer_parallel_tag
{
- static constexpr bool value = allow_parallel<policy>::value && is_random_access_iterator<_IteratorTypes...>::value;
+ static constexpr bool value =
+ __allow_parallel<policy>::value && __is_random_access_iterator<_IteratorTypes...>::value;
typedef std::integral_constant<bool, value> type;
};
-} // namespace internal
+} // namespace __internal
} // namespace __pstl
#endif /* __PSTL_execution_impl_H */
Modified: pstl/trunk/include/pstl/internal/glue_algorithm_defs.h
URL: http://llvm.org/viewvc/llvm-project/pstl/trunk/include/pstl/internal/glue_algorithm_defs.h?rev=357203&r1=357202&r2=357203&view=diff
==============================================================================
--- pstl/trunk/include/pstl/internal/glue_algorithm_defs.h (original)
+++ pstl/trunk/include/pstl/internal/glue_algorithm_defs.h Thu Mar 28 12:10:32 2019
@@ -20,422 +20,422 @@ namespace std
// [alg.any_of]
template <class _ExecutionPolicy, class _ForwardIterator, class _Predicate>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, bool>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, bool>
any_of(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred);
// [alg.all_of]
template <class _ExecutionPolicy, class _ForwardIterator, class _Predicate>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, bool>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, bool>
all_of(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred);
// [alg.none_of]
template <class _ExecutionPolicy, class _ForwardIterator, class _Predicate>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, bool>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, bool>
none_of(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred);
// [alg.foreach]
template <class _ExecutionPolicy, class _ForwardIterator, class _Function>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, void>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void>
for_each(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Function __f);
template <class _ExecutionPolicy, class _ForwardIterator, class _Size, class _Function>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
for_each_n(_ExecutionPolicy&& __exec, _ForwardIterator __first, _Size __n, _Function __f);
// [alg.find]
template <class _ExecutionPolicy, class _ForwardIterator, class _Predicate>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
find_if(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred);
template <class _ExecutionPolicy, class _ForwardIterator, class _Predicate>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
find_if_not(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred);
template <class _ExecutionPolicy, class _ForwardIterator, class _Tp>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
find(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
// [alg.find.end]
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator1>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator1>
find_end(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __s_first,
_ForwardIterator2 __s_last, _BinaryPredicate __pred);
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator1>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator1>
find_end(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __s_first,
_ForwardIterator2 __s_last);
// [alg.find_first_of]
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator1>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator1>
find_first_of(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last,
_ForwardIterator2 __s_first, _ForwardIterator2 __s_last, _BinaryPredicate __pred);
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator1>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator1>
find_first_of(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last,
_ForwardIterator2 __s_first, _ForwardIterator2 __s_last);
// [alg.adjacent_find]
template <class _ExecutionPolicy, class _ForwardIterator>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
adjacent_find(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last);
template <class _ExecutionPolicy, class _ForwardIterator, class _BinaryPredicate>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
adjacent_find(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __pred);
// [alg.count]
template <class _ExecutionPolicy, class _ForwardIterator, class _Tp>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy,
- typename iterator_traits<_ForwardIterator>::difference_type>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy,
+ typename iterator_traits<_ForwardIterator>::difference_type>
count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
template <class _ExecutionPolicy, class _ForwardIterator, class _Predicate>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy,
- typename iterator_traits<_ForwardIterator>::difference_type>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy,
+ typename iterator_traits<_ForwardIterator>::difference_type>
count_if(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred);
// [alg.search]
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator1>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator1>
search(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __s_first,
_ForwardIterator2 __s_last, _BinaryPredicate __pred);
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator1>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator1>
search(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __s_first,
_ForwardIterator2 __s_last);
template <class _ExecutionPolicy, class _ForwardIterator, class _Size, class _Tp, class _BinaryPredicate>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
search_n(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Size __count,
const _Tp& __value, _BinaryPredicate __pred);
template <class _ExecutionPolicy, class _ForwardIterator, class _Size, class _Tp>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
search_n(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Size __count,
const _Tp& __value);
// [alg.copy]
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
copy(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __result);
template <class _ExecutionPolicy, class _ForwardIterator1, class _Size, class _ForwardIterator2>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
copy_n(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _Size __n, _ForwardIterator2 __result);
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Predicate>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
copy_if(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 result,
_Predicate __pred);
// [alg.swap]
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
swap_ranges(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
_ForwardIterator2 __first2);
// [alg.transform]
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _UnaryOperation>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
transform(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __result,
_UnaryOperation __op);
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _ForwardIterator,
class _BinaryOperation>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
transform(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
_ForwardIterator __result, _BinaryOperation __op);
// [alg.replace]
template <class _ExecutionPolicy, class _ForwardIterator, class _UnaryPredicate, class _Tp>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, void>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void>
replace_if(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _UnaryPredicate __pred,
const _Tp& __new_value);
template <class _ExecutionPolicy, class _ForwardIterator, class _Tp>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, void>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void>
replace(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __old_value,
const _Tp& __new_value);
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _UnaryPredicate, class _Tp>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
replace_copy_if(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last,
_ForwardIterator2 __result, _UnaryPredicate __pred, const _Tp& __new_value);
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Tp>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
replace_copy(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __result,
const _Tp& __old_value, const _Tp& __new_value);
// [alg.fill]
template <class _ExecutionPolicy, class _ForwardIterator, class _Tp>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, void>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void>
fill(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
template <class _ExecutionPolicy, class _ForwardIterator, class _Size, class _Tp>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
fill_n(_ExecutionPolicy&& __exec, _ForwardIterator __first, _Size __count, const _Tp& __value);
// [alg.generate]
template <class _ExecutionPolicy, class _ForwardIterator, class _Generator>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, void>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void>
generate(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Generator __g);
template <class _ExecutionPolicy, class _ForwardIterator, class _Size, class _Generator>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
generate_n(_ExecutionPolicy&& __exec, _ForwardIterator __first, _Size count, _Generator __g);
// [alg.remove]
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Predicate>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
remove_copy_if(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last,
_ForwardIterator2 __result, _Predicate __pred);
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Tp>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
remove_copy(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __result,
const _Tp& __value);
template <class _ExecutionPolicy, class _ForwardIterator, class _UnaryPredicate>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
remove_if(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _UnaryPredicate __pred);
template <class _ExecutionPolicy, class _ForwardIterator, class _Tp>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
remove(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
// [alg.unique]
template <class _ExecutionPolicy, class _ForwardIterator, class _BinaryPredicate>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
unique(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __pred);
template <class _ExecutionPolicy, class _ForwardIterator>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
unique(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last);
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
unique_copy(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __result,
_BinaryPredicate __pred);
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
unique_copy(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __result);
// [alg.reverse]
template <class _ExecutionPolicy, class _BidirectionalIterator>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, void>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void>
reverse(_ExecutionPolicy&& __exec, _BidirectionalIterator __first, _BidirectionalIterator __last);
template <class _ExecutionPolicy, class _BidirectionalIterator, class _ForwardIterator>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
reverse_copy(_ExecutionPolicy&& __exec, _BidirectionalIterator __first, _BidirectionalIterator __last,
_ForwardIterator __d_first);
// [alg.rotate]
template <class _ExecutionPolicy, class _ForwardIterator>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
rotate(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last);
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
rotate_copy(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __middle, _ForwardIterator1 __last,
_ForwardIterator2 __result);
// [alg.partitions]
template <class _ExecutionPolicy, class _ForwardIterator, class _UnaryPredicate>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, bool>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, bool>
is_partitioned(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _UnaryPredicate __pred);
template <class _ExecutionPolicy, class _ForwardIterator, class _UnaryPredicate>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
partition(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _UnaryPredicate __pred);
template <class _ExecutionPolicy, class _BidirectionalIterator, class _UnaryPredicate>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _BidirectionalIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _BidirectionalIterator>
stable_partition(_ExecutionPolicy&& __exec, _BidirectionalIterator __first, _BidirectionalIterator __last,
_UnaryPredicate __pred);
template <class _ExecutionPolicy, class _ForwardIterator, class _ForwardIterator1, class _ForwardIterator2,
class _UnaryPredicate>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, std::pair<_ForwardIterator1, _ForwardIterator2>>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, std::pair<_ForwardIterator1, _ForwardIterator2>>
partition_copy(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last,
_ForwardIterator1 __out_true, _ForwardIterator2 __out_false, _UnaryPredicate __pred);
// [alg.sort]
template <class _ExecutionPolicy, class _RandomAccessIterator, class _Compare>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, void>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void>
sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp);
template <class _ExecutionPolicy, class _RandomAccessIterator>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, void>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void>
sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
// [stable.sort]
template <class _ExecutionPolicy, class _RandomAccessIterator, class _Compare>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, void>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void>
stable_sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp);
template <class _ExecutionPolicy, class _RandomAccessIterator>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, void>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void>
stable_sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
// [mismatch]
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, std::pair<_ForwardIterator1, _ForwardIterator2>>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, std::pair<_ForwardIterator1, _ForwardIterator2>>
mismatch(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
_ForwardIterator2 __last2, _BinaryPredicate __pred);
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, std::pair<_ForwardIterator1, _ForwardIterator2>>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, std::pair<_ForwardIterator1, _ForwardIterator2>>
mismatch(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
_BinaryPredicate __pred);
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, std::pair<_ForwardIterator1, _ForwardIterator2>>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, std::pair<_ForwardIterator1, _ForwardIterator2>>
mismatch(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
_ForwardIterator2 __last2);
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, std::pair<_ForwardIterator1, _ForwardIterator2>>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, std::pair<_ForwardIterator1, _ForwardIterator2>>
mismatch(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2);
// [alg.equal]
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, bool>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, bool>
equal(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
_BinaryPredicate __p);
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, bool>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, bool>
equal(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2);
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, bool>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, bool>
equal(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
_ForwardIterator2 __last2, _BinaryPredicate __p);
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, bool>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, bool>
equal(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
_ForwardIterator2 __last2);
// [alg.move]
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
move(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __d_first);
// [partial.sort]
template <class _ExecutionPolicy, class _RandomAccessIterator, class _Compare>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, void>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void>
partial_sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __middle,
_RandomAccessIterator __last, _Compare __comp);
template <class _ExecutionPolicy, class _RandomAccessIterator>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, void>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void>
partial_sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __middle,
_RandomAccessIterator __last);
// [partial.sort.copy]
template <class _ExecutionPolicy, class _ForwardIterator, class _RandomAccessIterator, class _Compare>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _RandomAccessIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _RandomAccessIterator>
partial_sort_copy(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last,
_RandomAccessIterator __d_first, _RandomAccessIterator __d_last, _Compare __comp);
template <class _ExecutionPolicy, class _ForwardIterator, class _RandomAccessIterator>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _RandomAccessIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _RandomAccessIterator>
partial_sort_copy(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last,
_RandomAccessIterator __d_first, _RandomAccessIterator __d_last);
// [is.sorted]
template <class _ExecutionPolicy, class _ForwardIterator, class _Compare>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
is_sorted_until(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Compare __comp);
template <class _ExecutionPolicy, class _ForwardIterator>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
is_sorted_until(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last);
template <class _ExecutionPolicy, class _ForwardIterator, class _Compare>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, bool>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, bool>
is_sorted(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Compare __comp);
template <class _ExecutionPolicy, class _ForwardIterator>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, bool>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, bool>
is_sorted(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last);
// [alg.nth.element]
template <class _ExecutionPolicy, class _RandomAccessIterator, class _Compare>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, void>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void>
nth_element(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __nth,
_RandomAccessIterator __last, _Compare __comp);
template <class _ExecutionPolicy, class _RandomAccessIterator>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, void>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void>
nth_element(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __nth,
_RandomAccessIterator __last);
// [alg.merge]
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _ForwardIterator,
class _Compare>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
merge(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
_ForwardIterator2 __last2, _ForwardIterator __d_first, _Compare __comp);
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _ForwardIterator>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
merge(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
_ForwardIterator2 __last2, _ForwardIterator __d_first);
template <class _ExecutionPolicy, class _BidirectionalIterator, class _Compare>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, void>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void>
inplace_merge(_ExecutionPolicy&& __exec, _BidirectionalIterator __first, _BidirectionalIterator __middle,
_BidirectionalIterator __last, _Compare __comp);
template <class _ExecutionPolicy, class _BidirectionalIterator>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, void>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void>
inplace_merge(_ExecutionPolicy&& __exec, _BidirectionalIterator __first, _BidirectionalIterator __middle,
_BidirectionalIterator __last);
// [includes]
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Compare>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, bool>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, bool>
includes(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
_ForwardIterator2 __last2, _Compare __comp);
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, bool>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, bool>
includes(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
_ForwardIterator2 __last2);
@@ -443,12 +443,12 @@ includes(_ExecutionPolicy&& __exec, _For
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _ForwardIterator,
class _Compare>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
set_union(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
_ForwardIterator2 __last2, _ForwardIterator __result, _Compare __comp);
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _ForwardIterator>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
set_union(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
_ForwardIterator2 __last2, _ForwardIterator __result);
@@ -456,12 +456,12 @@ set_union(_ExecutionPolicy&& __exec, _Fo
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _ForwardIterator,
class _Compare>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
set_intersection(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
_ForwardIterator2 __first2, _ForwardIterator2 __last2, _ForwardIterator __result, _Compare __comp);
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _ForwardIterator>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
set_intersection(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
_ForwardIterator2 __first2, _ForwardIterator2 __last2, _ForwardIterator __result);
@@ -469,12 +469,12 @@ set_intersection(_ExecutionPolicy&& __ex
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _ForwardIterator,
class _Compare>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
set_difference(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
_ForwardIterator2 __first2, _ForwardIterator2 __last2, _ForwardIterator __result, _Compare __comp);
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _ForwardIterator>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
set_difference(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
_ForwardIterator2 __first2, _ForwardIterator2 __last2, _ForwardIterator __result);
@@ -482,68 +482,68 @@ set_difference(_ExecutionPolicy&& __exec
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _ForwardIterator,
class _Compare>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
set_symmetric_difference(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
_ForwardIterator2 __first2, _ForwardIterator2 __last2, _ForwardIterator result,
_Compare __comp);
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _ForwardIterator>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
set_symmetric_difference(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
_ForwardIterator2 __first2, _ForwardIterator2 __last2, _ForwardIterator __result);
// [is.heap]
template <class _ExecutionPolicy, class _RandomAccessIterator, class _Compare>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _RandomAccessIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _RandomAccessIterator>
is_heap_until(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp);
template <class _ExecutionPolicy, class _RandomAccessIterator>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _RandomAccessIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _RandomAccessIterator>
is_heap_until(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
template <class _ExecutionPolicy, class _RandomAccessIterator, class _Compare>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, bool>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, bool>
is_heap(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp);
template <class _ExecutionPolicy, class _RandomAccessIterator>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, bool>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, bool>
is_heap(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
// [alg.min.max]
template <class _ExecutionPolicy, class _ForwardIterator, class _Compare>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
min_element(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Compare __comp);
template <class _ExecutionPolicy, class _ForwardIterator>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
min_element(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last);
template <class _ExecutionPolicy, class _ForwardIterator, class _Compare>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
max_element(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Compare __comp);
template <class _ExecutionPolicy, class _ForwardIterator>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
max_element(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last);
template <class _ExecutionPolicy, class _ForwardIterator, class _Compare>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, std::pair<_ForwardIterator, _ForwardIterator>>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, std::pair<_ForwardIterator, _ForwardIterator>>
minmax_element(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Compare __comp);
template <class _ExecutionPolicy, class _ForwardIterator>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, std::pair<_ForwardIterator, _ForwardIterator>>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, std::pair<_ForwardIterator, _ForwardIterator>>
minmax_element(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last);
// [alg.lex.comparison]
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Compare>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, bool>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, bool>
lexicographical_compare(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
_ForwardIterator2 __first2, _ForwardIterator2 __last2, _Compare __comp);
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, bool>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, bool>
lexicographical_compare(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
_ForwardIterator2 __first2, _ForwardIterator2 __last2);
Modified: pstl/trunk/include/pstl/internal/glue_algorithm_impl.h
URL: http://llvm.org/viewvc/llvm-project/pstl/trunk/include/pstl/internal/glue_algorithm_impl.h?rev=357203&r1=357202&r2=357203&view=diff
==============================================================================
--- pstl/trunk/include/pstl/internal/glue_algorithm_impl.h (original)
+++ pstl/trunk/include/pstl/internal/glue_algorithm_impl.h Thu Mar 28 12:10:32 2019
@@ -23,29 +23,30 @@ namespace std
// [alg.any_of]
template <class _ExecutionPolicy, class _ForwardIterator, class _Predicate>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, bool>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, bool>
any_of(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred)
{
using namespace __pstl;
- return internal::pattern_any_of(std::forward<_ExecutionPolicy>(__exec), __first, __last, __pred,
- internal::is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec),
- internal::is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec));
+ return __internal::__pattern_any_of(
+ std::forward<_ExecutionPolicy>(__exec), __first, __last, __pred,
+ __internal::__is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec),
+ __internal::__is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec));
}
// [alg.all_of]
template <class _ExecutionPolicy, class _ForwardIterator, class _Pred>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, bool>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, bool>
all_of(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Pred __pred)
{
return !std::any_of(std::forward<_ExecutionPolicy>(__exec), __first, __last,
- __pstl::internal::not_pred<_Pred>(__pred));
+ __pstl::__internal::__not_pred<_Pred>(__pred));
}
// [alg.none_of]
template <class _ExecutionPolicy, class _ForwardIterator, class _Predicate>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, bool>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, bool>
none_of(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred)
{
return !std::any_of(std::forward<_ExecutionPolicy>(__exec), __first, __last, __pred);
@@ -54,121 +55,121 @@ none_of(_ExecutionPolicy&& __exec, _Forw
// [alg.foreach]
template <class _ExecutionPolicy, class _ForwardIterator, class _Function>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, void>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void>
for_each(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Function __f)
{
using namespace __pstl;
- internal::pattern_walk1(std::forward<_ExecutionPolicy>(__exec), __first, __last, __f,
- internal::is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec),
- internal::is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec));
+ __internal::__pattern_walk1(std::forward<_ExecutionPolicy>(__exec), __first, __last, __f,
+ __internal::__is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec),
+ __internal::__is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec));
}
template <class _ExecutionPolicy, class _ForwardIterator, class _Size, class _Function>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
for_each_n(_ExecutionPolicy&& __exec, _ForwardIterator __first, _Size __n, _Function __f)
{
using namespace __pstl;
- return internal::pattern_walk1_n(
+ return __internal::__pattern_walk1_n(
std::forward<_ExecutionPolicy>(__exec), __first, __n, __f,
- internal::is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec),
- internal::is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec));
+ __internal::__is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec),
+ __internal::__is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec));
}
// [alg.find]
template <class _ExecutionPolicy, class _ForwardIterator, class _Predicate>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
find_if(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred)
{
using namespace __pstl;
- return internal::pattern_find_if(
+ return __internal::__pattern_find_if(
std::forward<_ExecutionPolicy>(__exec), __first, __last, __pred,
- internal::is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec),
- internal::is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec));
+ __internal::__is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec),
+ __internal::__is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec));
}
template <class _ExecutionPolicy, class _ForwardIterator, class _Predicate>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
find_if_not(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred)
{
return std::find_if(std::forward<_ExecutionPolicy>(__exec), __first, __last,
- __pstl::internal::not_pred<_Predicate>(__pred));
+ __pstl::__internal::__not_pred<_Predicate>(__pred));
}
template <class _ExecutionPolicy, class _ForwardIterator, class _Tp>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
find(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value)
{
return std::find_if(std::forward<_ExecutionPolicy>(__exec), __first, __last,
- __pstl::internal::equal_value<_Tp>(__value));
+ __pstl::__internal::__equal_value<_Tp>(__value));
}
// [alg.find.end]
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator1>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator1>
find_end(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __s_first,
_ForwardIterator2 __s_last, _BinaryPredicate __pred)
{
using namespace __pstl;
- return internal::pattern_find_end(
+ return __internal::__pattern_find_end(
std::forward<_ExecutionPolicy>(__exec), __first, __last, __s_first, __s_last, __pred,
- internal::is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec),
- internal::is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec));
+ __internal::__is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec),
+ __internal::__is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec));
}
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator1>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator1>
find_end(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __s_first,
_ForwardIterator2 __s_last)
{
return std::find_end(std::forward<_ExecutionPolicy>(__exec), __first, __last, __s_first, __s_last,
- __pstl::internal::pstl_equal());
+ __pstl::__internal::__pstl_equal());
}
// [alg.find_first_of]
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator1>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator1>
find_first_of(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last,
_ForwardIterator2 __s_first, _ForwardIterator2 __s_last, _BinaryPredicate __pred)
{
using namespace __pstl;
- return internal::pattern_find_first_of(
+ return __internal::__pattern_find_first_of(
std::forward<_ExecutionPolicy>(__exec), __first, __last, __s_first, __s_last, __pred,
- internal::is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec),
- internal::is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec));
+ __internal::__is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec),
+ __internal::__is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec));
}
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator1>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator1>
find_first_of(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last,
_ForwardIterator2 __s_first, _ForwardIterator2 __s_last)
{
return std::find_first_of(std::forward<_ExecutionPolicy>(__exec), __first, __last, __s_first, __s_last,
- __pstl::internal::pstl_equal());
+ __pstl::__internal::__pstl_equal());
}
// [alg.adjacent_find]
template <class _ExecutionPolicy, class _ForwardIterator>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
adjacent_find(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last)
{
typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType;
using namespace __pstl;
- return internal::pattern_adjacent_find(
+ return __internal::__pattern_adjacent_find(
std::forward<_ExecutionPolicy>(__exec), __first, __last, std::equal_to<_ValueType>(),
- internal::is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec),
- internal::is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec), /*first_semantic*/ false);
+ __internal::__is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec),
+ __internal::__is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec), /*first_semantic*/ false);
}
template <class _ExecutionPolicy, class _ForwardIterator, class _BinaryPredicate>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
adjacent_find(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __pred)
{
using namespace __pstl;
- return internal::pattern_adjacent_find(
+ return __internal::__pattern_adjacent_find(
std::forward<_ExecutionPolicy>(__exec), __first, __last, __pred,
- internal::is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec),
- internal::is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec), /*first_semantic*/ false);
+ __internal::__is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec),
+ __internal::__is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec), /*first_semantic*/ false);
}
// [alg.count]
@@ -177,66 +178,68 @@ adjacent_find(_ExecutionPolicy&& __exec,
// so that we do not have to include <numeric>.
template <class _ExecutionPolicy, class _ForwardIterator, class _Tp>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy,
- typename iterator_traits<_ForwardIterator>::difference_type>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy,
+ typename iterator_traits<_ForwardIterator>::difference_type>
count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value)
{
typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType;
using namespace __pstl;
- return internal::pattern_count(std::forward<_ExecutionPolicy>(__exec), __first, __last,
- [&__value](const _ValueType& __x) { return __value == __x; },
- internal::is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec),
- internal::is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec));
+ return __internal::__pattern_count(
+ std::forward<_ExecutionPolicy>(__exec), __first, __last,
+ [&__value](const _ValueType& __x) { return __value == __x; },
+ __internal::__is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec),
+ __internal::__is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec));
}
template <class _ExecutionPolicy, class _ForwardIterator, class _Predicate>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy,
- typename iterator_traits<_ForwardIterator>::difference_type>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy,
+ typename iterator_traits<_ForwardIterator>::difference_type>
count_if(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred)
{
using namespace __pstl;
- return internal::pattern_count(std::forward<_ExecutionPolicy>(__exec), __first, __last, __pred,
- internal::is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec),
- internal::is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec));
+ return __internal::__pattern_count(
+ std::forward<_ExecutionPolicy>(__exec), __first, __last, __pred,
+ __internal::__is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec),
+ __internal::__is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec));
}
// [alg.search]
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator1>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator1>
search(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __s_first,
_ForwardIterator2 __s_last, _BinaryPredicate __pred)
{
using namespace __pstl;
- return internal::pattern_search(
+ return __internal::__pattern_search(
std::forward<_ExecutionPolicy>(__exec), __first, __last, __s_first, __s_last, __pred,
- internal::is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec),
- internal::is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec));
+ __internal::__is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec),
+ __internal::__is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec));
}
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator1>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator1>
search(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __s_first,
_ForwardIterator2 __s_last)
{
return std::search(std::forward<_ExecutionPolicy>(__exec), __first, __last, __s_first, __s_last,
- __pstl::internal::pstl_equal());
+ __pstl::__internal::__pstl_equal());
}
template <class _ExecutionPolicy, class _ForwardIterator, class _Size, class _Tp, class _BinaryPredicate>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
search_n(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Size __count,
const _Tp& __value, _BinaryPredicate __pred)
{
using namespace __pstl;
- return internal::pattern_search_n(
+ return __internal::__pattern_search_n(
std::forward<_ExecutionPolicy>(__exec), __first, __last, __count, __value, __pred,
- internal::is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec),
- internal::is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec));
+ __internal::__is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec),
+ __internal::__is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec));
}
template <class _ExecutionPolicy, class _ForwardIterator, class _Size, class _Tp>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
search_n(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Size __count,
const _Tp& __value)
{
@@ -247,89 +250,89 @@ search_n(_ExecutionPolicy&& __exec, _For
// [alg.copy]
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
copy(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __result)
{
using namespace __pstl;
const auto __is_vector =
- internal::is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec);
+ __internal::__is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec);
- return internal::pattern_walk2_brick(
+ return __internal::__pattern_walk2_brick(
std::forward<_ExecutionPolicy>(__exec), __first, __last, __result,
[__is_vector](_ForwardIterator1 __begin, _ForwardIterator1 __end, _ForwardIterator2 __res) {
- return internal::brick_copy(__begin, __end, __res, __is_vector);
+ return __internal::__brick_copy(__begin, __end, __res, __is_vector);
},
- internal::is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec));
+ __internal::__is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec));
}
template <class _ExecutionPolicy, class _ForwardIterator1, class _Size, class _ForwardIterator2>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
copy_n(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _Size __n, _ForwardIterator2 __result)
{
using namespace __pstl;
const auto __is_vector =
- internal::is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec);
+ __internal::__is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec);
- return internal::pattern_walk2_brick_n(
+ return __internal::__pattern_walk2_brick_n(
std::forward<_ExecutionPolicy>(__exec), __first, __n, __result,
[__is_vector](_ForwardIterator1 __begin, _Size __sz, _ForwardIterator2 __res) {
- return internal::brick_copy_n(__begin, __sz, __res, __is_vector);
+ return __internal::__brick_copy_n(__begin, __sz, __res, __is_vector);
},
- internal::is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec));
+ __internal::__is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec));
}
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Predicate>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
copy_if(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __result,
_Predicate __pred)
{
using namespace __pstl;
- return internal::pattern_copy_if(
+ return __internal::__pattern_copy_if(
std::forward<_ExecutionPolicy>(__exec), __first, __last, __result, __pred,
- internal::is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec),
- internal::is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec));
+ __internal::__is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec),
+ __internal::__is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec));
}
// [alg.swap]
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
swap_ranges(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
_ForwardIterator2 __first2)
{
using namespace __pstl;
typedef typename iterator_traits<_ForwardIterator1>::reference _ReferenceType1;
typedef typename iterator_traits<_ForwardIterator2>::reference _ReferenceType2;
- return internal::pattern_walk2(
+ return __internal::__pattern_walk2(
std::forward<_ExecutionPolicy>(__exec), __first1, __last1, __first2,
[](_ReferenceType1 __x, _ReferenceType2 __y) {
using std::swap;
swap(__x, __y);
},
- internal::is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec),
- internal::is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec));
+ __internal::__is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec),
+ __internal::__is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec));
}
// [alg.transform]
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _UnaryOperation>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
transform(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __result,
_UnaryOperation __op)
{
typedef typename iterator_traits<_ForwardIterator1>::reference _InputType;
typedef typename iterator_traits<_ForwardIterator2>::reference _OutputType;
using namespace __pstl;
- return internal::pattern_walk2(
+ return __internal::__pattern_walk2(
std::forward<_ExecutionPolicy>(__exec), __first, __last, __result,
[__op](_InputType __x, _OutputType __y) mutable { __y = __op(__x); },
- internal::is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec),
- internal::is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec));
+ __internal::__is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec),
+ __internal::__is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec));
}
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _ForwardIterator,
class _BinaryOperation>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
transform(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
_ForwardIterator __result, _BinaryOperation __op)
{
@@ -337,311 +340,317 @@ transform(_ExecutionPolicy&& __exec, _Fo
typedef typename iterator_traits<_ForwardIterator2>::reference _Input2Type;
typedef typename iterator_traits<_ForwardIterator>::reference _OutputType;
using namespace __pstl;
- return internal::pattern_walk3(
+ return __internal::__pattern_walk3(
std::forward<_ExecutionPolicy>(__exec), __first1, __last1, __first2, __result,
[__op](_Input1Type x, _Input2Type y, _OutputType z) mutable { z = __op(x, y); },
- internal::is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2, _ForwardIterator>(
- __exec),
- internal::is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2,
- _ForwardIterator>(__exec));
+ __internal::__is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2,
+ _ForwardIterator>(__exec),
+ __internal::__is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2,
+ _ForwardIterator>(__exec));
}
// [alg.replace]
template <class _ExecutionPolicy, class _ForwardIterator, class _UnaryPredicate, class _Tp>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, void>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void>
replace_if(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _UnaryPredicate __pred,
const _Tp& __new_value)
{
using namespace __pstl;
typedef typename iterator_traits<_ForwardIterator>::reference _ElementType;
- internal::pattern_walk1(std::forward<_ExecutionPolicy>(__exec), __first, __last,
- [&__pred, &__new_value](_ElementType __elem) {
- if (__pred(__elem))
- {
- __elem = __new_value;
- }
- },
- internal::is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec),
- internal::is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec));
+ __internal::__pattern_walk1(
+ std::forward<_ExecutionPolicy>(__exec), __first, __last,
+ [&__pred, &__new_value](_ElementType __elem) {
+ if (__pred(__elem))
+ {
+ __elem = __new_value;
+ }
+ },
+ __internal::__is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec),
+ __internal::__is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec));
}
template <class _ExecutionPolicy, class _ForwardIterator, class _Tp>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, void>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void>
replace(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __old_value,
const _Tp& __new_value)
{
std::replace_if(std::forward<_ExecutionPolicy>(__exec), __first, __last,
- __pstl::internal::equal_value<_Tp>(__old_value), __new_value);
+ __pstl::__internal::__equal_value<_Tp>(__old_value), __new_value);
}
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _UnaryPredicate, class _Tp>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
replace_copy_if(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last,
_ForwardIterator2 __result, _UnaryPredicate __pred, const _Tp& __new_value)
{
typedef typename iterator_traits<_ForwardIterator1>::reference _InputType;
typedef typename iterator_traits<_ForwardIterator2>::reference _OutputType;
using namespace __pstl;
- return internal::pattern_walk2(
+ return __internal::__pattern_walk2(
std::forward<_ExecutionPolicy>(__exec), __first, __last, __result,
[__pred, &__new_value](_InputType __x, _OutputType __y) mutable { __y = __pred(__x) ? __new_value : __x; },
- internal::is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec),
- internal::is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec));
+ __internal::__is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec),
+ __internal::__is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec));
}
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Tp>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
replace_copy(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __result,
const _Tp& __old_value, const _Tp& __new_value)
{
return std::replace_copy_if(std::forward<_ExecutionPolicy>(__exec), __first, __last, __result,
- __pstl::internal::equal_value<_Tp>(__old_value), __new_value);
+ __pstl::__internal::__equal_value<_Tp>(__old_value), __new_value);
}
// [alg.fill]
template <class _ExecutionPolicy, class _ForwardIterator, class _Tp>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, void>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void>
fill(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value)
{
using namespace __pstl;
- internal::pattern_fill(std::forward<_ExecutionPolicy>(__exec), __first, __last, __value,
- internal::is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec),
- internal::is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec));
+ __internal::__pattern_fill(std::forward<_ExecutionPolicy>(__exec), __first, __last, __value,
+ __internal::__is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec),
+ __internal::__is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec));
}
template <class _ExecutionPolicy, class _ForwardIterator, class _Size, class _Tp>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
fill_n(_ExecutionPolicy&& __exec, _ForwardIterator __first, _Size __count, const _Tp& __value)
{
if (__count <= 0)
return __first;
using namespace __pstl;
- return internal::pattern_fill_n(std::forward<_ExecutionPolicy>(__exec), __first, __count, __value,
- internal::is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec),
- internal::is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec));
+ return __internal::__pattern_fill_n(
+ std::forward<_ExecutionPolicy>(__exec), __first, __count, __value,
+ __internal::__is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec),
+ __internal::__is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec));
}
// [alg.generate]
template <class _ExecutionPolicy, class _ForwardIterator, class _Generator>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, void>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void>
generate(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Generator __g)
{
using namespace __pstl;
- internal::pattern_generate(std::forward<_ExecutionPolicy>(__exec), __first, __last, __g,
- internal::is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec),
- internal::is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec));
+ __internal::__pattern_generate(
+ std::forward<_ExecutionPolicy>(__exec), __first, __last, __g,
+ __internal::__is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec),
+ __internal::__is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec));
}
template <class _ExecutionPolicy, class _ForwardIterator, class _Size, class _Generator>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
generate_n(_ExecutionPolicy&& __exec, _ForwardIterator __first, _Size __count, _Generator __g)
{
if (__count <= 0)
return __first;
using namespace __pstl;
- return internal::pattern_generate_n(
+ return __internal::__pattern_generate_n(
std::forward<_ExecutionPolicy>(__exec), __first, __count, __g,
- internal::is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec),
- internal::is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec));
+ __internal::__is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec),
+ __internal::__is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec));
}
// [alg.remove]
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Predicate>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
remove_copy_if(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last,
_ForwardIterator2 __result, _Predicate __pred)
{
return std::copy_if(std::forward<_ExecutionPolicy>(__exec), __first, __last, __result,
- __pstl::internal::not_pred<_Predicate>(__pred));
+ __pstl::__internal::__not_pred<_Predicate>(__pred));
}
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Tp>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
remove_copy(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __result,
const _Tp& __value)
{
return std::copy_if(std::forward<_ExecutionPolicy>(__exec), __first, __last, __result,
- __pstl::internal::not_equal_value<_Tp>(__value));
+ __pstl::__internal::__not_equal_value<_Tp>(__value));
}
template <class _ExecutionPolicy, class _ForwardIterator, class _UnaryPredicate>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
remove_if(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _UnaryPredicate __pred)
{
using namespace __pstl;
- return internal::pattern_remove_if(
+ return __internal::__pattern_remove_if(
std::forward<_ExecutionPolicy>(__exec), __first, __last, __pred,
- internal::is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec),
- internal::is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec));
+ __internal::__is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec),
+ __internal::__is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec));
}
template <class _ExecutionPolicy, class _ForwardIterator, class _Tp>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
remove(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value)
{
return std::remove_if(std::forward<_ExecutionPolicy>(__exec), __first, __last,
- __pstl::internal::equal_value<_Tp>(__value));
+ __pstl::__internal::__equal_value<_Tp>(__value));
}
// [alg.unique]
template <class _ExecutionPolicy, class _ForwardIterator, class _BinaryPredicate>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
unique(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __pred)
{
using namespace __pstl;
- return internal::pattern_unique(std::forward<_ExecutionPolicy>(__exec), __first, __last, __pred,
- internal::is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec),
- internal::is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec));
+ return __internal::__pattern_unique(
+ std::forward<_ExecutionPolicy>(__exec), __first, __last, __pred,
+ __internal::__is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec),
+ __internal::__is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec));
}
template <class _ExecutionPolicy, class _ForwardIterator>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
unique(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last)
{
- return std::unique(std::forward<_ExecutionPolicy>(__exec), __first, __last, __pstl::internal::pstl_equal());
+ return std::unique(std::forward<_ExecutionPolicy>(__exec), __first, __last, __pstl::__internal::__pstl_equal());
}
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
unique_copy(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __result,
_BinaryPredicate __pred)
{
using namespace __pstl;
- return internal::pattern_unique_copy(
+ return __internal::__pattern_unique_copy(
std::forward<_ExecutionPolicy>(__exec), __first, __last, __result, __pred,
- internal::is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec),
- internal::is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec));
+ __internal::__is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec),
+ __internal::__is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec));
}
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
unique_copy(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __result)
{
- return std::unique_copy(__exec, __first, __last, __result, __pstl::internal::pstl_equal());
+ return std::unique_copy(__exec, __first, __last, __result, __pstl::__internal::__pstl_equal());
}
// [alg.reverse]
template <class _ExecutionPolicy, class _BidirectionalIterator>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, void>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void>
reverse(_ExecutionPolicy&& __exec, _BidirectionalIterator __first, _BidirectionalIterator __last)
{
using namespace __pstl;
- internal::pattern_reverse(std::forward<_ExecutionPolicy>(__exec), __first, __last,
- internal::is_vectorization_preferred<_ExecutionPolicy, _BidirectionalIterator>(__exec),
- internal::is_parallelization_preferred<_ExecutionPolicy, _BidirectionalIterator>(__exec));
+ __internal::__pattern_reverse(
+ std::forward<_ExecutionPolicy>(__exec), __first, __last,
+ __internal::__is_vectorization_preferred<_ExecutionPolicy, _BidirectionalIterator>(__exec),
+ __internal::__is_parallelization_preferred<_ExecutionPolicy, _BidirectionalIterator>(__exec));
}
template <class _ExecutionPolicy, class _BidirectionalIterator, class _ForwardIterator>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
reverse_copy(_ExecutionPolicy&& __exec, _BidirectionalIterator __first, _BidirectionalIterator __last,
_ForwardIterator __d_first)
{
using namespace __pstl;
- return internal::pattern_reverse_copy(
+ return __internal::__pattern_reverse_copy(
std::forward<_ExecutionPolicy>(__exec), __first, __last, __d_first,
- internal::is_vectorization_preferred<_ExecutionPolicy, _BidirectionalIterator, _ForwardIterator>(__exec),
- internal::is_parallelization_preferred<_ExecutionPolicy, _BidirectionalIterator, _ForwardIterator>(__exec));
+ __internal::__is_vectorization_preferred<_ExecutionPolicy, _BidirectionalIterator, _ForwardIterator>(__exec),
+ __internal::__is_parallelization_preferred<_ExecutionPolicy, _BidirectionalIterator, _ForwardIterator>(__exec));
}
// [alg.rotate]
template <class _ExecutionPolicy, class _ForwardIterator>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
rotate(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last)
{
using namespace __pstl;
- return internal::pattern_rotate(std::forward<_ExecutionPolicy>(__exec), __first, __middle, __last,
- internal::is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec),
- internal::is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec));
+ return __internal::__pattern_rotate(
+ std::forward<_ExecutionPolicy>(__exec), __first, __middle, __last,
+ __internal::__is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec),
+ __internal::__is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec));
}
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
rotate_copy(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __middle, _ForwardIterator1 __last,
_ForwardIterator2 __result)
{
using namespace __pstl;
- return internal::pattern_rotate_copy(
+ return __internal::__pattern_rotate_copy(
std::forward<_ExecutionPolicy>(__exec), __first, __middle, __last, __result,
- internal::is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec),
- internal::is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec));
+ __internal::__is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec),
+ __internal::__is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec));
}
// [alg.partitions]
template <class _ExecutionPolicy, class _ForwardIterator, class _UnaryPredicate>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, bool>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, bool>
is_partitioned(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _UnaryPredicate __pred)
{
using namespace __pstl;
- return internal::pattern_is_partitioned(
+ return __internal::__pattern_is_partitioned(
std::forward<_ExecutionPolicy>(__exec), __first, __last, __pred,
- internal::is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec),
- internal::is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec));
+ __internal::__is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec),
+ __internal::__is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec));
}
template <class _ExecutionPolicy, class _ForwardIterator, class _UnaryPredicate>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
partition(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _UnaryPredicate __pred)
{
using namespace __pstl;
- return internal::pattern_partition(
+ return __internal::__pattern_partition(
std::forward<_ExecutionPolicy>(__exec), __first, __last, __pred,
- internal::is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec),
- internal::is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec));
+ __internal::__is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec),
+ __internal::__is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec));
}
template <class _ExecutionPolicy, class _BidirectionalIterator, class _UnaryPredicate>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _BidirectionalIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _BidirectionalIterator>
stable_partition(_ExecutionPolicy&& __exec, _BidirectionalIterator __first, _BidirectionalIterator __last,
_UnaryPredicate __pred)
{
using namespace __pstl;
- return internal::pattern_stable_partition(
+ return __internal::__pattern_stable_partition(
std::forward<_ExecutionPolicy>(__exec), __first, __last, __pred,
- internal::is_vectorization_preferred<_ExecutionPolicy, _BidirectionalIterator>(__exec),
- internal::is_parallelization_preferred<_ExecutionPolicy, _BidirectionalIterator>(__exec));
+ __internal::__is_vectorization_preferred<_ExecutionPolicy, _BidirectionalIterator>(__exec),
+ __internal::__is_parallelization_preferred<_ExecutionPolicy, _BidirectionalIterator>(__exec));
}
template <class _ExecutionPolicy, class _ForwardIterator, class _ForwardIterator1, class _ForwardIterator2,
class _UnaryPredicate>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, std::pair<_ForwardIterator1, _ForwardIterator2>>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, std::pair<_ForwardIterator1, _ForwardIterator2>>
partition_copy(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last,
_ForwardIterator1 __out_true, _ForwardIterator2 __out_false, _UnaryPredicate __pred)
{
using namespace __pstl;
- return internal::pattern_partition_copy(
+ return __internal::__pattern_partition_copy(
std::forward<_ExecutionPolicy>(__exec), __first, __last, __out_true, __out_false, __pred,
- internal::is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator, _ForwardIterator1, _ForwardIterator2>(
- __exec),
- internal::is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator, _ForwardIterator1,
- _ForwardIterator2>(__exec));
+ __internal::__is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator, _ForwardIterator1,
+ _ForwardIterator2>(__exec),
+ __internal::__is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator, _ForwardIterator1,
+ _ForwardIterator2>(__exec));
}
// [alg.sort]
template <class _ExecutionPolicy, class _RandomAccessIterator, class _Compare>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, void>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void>
sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
{
typedef typename iterator_traits<_RandomAccessIterator>::value_type _InputType;
using namespace __pstl;
- return internal::pattern_sort(
+ return __internal::__pattern_sort(
std::forward<_ExecutionPolicy>(__exec), __first, __last, __comp,
- internal::is_vectorization_preferred<_ExecutionPolicy, _RandomAccessIterator>(__exec),
- internal::is_parallelization_preferred<_ExecutionPolicy, _RandomAccessIterator>(__exec),
+ __internal::__is_vectorization_preferred<_ExecutionPolicy, _RandomAccessIterator>(__exec),
+ __internal::__is_parallelization_preferred<_ExecutionPolicy, _RandomAccessIterator>(__exec),
typename std::is_move_constructible<_InputType>::type());
}
template <class _ExecutionPolicy, class _RandomAccessIterator>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, void>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void>
sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last)
{
typedef typename std::iterator_traits<_RandomAccessIterator>::value_type _InputType;
@@ -651,18 +660,18 @@ sort(_ExecutionPolicy&& __exec, _RandomA
// [stable.sort]
template <class _ExecutionPolicy, class _RandomAccessIterator, class _Compare>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, void>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void>
stable_sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
{
using namespace __pstl;
- return internal::pattern_stable_sort(
+ return __internal::__pattern_stable_sort(
std::forward<_ExecutionPolicy>(__exec), __first, __last, __comp,
- internal::is_vectorization_preferred<_ExecutionPolicy, _RandomAccessIterator>(__exec),
- internal::is_parallelization_preferred<_ExecutionPolicy, _RandomAccessIterator>(__exec));
+ __internal::__is_vectorization_preferred<_ExecutionPolicy, _RandomAccessIterator>(__exec),
+ __internal::__is_parallelization_preferred<_ExecutionPolicy, _RandomAccessIterator>(__exec));
}
template <class _ExecutionPolicy, class _RandomAccessIterator>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, void>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void>
stable_sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last)
{
typedef typename std::iterator_traits<_RandomAccessIterator>::value_type _InputType;
@@ -672,19 +681,19 @@ stable_sort(_ExecutionPolicy&& __exec, _
// [mismatch]
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, std::pair<_ForwardIterator1, _ForwardIterator2>>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, std::pair<_ForwardIterator1, _ForwardIterator2>>
mismatch(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
_ForwardIterator2 __last2, _BinaryPredicate __pred)
{
using namespace __pstl;
- return internal::pattern_mismatch(
+ return __internal::__pattern_mismatch(
std::forward<_ExecutionPolicy>(__exec), __first1, __last1, __first2, __last2, __pred,
- internal::is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec),
- internal::is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec));
+ __internal::__is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec),
+ __internal::__is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec));
}
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, std::pair<_ForwardIterator1, _ForwardIterator2>>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, std::pair<_ForwardIterator1, _ForwardIterator2>>
mismatch(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
_BinaryPredicate __pred)
{
@@ -693,16 +702,16 @@ mismatch(_ExecutionPolicy&& __exec, _For
}
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, std::pair<_ForwardIterator1, _ForwardIterator2>>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, std::pair<_ForwardIterator1, _ForwardIterator2>>
mismatch(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
_ForwardIterator2 __last2)
{
return std::mismatch(std::forward<_ExecutionPolicy>(__exec), __first1, __last1, __first2, __last2,
- __pstl::internal::pstl_equal());
+ __pstl::__internal::__pstl_equal());
}
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, std::pair<_ForwardIterator1, _ForwardIterator2>>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, std::pair<_ForwardIterator1, _ForwardIterator2>>
mismatch(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2)
{
//TODO: to get rid of "distance"
@@ -713,26 +722,27 @@ mismatch(_ExecutionPolicy&& __exec, _For
// [alg.equal]
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, bool>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, bool>
equal(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
_BinaryPredicate __p)
{
using namespace __pstl;
- return internal::pattern_equal(std::forward<_ExecutionPolicy>(__exec), __first1, __last1, __first2, __p,
- internal::is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator1>(__exec),
- internal::is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator1>(__exec));
+ return __internal::__pattern_equal(
+ std::forward<_ExecutionPolicy>(__exec), __first1, __last1, __first2, __p,
+ __internal::__is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator1>(__exec),
+ __internal::__is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator1>(__exec));
}
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, bool>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, bool>
equal(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2)
{
return std::equal(std::forward<_ExecutionPolicy>(__exec), __first1, __last1, __first2,
- __pstl::internal::pstl_equal());
+ __pstl::__internal::__pstl_equal());
}
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, bool>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, bool>
equal(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
_ForwardIterator2 __last2, _BinaryPredicate __p)
{
@@ -743,46 +753,47 @@ equal(_ExecutionPolicy&& __exec, _Forwar
}
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, bool>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, bool>
equal(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
_ForwardIterator2 __last2)
{
- return equal(std::forward<_ExecutionPolicy>(__exec), __first1, __last1, __first2, __last2, __pstl::internal::pstl_equal());
+ return equal(std::forward<_ExecutionPolicy>(__exec), __first1, __last1, __first2, __last2,
+ __pstl::__internal::__pstl_equal());
}
// [alg.move]
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
move(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __d_first)
{
using namespace __pstl;
const auto __is_vector =
- internal::is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec);
+ __internal::__is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec);
- return internal::pattern_walk2_brick(
+ return __internal::__pattern_walk2_brick(
std::forward<_ExecutionPolicy>(__exec), __first, __last, __d_first,
[__is_vector](_ForwardIterator1 __begin, _ForwardIterator1 __end, _ForwardIterator2 __res) {
- return internal::brick_move(__begin, __end, __res, __is_vector);
+ return __internal::__brick_move(__begin, __end, __res, __is_vector);
},
- internal::is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec));
+ __internal::__is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec));
}
// [partial.sort]
template <class _ExecutionPolicy, class _RandomAccessIterator, class _Compare>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, void>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void>
partial_sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __middle,
_RandomAccessIterator __last, _Compare __comp)
{
using namespace __pstl;
- internal::pattern_partial_sort(
+ __internal::__pattern_partial_sort(
std::forward<_ExecutionPolicy>(__exec), __first, __middle, __last, __comp,
- internal::is_vectorization_preferred<_ExecutionPolicy, _RandomAccessIterator>(__exec),
- internal::is_parallelization_preferred<_ExecutionPolicy, _RandomAccessIterator>(__exec));
+ __internal::__is_vectorization_preferred<_ExecutionPolicy, _RandomAccessIterator>(__exec),
+ __internal::__is_parallelization_preferred<_ExecutionPolicy, _RandomAccessIterator>(__exec));
}
template <class _ExecutionPolicy, class _RandomAccessIterator>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, void>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void>
partial_sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __middle,
_RandomAccessIterator __last)
{
@@ -793,41 +804,41 @@ partial_sort(_ExecutionPolicy&& __exec,
// [partial.sort.copy]
template <class _ExecutionPolicy, class _ForwardIterator, class _RandomAccessIterator, class _Compare>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _RandomAccessIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _RandomAccessIterator>
partial_sort_copy(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last,
_RandomAccessIterator __d_first, _RandomAccessIterator __d_last, _Compare __comp)
{
using namespace __pstl;
- return internal::pattern_partial_sort_copy(
+ return __internal::__pattern_partial_sort_copy(
std::forward<_ExecutionPolicy>(__exec), __first, __last, __d_first, __d_last, __comp,
- internal::is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator, _RandomAccessIterator>(__exec),
- internal::is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator, _RandomAccessIterator>(__exec));
+ __internal::__is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator, _RandomAccessIterator>(__exec),
+ __internal::__is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator, _RandomAccessIterator>(__exec));
}
template <class _ExecutionPolicy, class _ForwardIterator, class _RandomAccessIterator>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _RandomAccessIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _RandomAccessIterator>
partial_sort_copy(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last,
_RandomAccessIterator __d_first, _RandomAccessIterator __d_last)
{
return std::partial_sort_copy(std::forward<_ExecutionPolicy>(__exec), __first, __last, __d_first, __d_last,
- __pstl::internal::pstl_less());
+ __pstl::__internal::__pstl_less());
}
// [is.sorted]
template <class _ExecutionPolicy, class _ForwardIterator, class _Compare>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
is_sorted_until(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Compare __comp)
{
using namespace __pstl;
- const _ForwardIterator __res = internal::pattern_adjacent_find(
- std::forward<_ExecutionPolicy>(__exec), __first, __last, __pstl::internal::reorder_pred<_Compare>(__comp),
- internal::is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec),
- internal::is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec), /*first_semantic*/ false);
+ const _ForwardIterator __res = __internal::__pattern_adjacent_find(
+ std::forward<_ExecutionPolicy>(__exec), __first, __last, __pstl::__internal::__reorder_pred<_Compare>(__comp),
+ __internal::__is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec),
+ __internal::__is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec), /*first_semantic*/ false);
return __res == __last ? __last : std::next(__res);
}
template <class _ExecutionPolicy, class _ForwardIterator>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
is_sorted_until(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last)
{
typedef typename std::iterator_traits<_ForwardIterator>::value_type _InputType;
@@ -835,19 +846,19 @@ is_sorted_until(_ExecutionPolicy&& __exe
}
template <class _ExecutionPolicy, class _ForwardIterator, class _Compare>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, bool>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, bool>
is_sorted(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Compare __comp)
{
using namespace __pstl;
- return internal::pattern_adjacent_find(
- std::forward<_ExecutionPolicy>(__exec), __first, __last, internal::reorder_pred<_Compare>(__comp),
- internal::is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec),
- internal::is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec),
+ return __internal::__pattern_adjacent_find(
+ std::forward<_ExecutionPolicy>(__exec), __first, __last, __internal::__reorder_pred<_Compare>(__comp),
+ __internal::__is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec),
+ __internal::__is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec),
/*or_semantic*/ true) == __last;
}
template <class _ExecutionPolicy, class _ForwardIterator>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, bool>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, bool>
is_sorted(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last)
{
typedef typename std::iterator_traits<_ForwardIterator>::value_type _InputType;
@@ -857,42 +868,42 @@ is_sorted(_ExecutionPolicy&& __exec, _Fo
// [alg.merge]
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _ForwardIterator,
class _Compare>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
merge(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
_ForwardIterator2 __last2, _ForwardIterator __d_first, _Compare __comp)
{
using namespace __pstl;
- return internal::pattern_merge(
+ return __internal::__pattern_merge(
std::forward<_ExecutionPolicy>(__exec), __first1, __last1, __first2, __last2, __d_first, __comp,
- internal::is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2, _ForwardIterator>(
- __exec),
- internal::is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2,
- _ForwardIterator>(__exec));
+ __internal::__is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2,
+ _ForwardIterator>(__exec),
+ __internal::__is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2,
+ _ForwardIterator>(__exec));
}
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _ForwardIterator>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
merge(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
_ForwardIterator2 __last2, _ForwardIterator __d_first)
{
return std::merge(std::forward<_ExecutionPolicy>(__exec), __first1, __last1, __first2, __last2, __d_first,
- __pstl::internal::pstl_less());
+ __pstl::__internal::__pstl_less());
}
template <class _ExecutionPolicy, class _BidirectionalIterator, class _Compare>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, void>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void>
inplace_merge(_ExecutionPolicy&& __exec, _BidirectionalIterator __first, _BidirectionalIterator __middle,
_BidirectionalIterator __last, _Compare __comp)
{
using namespace __pstl;
- internal::pattern_inplace_merge(
+ __internal::__pattern_inplace_merge(
std::forward<_ExecutionPolicy>(__exec), __first, __middle, __last, __comp,
- internal::is_vectorization_preferred<_ExecutionPolicy, _BidirectionalIterator>(__exec),
- internal::is_parallelization_preferred<_ExecutionPolicy, _BidirectionalIterator>(__exec));
+ __internal::__is_vectorization_preferred<_ExecutionPolicy, _BidirectionalIterator>(__exec),
+ __internal::__is_parallelization_preferred<_ExecutionPolicy, _BidirectionalIterator>(__exec));
}
template <class _ExecutionPolicy, class _BidirectionalIterator>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, void>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void>
inplace_merge(_ExecutionPolicy&& __exec, _BidirectionalIterator __first, _BidirectionalIterator __middle,
_BidirectionalIterator __last)
{
@@ -903,145 +914,145 @@ inplace_merge(_ExecutionPolicy&& __exec,
// [includes]
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Compare>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, bool>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, bool>
includes(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
_ForwardIterator2 __last2, _Compare __comp)
{
using namespace __pstl;
- return internal::pattern_includes(
+ return __internal::__pattern_includes(
std::forward<_ExecutionPolicy>(__exec), __first1, __last1, __first2, __last2, __comp,
- internal::is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec),
- internal::is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec));
+ __internal::__is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec),
+ __internal::__is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec));
}
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, bool>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, bool>
includes(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
_ForwardIterator2 __last2)
{
return std::includes(std::forward<_ExecutionPolicy>(__exec), __first1, __last1, __first2, __last2,
- __pstl::internal::pstl_less());
+ __pstl::__internal::__pstl_less());
}
// [set.union]
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _ForwardIterator,
class _Compare>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
set_union(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
_ForwardIterator2 __last2, _ForwardIterator __result, _Compare __comp)
{
using namespace __pstl;
- return internal::pattern_set_union(
+ return __internal::__pattern_set_union(
std::forward<_ExecutionPolicy>(__exec), __first1, __last1, __first2, __last2, __result, __comp,
- internal::is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2, _ForwardIterator>(
- __exec),
- internal::is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2,
- _ForwardIterator>(__exec));
+ __internal::__is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2,
+ _ForwardIterator>(__exec),
+ __internal::__is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2,
+ _ForwardIterator>(__exec));
}
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _ForwardIterator>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
set_union(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
_ForwardIterator2 __last2, _ForwardIterator __result)
{
return std::set_union(std::forward<_ExecutionPolicy>(__exec), __first1, __last1, __first2, __last2, __result,
- __pstl::internal::pstl_less());
+ __pstl::__internal::__pstl_less());
}
// [set.intersection]
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _ForwardIterator,
class _Compare>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
set_intersection(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
_ForwardIterator2 __first2, _ForwardIterator2 __last2, _ForwardIterator __result, _Compare __comp)
{
using namespace __pstl;
- return internal::pattern_set_intersection(
+ return __internal::__pattern_set_intersection(
std::forward<_ExecutionPolicy>(__exec), __first1, __last1, __first2, __last2, __result, __comp,
- internal::is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2, _ForwardIterator>(
- __exec),
- internal::is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2,
- _ForwardIterator>(__exec));
+ __internal::__is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2,
+ _ForwardIterator>(__exec),
+ __internal::__is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2,
+ _ForwardIterator>(__exec));
}
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _ForwardIterator>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
set_intersection(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
_ForwardIterator2 __first2, _ForwardIterator2 __last2, _ForwardIterator __result)
{
return std::set_intersection(std::forward<_ExecutionPolicy>(__exec), __first1, __last1, __first2, __last2, __result,
- __pstl::internal::pstl_less());
+ __pstl::__internal::__pstl_less());
}
// [set.difference]
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _ForwardIterator,
class _Compare>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
set_difference(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
_ForwardIterator2 __first2, _ForwardIterator2 __last2, _ForwardIterator __result, _Compare __comp)
{
using namespace __pstl;
- return internal::pattern_set_difference(
+ return __internal::__pattern_set_difference(
std::forward<_ExecutionPolicy>(__exec), __first1, __last1, __first2, __last2, __result, __comp,
- internal::is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2, _ForwardIterator>(
- __exec),
- internal::is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2,
- _ForwardIterator>(__exec));
+ __internal::__is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2,
+ _ForwardIterator>(__exec),
+ __internal::__is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2,
+ _ForwardIterator>(__exec));
}
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _ForwardIterator>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
set_difference(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
_ForwardIterator2 __first2, _ForwardIterator2 __last2, _ForwardIterator __result)
{
return std::set_difference(std::forward<_ExecutionPolicy>(__exec), __first1, __last1, __first2, __last2, __result,
- __pstl::internal::pstl_less());
+ __pstl::__internal::__pstl_less());
}
// [set.symmetric.difference]
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _ForwardIterator,
class _Compare>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
set_symmetric_difference(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
_ForwardIterator2 __first2, _ForwardIterator2 __last2, _ForwardIterator __result,
_Compare __comp)
{
using namespace __pstl;
- return internal::pattern_set_symmetric_difference(
+ return __internal::__pattern_set_symmetric_difference(
std::forward<_ExecutionPolicy>(__exec), __first1, __last1, __first2, __last2, __result, __comp,
- internal::is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2, _ForwardIterator>(
- __exec),
- internal::is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2,
- _ForwardIterator>(__exec));
+ __internal::__is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2,
+ _ForwardIterator>(__exec),
+ __internal::__is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2,
+ _ForwardIterator>(__exec));
}
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _ForwardIterator>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
set_symmetric_difference(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
_ForwardIterator2 __first2, _ForwardIterator2 __last2, _ForwardIterator __result)
{
return std::set_symmetric_difference(std::forward<_ExecutionPolicy>(__exec), __first1, __last1, __first2, __last2,
- __result, __pstl::internal::pstl_less());
+ __result, __pstl::__internal::__pstl_less());
}
// [is.heap]
template <class _ExecutionPolicy, class _RandomAccessIterator, class _Compare>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _RandomAccessIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _RandomAccessIterator>
is_heap_until(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
{
using namespace __pstl;
- return internal::pattern_is_heap_until(
+ return __internal::__pattern_is_heap_until(
std::forward<_ExecutionPolicy>(__exec), __first, __last, __comp,
- internal::is_vectorization_preferred<_ExecutionPolicy, _RandomAccessIterator>(__exec),
- internal::is_parallelization_preferred<_ExecutionPolicy, _RandomAccessIterator>(__exec));
+ __internal::__is_vectorization_preferred<_ExecutionPolicy, _RandomAccessIterator>(__exec),
+ __internal::__is_parallelization_preferred<_ExecutionPolicy, _RandomAccessIterator>(__exec));
}
template <class _ExecutionPolicy, class _RandomAccessIterator>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _RandomAccessIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _RandomAccessIterator>
is_heap_until(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last)
{
typedef typename std::iterator_traits<_RandomAccessIterator>::value_type _InputType;
@@ -1049,14 +1060,14 @@ is_heap_until(_ExecutionPolicy&& __exec,
}
template <class _ExecutionPolicy, class _RandomAccessIterator, class _Compare>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, bool>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, bool>
is_heap(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
{
return std::is_heap_until(std::forward<_ExecutionPolicy>(__exec), __first, __last, __comp) == __last;
}
template <class _ExecutionPolicy, class _RandomAccessIterator>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, bool>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, bool>
is_heap(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last)
{
typedef typename std::iterator_traits<_RandomAccessIterator>::value_type _InputType;
@@ -1066,18 +1077,18 @@ is_heap(_ExecutionPolicy&& __exec, _Rand
// [alg.min.max]
template <class _ExecutionPolicy, class _ForwardIterator, class _Compare>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
min_element(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Compare __comp)
{
using namespace __pstl;
- return internal::pattern_min_element(
+ return __internal::__pattern_min_element(
std::forward<_ExecutionPolicy>(__exec), __first, __last, __comp,
- internal::is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec),
- internal::is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec));
+ __internal::__is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec),
+ __internal::__is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec));
}
template <class _ExecutionPolicy, class _ForwardIterator>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
min_element(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last)
{
typedef typename std::iterator_traits<_ForwardIterator>::value_type _InputType;
@@ -1085,35 +1096,35 @@ min_element(_ExecutionPolicy&& __exec, _
}
template <class _ExecutionPolicy, class _ForwardIterator, class _Compare>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
max_element(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Compare __comp)
{
return min_element(std::forward<_ExecutionPolicy>(__exec), __first, __last,
- __pstl::internal::reorder_pred<_Compare>(__comp));
+ __pstl::__internal::__reorder_pred<_Compare>(__comp));
}
template <class _ExecutionPolicy, class _ForwardIterator>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
max_element(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last)
{
typedef typename std::iterator_traits<_ForwardIterator>::value_type _InputType;
return std::min_element(std::forward<_ExecutionPolicy>(__exec), __first, __last,
- __pstl::internal::reorder_pred<std::less<_InputType>>(std::less<_InputType>()));
+ __pstl::__internal::__reorder_pred<std::less<_InputType>>(std::less<_InputType>()));
}
template <class _ExecutionPolicy, class _ForwardIterator, class _Compare>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, std::pair<_ForwardIterator, _ForwardIterator>>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, std::pair<_ForwardIterator, _ForwardIterator>>
minmax_element(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Compare __comp)
{
using namespace __pstl;
- return internal::pattern_minmax_element(
+ return __internal::__pattern_minmax_element(
std::forward<_ExecutionPolicy>(__exec), __first, __last, __comp,
- internal::is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec),
- internal::is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec));
+ __internal::__is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec),
+ __internal::__is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec));
}
template <class _ExecutionPolicy, class _ForwardIterator>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, std::pair<_ForwardIterator, _ForwardIterator>>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, std::pair<_ForwardIterator, _ForwardIterator>>
minmax_element(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last)
{
typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType;
@@ -1123,19 +1134,19 @@ minmax_element(_ExecutionPolicy&& __exec
// [alg.nth.element]
template <class _ExecutionPolicy, class _RandomAccessIterator, class _Compare>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, void>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void>
nth_element(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __nth,
_RandomAccessIterator __last, _Compare __comp)
{
using namespace __pstl;
- internal::pattern_nth_element(
+ __internal::__pattern_nth_element(
std::forward<_ExecutionPolicy>(__exec), __first, __nth, __last, __comp,
- internal::is_vectorization_preferred<_ExecutionPolicy, _RandomAccessIterator>(__exec),
- internal::is_parallelization_preferred<_ExecutionPolicy, _RandomAccessIterator>(__exec));
+ __internal::__is_vectorization_preferred<_ExecutionPolicy, _RandomAccessIterator>(__exec),
+ __internal::__is_parallelization_preferred<_ExecutionPolicy, _RandomAccessIterator>(__exec));
}
template <class _ExecutionPolicy, class _RandomAccessIterator>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, void>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void>
nth_element(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __nth,
_RandomAccessIterator __last)
{
@@ -1146,24 +1157,24 @@ nth_element(_ExecutionPolicy&& __exec, _
// [alg.lex.comparison]
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Compare>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, bool>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, bool>
lexicographical_compare(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
_ForwardIterator2 __first2, _ForwardIterator2 __last2, _Compare __comp)
{
using namespace __pstl;
- return internal::pattern_lexicographical_compare(
+ return __internal::__pattern_lexicographical_compare(
std::forward<_ExecutionPolicy>(__exec), __first1, __last1, __first2, __last2, __comp,
- internal::is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec),
- internal::is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec));
+ __internal::__is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec),
+ __internal::__is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec));
}
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, bool>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, bool>
lexicographical_compare(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
_ForwardIterator2 __first2, _ForwardIterator2 __last2)
{
return std::lexicographical_compare(std::forward<_ExecutionPolicy>(__exec), __first1, __last1, __first2, __last2,
- __pstl::internal::pstl_less());
+ __pstl::__internal::__pstl_less());
}
} // namespace std
Modified: pstl/trunk/include/pstl/internal/glue_memory_defs.h
URL: http://llvm.org/viewvc/llvm-project/pstl/trunk/include/pstl/internal/glue_memory_defs.h?rev=357203&r1=357202&r2=357203&view=diff
==============================================================================
--- pstl/trunk/include/pstl/internal/glue_memory_defs.h (original)
+++ pstl/trunk/include/pstl/internal/glue_memory_defs.h Thu Mar 28 12:10:32 2019
@@ -18,61 +18,61 @@ namespace std
// [uninitialized.copy]
template <class _ExecutionPolicy, class _InputIterator, class _ForwardIterator>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
uninitialized_copy(_ExecutionPolicy&& __exec, _InputIterator __first, _InputIterator __last, _ForwardIterator __result);
template <class _ExecutionPolicy, class _InputIterator, class _Size, class _ForwardIterator>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
uninitialized_copy_n(_ExecutionPolicy&& __exec, _InputIterator __first, _Size __n, _ForwardIterator __result);
// [uninitialized.move]
template <class _ExecutionPolicy, class _InputIterator, class _ForwardIterator>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
uninitialized_move(_ExecutionPolicy&& __exec, _InputIterator __first, _InputIterator __last, _ForwardIterator __result);
template <class _ExecutionPolicy, class _InputIterator, class _Size, class _ForwardIterator>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
uninitialized_move_n(_ExecutionPolicy&& __exec, _InputIterator __first, _Size __n, _ForwardIterator __result);
// [uninitialized.fill]
template <class _ExecutionPolicy, class _ForwardIterator, class _Tp>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, void>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void>
uninitialized_fill(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
template <class _ExecutionPolicy, class _ForwardIterator, class _Size, class _Tp>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
uninitialized_fill_n(_ExecutionPolicy&& __exec, _ForwardIterator __first, _Size __n, const _Tp& __value);
// [specialized.destroy]
template <class _ExecutionPolicy, class _ForwardIterator>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, void>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void>
destroy(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last);
template <class _ExecutionPolicy, class _ForwardIterator, class _Size>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
destroy_n(_ExecutionPolicy&& __exec, _ForwardIterator __first, _Size __n);
// [uninitialized.construct.default]
template <class _ExecutionPolicy, class _ForwardIterator>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, void>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void>
uninitialized_default_construct(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last);
template <class _ExecutionPolicy, class _ForwardIterator, class _Size>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
uninitialized_default_construct_n(_ExecutionPolicy&& __exec, _ForwardIterator __first, _Size __n);
// [uninitialized.construct.value]
template <class _ExecutionPolicy, class _ForwardIterator>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, void>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void>
uninitialized_value_construct(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last);
template <class _ExecutionPolicy, class _ForwardIterator, class _Size>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
uninitialized_value_construct_n(_ExecutionPolicy&& __exec, _ForwardIterator __first, _Size __n);
} // namespace std
Modified: pstl/trunk/include/pstl/internal/glue_memory_impl.h
URL: http://llvm.org/viewvc/llvm-project/pstl/trunk/include/pstl/internal/glue_memory_impl.h?rev=357203&r1=357202&r2=357203&view=diff
==============================================================================
--- pstl/trunk/include/pstl/internal/glue_memory_impl.h (original)
+++ pstl/trunk/include/pstl/internal/glue_memory_impl.h Thu Mar 28 12:10:32 2019
@@ -19,7 +19,7 @@ namespace std
// [uninitialized.copy]
template <class _ExecutionPolicy, class _InputIterator, class _ForwardIterator>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
uninitialized_copy(_ExecutionPolicy&& __exec, _InputIterator __first, _InputIterator __last, _ForwardIterator __result)
{
typedef typename iterator_traits<_InputIterator>::value_type _ValueType1;
@@ -29,31 +29,32 @@ uninitialized_copy(_ExecutionPolicy&& __
using namespace __pstl;
const auto __is_parallel =
- internal::is_parallelization_preferred<_ExecutionPolicy, _InputIterator, _ForwardIterator>(__exec);
+ __internal::__is_parallelization_preferred<_ExecutionPolicy, _InputIterator, _ForwardIterator>(__exec);
const auto __is_vector =
- internal::is_vectorization_preferred<_ExecutionPolicy, _InputIterator, _ForwardIterator>(__exec);
+ __internal::__is_vectorization_preferred<_ExecutionPolicy, _InputIterator, _ForwardIterator>(__exec);
- return internal::invoke_if_else(
+ return __internal::__invoke_if_else(
std::integral_constant < bool, std::is_trivial<_ValueType1>::value&& std::is_trivial<_ValueType2>::value > (),
[&]() {
- return internal::pattern_walk2_brick(
+ return __internal::__pattern_walk2_brick(
std::forward<_ExecutionPolicy>(__exec), __first, __last, __result,
[__is_vector](_InputIterator __begin, _InputIterator __end, _ForwardIterator __res) {
- return internal::brick_copy(__begin, __end, __res, __is_vector);
+ return __internal::__brick_copy(__begin, __end, __res, __is_vector);
},
__is_parallel);
},
[&]() {
- return internal::pattern_walk2(std::forward<_ExecutionPolicy>(__exec), __first, __last, __result,
- [](_ReferenceType1 __val1, _ReferenceType2 __val2) {
- ::new (std::addressof(__val2)) _ValueType2(__val1);
- },
- __is_vector, __is_parallel);
+ return __internal::__pattern_walk2(
+ std::forward<_ExecutionPolicy>(__exec), __first, __last, __result,
+ [](_ReferenceType1 __val1, _ReferenceType2 __val2) {
+ ::new (std::addressof(__val2)) _ValueType2(__val1);
+ },
+ __is_vector, __is_parallel);
});
}
template <class _ExecutionPolicy, class _InputIterator, class _Size, class _ForwardIterator>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
uninitialized_copy_n(_ExecutionPolicy&& __exec, _InputIterator __first, _Size __n, _ForwardIterator __result)
{
typedef typename iterator_traits<_InputIterator>::value_type _ValueType1;
@@ -63,33 +64,34 @@ uninitialized_copy_n(_ExecutionPolicy&&
using namespace __pstl;
const auto __is_parallel =
- internal::is_parallelization_preferred<_ExecutionPolicy, _InputIterator, _ForwardIterator>(__exec);
+ __internal::__is_parallelization_preferred<_ExecutionPolicy, _InputIterator, _ForwardIterator>(__exec);
const auto __is_vector =
- internal::is_vectorization_preferred<_ExecutionPolicy, _InputIterator, _ForwardIterator>(__exec);
+ __internal::__is_vectorization_preferred<_ExecutionPolicy, _InputIterator, _ForwardIterator>(__exec);
- return internal::invoke_if_else(
+ return __internal::__invoke_if_else(
std::integral_constant < bool, std::is_trivial<_ValueType1>::value&& std::is_trivial<_ValueType2>::value > (),
[&]() {
- return internal::pattern_walk2_brick_n(
+ return __internal::__pattern_walk2_brick_n(
std::forward<_ExecutionPolicy>(__exec), __first, __n, __result,
[__is_vector](_InputIterator __begin, _Size __sz, _ForwardIterator __res) {
- return internal::brick_copy_n(__begin, __sz, __res, __is_vector);
+ return __internal::__brick_copy_n(__begin, __sz, __res, __is_vector);
},
__is_parallel);
},
[&]() {
- return internal::pattern_walk2_n(std::forward<_ExecutionPolicy>(__exec), __first, __n, __result,
- [](_ReferenceType1 __val1, _ReferenceType2 __val2) {
- ::new (std::addressof(__val2)) _ValueType2(__val1);
- },
- __is_vector, __is_parallel);
+ return __internal::__pattern_walk2_n(
+ std::forward<_ExecutionPolicy>(__exec), __first, __n, __result,
+ [](_ReferenceType1 __val1, _ReferenceType2 __val2) {
+ ::new (std::addressof(__val2)) _ValueType2(__val1);
+ },
+ __is_vector, __is_parallel);
});
}
// [uninitialized.move]
template <class _ExecutionPolicy, class _InputIterator, class _ForwardIterator>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
uninitialized_move(_ExecutionPolicy&& __exec, _InputIterator __first, _InputIterator __last, _ForwardIterator __result)
{
typedef typename iterator_traits<_InputIterator>::value_type _ValueType1;
@@ -99,31 +101,32 @@ uninitialized_move(_ExecutionPolicy&& __
using namespace __pstl;
const auto __is_parallel =
- internal::is_parallelization_preferred<_ExecutionPolicy, _InputIterator, _ForwardIterator>(__exec);
+ __internal::__is_parallelization_preferred<_ExecutionPolicy, _InputIterator, _ForwardIterator>(__exec);
const auto __is_vector =
- internal::is_vectorization_preferred<_ExecutionPolicy, _InputIterator, _ForwardIterator>(__exec);
+ __internal::__is_vectorization_preferred<_ExecutionPolicy, _InputIterator, _ForwardIterator>(__exec);
- return internal::invoke_if_else(
+ return __internal::__invoke_if_else(
std::integral_constant < bool, std::is_trivial<_ValueType1>::value&& std::is_trivial<_ValueType2>::value > (),
[&]() {
- return internal::pattern_walk2_brick(
+ return __internal::__pattern_walk2_brick(
std::forward<_ExecutionPolicy>(__exec), __first, __last, __result,
[__is_vector](_InputIterator __begin, _InputIterator __end, _ForwardIterator __res) {
- return internal::brick_copy(__begin, __end, __res, __is_vector);
+ return __internal::__brick_copy(__begin, __end, __res, __is_vector);
},
__is_parallel);
},
[&]() {
- return internal::pattern_walk2(std::forward<_ExecutionPolicy>(__exec), __first, __last, __result,
- [](_ReferenceType1 __val1, _ReferenceType2 __val2) {
- ::new (std::addressof(__val2)) _ValueType2(std::move(__val1));
- },
- __is_vector, __is_parallel);
+ return __internal::__pattern_walk2(
+ std::forward<_ExecutionPolicy>(__exec), __first, __last, __result,
+ [](_ReferenceType1 __val1, _ReferenceType2 __val2) {
+ ::new (std::addressof(__val2)) _ValueType2(std::move(__val1));
+ },
+ __is_vector, __is_parallel);
});
}
template <class _ExecutionPolicy, class _InputIterator, class _Size, class _ForwardIterator>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
uninitialized_move_n(_ExecutionPolicy&& __exec, _InputIterator __first, _Size __n, _ForwardIterator __result)
{
typedef typename iterator_traits<_InputIterator>::value_type _ValueType1;
@@ -133,53 +136,55 @@ uninitialized_move_n(_ExecutionPolicy&&
using namespace __pstl;
const auto __is_parallel =
- internal::is_parallelization_preferred<_ExecutionPolicy, _InputIterator, _ForwardIterator>(__exec);
+ __internal::__is_parallelization_preferred<_ExecutionPolicy, _InputIterator, _ForwardIterator>(__exec);
const auto __is_vector =
- internal::is_vectorization_preferred<_ExecutionPolicy, _InputIterator, _ForwardIterator>(__exec);
+ __internal::__is_vectorization_preferred<_ExecutionPolicy, _InputIterator, _ForwardIterator>(__exec);
- return internal::invoke_if_else(
+ return __internal::__invoke_if_else(
std::integral_constant < bool, std::is_trivial<_ValueType1>::value&& std::is_trivial<_ValueType2>::value > (),
[&]() {
- return internal::pattern_walk2_brick_n(
+ return __internal::__pattern_walk2_brick_n(
std::forward<_ExecutionPolicy>(__exec), __first, __n, __result,
[__is_vector](_InputIterator __begin, _Size __sz, _ForwardIterator __res) {
- return internal::brick_copy_n(__begin, __sz, __res, __is_vector);
+ return __internal::__brick_copy_n(__begin, __sz, __res, __is_vector);
},
__is_parallel);
},
[&]() {
- return internal::pattern_walk2_n(std::forward<_ExecutionPolicy>(__exec), __first, __n, __result,
- [](_ReferenceType1 __val1, _ReferenceType2 __val2) {
- ::new (std::addressof(__val2)) _ValueType2(std::move(__val1));
- },
- __is_vector, __is_parallel);
+ return __internal::__pattern_walk2_n(
+ std::forward<_ExecutionPolicy>(__exec), __first, __n, __result,
+ [](_ReferenceType1 __val1, _ReferenceType2 __val2) {
+ ::new (std::addressof(__val2)) _ValueType2(std::move(__val1));
+ },
+ __is_vector, __is_parallel);
});
}
// [uninitialized.fill]
template <class _ExecutionPolicy, class _ForwardIterator, class _Tp>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, void>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void>
uninitialized_fill(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value)
{
typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType;
typedef typename iterator_traits<_ForwardIterator>::reference _ReferenceType;
using namespace __pstl;
- const auto __is_parallel = internal::is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec);
- const auto __is_vector = internal::is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec);
+ const auto __is_parallel = __internal::__is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec);
+ const auto __is_vector = __internal::__is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec);
- internal::invoke_if_else(
+ __internal::__invoke_if_else(
std::is_arithmetic<_ValueType>(),
[&]() {
- internal::pattern_walk_brick(std::forward<_ExecutionPolicy>(__exec), __first, __last,
- [&__value, &__is_vector](_ForwardIterator __begin, _ForwardIterator __end) {
- internal::brick_fill(__begin, __end, _ValueType(__value), __is_vector);
- },
- __is_parallel);
+ __internal::__pattern_walk_brick(
+ std::forward<_ExecutionPolicy>(__exec), __first, __last,
+ [&__value, &__is_vector](_ForwardIterator __begin, _ForwardIterator __end) {
+ __internal::__brick_fill(__begin, __end, _ValueType(__value), __is_vector);
+ },
+ __is_parallel);
},
[&]() {
- internal::pattern_walk1(
+ __internal::__pattern_walk1(
std::forward<_ExecutionPolicy>(__exec), __first, __last,
[&__value](_ReferenceType __val) { ::new (std::addressof(__val)) _ValueType(__value); }, __is_vector,
__is_parallel);
@@ -187,28 +192,28 @@ uninitialized_fill(_ExecutionPolicy&& __
}
template <class _ExecutionPolicy, class _ForwardIterator, class _Size, class _Tp>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
uninitialized_fill_n(_ExecutionPolicy&& __exec, _ForwardIterator __first, _Size __n, const _Tp& __value)
{
typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType;
typedef typename iterator_traits<_ForwardIterator>::reference _ReferenceType;
using namespace __pstl;
- const auto __is_parallel = internal::is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec);
- const auto __is_vector = internal::is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec);
+ const auto __is_parallel = __internal::__is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec);
+ const auto __is_vector = __internal::__is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec);
- return internal::invoke_if_else(
+ return __internal::__invoke_if_else(
std::is_arithmetic<_ValueType>(),
[&]() {
- return internal::pattern_walk_brick_n(std::forward<_ExecutionPolicy>(__exec), __first, __n,
- [&__value, &__is_vector](_ForwardIterator __begin, _Size __count) {
- return internal::brick_fill_n(__begin, __count,
- _ValueType(__value), __is_vector);
- },
- __is_parallel);
+ return __internal::__pattern_walk_brick_n(
+ std::forward<_ExecutionPolicy>(__exec), __first, __n,
+ [&__value, &__is_vector](_ForwardIterator __begin, _Size __count) {
+ return __internal::__brick_fill_n(__begin, __count, _ValueType(__value), __is_vector);
+ },
+ __is_parallel);
},
[&]() {
- return internal::pattern_walk1_n(
+ return __internal::__pattern_walk1_n(
std::forward<_ExecutionPolicy>(__exec), __first, __n,
[&__value](_ReferenceType __val) { ::new (std::addressof(__val)) _ValueType(__value); }, __is_vector,
__is_parallel);
@@ -218,136 +223,138 @@ uninitialized_fill_n(_ExecutionPolicy&&
// [specialized.destroy]
template <class _ExecutionPolicy, class _ForwardIterator>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, void>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void>
destroy(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last)
{
typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType;
typedef typename iterator_traits<_ForwardIterator>::reference _ReferenceType;
using namespace __pstl;
- const auto __is_parallel = internal::is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec);
- const auto __is_vector = internal::is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec);
+ const auto __is_parallel = __internal::__is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec);
+ const auto __is_vector = __internal::__is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec);
- internal::invoke_if_not(std::is_trivially_destructible<_ValueType>(), [&]() {
- internal::pattern_walk1(std::forward<_ExecutionPolicy>(__exec), __first, __last,
- [](_ReferenceType __val) { __val.~_ValueType(); }, __is_vector, __is_parallel);
+ __internal::__invoke_if_not(std::is_trivially_destructible<_ValueType>(), [&]() {
+ __internal::__pattern_walk1(
+ std::forward<_ExecutionPolicy>(__exec), __first, __last, [](_ReferenceType __val) { __val.~_ValueType(); },
+ __is_vector, __is_parallel);
});
}
template <class _ExecutionPolicy, class _ForwardIterator, class _Size>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
destroy_n(_ExecutionPolicy&& __exec, _ForwardIterator __first, _Size __n)
{
typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType;
typedef typename iterator_traits<_ForwardIterator>::reference _ReferenceType;
using namespace __pstl;
- const auto __is_parallel = internal::is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec);
- const auto __is_vector = internal::is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec);
+ const auto __is_parallel = __internal::__is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec);
+ const auto __is_vector = __internal::__is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec);
- return internal::invoke_if_else(
+ return __internal::__invoke_if_else(
std::is_trivially_destructible<_ValueType>(), [&]() { return std::next(__first, __n); },
[&]() {
- return internal::pattern_walk1_n(std::forward<_ExecutionPolicy>(__exec), __first, __n,
- [](_ReferenceType __val) { __val.~_ValueType(); }, __is_vector,
- __is_parallel);
+ return __internal::__pattern_walk1_n(
+ std::forward<_ExecutionPolicy>(__exec), __first, __n, [](_ReferenceType __val) { __val.~_ValueType(); },
+ __is_vector, __is_parallel);
});
}
// [uninitialized.construct.default]
template <class _ExecutionPolicy, class _ForwardIterator>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, void>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void>
uninitialized_default_construct(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last)
{
typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType;
typedef typename iterator_traits<_ForwardIterator>::reference _ReferenceType;
using namespace __pstl;
- const auto __is_parallel = internal::is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec);
- const auto __is_vector = internal::is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec);
+ const auto __is_parallel = __internal::__is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec);
+ const auto __is_vector = __internal::__is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec);
- internal::invoke_if_not(std::is_trivial<_ValueType>(), [&]() {
- internal::pattern_walk1(std::forward<_ExecutionPolicy>(__exec), __first, __last,
- [](_ReferenceType __val) { ::new (std::addressof(__val)) _ValueType; }, __is_vector,
- __is_parallel);
+ __internal::__invoke_if_not(std::is_trivial<_ValueType>(), [&]() {
+ __internal::__pattern_walk1(
+ std::forward<_ExecutionPolicy>(__exec), __first, __last,
+ [](_ReferenceType __val) { ::new (std::addressof(__val)) _ValueType; }, __is_vector, __is_parallel);
});
}
template <class _ExecutionPolicy, class _ForwardIterator, class _Size>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
uninitialized_default_construct_n(_ExecutionPolicy&& __exec, _ForwardIterator __first, _Size __n)
{
typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType;
typedef typename iterator_traits<_ForwardIterator>::reference _ReferenceType;
using namespace __pstl;
- const auto __is_parallel = internal::is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec);
- const auto __is_vector = internal::is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec);
+ const auto __is_parallel = __internal::__is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec);
+ const auto __is_vector = __internal::__is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec);
- return internal::invoke_if_else(std::is_trivial<_ValueType>(), [&]() { return std::next(__first, __n); },
- [&]() {
- return internal::pattern_walk1_n(
- std::forward<_ExecutionPolicy>(__exec), __first, __n,
- [](_ReferenceType __val) { ::new (std::addressof(__val)) _ValueType; },
- __is_vector, __is_parallel);
- });
+ return __internal::__invoke_if_else(
+ std::is_trivial<_ValueType>(), [&]() { return std::next(__first, __n); },
+ [&]() {
+ return __internal::__pattern_walk1_n(
+ std::forward<_ExecutionPolicy>(__exec), __first, __n,
+ [](_ReferenceType __val) { ::new (std::addressof(__val)) _ValueType; }, __is_vector, __is_parallel);
+ });
}
// [uninitialized.construct.value]
template <class _ExecutionPolicy, class _ForwardIterator>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, void>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void>
uninitialized_value_construct(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last)
{
typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType;
typedef typename iterator_traits<_ForwardIterator>::reference _ReferenceType;
using namespace __pstl;
- const auto __is_parallel = internal::is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec);
- const auto __is_vector = internal::is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec);
+ const auto __is_parallel = __internal::__is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec);
+ const auto __is_vector = __internal::__is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec);
- internal::invoke_if_else(
+ __internal::__invoke_if_else(
std::is_trivial<_ValueType>(),
[&]() {
- internal::pattern_walk_brick(std::forward<_ExecutionPolicy>(__exec), __first, __last,
- [__is_vector](_ForwardIterator __begin, _ForwardIterator __end) {
- internal::brick_fill(__begin, __end, _ValueType(), __is_vector);
- },
- __is_parallel);
+ __internal::__pattern_walk_brick(
+ std::forward<_ExecutionPolicy>(__exec), __first, __last,
+ [__is_vector](_ForwardIterator __begin, _ForwardIterator __end) {
+ __internal::__brick_fill(__begin, __end, _ValueType(), __is_vector);
+ },
+ __is_parallel);
},
[&]() {
- internal::pattern_walk1(std::forward<_ExecutionPolicy>(__exec), __first, __last,
- [](_ReferenceType __val) { ::new (std::addressof(__val)) _ValueType(); },
- __is_vector, __is_parallel);
+ __internal::__pattern_walk1(
+ std::forward<_ExecutionPolicy>(__exec), __first, __last,
+ [](_ReferenceType __val) { ::new (std::addressof(__val)) _ValueType(); }, __is_vector, __is_parallel);
});
}
template <class _ExecutionPolicy, class _ForwardIterator, class _Size>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
uninitialized_value_construct_n(_ExecutionPolicy&& __exec, _ForwardIterator __first, _Size __n)
{
typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType;
typedef typename iterator_traits<_ForwardIterator>::reference _ReferenceType;
using namespace __pstl;
- const auto __is_parallel = internal::is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec);
- const auto __is_vector = internal::is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec);
+ const auto __is_parallel = __internal::__is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec);
+ const auto __is_vector = __internal::__is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec);
- return internal::invoke_if_else(
+ return __internal::__invoke_if_else(
std::is_trivial<_ValueType>(),
[&]() {
- return internal::pattern_walk_brick_n(std::forward<_ExecutionPolicy>(__exec), __first, __n,
- [__is_vector](_ForwardIterator __begin, _Size __count) {
- return internal::brick_fill_n(__begin, __count, _ValueType(),
- __is_vector);
- },
- __is_parallel);
+ return __internal::__pattern_walk_brick_n(
+ std::forward<_ExecutionPolicy>(__exec), __first, __n,
+ [__is_vector](_ForwardIterator __begin, _Size __count) {
+ return __internal::__brick_fill_n(__begin, __count, _ValueType(), __is_vector);
+ },
+ __is_parallel);
},
[&]() {
- return internal::pattern_walk1_n(std::forward<_ExecutionPolicy>(__exec), __first, __n,
- [](_ReferenceType __val) { ::new (std::addressof(__val)) _ValueType(); },
- __is_vector, __is_parallel);
+ return __internal::__pattern_walk1_n(
+ std::forward<_ExecutionPolicy>(__exec), __first, __n,
+ [](_ReferenceType __val) { ::new (std::addressof(__val)) _ValueType(); }, __is_vector, __is_parallel);
});
}
Modified: pstl/trunk/include/pstl/internal/glue_numeric_defs.h
URL: http://llvm.org/viewvc/llvm-project/pstl/trunk/include/pstl/internal/glue_numeric_defs.h?rev=357203&r1=357202&r2=357203&view=diff
==============================================================================
--- pstl/trunk/include/pstl/internal/glue_numeric_defs.h (original)
+++ pstl/trunk/include/pstl/internal/glue_numeric_defs.h Thu Mar 28 12:10:32 2019
@@ -17,39 +17,40 @@ namespace std
// [reduce]
template <class _ExecutionPolicy, class _ForwardIterator, class _Tp, class _BinaryOperation>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _Tp>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _Tp>
reduce(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Tp __init,
_BinaryOperation __binary_op);
template <class _ExecutionPolicy, class _ForwardIterator, class _Tp>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _Tp>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _Tp>
reduce(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Tp __init);
template <class _ExecutionPolicy, class _ForwardIterator>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, typename iterator_traits<_ForwardIterator>::value_type>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy,
+ typename iterator_traits<_ForwardIterator>::value_type>
reduce(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last);
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Tp>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _Tp>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _Tp>
transform_reduce(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
_ForwardIterator2 __first2, _Tp __init);
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Tp, class _BinaryOperation1,
class _BinaryOperation2>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _Tp>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _Tp>
transform_reduce(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
_ForwardIterator2 __first2, _Tp __init, _BinaryOperation1 __binary_op1,
_BinaryOperation2 __binary_op2);
template <class _ExecutionPolicy, class _ForwardIterator, class _Tp, class _BinaryOperation, class _UnaryOperation>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _Tp>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _Tp>
transform_reduce(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Tp __init,
_BinaryOperation __binary_op, _UnaryOperation __unary_op);
// [exclusive.scan]
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Tp>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
exclusive_scan(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last,
_ForwardIterator2 __result, _Tp __init);
@@ -61,17 +62,17 @@ exclusive_scan(_ExecutionPolicy&& __exec
// [inclusive.scan]
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
inclusive_scan(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last,
_ForwardIterator2 __result);
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _BinaryOperation>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
inclusive_scan(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last,
_ForwardIterator2 __result, _BinaryOperation __binary_op);
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Tp, class _BinaryOperation>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
inclusive_scan(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last,
_ForwardIterator2 __result, _BinaryOperation __binary_op, _Tp __init);
@@ -79,7 +80,7 @@ inclusive_scan(_ExecutionPolicy&& __exec
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Tp, class _BinaryOperation,
class _UnaryOperation>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
transform_exclusive_scan(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last,
_ForwardIterator2 __result, _Tp __init, _BinaryOperation __binary_op,
_UnaryOperation __unary_op);
@@ -88,26 +89,26 @@ transform_exclusive_scan(_ExecutionPolic
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _BinaryOperation,
class _UnaryOperation, class _Tp>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
transform_inclusive_scan(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last,
_ForwardIterator2 __result, _BinaryOperation __binary_op, _UnaryOperation __unary_op,
_Tp __init);
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _UnaryOperation,
class _BinaryOperation>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
transform_inclusive_scan(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last,
_ForwardIterator2 __result, _BinaryOperation __binary_op, _UnaryOperation __unary_op);
// [adjacent.difference]
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _BinaryOperation>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
adjacent_difference(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last,
_ForwardIterator2 __d_first, _BinaryOperation op);
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
adjacent_difference(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last,
_ForwardIterator2 __d_first);
Modified: pstl/trunk/include/pstl/internal/glue_numeric_impl.h
URL: http://llvm.org/viewvc/llvm-project/pstl/trunk/include/pstl/internal/glue_numeric_impl.h?rev=357203&r1=357202&r2=357203&view=diff
==============================================================================
--- pstl/trunk/include/pstl/internal/glue_numeric_impl.h (original)
+++ pstl/trunk/include/pstl/internal/glue_numeric_impl.h Thu Mar 28 12:10:32 2019
@@ -21,81 +21,82 @@ namespace std
// [reduce]
template <class _ExecutionPolicy, class _ForwardIterator, class _Tp, class _BinaryOperation>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _Tp>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _Tp>
reduce(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Tp __init,
_BinaryOperation __binary_op)
{
return transform_reduce(std::forward<_ExecutionPolicy>(__exec), __first, __last, __init, __binary_op,
- __pstl::internal::no_op());
+ __pstl::__internal::__no_op());
}
template <class _ExecutionPolicy, class _ForwardIterator, class _Tp>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _Tp>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _Tp>
reduce(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Tp __init)
{
return transform_reduce(std::forward<_ExecutionPolicy>(__exec), __first, __last, __init, std::plus<_Tp>(),
- __pstl::internal::no_op());
+ __pstl::__internal::__no_op());
}
template <class _ExecutionPolicy, class _ForwardIterator>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, typename iterator_traits<_ForwardIterator>::value_type>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy,
+ typename iterator_traits<_ForwardIterator>::value_type>
reduce(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last)
{
typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType;
return transform_reduce(std::forward<_ExecutionPolicy>(__exec), __first, __last, _ValueType{},
- std::plus<_ValueType>(), __pstl::internal::no_op());
+ std::plus<_ValueType>(), __pstl::__internal::__no_op());
}
// [transform.reduce]
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Tp>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _Tp>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _Tp>
transform_reduce(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
_ForwardIterator2 __first2, _Tp __init)
{
typedef typename iterator_traits<_ForwardIterator1>::value_type _InputType;
using namespace __pstl;
- return internal::pattern_transform_reduce(
+ return __internal::__pattern_transform_reduce(
std::forward<_ExecutionPolicy>(__exec), __first1, __last1, __first2, __init, std::plus<_InputType>(),
std::multiplies<_InputType>(),
- internal::is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec),
- internal::is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec));
+ __internal::__is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec),
+ __internal::__is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec));
}
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Tp, class _BinaryOperation1,
class _BinaryOperation2>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _Tp>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _Tp>
transform_reduce(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
_ForwardIterator2 __first2, _Tp __init, _BinaryOperation1 __binary_op1, _BinaryOperation2 __binary_op2)
{
using namespace __pstl;
- return internal::pattern_transform_reduce(
+ return __internal::__pattern_transform_reduce(
std::forward<_ExecutionPolicy>(__exec), __first1, __last1, __first2, __init, __binary_op1, __binary_op2,
- internal::is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec),
- internal::is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec));
+ __internal::__is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec),
+ __internal::__is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec));
}
template <class _ExecutionPolicy, class _ForwardIterator, class _Tp, class _BinaryOperation, class _UnaryOperation>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _Tp>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _Tp>
transform_reduce(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Tp __init,
_BinaryOperation __binary_op, _UnaryOperation __unary_op)
{
using namespace __pstl;
- return internal::pattern_transform_reduce(
+ return __internal::__pattern_transform_reduce(
std::forward<_ExecutionPolicy>(__exec), __first, __last, __init, __binary_op, __unary_op,
- internal::is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec),
- internal::is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec));
+ __internal::__is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec),
+ __internal::__is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator>(__exec));
}
// [exclusive.scan]
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Tp>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
exclusive_scan(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last,
_ForwardIterator2 __result, _Tp __init)
{
return transform_exclusive_scan(std::forward<_ExecutionPolicy>(__exec), __first, __last, __result, __init,
- std::plus<_Tp>(), __pstl::internal::no_op());
+ std::plus<_Tp>(), __pstl::__internal::__no_op());
}
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Tp, class _BinaryOperation>
@@ -104,76 +105,76 @@ exclusive_scan(_ExecutionPolicy&& __exec
_ForwardIterator2 __result, _Tp __init, _BinaryOperation __binary_op)
{
return transform_exclusive_scan(std::forward<_ExecutionPolicy>(__exec), __first, __last, __result, __init,
- __binary_op, __pstl::internal::no_op());
+ __binary_op, __pstl::__internal::__no_op());
}
// [inclusive.scan]
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
inclusive_scan(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last,
_ForwardIterator2 __result)
{
typedef typename iterator_traits<_ForwardIterator1>::value_type _InputType;
return transform_inclusive_scan(std::forward<_ExecutionPolicy>(__exec), __first, __last, __result,
- std::plus<_InputType>(), __pstl::internal::no_op());
+ std::plus<_InputType>(), __pstl::__internal::__no_op());
}
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _BinaryOperation>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
inclusive_scan(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last,
_ForwardIterator2 __result, _BinaryOperation __binary_op)
{
return transform_inclusive_scan(std::forward<_ExecutionPolicy>(__exec), __first, __last, __result, __binary_op,
- __pstl::internal::no_op());
+ __pstl::__internal::__no_op());
}
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Tp, class _BinaryOperation>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
inclusive_scan(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last,
_ForwardIterator2 __result, _BinaryOperation __binary_op, _Tp __init)
{
return transform_inclusive_scan(std::forward<_ExecutionPolicy>(__exec), __first, __last, __result, __binary_op,
- __pstl::internal::no_op(), __init);
+ __pstl::__internal::__no_op(), __init);
}
// [transform.exclusive.scan]
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Tp, class _BinaryOperation,
class _UnaryOperation>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
transform_exclusive_scan(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last,
_ForwardIterator2 __result, _Tp __init, _BinaryOperation __binary_op,
_UnaryOperation __unary_op)
{
using namespace __pstl;
- return internal::pattern_transform_scan(
+ return __internal::__pattern_transform_scan(
std::forward<_ExecutionPolicy>(__exec), __first, __last, __result, __unary_op, __init, __binary_op,
/*inclusive=*/std::false_type(),
- internal::is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec),
- internal::is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec));
+ __internal::__is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec),
+ __internal::__is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec));
}
// [transform.inclusive.scan]
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _BinaryOperation,
class _UnaryOperation, class _Tp>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
transform_inclusive_scan(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last,
_ForwardIterator2 __result, _BinaryOperation __binary_op, _UnaryOperation __unary_op,
_Tp __init)
{
using namespace __pstl;
- return internal::pattern_transform_scan(
+ return __internal::__pattern_transform_scan(
std::forward<_ExecutionPolicy>(__exec), __first, __last, __result, __unary_op, __init, __binary_op,
/*inclusive=*/std::true_type(),
- internal::is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec),
- internal::is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec));
+ __internal::__is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec),
+ __internal::__is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec));
}
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _UnaryOperation,
class _BinaryOperation>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
transform_inclusive_scan(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last,
_ForwardIterator2 __result, _BinaryOperation __binary_op, _UnaryOperation __unary_op)
{
@@ -193,7 +194,7 @@ transform_inclusive_scan(_ExecutionPolic
// [adjacent.difference]
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _BinaryOperation>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
adjacent_difference(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last,
_ForwardIterator2 __d_first, _BinaryOperation __op)
{
@@ -202,14 +203,14 @@ adjacent_difference(_ExecutionPolicy&& _
return __d_first;
using namespace __pstl;
- return internal::pattern_adjacent_difference(
+ return __internal::__pattern_adjacent_difference(
std::forward<_ExecutionPolicy>(__exec), __first, __last, __d_first, __op,
- internal::is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec),
- internal::is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec));
+ __internal::__is_vectorization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec),
+ __internal::__is_parallelization_preferred<_ExecutionPolicy, _ForwardIterator1, _ForwardIterator2>(__exec));
}
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2>
-__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
+__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
adjacent_difference(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last,
_ForwardIterator2 __d_first)
{
Modified: pstl/trunk/include/pstl/internal/memory_impl.h
URL: http://llvm.org/viewvc/llvm-project/pstl/trunk/include/pstl/internal/memory_impl.h?rev=357203&r1=357202&r2=357203&view=diff
==============================================================================
--- pstl/trunk/include/pstl/internal/memory_impl.h (original)
+++ pstl/trunk/include/pstl/internal/memory_impl.h Thu Mar 28 12:10:32 2019
@@ -16,7 +16,7 @@
namespace __pstl
{
-namespace internal
+namespace __internal
{
//------------------------------------------------------------------------
@@ -25,8 +25,8 @@ namespace internal
template <class _ForwardIterator, class _OutputIterator>
_OutputIterator
-brick_uninitialized_move(_ForwardIterator __first, _ForwardIterator __last, _OutputIterator __result,
- /*vector=*/std::false_type) noexcept
+__brick_uninitialized_move(_ForwardIterator __first, _ForwardIterator __last, _OutputIterator __result,
+ /*vector=*/std::false_type) noexcept
{
typedef typename std::iterator_traits<_OutputIterator>::value_type _ValueType2;
for (; __first != __last; ++__first, ++__result)
@@ -38,19 +38,19 @@ brick_uninitialized_move(_ForwardIterato
template <class _ForwardIterator, class _OutputIterator>
_OutputIterator
-brick_uninitialized_move(_ForwardIterator __first, _ForwardIterator __last, _OutputIterator __result,
- /*vector=*/std::true_type) noexcept
+__brick_uninitialized_move(_ForwardIterator __first, _ForwardIterator __last, _OutputIterator __result,
+ /*vector=*/std::true_type) noexcept
{
typedef typename std::iterator_traits<_OutputIterator>::value_type __ValueType2;
typedef typename std::iterator_traits<_ForwardIterator>::reference _ReferenceType1;
typedef typename std::iterator_traits<_OutputIterator>::reference _ReferenceType2;
- return unseq_backend::simd_walk_2(
+ return __unseq_backend::__simd_walk_2(
__first, __last - __first, __result,
[](_ReferenceType1 __x, _ReferenceType2 __y) { ::new (std::addressof(__y)) __ValueType2(std::move(__x)); });
}
-} // namespace internal
+} // namespace __internal
} // namespace __pstl
#endif /* __PSTL_memory_impl_H */
Modified: pstl/trunk/include/pstl/internal/numeric_fwd.h
URL: http://llvm.org/viewvc/llvm-project/pstl/trunk/include/pstl/internal/numeric_fwd.h?rev=357203&r1=357202&r2=357203&view=diff
==============================================================================
--- pstl/trunk/include/pstl/internal/numeric_fwd.h (original)
+++ pstl/trunk/include/pstl/internal/numeric_fwd.h Thu Mar 28 12:10:32 2019
@@ -15,7 +15,7 @@
namespace __pstl
{
-namespace internal
+namespace __internal
{
//------------------------------------------------------------------------
@@ -23,30 +23,29 @@ namespace internal
//------------------------------------------------------------------------
template <class _ForwardIterator1, class _ForwardIterator2, class _Tp, class _BinaryOperation1, class _BinaryOperation2>
-_Tp
-brick_transform_reduce(_ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _Tp, _BinaryOperation1,
- _BinaryOperation2,
- /*__is_vector=*/std::true_type) noexcept;
+_Tp __brick_transform_reduce(_ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _Tp, _BinaryOperation1,
+ _BinaryOperation2,
+ /*__is_vector=*/std::true_type) noexcept;
template <class _ForwardIterator1, class _ForwardIterator2, class _Tp, class _BinaryOperation1, class _BinaryOperation2>
-_Tp
-brick_transform_reduce(_ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _Tp, _BinaryOperation1,
- _BinaryOperation2,
- /*__is_vector=*/std::false_type) noexcept;
+_Tp __brick_transform_reduce(_ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _Tp, _BinaryOperation1,
+ _BinaryOperation2,
+ /*__is_vector=*/std::false_type) noexcept;
-template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Tp, class _BinaryOperation1, class _BinaryOperation2,
- class _IsVector>
+template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Tp, class _BinaryOperation1,
+ class _BinaryOperation2, class _IsVector>
_Tp
-pattern_transform_reduce(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _Tp, _BinaryOperation1,
- _BinaryOperation2, _IsVector,
- /*is_parallel=*/std::false_type) noexcept;
+__pattern_transform_reduce(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _Tp,
+ _BinaryOperation1, _BinaryOperation2, _IsVector,
+ /*is_parallel=*/std::false_type) noexcept;
#if __PSTL_USE_PAR_POLICIES
-template <class _ExecutionPolicy, class _RandomAccessIterator1, class _RandomAccessIterator2, class _Tp, class _BinaryOperation1,
- class _BinaryOperation2, class _IsVector>
+template <class _ExecutionPolicy, class _RandomAccessIterator1, class _RandomAccessIterator2, class _Tp,
+ class _BinaryOperation1, class _BinaryOperation2, class _IsVector>
_Tp
-pattern_transform_reduce(_ExecutionPolicy&&, _RandomAccessIterator1, _RandomAccessIterator1, _RandomAccessIterator2, _Tp, _BinaryOperation1,
- _BinaryOperation2, _IsVector __is_vector, /*is_parallel=*/std::true_type);
+__pattern_transform_reduce(_ExecutionPolicy&&, _RandomAccessIterator1, _RandomAccessIterator1, _RandomAccessIterator2,
+ _Tp, _BinaryOperation1, _BinaryOperation2, _IsVector __is_vector,
+ /*is_parallel=*/std::true_type);
#endif
//------------------------------------------------------------------------
@@ -54,25 +53,27 @@ pattern_transform_reduce(_ExecutionPolic
//------------------------------------------------------------------------
template <class _ForwardIterator, class _Tp, class _UnaryOperation, class _BinaryOperation>
-_Tp
-brick_transform_reduce(_ForwardIterator, _ForwardIterator, _Tp, _BinaryOperation, _UnaryOperation,
- /*is_vector=*/std::true_type) noexcept;
+_Tp __brick_transform_reduce(_ForwardIterator, _ForwardIterator, _Tp, _BinaryOperation, _UnaryOperation,
+ /*is_vector=*/std::true_type) noexcept;
template <class _ForwardIterator, class _Tp, class _BinaryOperation, class _UnaryOperation>
-_Tp
-brick_transform_reduce(_ForwardIterator, _ForwardIterator, _Tp, _BinaryOperation, _UnaryOperation,
- /*is_vector=*/std::false_type) noexcept;
+_Tp __brick_transform_reduce(_ForwardIterator, _ForwardIterator, _Tp, _BinaryOperation, _UnaryOperation,
+ /*is_vector=*/std::false_type) noexcept;
-template <class _ExecutionPolicy, class _ForwardIterator, class _Tp, class _BinaryOperation, class _UnaryOperation, class _IsVector>
+template <class _ExecutionPolicy, class _ForwardIterator, class _Tp, class _BinaryOperation, class _UnaryOperation,
+ class _IsVector>
_Tp
-pattern_transform_reduce(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _Tp, _BinaryOperation, _UnaryOperation, _IsVector,
- /*is_parallel=*/std::false_type) noexcept;
+__pattern_transform_reduce(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _Tp, _BinaryOperation,
+ _UnaryOperation, _IsVector,
+ /*is_parallel=*/std::false_type) noexcept;
#if __PSTL_USE_PAR_POLICIES
-template <class _ExecutionPolicy, class _ForwardIterator, class _Tp, class _BinaryOperation, class _UnaryOperation, class _IsVector>
+template <class _ExecutionPolicy, class _ForwardIterator, class _Tp, class _BinaryOperation, class _UnaryOperation,
+ class _IsVector>
_Tp
-pattern_transform_reduce(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _Tp, _BinaryOperation, _UnaryOperation, _IsVector,
- /*is_parallel=*/std::true_type);
+__pattern_transform_reduce(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _Tp, _BinaryOperation,
+ _UnaryOperation, _IsVector,
+ /*is_parallel=*/std::true_type);
#endif
//------------------------------------------------------------------------
@@ -82,37 +83,36 @@ pattern_transform_reduce(_ExecutionPolic
//------------------------------------------------------------------------
template <class _ForwardIterator, class _OutputIterator, class _UnaryOperation, class _Tp, class _BinaryOperation>
-std::pair<_OutputIterator, _Tp> brick_transform_scan(_ForwardIterator, _ForwardIterator, _OutputIterator,
- _UnaryOperation, _Tp, _BinaryOperation,
- /*Inclusive*/ std::false_type) noexcept;
+std::pair<_OutputIterator, _Tp> __brick_transform_scan(_ForwardIterator, _ForwardIterator, _OutputIterator,
+ _UnaryOperation, _Tp, _BinaryOperation,
+ /*Inclusive*/ std::false_type) noexcept;
template <class _ForwardIterator, class _OutputIterator, class _UnaryOperation, class _Tp, class _BinaryOperation>
-std::pair<_OutputIterator, _Tp> brick_transform_scan(_ForwardIterator, _ForwardIterator, _OutputIterator,
- _UnaryOperation, _Tp, _BinaryOperation,
- /*Inclusive*/ std::true_type) noexcept;
-
-template <class _ExecutionPolicy, class _ForwardIterator, class _OutputIterator, class _UnaryOperation, class _Tp, class _BinaryOperation,
- class _Inclusive, class _IsVector>
-_OutputIterator pattern_transform_scan(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _OutputIterator, _UnaryOperation, _Tp,
- _BinaryOperation, _Inclusive, _IsVector,
- /*is_parallel=*/std::false_type) noexcept;
+std::pair<_OutputIterator, _Tp> __brick_transform_scan(_ForwardIterator, _ForwardIterator, _OutputIterator,
+ _UnaryOperation, _Tp, _BinaryOperation,
+ /*Inclusive*/ std::true_type) noexcept;
+
+template <class _ExecutionPolicy, class _ForwardIterator, class _OutputIterator, class _UnaryOperation, class _Tp,
+ class _BinaryOperation, class _Inclusive, class _IsVector>
+_OutputIterator
+__pattern_transform_scan(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _OutputIterator, _UnaryOperation, _Tp,
+ _BinaryOperation, _Inclusive, _IsVector,
+ /*is_parallel=*/std::false_type) noexcept;
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _RandomAccessIterator, class _OutputIterator, class _UnaryOperation, class _Tp,
class _BinaryOperation, class _Inclusive, class _IsVector>
typename std::enable_if<!std::is_floating_point<_Tp>::value, _OutputIterator>::type
-pattern_transform_scan(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator,
- _OutputIterator, _UnaryOperation, _Tp, _BinaryOperation,
- _Inclusive, _IsVector, /*is_parallel=*/std::true_type);
+__pattern_transform_scan(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _OutputIterator,
+ _UnaryOperation, _Tp, _BinaryOperation, _Inclusive, _IsVector, /*is_parallel=*/std::true_type);
#endif
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _RandomAccessIterator, class _OutputIterator, class _UnaryOperation, class _Tp,
class _BinaryOperation, class _Inclusive, class _IsVector>
typename std::enable_if<std::is_floating_point<_Tp>::value, _OutputIterator>::type
-pattern_transform_scan(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator,
- _OutputIterator, _UnaryOperation, _Tp, _BinaryOperation,
- _Inclusive, _IsVector, /*is_parallel=*/std::true_type);
+__pattern_transform_scan(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _OutputIterator,
+ _UnaryOperation, _Tp, _BinaryOperation, _Inclusive, _IsVector, /*is_parallel=*/std::true_type);
#endif
//------------------------------------------------------------------------
@@ -120,23 +120,27 @@ pattern_transform_scan(_ExecutionPolicy&
//------------------------------------------------------------------------
template <class _ForwardIterator, class _OutputIterator, class _BinaryOperation>
-_OutputIterator brick_adjacent_difference(_ForwardIterator, _ForwardIterator, _OutputIterator, _BinaryOperation,
- /*is_vector*/ std::false_type) noexcept;
+_OutputIterator __brick_adjacent_difference(_ForwardIterator, _ForwardIterator, _OutputIterator, _BinaryOperation,
+ /*is_vector*/ std::false_type) noexcept;
template <class _ForwardIterator, class _OutputIterator, class _BinaryOperation>
-_OutputIterator brick_adjacent_difference(_ForwardIterator, _ForwardIterator, _OutputIterator, _BinaryOperation,
- /*is_vector*/ std::true_type) noexcept;
+_OutputIterator __brick_adjacent_difference(_ForwardIterator, _ForwardIterator, _OutputIterator, _BinaryOperation,
+ /*is_vector*/ std::true_type) noexcept;
-template <class _ExecutionPolicy, class _ForwardIterator, class _OutputIterator, class _BinaryOperation, class _IsVector>
-_OutputIterator pattern_adjacent_difference(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _OutputIterator, _BinaryOperation,
- _IsVector, /*is_parallel*/ std::false_type) noexcept;
+template <class _ExecutionPolicy, class _ForwardIterator, class _OutputIterator, class _BinaryOperation,
+ class _IsVector>
+_OutputIterator
+__pattern_adjacent_difference(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _OutputIterator, _BinaryOperation,
+ _IsVector, /*is_parallel*/ std::false_type) noexcept;
#if __PSTL_USE_PAR_POLICIES
-template <class _ExecutionPolicy, class _ForwardIterator, class _OutputIterator, class _BinaryOperation, class _IsVector>
-_OutputIterator pattern_adjacent_difference(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _OutputIterator, _BinaryOperation,
- _IsVector, /*is_parallel*/ std::true_type);
+template <class _ExecutionPolicy, class _ForwardIterator, class _OutputIterator, class _BinaryOperation,
+ class _IsVector>
+_OutputIterator
+__pattern_adjacent_difference(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _OutputIterator, _BinaryOperation,
+ _IsVector, /*is_parallel*/ std::true_type);
#endif
-} // namespace internal
+} // namespace __internal
} // namespace __pstl
#endif /* __PSTL_numeric_fwd_H */
Modified: pstl/trunk/include/pstl/internal/numeric_impl.h
URL: http://llvm.org/viewvc/llvm-project/pstl/trunk/include/pstl/internal/numeric_impl.h?rev=357203&r1=357202&r2=357203&view=diff
==============================================================================
--- pstl/trunk/include/pstl/internal/numeric_impl.h (original)
+++ pstl/trunk/include/pstl/internal/numeric_impl.h Thu Mar 28 12:10:32 2019
@@ -24,7 +24,7 @@
namespace __pstl
{
-namespace internal
+namespace __internal
{
//------------------------------------------------------------------------
@@ -33,21 +33,21 @@ namespace internal
template <class _ForwardIterator1, class _ForwardIterator2, class _Tp, class _BinaryOperation1, class _BinaryOperation2>
_Tp
-brick_transform_reduce(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _Tp __init,
- _BinaryOperation1 __binary_op1, _BinaryOperation2 __binary_op2,
- /*is_vector=*/std::false_type) noexcept
+__brick_transform_reduce(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _Tp __init,
+ _BinaryOperation1 __binary_op1, _BinaryOperation2 __binary_op2,
+ /*is_vector=*/std::false_type) noexcept
{
return std::inner_product(__first1, __last1, __first2, __init, __binary_op1, __binary_op2);
}
template <class _ForwardIterator1, class _ForwardIterator2, class _Tp, class _BinaryOperation1, class _BinaryOperation2>
_Tp
-brick_transform_reduce(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _Tp __init,
- _BinaryOperation1 __binary_op1, _BinaryOperation2 __binary_op2,
- /*is_vector=*/std::true_type) noexcept
+__brick_transform_reduce(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _Tp __init,
+ _BinaryOperation1 __binary_op1, _BinaryOperation2 __binary_op2,
+ /*is_vector=*/std::true_type) noexcept
{
typedef typename std::iterator_traits<_ForwardIterator1>::difference_type _DifferenceType;
- return unseq_backend::simd_transform_reduce(
+ return __unseq_backend::__simd_transform_reduce(
__last1 - __first1, __init, __binary_op1,
[=, &__binary_op2](_DifferenceType __i) { return __binary_op2(__first1[__i], __first2[__i]); });
}
@@ -55,24 +55,24 @@ brick_transform_reduce(_ForwardIterator1
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Tp, class _BinaryOperation1,
class _BinaryOperation2, class _IsVector>
_Tp
-pattern_transform_reduce(_ExecutionPolicy&&, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
- _ForwardIterator2 __first2, _Tp __init, _BinaryOperation1 __binary_op1,
- _BinaryOperation2 __binary_op2, _IsVector __is_vector,
- /*is_parallel=*/std::false_type) noexcept
+__pattern_transform_reduce(_ExecutionPolicy&&, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
+ _ForwardIterator2 __first2, _Tp __init, _BinaryOperation1 __binary_op1,
+ _BinaryOperation2 __binary_op2, _IsVector __is_vector,
+ /*is_parallel=*/std::false_type) noexcept
{
- return brick_transform_reduce(__first1, __last1, __first2, __init, __binary_op1, __binary_op2, __is_vector);
+ return __brick_transform_reduce(__first1, __last1, __first2, __init, __binary_op1, __binary_op2, __is_vector);
}
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _RandomAccessIterator1, class _RandomAccessIterator2, class _Tp,
class _BinaryOperation1, class _BinaryOperation2, class _IsVector>
_Tp
-pattern_transform_reduce(_ExecutionPolicy&& __exec, _RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1,
- _RandomAccessIterator2 __first2, _Tp __init, _BinaryOperation1 __binary_op1,
- _BinaryOperation2 __binary_op2, _IsVector __is_vector, /*is_parallel=*/std::true_type)
+__pattern_transform_reduce(_ExecutionPolicy&& __exec, _RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1,
+ _RandomAccessIterator2 __first2, _Tp __init, _BinaryOperation1 __binary_op1,
+ _BinaryOperation2 __binary_op2, _IsVector __is_vector, /*is_parallel=*/std::true_type)
{
- return internal::except_handler([&]() {
- return par_backend::parallel_transform_reduce(
+ return __except_handler([&]() {
+ return __par_backend::__parallel_transform_reduce(
std::forward<_ExecutionPolicy>(__exec), __first1, __last1,
[__first1, __first2, __binary_op2](_RandomAccessIterator1 __i) mutable {
return __binary_op2(*__i, *(__first2 + (__i - __first1)));
@@ -81,8 +81,8 @@ pattern_transform_reduce(_ExecutionPolic
__binary_op1, // Combine
[__first1, __first2, __binary_op1, __binary_op2,
__is_vector](_RandomAccessIterator1 __i, _RandomAccessIterator1 __j, _Tp __init) -> _Tp {
- return internal::brick_transform_reduce(__i, __j, __first2 + (__i - __first1), __init, __binary_op1,
- __binary_op2, __is_vector);
+ return __brick_transform_reduce(__i, __j, __first2 + (__i - __first1), __init, __binary_op1,
+ __binary_op2, __is_vector);
});
});
}
@@ -94,8 +94,8 @@ pattern_transform_reduce(_ExecutionPolic
template <class _ForwardIterator, class _Tp, class _BinaryOperation, class _UnaryOperation>
_Tp
-brick_transform_reduce(_ForwardIterator __first, _ForwardIterator __last, _Tp __init, _BinaryOperation __binary_op,
- _UnaryOperation __unary_op, /*is_vector=*/std::false_type) noexcept
+__brick_transform_reduce(_ForwardIterator __first, _ForwardIterator __last, _Tp __init, _BinaryOperation __binary_op,
+ _UnaryOperation __unary_op, /*is_vector=*/std::false_type) noexcept
{
for (; __first != __last; ++__first)
{
@@ -106,11 +106,11 @@ brick_transform_reduce(_ForwardIterator
template <class _ForwardIterator, class _Tp, class _UnaryOperation, class _BinaryOperation>
_Tp
-brick_transform_reduce(_ForwardIterator __first, _ForwardIterator __last, _Tp __init, _BinaryOperation __binary_op,
- _UnaryOperation __unary_op, /*is_vector=*/std::true_type) noexcept
+__brick_transform_reduce(_ForwardIterator __first, _ForwardIterator __last, _Tp __init, _BinaryOperation __binary_op,
+ _UnaryOperation __unary_op, /*is_vector=*/std::true_type) noexcept
{
typedef typename std::iterator_traits<_ForwardIterator>::difference_type _DifferenceType;
- return unseq_backend::simd_transform_reduce(
+ return __unseq_backend::__simd_transform_reduce(
__last - __first, __init, __binary_op,
[=, &__unary_op](_DifferenceType __i) { return __unary_op(__first[__i]); });
}
@@ -118,27 +118,27 @@ brick_transform_reduce(_ForwardIterator
template <class _ExecutionPolicy, class _ForwardIterator, class _Tp, class _BinaryOperation, class _UnaryOperation,
class _IsVector>
_Tp
-pattern_transform_reduce(_ExecutionPolicy&&, _ForwardIterator __first, _ForwardIterator __last, _Tp __init,
- _BinaryOperation __binary_op, _UnaryOperation __unary_op, _IsVector __is_vector,
- /*is_parallel=*/std::false_type) noexcept
+__pattern_transform_reduce(_ExecutionPolicy&&, _ForwardIterator __first, _ForwardIterator __last, _Tp __init,
+ _BinaryOperation __binary_op, _UnaryOperation __unary_op, _IsVector __is_vector,
+ /*is_parallel=*/std::false_type) noexcept
{
- return brick_transform_reduce(__first, __last, __init, __binary_op, __unary_op, __is_vector);
+ return __brick_transform_reduce(__first, __last, __init, __binary_op, __unary_op, __is_vector);
}
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _ForwardIterator, class _Tp, class _BinaryOperation, class _UnaryOperation,
class _IsVector>
_Tp
-pattern_transform_reduce(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Tp __init,
- _BinaryOperation __binary_op, _UnaryOperation __unary_op, _IsVector __is_vector,
- /*is_parallel=*/std::true_type)
+__pattern_transform_reduce(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Tp __init,
+ _BinaryOperation __binary_op, _UnaryOperation __unary_op, _IsVector __is_vector,
+ /*is_parallel=*/std::true_type)
{
- return except_handler([&]() {
- return par_backend::parallel_transform_reduce(
+ return __except_handler([&]() {
+ return __par_backend::__parallel_transform_reduce(
std::forward<_ExecutionPolicy>(__exec), __first, __last,
[__unary_op](_ForwardIterator __i) mutable { return __unary_op(*__i); }, __init, __binary_op,
[__unary_op, __binary_op, __is_vector](_ForwardIterator __i, _ForwardIterator __j, _Tp __init) {
- return brick_transform_reduce(__i, __j, __init, __binary_op, __unary_op, __is_vector);
+ return __brick_transform_reduce(__i, __j, __init, __binary_op, __unary_op, __is_vector);
});
});
}
@@ -153,9 +153,9 @@ pattern_transform_reduce(_ExecutionPolic
// Exclusive form
template <class _ForwardIterator, class _OutputIterator, class _UnaryOperation, class _Tp, class _BinaryOperation>
std::pair<_OutputIterator, _Tp>
-brick_transform_scan(_ForwardIterator __first, _ForwardIterator __last, _OutputIterator __result,
- _UnaryOperation __unary_op, _Tp __init, _BinaryOperation __binary_op,
- /*Inclusive*/ std::false_type, /*is_vector=*/std::false_type) noexcept
+__brick_transform_scan(_ForwardIterator __first, _ForwardIterator __last, _OutputIterator __result,
+ _UnaryOperation __unary_op, _Tp __init, _BinaryOperation __binary_op,
+ /*Inclusive*/ std::false_type, /*is_vector=*/std::false_type) noexcept
{
for (; __first != __last; ++__first, ++__result)
{
@@ -169,9 +169,9 @@ brick_transform_scan(_ForwardIterator __
// Inclusive form
template <class _ForwardIterator, class _OutputIterator, class _UnaryOperation, class _Tp, class _BinaryOperation>
std::pair<_OutputIterator, _Tp>
-brick_transform_scan(_ForwardIterator __first, _ForwardIterator __last, _OutputIterator __result,
- _UnaryOperation __unary_op, _Tp __init, _BinaryOperation __binary_op,
- /*Inclusive*/ std::true_type, /*is_vector=*/std::false_type) noexcept
+__brick_transform_scan(_ForwardIterator __first, _ForwardIterator __last, _OutputIterator __result,
+ _UnaryOperation __unary_op, _Tp __init, _BinaryOperation __binary_op,
+ /*Inclusive*/ std::true_type, /*is_vector=*/std::false_type) noexcept
{
for (; __first != __last; ++__first, ++__result)
{
@@ -192,39 +192,39 @@ using is_arithmetic_udop = std::integral
template <class _ForwardIterator, class _OutputIterator, class _UnaryOperation, class _Tp, class _BinaryOperation,
class _Inclusive>
typename std::enable_if<!is_arithmetic_udop<_Tp, _BinaryOperation>::value, std::pair<_OutputIterator, _Tp>>::type
-brick_transform_scan(_ForwardIterator __first, _ForwardIterator __last, _OutputIterator __result,
- _UnaryOperation __unary_op, _Tp __init, _BinaryOperation __binary_op, _Inclusive,
- /*is_vector=*/std::true_type) noexcept
+__brick_transform_scan(_ForwardIterator __first, _ForwardIterator __last, _OutputIterator __result,
+ _UnaryOperation __unary_op, _Tp __init, _BinaryOperation __binary_op, _Inclusive,
+ /*is_vector=*/std::true_type) noexcept
{
#if (__PSTL_UDS_PRESENT)
- return unseq_backend::simd_scan(__first, __last - __first, __result, __unary_op, __init, __binary_op, _Inclusive());
+ return __unseq_backend::__simd_scan(__first, __last - __first, __result, __unary_op, __init, __binary_op,
+ _Inclusive());
#else
// We need to call serial brick here to call function for inclusive and exclusive scan that depends on _Inclusive() value
- return brick_transform_scan(__first, __last, __result, __unary_op, __init, __binary_op, _Inclusive(),
- /*is_vector=*/std::false_type());
+ return __brick_transform_scan(__first, __last, __result, __unary_op, __init, __binary_op, _Inclusive(),
+ /*is_vector=*/std::false_type());
#endif
}
template <class _ForwardIterator, class _OutputIterator, class _UnaryOperation, class _Tp, class _BinaryOperation,
class _Inclusive>
typename std::enable_if<is_arithmetic_udop<_Tp, _BinaryOperation>::value, std::pair<_OutputIterator, _Tp>>::type
-brick_transform_scan(_ForwardIterator __first, _ForwardIterator __last, _OutputIterator __result,
- _UnaryOperation __unary_op, _Tp __init, _BinaryOperation __binary_op, _Inclusive,
- /*is_vector=*/std::true_type) noexcept
+__brick_transform_scan(_ForwardIterator __first, _ForwardIterator __last, _OutputIterator __result,
+ _UnaryOperation __unary_op, _Tp __init, _BinaryOperation __binary_op, _Inclusive,
+ /*is_vector=*/std::true_type) noexcept
{
- return brick_transform_scan(__first, __last, __result, __unary_op, __init, __binary_op, _Inclusive(),
- /*is_vector=*/std::false_type());
+ return __brick_transform_scan(__first, __last, __result, __unary_op, __init, __binary_op, _Inclusive(),
+ /*is_vector=*/std::false_type());
}
template <class _ExecutionPolicy, class _ForwardIterator, class _OutputIterator, class _UnaryOperation, class _Tp,
class _BinaryOperation, class _Inclusive, class _IsVector>
_OutputIterator
-pattern_transform_scan(_ExecutionPolicy&&, _ForwardIterator __first, _ForwardIterator __last, _OutputIterator __result,
- _UnaryOperation __unary_op, _Tp __init, _BinaryOperation __binary_op, _Inclusive,
- _IsVector __is_vector, /*is_parallel=*/std::false_type) noexcept
+__pattern_transform_scan(_ExecutionPolicy&&, _ForwardIterator __first, _ForwardIterator __last,
+ _OutputIterator __result, _UnaryOperation __unary_op, _Tp __init, _BinaryOperation __binary_op,
+ _Inclusive, _IsVector __is_vector, /*is_parallel=*/std::false_type) noexcept
{
- return internal::brick_transform_scan(__first, __last, __result, __unary_op, __init, __binary_op, _Inclusive(),
- __is_vector)
+ return __brick_transform_scan(__first, __last, __result, __unary_op, __init, __binary_op, _Inclusive(), __is_vector)
.first;
}
@@ -232,26 +232,26 @@ pattern_transform_scan(_ExecutionPolicy&
template <class _ExecutionPolicy, class _RandomAccessIterator, class _OutputIterator, class _UnaryOperation, class _Tp,
class _BinaryOperation, class _Inclusive, class _IsVector>
typename std::enable_if<!std::is_floating_point<_Tp>::value, _OutputIterator>::type
-pattern_transform_scan(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last,
- _OutputIterator __result, _UnaryOperation __unary_op, _Tp __init, _BinaryOperation __binary_op,
- _Inclusive, _IsVector __is_vector, /*is_parallel=*/std::true_type)
+__pattern_transform_scan(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last,
+ _OutputIterator __result, _UnaryOperation __unary_op, _Tp __init, _BinaryOperation __binary_op,
+ _Inclusive, _IsVector __is_vector, /*is_parallel=*/std::true_type)
{
typedef typename std::iterator_traits<_RandomAccessIterator>::difference_type _DifferenceType;
- return internal::except_handler([&]() {
- par_backend::parallel_transform_scan(
+ return __except_handler([&]() {
+ __par_backend::__parallel_transform_scan(
std::forward<_ExecutionPolicy>(__exec), __last - __first,
[__first, __unary_op](_DifferenceType __i) mutable { return __unary_op(__first[__i]); }, __init,
__binary_op,
[__first, __unary_op, __binary_op](_DifferenceType __i, _DifferenceType __j, _Tp __init) {
- // Execute serial brick_transform_reduce, due to the explicit SIMD vectorization (reduction) requires a commutative operation for the guarantee of correct scan.
- return internal::brick_transform_reduce(__first + __i, __first + __j, __init, __binary_op, __unary_op,
- /*__is_vector*/ std::false_type());
+ // Execute serial __brick_transform_reduce, due to the explicit SIMD vectorization (reduction) requires a commutative operation for the guarantee of correct scan.
+ return __brick_transform_reduce(__first + __i, __first + __j, __init, __binary_op, __unary_op,
+ /*__is_vector*/ std::false_type());
},
[__first, __unary_op, __binary_op, __result, __is_vector](_DifferenceType __i, _DifferenceType __j,
_Tp __init) {
- return internal::brick_transform_scan(__first + __i, __first + __j, __result + __i, __unary_op, __init,
- __binary_op, _Inclusive(), __is_vector)
+ return __brick_transform_scan(__first + __i, __first + __j, __result + __i, __unary_op, __init,
+ __binary_op, _Inclusive(), __is_vector)
.second;
});
return __result + (__last - __first);
@@ -263,9 +263,9 @@ pattern_transform_scan(_ExecutionPolicy&
template <class _ExecutionPolicy, class _RandomAccessIterator, class _OutputIterator, class _UnaryOperation, class _Tp,
class _BinaryOperation, class _Inclusive, class _IsVector>
typename std::enable_if<std::is_floating_point<_Tp>::value, _OutputIterator>::type
-pattern_transform_scan(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last,
- _OutputIterator __result, _UnaryOperation __unary_op, _Tp __init, _BinaryOperation __binary_op,
- _Inclusive, _IsVector __is_vector, /*is_parallel=*/std::true_type)
+__pattern_transform_scan(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last,
+ _OutputIterator __result, _UnaryOperation __unary_op, _Tp __init, _BinaryOperation __binary_op,
+ _Inclusive, _IsVector __is_vector, /*is_parallel=*/std::true_type)
{
typedef typename std::iterator_traits<_RandomAccessIterator>::difference_type _DifferenceType;
_DifferenceType __n = __last - __first;
@@ -274,12 +274,12 @@ pattern_transform_scan(_ExecutionPolicy&
{
return __result;
}
- return except_handler([&]() {
- par_backend::parallel_strict_scan(
+ return __except_handler([&]() {
+ __par_backend::parallel_strict_scan(
std::forward<_ExecutionPolicy>(__exec), __n, __init,
[__first, __unary_op, __binary_op, __result, __is_vector](_DifferenceType __i, _DifferenceType __len) {
- return brick_transform_scan(__first + __i, __first + (__i + __len), __result + __i, __unary_op, _Tp{},
- __binary_op, _Inclusive(), __is_vector)
+ return __brick_transform_scan(__first + __i, __first + (__i + __len), __result + __i, __unary_op, _Tp{},
+ __binary_op, _Inclusive(), __is_vector)
.second;
},
__binary_op,
@@ -303,16 +303,16 @@ pattern_transform_scan(_ExecutionPolicy&
template <class _ForwardIterator, class _OutputIterator, class _BinaryOperation>
_OutputIterator
-brick_adjacent_difference(_ForwardIterator __first, _ForwardIterator __last, _OutputIterator __d_first,
- _BinaryOperation __op, /*is_vector*/ std::false_type) noexcept
+__brick_adjacent_difference(_ForwardIterator __first, _ForwardIterator __last, _OutputIterator __d_first,
+ _BinaryOperation __op, /*is_vector*/ std::false_type) noexcept
{
return std::adjacent_difference(__first, __last, __d_first, __op);
}
template <class _ForwardIterator1, class _ForwardIterator2, class BinaryOperation>
_ForwardIterator2
-brick_adjacent_difference(_ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __d_first,
- BinaryOperation __op, /*is_vector=*/std::true_type) noexcept
+__brick_adjacent_difference(_ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __d_first,
+ BinaryOperation __op, /*is_vector=*/std::true_type) noexcept
{
assert(__first != __last);
@@ -321,7 +321,7 @@ brick_adjacent_difference(_ForwardIterat
auto __n = __last - __first;
*__d_first = *__first;
- return unseq_backend::simd_walk_3(
+ return __unseq_backend::__simd_walk_3(
__first + 1, __n - 1, __first, __d_first + 1,
[&__op](_ReferenceType1 __x, _ReferenceType1 __y, _ReferenceType2 __z) { __z = __op(__x, __y); });
}
@@ -329,40 +329,40 @@ brick_adjacent_difference(_ForwardIterat
template <class _ExecutionPolicy, class _ForwardIterator, class _OutputIterator, class _BinaryOperation,
class _IsVector>
_OutputIterator
-pattern_adjacent_difference(_ExecutionPolicy&&, _ForwardIterator __first, _ForwardIterator __last,
- _OutputIterator __d_first, _BinaryOperation __op, _IsVector __is_vector,
- /*is_parallel*/ std::false_type) noexcept
+__pattern_adjacent_difference(_ExecutionPolicy&&, _ForwardIterator __first, _ForwardIterator __last,
+ _OutputIterator __d_first, _BinaryOperation __op, _IsVector __is_vector,
+ /*is_parallel*/ std::false_type) noexcept
{
- return internal::brick_adjacent_difference(__first, __last, __d_first, __op, __is_vector);
+ return __brick_adjacent_difference(__first, __last, __d_first, __op, __is_vector);
}
#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _BinaryOperation,
class _IsVector>
_ForwardIterator2
-pattern_adjacent_difference(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last,
- _ForwardIterator2 __d_first, _BinaryOperation __op, _IsVector __is_vector,
- /*is_parallel=*/std::true_type)
+__pattern_adjacent_difference(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last,
+ _ForwardIterator2 __d_first, _BinaryOperation __op, _IsVector __is_vector,
+ /*is_parallel=*/std::true_type)
{
assert(__first != __last);
typedef typename std::iterator_traits<_ForwardIterator1>::reference _ReferenceType1;
typedef typename std::iterator_traits<_ForwardIterator2>::reference _ReferenceType2;
*__d_first = *__first;
- par_backend::parallel_for(std::forward<_ExecutionPolicy>(__exec), __first, __last - 1,
- [&__op, __is_vector, __d_first, __first](_ForwardIterator1 __b, _ForwardIterator1 __e) {
- _ForwardIterator2 __d_b = __d_first + (__b - __first);
- brick_walk3(__b, __e, __b + 1, __d_b + 1,
- [&__op](_ReferenceType1 __x, _ReferenceType1 __y, _ReferenceType2 __z) {
- __z = __op(__y, __x);
- },
- __is_vector);
- });
+ __par_backend::__parallel_for(
+ std::forward<_ExecutionPolicy>(__exec), __first, __last - 1,
+ [&__op, __is_vector, __d_first, __first](_ForwardIterator1 __b, _ForwardIterator1 __e) {
+ _ForwardIterator2 __d_b = __d_first + (__b - __first);
+ __brick_walk3(
+ __b, __e, __b + 1, __d_b + 1,
+ [&__op](_ReferenceType1 __x, _ReferenceType1 __y, _ReferenceType2 __z) { __z = __op(__y, __x); },
+ __is_vector);
+ });
return __d_first + (__last - __first);
}
#endif
-} // namespace internal
+} // namespace __internal
} // namespace __pstl
#endif /* __PSTL_numeric_impl_H */
Modified: pstl/trunk/include/pstl/internal/parallel_backend_tbb.h
URL: http://llvm.org/viewvc/llvm-project/pstl/trunk/include/pstl/internal/parallel_backend_tbb.h?rev=357203&r1=357202&r2=357203&view=diff
==============================================================================
--- pstl/trunk/include/pstl/internal/parallel_backend_tbb.h (original)
+++ pstl/trunk/include/pstl/internal/parallel_backend_tbb.h Thu Mar 28 12:10:32 2019
@@ -31,7 +31,7 @@
namespace __pstl
{
-namespace par_backend
+namespace __par_backend
{
//! Raw memory buffer with automatic freeing and no exceptions.
@@ -40,18 +40,18 @@ not an initialize array, because initial
would make the span be at least O(N). */
// tbb::allocator can improve performance in some cases.
template <typename _Tp>
-class buffer
+class __buffer
{
tbb::tbb_allocator<_Tp> _M_allocator;
_Tp* _M_ptr;
const std::size_t _M_buf_size;
- buffer(const buffer&) = delete;
+ __buffer(const __buffer&) = delete;
void
- operator=(const buffer&) = delete;
+ operator=(const __buffer&) = delete;
public:
//! Try to obtain buffer of given size to store objects of _Tp type
- buffer(std::size_t n) : _M_allocator(), _M_ptr(_M_allocator.allocate(n)), _M_buf_size(n) {}
+ __buffer(std::size_t n) : _M_allocator(), _M_ptr(_M_allocator.allocate(n)), _M_buf_size(n) {}
//! True if buffer was successfully obtained, zero otherwise.
operator bool() const { return _M_ptr != NULL; }
//! Return pointer to buffer, or NULL if buffer could not be obtained.
@@ -61,12 +61,12 @@ class buffer
return _M_ptr;
}
//! Destroy buffer
- ~buffer() { _M_allocator.deallocate(_M_ptr, _M_buf_size); }
+ ~__buffer() { _M_allocator.deallocate(_M_ptr, _M_buf_size); }
};
// Wrapper for tbb::task
inline void
-cancel_execution()
+__cancel_execution()
{
tbb::task::self().group()->cancel_group_execution();
}
@@ -76,11 +76,11 @@ cancel_execution()
//------------------------------------------------------------------------
template <class _Index, class _RealBody>
-class parallel_for_body
+class __parallel_for_body
{
public:
- parallel_for_body(const _RealBody& __body) : _M_body(__body) {}
- parallel_for_body(const parallel_for_body& __body) : _M_body(__body._M_body) {}
+ __parallel_for_body(const _RealBody& __body) : _M_body(__body) {}
+ __parallel_for_body(const __parallel_for_body& __body) : _M_body(__body._M_body) {}
void
operator()(const tbb::blocked_range<_Index>& __range) const
{
@@ -95,18 +95,19 @@ class parallel_for_body
// wrapper over tbb::parallel_for
template <class _ExecutionPolicy, class _Index, class _Fp>
void
-parallel_for(_ExecutionPolicy&&, _Index __first, _Index __last, _Fp __f)
+__parallel_for(_ExecutionPolicy&&, _Index __first, _Index __last, _Fp __f)
{
- tbb::this_task_arena::isolate(
- [=]() { tbb::parallel_for(tbb::blocked_range<_Index>(__first, __last), parallel_for_body<_Index, _Fp>(__f)); });
+ tbb::this_task_arena::isolate([=]() {
+ tbb::parallel_for(tbb::blocked_range<_Index>(__first, __last), __parallel_for_body<_Index, _Fp>(__f));
+ });
}
//! Evaluation of brick f[i,j) for each subrange [i,j) of [first,last)
// wrapper over tbb::parallel_reduce
template <class _ExecutionPolicy, class _Value, class _Index, typename _RealBody, typename _Reduction>
_Value
-parallel_reduce(_ExecutionPolicy&&, _Index __first, _Index __last, const _Value& __identity,
- const _RealBody& __real_body, const _Reduction& __reduction)
+__parallel_reduce(_ExecutionPolicy&&, _Index __first, _Index __last, const _Value& __identity,
+ const _RealBody& __real_body, const _Reduction& __reduction)
{
return tbb::this_task_arena::isolate([__first, __last, &__identity, &__real_body, &__reduction]() -> _Value {
return tbb::parallel_reduce(
@@ -128,7 +129,7 @@ parallel_reduce(_ExecutionPolicy&&, _Ind
//------------------------------------------------------------------------
template <class _Index, class _Up, class _Tp, class _Cp, class _Rp>
-struct par_trans_red_body
+struct __par_trans_red_body
{
alignas(_Tp) char _M_sum_storage[sizeof(_Tp)]; // Holds generalized non-commutative sum when has_sum==true
_Rp _M_brick_reduce; // Most likely to have non-empty layout
@@ -141,18 +142,18 @@ struct par_trans_red_body
__TBB_ASSERT(_M_has_sum, "sum expected");
return *(_Tp*)_M_sum_storage;
}
- par_trans_red_body(_Up __u, _Tp __init, _Cp __c, _Rp __r)
+ __par_trans_red_body(_Up __u, _Tp __init, _Cp __c, _Rp __r)
: _M_brick_reduce(__r), _M_u(__u), _M_combine(__c), _M_has_sum(true)
{
new (_M_sum_storage) _Tp(__init);
}
- par_trans_red_body(par_trans_red_body& __left, tbb::split)
+ __par_trans_red_body(__par_trans_red_body& __left, tbb::split)
: _M_brick_reduce(__left._M_brick_reduce), _M_u(__left._M_u), _M_combine(__left._M_combine), _M_has_sum(false)
{
}
- ~par_trans_red_body()
+ ~__par_trans_red_body()
{
// 17.6.5.12 tells us to not worry about catching exceptions from destructors.
if (_M_has_sum)
@@ -160,7 +161,7 @@ struct par_trans_red_body
}
void
- join(par_trans_red_body& __rhs)
+ join(__par_trans_red_body& __rhs)
{
sum() = _M_combine(sum(), __rhs.sum());
}
@@ -186,10 +187,10 @@ struct par_trans_red_body
template <class _ExecutionPolicy, class _Index, class _Up, class _Tp, class _Cp, class _Rp>
_Tp
-parallel_transform_reduce(_ExecutionPolicy&&, _Index __first, _Index __last, _Up __u, _Tp __init, _Cp __combine,
- _Rp __brick_reduce)
+__parallel_transform_reduce(_ExecutionPolicy&&, _Index __first, _Index __last, _Up __u, _Tp __init, _Cp __combine,
+ _Rp __brick_reduce)
{
- par_trans_red_body<_Index, _Up, _Tp, _Cp, _Rp> __body(__u, __init, __combine, __brick_reduce);
+ __par_trans_red_body<_Index, _Up, _Tp, _Cp, _Rp> __body(__u, __init, __combine, __brick_reduce);
// The grain size of 3 is used in order to provide mininum 2 elements for each body
tbb::this_task_arena::isolate(
[__first, __last, &__body]() { tbb::parallel_reduce(tbb::blocked_range<_Index>(__first, __last, 3), __body); });
@@ -201,7 +202,7 @@ parallel_transform_reduce(_ExecutionPoli
//------------------------------------------------------------------------
template <class _Index, class _Up, class _Tp, class _Cp, class _Rp, class _Sp>
-class trans_scan_body
+class __trans_scan_body
{
alignas(_Tp) char _M_sum_storage[sizeof(_Tp)]; // Holds generalized non-commutative sum when has_sum==true
_Rp _M_brick_reduce; // Most likely to have non-empty layout
@@ -210,19 +211,19 @@ class trans_scan_body
_Sp _M_scan;
bool _M_has_sum; // Put last to minimize size of class
public:
- trans_scan_body(_Up __u, _Tp __init, _Cp __combine, _Rp __reduce, _Sp __scan)
+ __trans_scan_body(_Up __u, _Tp __init, _Cp __combine, _Rp __reduce, _Sp __scan)
: _M_brick_reduce(__reduce), _M_u(__u), _M_combine(__combine), _M_scan(__scan), _M_has_sum(true)
{
new (_M_sum_storage) _Tp(__init);
}
- trans_scan_body(trans_scan_body& __b, tbb::split)
+ __trans_scan_body(__trans_scan_body& __b, tbb::split)
: _M_brick_reduce(__b._M_brick_reduce), _M_u(__b._M_u), _M_combine(__b._M_combine), _M_scan(__b._M_scan),
_M_has_sum(false)
{
}
- ~trans_scan_body()
+ ~__trans_scan_body()
{
// 17.6.5.12 tells us to not worry about catching exceptions from destructors.
if (_M_has_sum)
@@ -259,7 +260,7 @@ class trans_scan_body
}
void
- reverse_join(trans_scan_body& __a)
+ reverse_join(__trans_scan_body& __a)
{
if (_M_has_sum)
{
@@ -273,7 +274,7 @@ class trans_scan_body
}
void
- assign(trans_scan_body& __b)
+ assign(__trans_scan_body& __b)
{
sum() = __b.sum();
}
@@ -281,7 +282,7 @@ class trans_scan_body
template <typename _Index>
_Index
-split(_Index __m)
+__split(_Index __m)
{
_Index __k = 1;
while (2 * __k < __m)
@@ -295,18 +296,16 @@ split(_Index __m)
template <typename _Index, typename _Tp, typename _Rp, typename _Cp>
void
-upsweep(_Index __i, _Index __m, _Index __tilesize, _Tp* __r, _Index __lastsize, _Rp __reduce, _Cp __combine)
+__upsweep(_Index __i, _Index __m, _Index __tilesize, _Tp* __r, _Index __lastsize, _Rp __reduce, _Cp __combine)
{
if (__m == 1)
__r[0] = __reduce(__i * __tilesize, __lastsize);
else
{
- _Index __k = split(__m);
- tbb::parallel_invoke([=] { par_backend::upsweep(__i, __k, __tilesize, __r, __tilesize, __reduce, __combine); },
- [=] {
- par_backend::upsweep(__i + __k, __m - __k, __tilesize, __r + __k, __lastsize, __reduce,
- __combine);
- });
+ _Index __k = __split(__m);
+ tbb::parallel_invoke(
+ [=] { __upsweep(__i, __k, __tilesize, __r, __tilesize, __reduce, __combine); },
+ [=] { __upsweep(__i + __k, __m - __k, __tilesize, __r + __k, __lastsize, __reduce, __combine); });
if (__m == 2 * __k)
__r[__m - 1] = __combine(__r[__k - 1], __r[__m - 1]);
}
@@ -314,22 +313,21 @@ upsweep(_Index __i, _Index __m, _Index _
template <typename _Index, typename _Tp, typename _Cp, typename _Sp>
void
-downsweep(_Index __i, _Index __m, _Index __tilesize, _Tp* __r, _Index __lastsize, _Tp __initial, _Cp __combine,
- _Sp __scan)
+__downsweep(_Index __i, _Index __m, _Index __tilesize, _Tp* __r, _Index __lastsize, _Tp __initial, _Cp __combine,
+ _Sp __scan)
{
if (__m == 1)
__scan(__i * __tilesize, __lastsize, __initial);
else
{
- const _Index __k = par_backend::split(__m);
- tbb::parallel_invoke(
- [=] { par_backend::downsweep(__i, __k, __tilesize, __r, __tilesize, __initial, __combine, __scan); },
- // Assumes that __combine never throws.
- //TODO: Consider adding a requirement for user functors to be constant.
- [=, &__combine] {
- par_backend::downsweep(__i + __k, __m - __k, __tilesize, __r + __k, __lastsize,
- __combine(__initial, __r[__k - 1]), __combine, __scan);
- });
+ const _Index __k = __split(__m);
+ tbb::parallel_invoke([=] { __downsweep(__i, __k, __tilesize, __r, __tilesize, __initial, __combine, __scan); },
+ // Assumes that __combine never throws.
+ //TODO: Consider adding a requirement for user functors to be constant.
+ [=, &__combine] {
+ __downsweep(__i + __k, __m - __k, __tilesize, __r + __k, __lastsize,
+ __combine(__initial, __r[__k - 1]), __combine, __scan);
+ });
}
}
@@ -345,7 +343,7 @@ downsweep(_Index __i, _Index __m, _Index
// Thus callers can rely upon side effects in reduce.
// combine must not throw an exception.
// apex is called exactly once, after all calls to reduce and before all calls to scan.
-// For example, it's useful for allocating a buffer used by scan but whose size is the sum of all reduction values.
+// For example, it's useful for allocating a __buffer used by scan but whose size is the sum of all reduction values.
// T must have a trivial constructor and destructor.
template <class _ExecutionPolicy, typename _Index, typename _Tp, typename _Rp, typename _Cp, typename _Sp, typename _Ap>
void
@@ -358,10 +356,10 @@ parallel_strict_scan(_ExecutionPolicy&&,
const _Index __slack = 4;
_Index __tilesize = (__n - 1) / (__slack * __p) + 1;
_Index __m = (__n - 1) / __tilesize;
- buffer<_Tp> __buf(__m + 1);
+ __buffer<_Tp> __buf(__m + 1);
_Tp* __r = __buf.get();
- par_backend::upsweep(_Index(0), _Index(__m + 1), __tilesize, __r, __n - __m * __tilesize, __reduce,
- __combine);
+ __upsweep(_Index(0), _Index(__m + 1), __tilesize, __r, __n - __m * __tilesize, __reduce, __combine);
+
// When __apex is a no-op and __combine has no side effects, a good optimizer
// should be able to eliminate all code between here and __apex.
// Alternatively, provide a default value for __apex that can be
@@ -371,8 +369,8 @@ parallel_strict_scan(_ExecutionPolicy&&,
while ((__k &= __k - 1))
__t = __combine(__r[__k - 1], __t);
__apex(__combine(__initial, __t));
- par_backend::downsweep(_Index(0), _Index(__m + 1), __tilesize, __r, __n - __m * __tilesize, __initial,
- __combine, __scan);
+ __downsweep(_Index(0), _Index(__m + 1), __tilesize, __r, __n - __m * __tilesize, __initial, __combine,
+ __scan);
return;
}
// Fewer than 2 elements in sequence, or out of memory. Handle has single block.
@@ -387,10 +385,10 @@ parallel_strict_scan(_ExecutionPolicy&&,
template <class _ExecutionPolicy, class _Index, class _Up, class _Tp, class _Cp, class _Rp, class _Sp>
_Tp
-parallel_transform_scan(_ExecutionPolicy&&, _Index __n, _Up __u, _Tp __init, _Cp __combine, _Rp __brick_reduce,
- _Sp __scan)
+__parallel_transform_scan(_ExecutionPolicy&&, _Index __n, _Up __u, _Tp __init, _Cp __combine, _Rp __brick_reduce,
+ _Sp __scan)
{
- trans_scan_body<_Index, _Up, _Tp, _Cp, _Rp, _Sp> __body(__u, __init, __combine, __brick_reduce, __scan);
+ __trans_scan_body<_Index, _Up, _Tp, _Cp, _Rp, _Sp> __body(__u, __init, __combine, __brick_reduce, __scan);
auto __range = tbb::blocked_range<_Index>(0, __n);
tbb::this_task_arena::isolate([__range, &__body]() { tbb::parallel_scan(__range, __body); });
return __body.sum();
@@ -408,7 +406,7 @@ parallel_transform_scan(_ExecutionPolicy
template <typename _RandomAccessIterator1, typename _RandomAccessIterator2, typename _RandomAccessIterator3,
typename _Compare, typename _Cleanup, typename _LeafMerge>
-class merge_task : public tbb::task
+class __merge_task : public tbb::task
{
/*override*/ tbb::task*
execute();
@@ -420,9 +418,9 @@ class merge_task : public tbb::task
_LeafMerge _M_leaf_merge;
public:
- merge_task(_RandomAccessIterator1 __xs, _RandomAccessIterator1 __xe, _RandomAccessIterator2 __ys,
- _RandomAccessIterator2 __ye, _RandomAccessIterator3 __zs, _Compare __comp, _Cleanup __cleanup,
- _LeafMerge __leaf_merge)
+ __merge_task(_RandomAccessIterator1 __xs, _RandomAccessIterator1 __xe, _RandomAccessIterator2 __ys,
+ _RandomAccessIterator2 __ye, _RandomAccessIterator3 __zs, _Compare __comp, _Cleanup __cleanup,
+ _LeafMerge __leaf_merge)
: _M_xs(__xs), _M_xe(__xe), _M_ys(__ys), _M_ye(__ye), _M_zs(__zs), _M_comp(__comp), _M_cleanup(__cleanup),
_M_leaf_merge(__leaf_merge)
{
@@ -434,8 +432,8 @@ class merge_task : public tbb::task
template <typename _RandomAccessIterator1, typename _RandomAccessIterator2, typename _RandomAccessIterator3,
typename __M_Compare, typename _Cleanup, typename _LeafMerge>
tbb::task*
-merge_task<_RandomAccessIterator1, _RandomAccessIterator2, _RandomAccessIterator3, __M_Compare, _Cleanup,
- _LeafMerge>::execute()
+__merge_task<_RandomAccessIterator1, _RandomAccessIterator2, _RandomAccessIterator3, __M_Compare, _Cleanup,
+ _LeafMerge>::execute()
{
typedef typename std::iterator_traits<_RandomAccessIterator1>::difference_type _DifferenceType1;
typedef typename std::iterator_traits<_RandomAccessIterator2>::difference_type _DifferenceType2;
@@ -467,7 +465,7 @@ merge_task<_RandomAccessIterator1, _Rand
}
const _RandomAccessIterator3 __zm = _M_zs + ((__xm - _M_xs) + (__ym - _M_ys));
tbb::task* __right = new (tbb::task::allocate_additional_child_of(*parent()))
- merge_task(__xm, _M_xe, __ym, _M_ye, __zm, _M_comp, _M_cleanup, _M_leaf_merge);
+ __merge_task(__xm, _M_xe, __ym, _M_ye, __zm, _M_comp, _M_cleanup, _M_leaf_merge);
tbb::task::spawn(*__right);
tbb::task::recycle_as_continuation();
_M_xe = __xm;
@@ -477,7 +475,7 @@ merge_task<_RandomAccessIterator1, _Rand
}
template <typename _RandomAccessIterator1, typename _RandomAccessIterator2, typename _Compare, typename _LeafSort>
-class stable_sort_task : public tbb::task
+class __stable_sort_task : public tbb::task
{
public:
typedef typename std::iterator_traits<_RandomAccessIterator1>::difference_type _DifferenceType1;
@@ -495,8 +493,8 @@ class stable_sort_task : public tbb::tas
_SizeType _M_nsort;
public:
- stable_sort_task(_RandomAccessIterator1 __xs, _RandomAccessIterator1 __xe, _RandomAccessIterator2 __zs,
- int32_t __inplace, _Compare __comp, _LeafSort __leaf_sort, _SizeType __n)
+ __stable_sort_task(_RandomAccessIterator1 __xs, _RandomAccessIterator1 __xe, _RandomAccessIterator2 __zs,
+ int32_t __inplace, _Compare __comp, _LeafSort __leaf_sort, _SizeType __n)
: _M_xs(__xs), _M_xe(__xe), _M_zs(__zs), _M_comp(__comp), _M_leaf_sort(__leaf_sort), _M_inplace(__inplace),
_M_nsort(__n)
{
@@ -504,7 +502,7 @@ class stable_sort_task : public tbb::tas
};
//! Binary operator that does nothing
-struct binary_no_op
+struct __binary_no_op
{
template <typename _T>
void operator()(_T, _T)
@@ -516,7 +514,7 @@ struct binary_no_op
template <typename _RandomAccessIterator1, typename _RandomAccessIterator2, typename _Compare, typename _LeafSort>
tbb::task*
-stable_sort_task<_RandomAccessIterator1, _RandomAccessIterator2, _Compare, _LeafSort>::execute()
+__stable_sort_task<_RandomAccessIterator1, _RandomAccessIterator2, _Compare, _LeafSort>::execute()
{
const _SizeType __n = _M_xe - _M_xs;
const _SizeType __nmerge = _M_nsort > 0 ? _M_nsort : __n;
@@ -525,7 +523,7 @@ stable_sort_task<_RandomAccessIterator1,
{
_M_leaf_sort(_M_xs, _M_xe, _M_comp);
if (_M_inplace != 2)
- init_buf(_M_xs, _M_xe, _M_zs, _M_inplace == 0);
+ __init_buf(_M_xs, _M_xe, _M_zs, _M_inplace == 0);
return NULL;
}
else
@@ -539,18 +537,19 @@ stable_sort_task<_RandomAccessIterator1,
_RandomAccessIterator1 __first2) { return std::move(__first1, __last1, __first2); };
if (_M_inplace == 2)
__m = new (allocate_continuation())
- merge_task<_RandomAccessIterator2, _RandomAccessIterator2, _RandomAccessIterator1, _Compare,
- serial_destroy, serial_move_merge<decltype(__move_values), decltype(__move_sequences)>>(
- _M_zs, __zm, __zm, __ze, _M_xs, _M_comp, serial_destroy(),
- serial_move_merge<decltype(__move_values), decltype(__move_sequences)>(__nmerge, __move_values,
- __move_sequences));
+ __merge_task<_RandomAccessIterator2, _RandomAccessIterator2, _RandomAccessIterator1, _Compare,
+ __serial_destroy,
+ __serial_move_merge<decltype(__move_values), decltype(__move_sequences)>>(
+ _M_zs, __zm, __zm, __ze, _M_xs, _M_comp, __serial_destroy(),
+ __serial_move_merge<decltype(__move_values), decltype(__move_sequences)>(__nmerge, __move_values,
+ __move_sequences));
else if (_M_inplace)
__m = new (allocate_continuation())
- merge_task<_RandomAccessIterator2, _RandomAccessIterator2, _RandomAccessIterator1, _Compare,
- binary_no_op, serial_move_merge<decltype(__move_values), decltype(__move_sequences)>>(
- _M_zs, __zm, __zm, __ze, _M_xs, _M_comp, binary_no_op(),
- serial_move_merge<decltype(__move_values), decltype(__move_sequences)>(__nmerge, __move_values,
- __move_sequences));
+ __merge_task<_RandomAccessIterator2, _RandomAccessIterator2, _RandomAccessIterator1, _Compare,
+ __binary_no_op, __serial_move_merge<decltype(__move_values), decltype(__move_sequences)>>(
+ _M_zs, __zm, __zm, __ze, _M_xs, _M_comp, __binary_no_op(),
+ __serial_move_merge<decltype(__move_values), decltype(__move_sequences)>(__nmerge, __move_values,
+ __move_sequences));
else
{
auto __move_values = [](_RandomAccessIterator1 __x, _RandomAccessIterator2 __z) { *__z = std::move(*__x); };
@@ -559,15 +558,15 @@ stable_sort_task<_RandomAccessIterator1,
return std::move(__first1, __last1, __first2);
};
__m = new (allocate_continuation())
- merge_task<_RandomAccessIterator1, _RandomAccessIterator1, _RandomAccessIterator2, _Compare,
- binary_no_op, serial_move_merge<decltype(__move_values), decltype(__move_sequences)>>(
- _M_xs, __xm, __xm, _M_xe, _M_zs, _M_comp, binary_no_op(),
- serial_move_merge<decltype(__move_values), decltype(__move_sequences)>(__nmerge, __move_values,
- __move_sequences));
+ __merge_task<_RandomAccessIterator1, _RandomAccessIterator1, _RandomAccessIterator2, _Compare,
+ __binary_no_op, __serial_move_merge<decltype(__move_values), decltype(__move_sequences)>>(
+ _M_xs, __xm, __xm, _M_xe, _M_zs, _M_comp, __binary_no_op(),
+ __serial_move_merge<decltype(__move_values), decltype(__move_sequences)>(__nmerge, __move_values,
+ __move_sequences));
}
__m->set_ref_count(2);
task* __right = new (__m->allocate_child())
- stable_sort_task(__xm, _M_xe, __zm, !_M_inplace, _M_comp, _M_leaf_sort, __nmerge);
+ __stable_sort_task(__xm, _M_xe, __zm, !_M_inplace, _M_comp, _M_leaf_sort, __nmerge);
spawn(*__right);
recycle_as_child_of(*__m);
_M_xe = __xm;
@@ -578,8 +577,8 @@ stable_sort_task<_RandomAccessIterator1,
template <class _ExecutionPolicy, typename _RandomAccessIterator, typename _Compare, typename _LeafSort>
void
-parallel_stable_sort(_ExecutionPolicy&&, _RandomAccessIterator __xs, _RandomAccessIterator __xe, _Compare __comp,
- _LeafSort __leaf_sort, std::size_t __nsort = 0)
+__parallel_stable_sort(_ExecutionPolicy&&, _RandomAccessIterator __xs, _RandomAccessIterator __xe, _Compare __comp,
+ _LeafSort __leaf_sort, std::size_t __nsort = 0)
{
tbb::this_task_arena::isolate([=, &__nsort]() {
//sorting based on task tree and parallel merge
@@ -593,10 +592,10 @@ parallel_stable_sort(_ExecutionPolicy&&,
if (__n > __sort_cut_off)
{
assert(__nsort > 0 && __nsort <= __n);
- buffer<_ValueType> __buf(__n);
+ __buffer<_ValueType> __buf(__n);
using tbb::task;
task::spawn_root_and_wait(*new (task::allocate_root())
- stable_sort_task<_RandomAccessIterator, _ValueType*, _Compare, _LeafSort>(
+ __stable_sort_task<_RandomAccessIterator, _ValueType*, _Compare, _LeafSort>(
__xs, __xe, (_ValueType*)__buf.get(), 2, __comp, __leaf_sort, __nsort));
return;
}
@@ -612,9 +611,9 @@ parallel_stable_sort(_ExecutionPolicy&&,
template <class _ExecutionPolicy, typename _RandomAccessIterator1, typename _RandomAccessIterator2,
typename _RandomAccessIterator3, typename _Compare, typename _LeafMerge>
void
-parallel_merge(_ExecutionPolicy&&, _RandomAccessIterator1 __xs, _RandomAccessIterator1 __xe,
- _RandomAccessIterator2 __ys, _RandomAccessIterator2 __ye, _RandomAccessIterator3 __zs, _Compare __comp,
- _LeafMerge __leaf_merge)
+__parallel_merge(_ExecutionPolicy&&, _RandomAccessIterator1 __xs, _RandomAccessIterator1 __xe,
+ _RandomAccessIterator2 __ys, _RandomAccessIterator2 __ye, _RandomAccessIterator3 __zs, _Compare __comp,
+ _LeafMerge __leaf_merge)
{
typedef typename std::iterator_traits<_RandomAccessIterator1>::difference_type _DifferenceType1;
typedef typename std::iterator_traits<_RandomAccessIterator2>::difference_type _DifferenceType2;
@@ -629,11 +628,11 @@ parallel_merge(_ExecutionPolicy&&, _Rand
else
{
tbb::this_task_arena::isolate([=]() {
- typedef merge_task<_RandomAccessIterator1, _RandomAccessIterator2, _RandomAccessIterator3, _Compare,
- par_backend::binary_no_op, _LeafMerge>
+ typedef __merge_task<_RandomAccessIterator1, _RandomAccessIterator2, _RandomAccessIterator3, _Compare,
+ __binary_no_op, _LeafMerge>
_TaskType;
tbb::task::spawn_root_and_wait(*new (tbb::task::allocate_root()) _TaskType(
- __xs, __xe, __ys, __ye, __zs, __comp, par_backend::binary_no_op(), __leaf_merge));
+ __xs, __xe, __ys, __ye, __zs, __comp, __binary_no_op(), __leaf_merge));
});
}
}
@@ -643,13 +642,13 @@ parallel_merge(_ExecutionPolicy&&, _Rand
//------------------------------------------------------------------------
template <class _ExecutionPolicy, typename _F1, typename _F2>
void
-parallel_invoke(_ExecutionPolicy&&, _F1&& __f1, _F2&& __f2)
+__parallel_invoke(_ExecutionPolicy&&, _F1&& __f1, _F2&& __f2)
{
//TODO: a version of tbb::this_task_arena::isolate with variadic arguments pack should be added in the future
tbb::this_task_arena::isolate([&]() { tbb::parallel_invoke(std::forward<_F1>(__f1), std::forward<_F2>(__f2)); });
}
-} // namespace par_backend
+} // namespace __par_backend
} // namespace __pstl
#endif /* __PSTL_parallel_backend_tbb_H */
Modified: pstl/trunk/include/pstl/internal/parallel_backend_utils.h
URL: http://llvm.org/viewvc/llvm-project/pstl/trunk/include/pstl/internal/parallel_backend_utils.h?rev=357203&r1=357202&r2=357203&view=diff
==============================================================================
--- pstl/trunk/include/pstl/internal/parallel_backend_utils.h (original)
+++ pstl/trunk/include/pstl/internal/parallel_backend_utils.h Thu Mar 28 12:10:32 2019
@@ -17,11 +17,11 @@
namespace __pstl
{
-namespace par_backend
+namespace __par_backend
{
//! Destroy sequence [xs,xe)
-struct serial_destroy
+struct __serial_destroy
{
template <typename _RandomAccessIterator>
void
@@ -38,13 +38,13 @@ struct serial_destroy
//! Merge sequences [__xs,__xe) and [__ys,__ye) to output sequence [__zs,(__xe-__xs)+(__ye-__ys)), using std::move
template <class _MoveValues, class _MoveSequences>
-struct serial_move_merge
+struct __serial_move_merge
{
const std::size_t _M_nmerge;
_MoveValues _M_move_values;
_MoveSequences _M_move_sequences;
- explicit serial_move_merge(std::size_t __nmerge, _MoveValues __move_values, _MoveSequences __move_sequences)
+ explicit __serial_move_merge(std::size_t __nmerge, _MoveValues __move_values, _MoveSequences __move_sequences)
: _M_nmerge(__nmerge), _M_move_values(__move_values), _M_move_sequences(__move_sequences)
{
}
@@ -108,7 +108,7 @@ struct serial_move_merge
template <typename _RandomAccessIterator1, typename _OutputIterator>
void
-init_buf(_RandomAccessIterator1 __xs, _RandomAccessIterator1 __xe, _OutputIterator __zs, bool __bMove)
+__init_buf(_RandomAccessIterator1 __xs, _RandomAccessIterator1 __xe, _OutputIterator __zs, bool __bMove)
{
const _OutputIterator __ze = __zs + (__xe - __xs);
typedef typename std::iterator_traits<_OutputIterator>::value_type _ValueType;
@@ -126,8 +126,9 @@ init_buf(_RandomAccessIterator1 __xs, _R
}
}
+// TODO is this actually used anywhere?
template <typename _Buf>
-class stack
+class __stack
{
typedef typename std::iterator_traits<decltype(_Buf(0).get())>::value_type _ValueType;
typedef typename std::iterator_traits<_ValueType*>::difference_type _DifferenceType;
@@ -136,14 +137,14 @@ class stack
_ValueType* _M_ptr;
_DifferenceType _M_maxsize;
- stack(const stack&) = delete;
+ __stack(const __stack&) = delete;
void
- operator=(const stack&) = delete;
+ operator=(const __stack&) = delete;
public:
- stack(_DifferenceType __max_size) : _M_buf(__max_size), _M_maxsize(__max_size) { _M_ptr = _M_buf.get(); }
+ __stack(_DifferenceType __max_size) : _M_buf(__max_size), _M_maxsize(__max_size) { _M_ptr = _M_buf.get(); }
- ~stack()
+ ~__stack()
{
assert(size() <= _M_maxsize);
while (!empty())
@@ -189,7 +190,7 @@ class stack
}
};
-} // namespace par_backend
+} // namespace __par_backend
} // namespace __pstl
#endif /* __PSTL_parallel_backend_utils_H */
Modified: pstl/trunk/include/pstl/internal/parallel_impl.h
URL: http://llvm.org/viewvc/llvm-project/pstl/trunk/include/pstl/internal/parallel_impl.h?rev=357203&r1=357202&r2=357203&view=diff
==============================================================================
--- pstl/trunk/include/pstl/internal/parallel_impl.h (original)
+++ pstl/trunk/include/pstl/internal/parallel_impl.h Thu Mar 28 12:10:32 2019
@@ -16,7 +16,7 @@
namespace __pstl
{
-namespace internal
+namespace __internal
{
//------------------------------------------------------------------------
@@ -26,32 +26,32 @@ namespace internal
Each f[i,j) must return a value in [i,j). */
template <class _ExecutionPolicy, class _Index, class _Brick, class _Compare>
_Index
-parallel_find(_ExecutionPolicy&& __exec, _Index __first, _Index __last, _Brick __f, _Compare __comp, bool __b_first)
+__parallel_find(_ExecutionPolicy&& __exec, _Index __first, _Index __last, _Brick __f, _Compare __comp, bool __b_first)
{
typedef typename std::iterator_traits<_Index>::difference_type _DifferenceType;
const _DifferenceType __n = __last - __first;
_DifferenceType __initial_dist = __b_first ? __n : -1;
std::atomic<_DifferenceType> __extremum(__initial_dist);
// TODO: find out what is better here: parallel_for or parallel_reduce
- par_backend::parallel_for(std::forward<_ExecutionPolicy>(__exec), __first, __last,
- [__comp, __f, __first, &__extremum](_Index __i, _Index __j) {
- // See "Reducing Contention Through Priority Updates", PPoPP '13, for discussion of
- // why using a shared variable scales fairly well in this situation.
- if (__comp(__i - __first, __extremum))
- {
- _Index __res = __f(__i, __j);
- // If not '__last' returned then we found what we want so put this to extremum
- if (__res != __j)
+ __par_backend::__parallel_for(std::forward<_ExecutionPolicy>(__exec), __first, __last,
+ [__comp, __f, __first, &__extremum](_Index __i, _Index __j) {
+ // See "Reducing Contention Through Priority Updates", PPoPP '13, for discussion of
+ // why using a shared variable scales fairly well in this situation.
+ if (__comp(__i - __first, __extremum))
{
- const _DifferenceType __k = __res - __first;
- for (_DifferenceType __old = __extremum; __comp(__k, __old);
- __old = __extremum)
+ _Index __res = __f(__i, __j);
+ // If not '__last' returned then we found what we want so put this to extremum
+ if (__res != __j)
{
- __extremum.compare_exchange_weak(__old, __k);
+ const _DifferenceType __k = __res - __first;
+ for (_DifferenceType __old = __extremum; __comp(__k, __old);
+ __old = __extremum)
+ {
+ __extremum.compare_exchange_weak(__old, __k);
+ }
}
}
- }
- });
+ });
return __extremum != __initial_dist ? __first + __extremum : __last;
}
@@ -61,21 +61,21 @@ parallel_find(_ExecutionPolicy&& __exec,
//! Return true if brick f[i,j) returns true for some subrange [i,j) of [first,last)
template <class _ExecutionPolicy, class _Index, class _Brick>
bool
-parallel_or(_ExecutionPolicy&& __exec, _Index __first, _Index __last, _Brick __f)
+__parallel_or(_ExecutionPolicy&& __exec, _Index __first, _Index __last, _Brick __f)
{
std::atomic<bool> __found(false);
- par_backend::parallel_for(std::forward<_ExecutionPolicy>(__exec), __first, __last,
- [__f, &__found](_Index __i, _Index __j) {
- if (!__found.load(std::memory_order_relaxed) && __f(__i, __j))
- {
- __found.store(true, std::memory_order_relaxed);
- par_backend::cancel_execution();
- }
- });
+ __par_backend::__parallel_for(std::forward<_ExecutionPolicy>(__exec), __first, __last,
+ [__f, &__found](_Index __i, _Index __j) {
+ if (!__found.load(std::memory_order_relaxed) && __f(__i, __j))
+ {
+ __found.store(true, std::memory_order_relaxed);
+ __par_backend::__cancel_execution();
+ }
+ });
return __found;
}
-} // namespace internal
+} // namespace __internal
} // namespace __pstl
#endif /* __PSTL_parallel_impl_H */
Modified: pstl/trunk/include/pstl/internal/unseq_backend_simd.h
URL: http://llvm.org/viewvc/llvm-project/pstl/trunk/include/pstl/internal/unseq_backend_simd.h?rev=357203&r1=357202&r2=357203&view=diff
==============================================================================
--- pstl/trunk/include/pstl/internal/unseq_backend_simd.h (original)
+++ pstl/trunk/include/pstl/internal/unseq_backend_simd.h Thu Mar 28 12:10:32 2019
@@ -18,7 +18,7 @@
// to support parallel STL.
namespace __pstl
{
-namespace unseq_backend
+namespace __unseq_backend
{
// Expect vector width up to 64 (or 512 bit)
@@ -26,7 +26,7 @@ const std::size_t __lane_size = 64;
template <class _Iterator, class _DifferenceType, class _Function>
_Iterator
-simd_walk_1(_Iterator __first, _DifferenceType __n, _Function __f) noexcept
+__simd_walk_1(_Iterator __first, _DifferenceType __n, _Function __f) noexcept
{
__PSTL_PRAGMA_SIMD
for (_DifferenceType __i = 0; __i < __n; ++__i)
@@ -37,7 +37,7 @@ simd_walk_1(_Iterator __first, _Differen
template <class _Iterator1, class _DifferenceType, class _Iterator2, class _Function>
_Iterator2
-simd_walk_2(_Iterator1 __first1, _DifferenceType __n, _Iterator2 __first2, _Function __f) noexcept
+__simd_walk_2(_Iterator1 __first1, _DifferenceType __n, _Iterator2 __first2, _Function __f) noexcept
{
__PSTL_PRAGMA_SIMD
for (_DifferenceType __i = 0; __i < __n; ++__i)
@@ -47,7 +47,8 @@ simd_walk_2(_Iterator1 __first1, _Differ
template <class _Iterator1, class _DifferenceType, class _Iterator2, class _Iterator3, class _Function>
_Iterator3
-simd_walk_3(_Iterator1 __first1, _DifferenceType __n, _Iterator2 __first2, _Iterator3 __first3, _Function __f) noexcept
+__simd_walk_3(_Iterator1 __first1, _DifferenceType __n, _Iterator2 __first2, _Iterator3 __first3,
+ _Function __f) noexcept
{
__PSTL_PRAGMA_SIMD
for (_DifferenceType __i = 0; __i < __n; ++__i)
@@ -55,10 +56,10 @@ simd_walk_3(_Iterator1 __first1, _Differ
return __first3 + __n;
}
-// TODO: check whether simd_first() can be used here
+// TODO: check whether __simd_first() can be used here
template <class _Index, class _DifferenceType, class _Pred>
bool
-simd_or(_Index __first, _DifferenceType __n, _Pred __pred) noexcept
+__simd_or(_Index __first, _DifferenceType __n, _Pred __pred) noexcept
{
#if __PSTL_EARLYEXIT_PRESENT
_DifferenceType __i;
@@ -98,7 +99,7 @@ simd_or(_Index __first, _DifferenceType
template <class _Index, class _DifferenceType, class _Compare>
_Index
-simd_first(_Index __first, _DifferenceType __begin, _DifferenceType __end, _Compare __comp) noexcept
+__simd_first(_Index __first, _DifferenceType __begin, _DifferenceType __end, _Compare __comp) noexcept
{
#if __PSTL_EARLYEXIT_PRESENT
_DifferenceType __i = __begin;
@@ -158,7 +159,7 @@ simd_first(_Index __first, _DifferenceTy
template <class _Index1, class _DifferenceType, class _Index2, class _Pred>
std::pair<_Index1, _Index2>
-simd_first(_Index1 __first1, _DifferenceType __n, _Index2 __first2, _Pred __pred) noexcept
+__simd_first(_Index1 __first1, _DifferenceType __n, _Index2 __first2, _Pred __pred) noexcept
{
#if __PSTL_EARLYEXIT_PRESENT
_DifferenceType __i = 0;
@@ -212,7 +213,7 @@ simd_first(_Index1 __first1, _Difference
template <class _Index, class _DifferenceType, class _Pred>
_DifferenceType
-simd_count(_Index __index, _DifferenceType __n, _Pred __pred) noexcept
+__simd_count(_Index __index, _DifferenceType __n, _Pred __pred) noexcept
{
_DifferenceType __count = 0;
__PSTL_PRAGMA_SIMD_REDUCTION(+ : __count)
@@ -225,8 +226,8 @@ simd_count(_Index __index, _DifferenceTy
template <class _InputIterator, class _DifferenceType, class _OutputIterator, class _BinaryPredicate>
_OutputIterator
-simd_unique_copy(_InputIterator __first, _DifferenceType __n, _OutputIterator __result,
- _BinaryPredicate __pred) noexcept
+__simd_unique_copy(_InputIterator __first, _DifferenceType __n, _OutputIterator __result,
+ _BinaryPredicate __pred) noexcept
{
if (__n == 0)
return __result;
@@ -249,7 +250,7 @@ simd_unique_copy(_InputIterator __first,
template <class _InputIterator, class _DifferenceType, class _OutputIterator, class _Assigner>
_OutputIterator
-simd_assign(_InputIterator __first, _DifferenceType __n, _OutputIterator __result, _Assigner __assigner) noexcept
+__simd_assign(_InputIterator __first, _DifferenceType __n, _OutputIterator __result, _Assigner __assigner) noexcept
{
__PSTL_USE_NONTEMPORAL_STORES_IF_ALLOWED
__PSTL_PRAGMA_SIMD
@@ -260,7 +261,7 @@ simd_assign(_InputIterator __first, _Dif
template <class _InputIterator, class _DifferenceType, class _OutputIterator, class _UnaryPredicate>
_OutputIterator
-simd_copy_if(_InputIterator __first, _DifferenceType __n, _OutputIterator __result, _UnaryPredicate __pred) noexcept
+__simd_copy_if(_InputIterator __first, _DifferenceType __n, _OutputIterator __result, _UnaryPredicate __pred) noexcept
{
_DifferenceType __cnt = 0;
@@ -279,7 +280,7 @@ simd_copy_if(_InputIterator __first, _Di
template <class _InputIterator, class _DifferenceType, class _BinaryPredicate>
_DifferenceType
-simd_calc_mask_2(_InputIterator __first, _DifferenceType __n, bool* __mask, _BinaryPredicate __pred) noexcept
+__simd_calc_mask_2(_InputIterator __first, _DifferenceType __n, bool* __mask, _BinaryPredicate __pred) noexcept
{
_DifferenceType __count = 0;
@@ -294,7 +295,7 @@ simd_calc_mask_2(_InputIterator __first,
template <class _InputIterator, class _DifferenceType, class _UnaryPredicate>
_DifferenceType
-simd_calc_mask_1(_InputIterator __first, _DifferenceType __n, bool* __mask, _UnaryPredicate __pred) noexcept
+__simd_calc_mask_1(_InputIterator __first, _DifferenceType __n, bool* __mask, _UnaryPredicate __pred) noexcept
{
_DifferenceType __count = 0;
@@ -309,8 +310,8 @@ simd_calc_mask_1(_InputIterator __first,
template <class _InputIterator, class _DifferenceType, class _OutputIterator, class _Assigner>
void
-simd_copy_by_mask(_InputIterator __first, _DifferenceType __n, _OutputIterator __result, bool* __mask,
- _Assigner __assigner) noexcept
+__simd_copy_by_mask(_InputIterator __first, _DifferenceType __n, _OutputIterator __result, bool* __mask,
+ _Assigner __assigner) noexcept
{
_DifferenceType __cnt = 0;
__PSTL_PRAGMA_SIMD
@@ -329,8 +330,8 @@ simd_copy_by_mask(_InputIterator __first
template <class _InputIterator, class _DifferenceType, class _OutputIterator1, class _OutputIterator2>
void
-simd_partition_by_mask(_InputIterator __first, _DifferenceType __n, _OutputIterator1 __out_true,
- _OutputIterator2 __out_false, bool* __mask) noexcept
+__simd_partition_by_mask(_InputIterator __first, _DifferenceType __n, _OutputIterator1 __out_true,
+ _OutputIterator2 __out_false, bool* __mask) noexcept
{
_DifferenceType __cnt_true = 0, __cnt_false = 0;
__PSTL_PRAGMA_SIMD
@@ -352,7 +353,7 @@ simd_partition_by_mask(_InputIterator __
template <class _Index, class _DifferenceType, class _Tp>
_Index
-simd_fill_n(_Index __first, _DifferenceType __n, const _Tp& __value) noexcept
+__simd_fill_n(_Index __first, _DifferenceType __n, const _Tp& __value) noexcept
{
__PSTL_USE_NONTEMPORAL_STORES_IF_ALLOWED
__PSTL_PRAGMA_SIMD
@@ -363,7 +364,7 @@ simd_fill_n(_Index __first, _DifferenceT
template <class _Index, class _DifferenceType, class _Generator>
_Index
-simd_generate_n(_Index __first, _DifferenceType __size, _Generator __g) noexcept
+__simd_generate_n(_Index __first, _DifferenceType __size, _Generator __g) noexcept
{
__PSTL_USE_NONTEMPORAL_STORES_IF_ALLOWED
__PSTL_PRAGMA_SIMD
@@ -374,7 +375,7 @@ simd_generate_n(_Index __first, _Differe
template <class _Index, class _BinaryPredicate>
_Index
-simd_adjacent_find(_Index __first, _Index __last, _BinaryPredicate __pred, bool __or_semantic) noexcept
+__simd_adjacent_find(_Index __first, _Index __last, _BinaryPredicate __pred, bool __or_semantic) noexcept
{
if (__last - __first < 2)
return __last;
@@ -443,7 +444,7 @@ using is_arithmetic_plus = std::integral
template <typename _DifferenceType, typename _Tp, typename _BinaryOperation, typename _UnaryOperation>
typename std::enable_if<is_arithmetic_plus<_Tp, _BinaryOperation>::value, _Tp>::type
-simd_transform_reduce(_DifferenceType __n, _Tp __init, _BinaryOperation, _UnaryOperation __f) noexcept
+__simd_transform_reduce(_DifferenceType __n, _Tp __init, _BinaryOperation, _UnaryOperation __f) noexcept
{
__PSTL_PRAGMA_SIMD_REDUCTION(+ : __init)
for (_DifferenceType __i = 0; __i < __n; ++__i)
@@ -453,7 +454,7 @@ simd_transform_reduce(_DifferenceType __
template <typename _Size, typename _Tp, typename _BinaryOperation, typename _UnaryOperation>
typename std::enable_if<!is_arithmetic_plus<_Tp, _BinaryOperation>::value, _Tp>::type
-simd_transform_reduce(_Size __n, _Tp __init, _BinaryOperation __binary_op, _UnaryOperation __f) noexcept
+__simd_transform_reduce(_Size __n, _Tp __init, _BinaryOperation __binary_op, _UnaryOperation __f) noexcept
{
const _Size __block_size = __lane_size / sizeof(_Tp);
if (__n > 2 * __block_size && __block_size > 1)
@@ -510,8 +511,8 @@ simd_transform_reduce(_Size __n, _Tp __i
template <class _InputIterator, class _Size, class _OutputIterator, class _UnaryOperation, class _Tp,
class _BinaryOperation>
typename std::enable_if<is_arithmetic_plus<_Tp, _BinaryOperation>::value, std::pair<_OutputIterator, _Tp>>::type
-simd_scan(_InputIterator __first, _Size __n, _OutputIterator __result, _UnaryOperation __unary_op, _Tp __init,
- _BinaryOperation, /*Inclusive*/ std::false_type)
+__simd_scan(_InputIterator __first, _Size __n, _OutputIterator __result, _UnaryOperation __unary_op, _Tp __init,
+ _BinaryOperation, /*Inclusive*/ std::false_type)
{
__PSTL_PRAGMA_SIMD_SCAN(+ : __init)
for (_Size __i = 0; __i < __n; ++__i)
@@ -545,8 +546,8 @@ struct _Combiner
template <class _InputIterator, class _Size, class _OutputIterator, class _UnaryOperation, class _Tp,
class _BinaryOperation>
typename std::enable_if<!is_arithmetic_plus<_Tp, _BinaryOperation>::value, std::pair<_OutputIterator, _Tp>>::type
-simd_scan(_InputIterator __first, _Size __n, _OutputIterator __result, _UnaryOperation __unary_op, _Tp __init,
- _BinaryOperation __binary_op, /*Inclusive*/ std::false_type)
+__simd_scan(_InputIterator __first, _Size __n, _OutputIterator __result, _UnaryOperation __unary_op, _Tp __init,
+ _BinaryOperation __binary_op, /*Inclusive*/ std::false_type)
{
typedef _Combiner<_Tp, _BinaryOperation> _CombinerType;
_CombinerType __init_{__init, &__binary_op};
@@ -568,8 +569,8 @@ simd_scan(_InputIterator __first, _Size
template <class _InputIterator, class _Size, class _OutputIterator, class _UnaryOperation, class _Tp,
class _BinaryOperation>
typename std::enable_if<is_arithmetic_plus<_Tp, _BinaryOperation>::value, std::pair<_OutputIterator, _Tp>>::type
-simd_scan(_InputIterator __first, _Size __n, _OutputIterator __result, _UnaryOperation __unary_op, _Tp __init,
- _BinaryOperation, /*Inclusive*/ std::true_type)
+__simd_scan(_InputIterator __first, _Size __n, _OutputIterator __result, _UnaryOperation __unary_op, _Tp __init,
+ _BinaryOperation, /*Inclusive*/ std::true_type)
{
__PSTL_PRAGMA_SIMD_SCAN(+ : __init)
for (_Size __i = 0; __i < __n; ++__i)
@@ -585,8 +586,8 @@ simd_scan(_InputIterator __first, _Size
template <class _InputIterator, class _Size, class _OutputIterator, class _UnaryOperation, class _Tp,
class _BinaryOperation>
typename std::enable_if<!is_arithmetic_plus<_Tp, _BinaryOperation>::value, std::pair<_OutputIterator, _Tp>>::type
-simd_scan(_InputIterator __first, _Size __n, _OutputIterator __result, _UnaryOperation __unary_op, _Tp __init,
- _BinaryOperation __binary_op, std::true_type)
+__simd_scan(_InputIterator __first, _Size __n, _OutputIterator __result, _UnaryOperation __unary_op, _Tp __init,
+ _BinaryOperation __binary_op, std::true_type)
{
typedef _Combiner<_Tp, _BinaryOperation> _CombinerType;
_CombinerType __init_{__init, &__binary_op};
@@ -608,7 +609,7 @@ simd_scan(_InputIterator __first, _Size
// complexity [violation] - We will have at most (__n-1 + number_of_lanes) comparisons instead of at most __n-1.
template <typename _ForwardIterator, typename _Size, typename _Compare>
_ForwardIterator
-simd_min_element(_ForwardIterator __first, _Size __n, _Compare __comp) noexcept
+__simd_min_element(_ForwardIterator __first, _Size __n, _Compare __comp) noexcept
{
if (__n == 0)
{
@@ -667,7 +668,7 @@ simd_min_element(_ForwardIterator __firs
// complexity [violation] - We will have at most (2*(__n-1) + 4*number_of_lanes) comparisons instead of at most [1.5*(__n-1)].
template <typename _ForwardIterator, typename _Size, typename _Compare>
std::pair<_ForwardIterator, _ForwardIterator>
-simd_minmax_element(_ForwardIterator __first, _Size __n, _Compare __comp) noexcept
+__simd_minmax_element(_ForwardIterator __first, _Size __n, _Compare __comp) noexcept
{
if (__n == 0)
{
@@ -751,8 +752,8 @@ simd_minmax_element(_ForwardIterator __f
template <class _InputIterator, class _DifferenceType, class _OutputIterator1, class _OutputIterator2,
class _UnaryPredicate>
std::pair<_OutputIterator1, _OutputIterator2>
-simd_partition_copy(_InputIterator __first, _DifferenceType __n, _OutputIterator1 __out_true,
- _OutputIterator2 __out_false, _UnaryPredicate __pred) noexcept
+__simd_partition_copy(_InputIterator __first, _DifferenceType __n, _OutputIterator1 __out_true,
+ _OutputIterator2 __out_false, _UnaryPredicate __pred) noexcept
{
_DifferenceType __cnt_true = 0, __cnt_false = 0;
@@ -776,8 +777,8 @@ simd_partition_copy(_InputIterator __fir
template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
_ForwardIterator1
-simd_find_first_of(_ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __s_first,
- _ForwardIterator2 __s_last, _BinaryPredicate __pred) noexcept
+__simd_find_first_of(_ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __s_first,
+ _ForwardIterator2 __s_last, _BinaryPredicate __pred) noexcept
{
typedef typename std::iterator_traits<_ForwardIterator1>::difference_type _DifferencType;
@@ -795,8 +796,8 @@ simd_find_first_of(_ForwardIterator1 __f
{
for (; __first != __last; ++__first)
{
- if (simd_or(__s_first, __n2,
- internal::equal_value_by_pred<decltype(*__first), _BinaryPredicate>(*__first, __pred)))
+ if (__simd_or(__s_first, __n2,
+ __internal::__equal_value_by_pred<decltype(*__first), _BinaryPredicate>(*__first, __pred)))
{
return __first;
}
@@ -806,10 +807,10 @@ simd_find_first_of(_ForwardIterator1 __f
{
for (; __s_first != __s_last; ++__s_first)
{
- const auto __result = unseq_backend::simd_first(
- __first, _DifferencType(0), __n1, [__s_first, &__pred](_ForwardIterator1 __it, _DifferencType __i) {
- return __pred(__it[__i], *__s_first);
- });
+ const auto __result = __simd_first(__first, _DifferencType(0), __n1,
+ [__s_first, &__pred](_ForwardIterator1 __it, _DifferencType __i) {
+ return __pred(__it[__i], *__s_first);
+ });
if (__result != __last)
{
return __result;
@@ -821,12 +822,12 @@ simd_find_first_of(_ForwardIterator1 __f
template <class _RandomAccessIterator, class _DifferenceType, class _UnaryPredicate>
_RandomAccessIterator
-simd_remove_if(_RandomAccessIterator __first, _DifferenceType __n, _UnaryPredicate __pred) noexcept
+__simd_remove_if(_RandomAccessIterator __first, _DifferenceType __n, _UnaryPredicate __pred) noexcept
{
// find first element we need to remove
- auto __current = unseq_backend::simd_first(
- __first, _DifferenceType(0), __n,
- [&__pred](_RandomAccessIterator __it, _DifferenceType __i) { return __pred(__it[__i]); });
+ auto __current =
+ __simd_first(__first, _DifferenceType(0), __n,
+ [&__pred](_RandomAccessIterator __it, _DifferenceType __i) { return __pred(__it[__i]); });
__n -= __current - __first;
// if we have in sequence only one element that pred(__current[1]) != false we can exit the function
@@ -848,7 +849,7 @@ simd_remove_if(_RandomAccessIterator __f
}
return __current + __cnt;
}
-} // namespace unseq_backend
+} // namespace __unseq_backend
} // namespace __pstl
#endif /* __PSTL_unseq_backend_simd_H */
Modified: pstl/trunk/include/pstl/internal/utils.h
URL: http://llvm.org/viewvc/llvm-project/pstl/trunk/include/pstl/internal/utils.h?rev=357203&r1=357202&r2=357203&view=diff
==============================================================================
--- pstl/trunk/include/pstl/internal/utils.h (original)
+++ pstl/trunk/include/pstl/internal/utils.h Thu Mar 28 12:10:32 2019
@@ -15,12 +15,12 @@
namespace __pstl
{
-namespace internal
+namespace __internal
{
template <typename _Fp>
typename std::result_of<_Fp()>::type
-except_handler(_Fp __f)
+__except_handler(_Fp __f)
{
try
{
@@ -38,46 +38,46 @@ except_handler(_Fp __f)
template <typename _Fp>
void
-invoke_if(std::true_type, _Fp __f)
+__invoke_if(std::true_type, _Fp __f)
{
__f();
}
template <typename _Fp>
void
-invoke_if(std::false_type, _Fp __f)
+__invoke_if(std::false_type, _Fp __f)
{
}
template <typename _Fp>
void
-invoke_if_not(std::false_type, _Fp __f)
+__invoke_if_not(std::false_type, _Fp __f)
{
__f();
}
template <typename _Fp>
void
-invoke_if_not(std::true_type, _Fp __f)
+__invoke_if_not(std::true_type, _Fp __f)
{
}
template <typename _F1, typename _F2>
typename std::result_of<_F1()>::type
-invoke_if_else(std::true_type, _F1 __f1, _F2 __f2)
+__invoke_if_else(std::true_type, _F1 __f1, _F2 __f2)
{
return __f1();
}
template <typename _F1, typename _F2>
typename std::result_of<_F2()>::type
-invoke_if_else(std::false_type, _F1 __f1, _F2 __f2)
+__invoke_if_else(std::false_type, _F1 __f1, _F2 __f2)
{
return __f2();
}
//! Unary operator that returns reference to its argument.
-struct no_op
+struct __no_op
{
template <typename _Tp>
_Tp&&
@@ -89,12 +89,12 @@ struct no_op
//! Logical negation of a predicate
template <typename _Pred>
-class not_pred
+class __not_pred
{
_Pred _M_pred;
public:
- explicit not_pred(_Pred __pred) : _M_pred(__pred) {}
+ explicit __not_pred(_Pred __pred) : _M_pred(__pred) {}
template <typename... _Args>
bool
@@ -105,12 +105,12 @@ class not_pred
};
template <typename _Pred>
-class reorder_pred
+class __reorder_pred
{
_Pred _M_pred;
public:
- explicit reorder_pred(_Pred __pred) : _M_pred(__pred) {}
+ explicit __reorder_pred(_Pred __pred) : _M_pred(__pred) {}
template <typename _FTp, typename _STp>
bool
@@ -123,10 +123,10 @@ class reorder_pred
//! "==" comparison.
/** Not called "equal" to avoid (possibly unfounded) concerns about accidental invocation via
argument-dependent name lookup by code expecting to find the usual std::equal. */
-class pstl_equal
+class __pstl_equal
{
public:
- explicit pstl_equal() {}
+ explicit __pstl_equal() {}
template <typename _Xp, typename _Yp>
bool
@@ -137,10 +137,10 @@ class pstl_equal
};
//! "<" comparison.
-class pstl_less
+class __pstl_less
{
public:
- explicit pstl_less() {}
+ explicit __pstl_less() {}
template <typename _Xp, typename _Yp>
bool
@@ -152,13 +152,13 @@ class pstl_less
//! Like a polymorphic lambda for pred(...,value)
template <typename _Tp, typename _Predicate>
-class equal_value_by_pred
+class __equal_value_by_pred
{
const _Tp& _M_value;
_Predicate _M_pred;
public:
- equal_value_by_pred(const _Tp& __value, _Predicate __pred) : _M_value(__value), _M_pred(__pred) {}
+ __equal_value_by_pred(const _Tp& __value, _Predicate __pred) : _M_value(__value), _M_pred(__pred) {}
template <typename _Arg>
bool
@@ -170,12 +170,12 @@ class equal_value_by_pred
//! Like a polymorphic lambda for ==value
template <typename _Tp>
-class equal_value
+class __equal_value
{
const _Tp& _M_value;
public:
- explicit equal_value(const _Tp& __value) : _M_value(__value) {}
+ explicit __equal_value(const _Tp& __value) : _M_value(__value) {}
template <typename _Arg>
bool
@@ -187,12 +187,12 @@ class equal_value
//! Logical negation of ==value
template <typename _Tp>
-class not_equal_value
+class __not_equal_value
{
const _Tp& _M_value;
public:
- explicit not_equal_value(const _Tp& __value) : _M_value(__value) {}
+ explicit __not_equal_value(const _Tp& __value) : _M_value(__value) {}
template <typename _Arg>
bool
@@ -204,7 +204,7 @@ class not_equal_value
template <typename _ForwardIterator, typename _Compare>
_ForwardIterator
-cmp_iterators_by_values(_ForwardIterator __a, _ForwardIterator __b, _Compare __comp)
+__cmp_iterators_by_values(_ForwardIterator __a, _ForwardIterator __b, _Compare __comp)
{
if (__a < __b)
{ // we should return closer iterator
@@ -216,7 +216,7 @@ cmp_iterators_by_values(_ForwardIterator
}
}
-} // namespace internal
+} // namespace __internal
} // namespace __pstl
#endif /* __PSTL_utils_H */
Modified: pstl/trunk/test/std/algorithms/alg.modifying.operations/alg.partitions/partition_copy.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/pstl/trunk/test/std/algorithms/alg.modifying.operations/alg.partitions/partition_copy.pass.cpp?rev=357203&r1=357202&r2=357203&view=diff
==============================================================================
--- pstl/trunk/test/std/algorithms/alg.modifying.operations/alg.partitions/partition_copy.pass.cpp (original)
+++ pstl/trunk/test/std/algorithms/alg.modifying.operations/alg.partitions/partition_copy.pass.cpp Thu Mar 28 12:10:32 2019
@@ -39,7 +39,7 @@ struct test_partition_copy
EXPECT_TRUE(std::distance(true_first, actual_ret.first) == std::count_if(first, last, unary_op),
"partition_copy has wrong effect from true sequence");
EXPECT_TRUE(std::distance(false_first, actual_ret.second) ==
- std::count_if(first, last, __pstl::internal::not_pred<UnaryOp>(unary_op)),
+ std::count_if(first, last, __pstl::__internal::__not_pred<UnaryOp>(unary_op)),
"partition_copy has wrong effect from false sequence");
}
Modified: pstl/trunk/test/std/algorithms/alg.modifying.operations/replace.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/pstl/trunk/test/std/algorithms/alg.modifying.operations/replace.pass.cpp?rev=357203&r1=357202&r2=357203&view=diff
==============================================================================
--- pstl/trunk/test/std/algorithms/alg.modifying.operations/replace.pass.cpp (original)
+++ pstl/trunk/test/std/algorithms/alg.modifying.operations/replace.pass.cpp Thu Mar 28 12:10:32 2019
@@ -151,7 +151,7 @@ struct test_non_const
int32_t
main()
{
- test<int32_t, float32_t>(__pstl::internal::equal_value<int32_t>(666));
+ test<int32_t, float32_t>(__pstl::__internal::__equal_value<int32_t>(666));
test<uint16_t, uint8_t>([](const uint16_t& elem) { return elem % 3 < 2; });
test<float64_t, int64_t>([](const float64_t& elem) { return elem * elem - 3.5 * elem > 10; });
test<copy_int, copy_int>([](const copy_int& val) { return val.value / 5 > 2; });
Modified: pstl/trunk/test/std/algorithms/alg.sorting/alg.set.operations/includes.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/pstl/trunk/test/std/algorithms/alg.sorting/alg.set.operations/includes.pass.cpp?rev=357203&r1=357202&r2=357203&view=diff
==============================================================================
--- pstl/trunk/test/std/algorithms/alg.sorting/alg.set.operations/includes.pass.cpp (original)
+++ pstl/trunk/test/std/algorithms/alg.sorting/alg.set.operations/includes.pass.cpp Thu Mar 28 12:10:32 2019
@@ -103,7 +103,7 @@ int32_t
main()
{
- test_includes<float64_t, float64_t>(__pstl::internal::pstl_less());
+ test_includes<float64_t, float64_t>(__pstl::__internal::__pstl_less());
test_includes<Num<int64_t>, Num<int32_t>>([](const Num<int64_t>& x, const Num<int32_t>& y) { return x < y; });
std::cout << done() << std::endl;
Modified: pstl/trunk/test/std/algorithms/alg.sorting/alg.set.operations/set.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/pstl/trunk/test/std/algorithms/alg.sorting/alg.set.operations/set.pass.cpp?rev=357203&r1=357202&r2=357203&view=diff
==============================================================================
--- pstl/trunk/test/std/algorithms/alg.sorting/alg.set.operations/set.pass.cpp (original)
+++ pstl/trunk/test/std/algorithms/alg.sorting/alg.set.operations/set.pass.cpp Thu Mar 28 12:10:32 2019
@@ -156,7 +156,7 @@ int32_t
main()
{
- test_set<float64_t, float64_t>(__pstl::internal::pstl_less());
+ test_set<float64_t, float64_t>(__pstl::__internal::__pstl_less());
test_set<Num<int64_t>, Num<int32_t>>([](const Num<int64_t>& x, const Num<int32_t>& y) { return x < y; });
test_algo_basic_double<int32_t>(run_for_rnd_fw<test_non_const<int32_t>>());
Modified: pstl/trunk/test/support/utils.h
URL: http://llvm.org/viewvc/llvm-project/pstl/trunk/test/support/utils.h?rev=357203&r1=357202&r2=357203&view=diff
==============================================================================
--- pstl/trunk/test/support/utils.h (original)
+++ pstl/trunk/test/support/utils.h Thu Mar 28 12:10:32 2019
@@ -1238,7 +1238,7 @@ static void
invoke_if(Policy&& p, F f)
{
#if __PSTL_ICC_16_VC14_TEST_SIMD_LAMBDA_DEBUG_32_BROKEN || __PSTL_ICC_17_VC141_TEST_SIMD_LAMBDA_DEBUG_32_BROKEN
- __pstl::internal::invoke_if_not(__pstl::internal::allow_unsequenced<Policy>(), f);
+ __pstl::__internal::invoke_if_not(__pstl::__internal::allow_unsequenced<Policy>(), f);
#else
f();
#endif
More information about the libcxx-commits
mailing list