[libcxx-commits] [pstl] r355161 - [pstl] Fix missing parallel policy guards

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Thu Feb 28 17:26:36 PST 2019


Author: ldionne
Date: Thu Feb 28 17:26:35 2019
New Revision: 355161

URL: http://llvm.org/viewvc/llvm-project?rev=355161&view=rev
Log:
[pstl] Fix missing parallel policy guards

Thanks to @jerryct for the patch.
Differential Revision: https://reviews.llvm.org/D57638

Modified:
    pstl/trunk/include/pstl/internal/algorithm_impl.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=355161&r1=355160&r2=355161&view=diff
==============================================================================
--- pstl/trunk/include/pstl/internal/algorithm_impl.h (original)
+++ pstl/trunk/include/pstl/internal/algorithm_impl.h Thu Feb 28 17:26:35 2019
@@ -177,6 +177,7 @@ pattern_walk1_n(_ExecutionPolicy&&, _For
     return internal::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,
@@ -187,6 +188,7 @@ pattern_walk1_n(_ExecutionPolicy&& __exe
                             std::true_type());
     return __first + __n;
 }
+#endif
 
 template <class _ExecutionPolicy, class _ForwardIterator, class _Size, class _Brick>
 _ForwardIterator
@@ -2499,6 +2501,7 @@ pattern_generate_n(_ExecutionPolicy&&, _
     return internal::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,
@@ -2509,6 +2512,7 @@ pattern_generate_n(_ExecutionPolicy&& __
     return internal::pattern_generate(std::forward<_ExecutionPolicy>(__exec), __first, __first + __count, __g,
                                       std::true_type(), __is_vector);
 }
+#endif
 
 //------------------------------------------------------------------------
 // remove




More information about the libcxx-commits mailing list