@@ -35,10 +35,9 @@ <h1>Effect of execution policies on algorithm execution</h1>
3535 < p >
3636 The invocations of element access functions in parallel algorithms invoked with an execution
3737 policy object of type < code > parallel_execution_policy</ code > are permitted to execute in an
38- unordered fashion in < del > unspecified threads</ del > < ins > either the invoking thread or in a
39- thread implicitly created by the library to support parallel algorithm execution.</ ins >
40- < del > , and</ del > < ins > Any such invocations executing in the same thread are</ ins > indeterminately
41- sequenced < del > within each thread</ del > < ins > with respect to each other</ ins > .
38+ unordered fashion in either the invoking thread or in a thread implicitly created by the library
39+ to support parallel algorithm execution. Any such invocations executing in the same thread are
40+ indeterminately sequenced with respect to each other.
4241
4342 < cxx-note >
4443 It is the caller's responsibility to ensure correctness, for example that the invocation does
@@ -296,9 +295,9 @@ <h1><code>ExecutionPolicy</code> algorithm overloads</h1>
296295 < td > < code > transform</ code > </ td >
297296 </ tr >
298297 < tr >
299- < td > < code > < ins > transform_exclusive_scan</ ins > </ code > </ td >
300- < td > < code > < ins > transform_inclusive_scan</ ins > </ code > </ td >
301- < td > < code > < ins > transform_reduce</ ins > </ code > </ td >
298+ < td > < code > transform_exclusive_scan</ code > </ td >
299+ < td > < code > transform_inclusive_scan</ code > </ td >
300+ < td > < code > transform_reduce</ code > </ td >
302301 < td > < code > uninitialized_copy</ code > </ td >
303302 </ tr >
304303 < tr >
@@ -374,6 +373,11 @@ <h1>Header <code><experimental/algorithm></code> synopsis</h1>
374373 template<class InputIterator, class Size, class Function>
375374 InputIterator for_each_n(InputIterator first, Size n,
376375 Function f);
376+ < ins > template<class ExecutionPolicy,
377+ class InputIterator, class Size, class Function>
378+ InputIterator for_each_n(ExecutionPolicy&& exec,
379+ InputIterator first, Size n,
380+ Function f);</ ins >
377381}
378382}
379383}
@@ -504,48 +508,105 @@ <h1>Header <code><experimental/numeric></code> synopsis</h1>
504508 template<class InputIterator>
505509 typename iterator_traits<InputIterator>::value_type
506510 reduce(InputIterator first, InputIterator last);
511+ < ins > template<class ExecutionPolicy,
512+ InputIterator>
513+ typename iterator_traits<InputIterator>::value_type
514+ reduce(ExecutionPolicy&& exec,
515+ InputIterator first, InputIterator last);</ ins >
507516 template<class InputIterator, class T>
508- T reduce(InputIterator first, InputIterator last< ins > ,</ ins > T init);
517+ T reduce(InputIterator first, InputIterator last, T init);
518+ < ins > template<class ExecutionPolicy,
519+ class InputIterator, class T>
520+ T reduce(ExecutionPolicy&& exec,
521+ InputIterator first, InputIterator last, T init);</ ins >
509522 template<class InputIterator, class T, class BinaryOperation>
510523 T reduce(InputIterator first, InputIterator last, T init,
511524 BinaryOperation binary_op);
525+ < ins > template<class ExecutionPolicy, class InputIterator, class T, class BinaryOperation>
526+ T reduce(ExecutionPolicy&& exec,
527+ InputIterator first, InputIterator last, T init,
528+ BinaryOperation binary_op);</ ins >
512529
513530 template<class InputIterator, class OutputIterator,
514531 class T>
515532 OutputIterator
516533 exclusive_scan(InputIterator first, InputIterator last,
517534 OutputIterator result,
518535 T init);
536+ < ins > template<class ExecutionPolicy,
537+ class InputIterator, class OutputIterator,
538+ class T>
539+ OutputIterator
540+ exclusive_scan(ExecutionPolicy&& exec,
541+ InputIterator first, InputIterator last,
542+ OutputIterator result,
543+ T init);</ ins >
519544 template<class InputIterator, class OutputIterator,
520545 class T, class BinaryOperation>
521546 OutputIterator
522547 exclusive_scan(InputIterator first, InputIterator last,
523548 OutputIterator result,
524549 T init, BinaryOperation binary_op);
550+ < ins > template<class ExecutionPolicy,
551+ class InputIterator, class OutputIterator,
552+ class T, class BinaryOperation>
553+ OutputIterator
554+ exclusive_scan(ExecutionPolicy&& exec,
555+ InputIterator first, InputIterator last,
556+ OutputIterator result,
557+ T init, BinaryOperation binary_op);</ ins >
525558
526559 template<class InputIterator, class OutputIterator>
527560 OutputIterator
528561 inclusive_scan(InputIterator first, InputIterator last,
529562 OutputIterator result);
563+ < ins > template<class ExecutionPolicy,
564+ class InputIterator, class OutputIterator>
565+ OutputIterator
566+ inclusive_scan(ExecutionPolicy&& exec,
567+ InputIterator first, InputIterator last,
568+ OutputIterator result);</ ins >
530569 template<class InputIterator, class OutputIterator,
531570 class BinaryOperation>
532571 OutputIterator
533572 inclusive_scan(InputIterator first, InputIterator last,
534573 OutputIterator result,
535574 BinaryOperation binary_op);
575+ < ins > template<class ExecutionPolicy,
576+ class InputIterator, class OutputIterator,
577+ class BinaryOperation>
578+ OutputIterator
579+ inclusive_scan(ExecutionPolicy&& exec,
580+ InputIterator first, InputIterator last,
581+ OutputIterator result,
582+ BinaryOperation binary_op);</ ins >
536583 template<class InputIterator, class OutputIterator,
537584 class BinaryOperation, class T>
538585 OutputIterator
539586 inclusive_scan(InputIterator first, InputIterator last,
540587 OutputIterator result,
541588 BinaryOperation binary_op, T init);
589+ < ins > template<class ExecutionPolicy,
590+ class InputIterator, class OutputIterator,
591+ class BinaryOperation, class T>
592+ OutputIterator
593+ inclusive_scan(ExecutionPolicy&& exec,
594+ InputIterator first, InputIterator last,
595+ OutputIterator result,
596+ BinaryOperation binary_op, T init);</ ins >
542597
543- < ins >
544598 template<class InputIterator, class UnaryOperation,
545599 class T, class BinaryOperation>
546600 T transform_reduce(InputIterator first, InputIterator last,
547601 UnaryOperation unary_op,
548602 T init, BinaryOperation binary_op);
603+ < ins > template<class ExecutionPolicy,
604+ class InputIterator, class UnaryOperation,
605+ class T, class BinaryOperation>
606+ T transform_reduce(ExecutionPolicy&& exec,
607+ InputIterator first, InputIterator last,
608+ UnaryOperation unary_op,
609+ T init, BinaryOperation binary_op);</ ins >
549610
550611 template<class InputIterator, class OutputIterator,
551612 class UnaryOperation, class T, class BinaryOperation>
@@ -554,6 +615,15 @@ <h1>Header <code><experimental/numeric></code> synopsis</h1>
554615 OutputIterator result,
555616 UnaryOperation unary_op,
556617 T init, BinaryOperation binary_op);
618+ < ins > template<class ExecutionPolicy,
619+ class InputIterator, class OutputIterator,
620+ class UnaryOperation, class T, class BinaryOperation>
621+ OutputIterator
622+ transform_exclusive_scan(ExecutionPolicy&& exec,
623+ InputIterator first, InputIterator last,
624+ OutputIterator result,
625+ UnaryOperation unary_op,
626+ T init, BinaryOperation binary_op);</ ins >
557627
558628 template<class InputIterator, class OutputIterator,
559629 class UnaryOperation, class BinaryOperation>
@@ -562,6 +632,15 @@ <h1>Header <code><experimental/numeric></code> synopsis</h1>
562632 OutputIterator result,
563633 UnaryOperation unary_op,
564634 BinaryOperation binary_op);
635+ < ins > template<class ExecutionPolicy,
636+ class InputIterator, class OutputIterator,
637+ class UnaryOperation, class BinaryOperation>
638+ OutputIterator
639+ transform_inclusive_scan(ExecutionPolicy&& exec,
640+ InputIterator first, InputIterator last,
641+ OutputIterator result,
642+ UnaryOperation unary_op,
643+ BinaryOperation binary_op);</ ins >
565644
566645 template<class InputIterator, class OutputIterator,
567646 class UnaryOperation, class BinaryOperation, class T>
@@ -570,7 +649,15 @@ <h1>Header <code><experimental/numeric></code> synopsis</h1>
570649 OutputIterator result,
571650 UnaryOperation unary_op,
572651 BinaryOperation binary_op, T init);
573- </ ins >
652+ < ins > template<class ExecutionPolicy,
653+ class InputIterator, class OutputIterator,
654+ class UnaryOperation, class BinaryOperation, class T>
655+ OutputIterator
656+ transform_inclusive_scan(ExecutionPolicy&& exec,
657+ InputIterator first, InputIterator last,
658+ OutputIterator result,
659+ UnaryOperation unary_op,
660+ BinaryOperation binary_op, T init);</ ins >
574661}
575662}
576663}
@@ -753,35 +840,25 @@ <h1>Transform reduce</h1>
753840
754841 < cxx-function >
755842 < cxx-signature >
756- < ins >
757843 template<class InputIterator, class UnaryFunction, class T, class BinaryOperation>
758844 T transform_reduce(InputIterator first, InputIterator last,
759845 UnaryOperation unary_op, T init, BinaryOperation binary_op);
760- </ ins >
761846 </ cxx-signature >
762847
763848 < cxx-returns >
764- < ins >
765849 < code > < em > GENERALIZED_SUM</ em > (binary_op, init, unary_op(*first), ..., unary_op(*(first + (last - first) - 1)))</ code > .
766- </ ins >
767850 </ cxx-returns >
768851
769852 < cxx-requires >
770- < ins >
771853 Neither < code > unary_op</ code > nor < code > binary_op</ code > shall invalidate subranges, or modify elements in the range < code > [first,last)</ code >
772- </ ins >
773854 </ cxx-requires >
774855
775856 < cxx-complexity >
776- < ins >
777857 O(< code > last - first</ code > ) applications each of < code > unary_op</ code > and < code > binary_op</ code > .
778- </ ins >
779858 </ cxx-complexity >
780859
781860 < cxx-notes >
782- < ins >
783861 < code > transform_reduce</ code > does not apply < code > unary_op</ code > to < code > init</ code > .
784- </ ins >
785862 </ cxx-notes >
786863 </ cxx-function >
787864 </ cxx-section >
@@ -791,7 +868,6 @@ <h1>Transform exclusive scan</h1>
791868
792869 < cxx-function >
793870 < cxx-signature >
794- < ins >
795871 template<class InputIterator, class OutputIterator,
796872 class UnaryOperation,
797873 class T, class BinaryOperation>
@@ -800,41 +876,30 @@ <h1>Transform exclusive scan</h1>
800876 OutputIterator result,
801877 UnaryOperation unary_op,
802878 T init, BinaryOperation binary_op);
803- </ ins >
804879 </ cxx-signature >
805880
806881 < cxx-effects >
807- < ins >
808882 Assigns through each iterator < code > i</ code > in < code > [result,result + (last - first))</ code > the value of
809883 < code > < em > GENERALIZED_NONCOMMUTATIVE_SUM</ em > (binary_op, init, unary_op(*first), ..., unary_op(*(first + (i - result) - 1)))</ code > .
810- </ ins >
811884 </ cxx-effects >
812885
813886 < cxx-returns >
814- < ins >
815887 The end of the resulting range beginning at < code > result</ code > .
816- </ ins >
817888 </ cxx-returns >
818889
819890 < cxx-requires >
820- < ins >
821891 Neither < code > unary_op</ code > nor < code > binary_op</ code > shall invalidate iterators or subranges, or modify elements in the
822892 ranges < code > [first,last)</ code > or < code > [result,result + (last - first))</ code > .
823- </ ins >
824893 </ cxx-requires >
825894
826895 < cxx-complexity >
827- < ins >
828896 O(< code > last - first</ code > ) applications each of < code > unary_op</ code > and < code > binary_op</ code > .
829- </ ins >
830897 </ cxx-complexity >
831898
832899 < cxx-notes >
833- < ins >
834900 The difference between < code > transform_exclusive_scan</ code > and < code > transform_inclusive_scan</ code > is that < code > transform_exclusive_scan</ code >
835901 excludes the ith input element from the ith sum. If < code > binary_op</ code > is not mathematically associative, the behavior of
836902 < code > transform_exclusive_scan</ code > may be non-deterministic. < code > transform_exclusive_scan</ code > does not apply < code > unary_op</ code > to < code > init</ code > .
837- </ ins >
838903 </ cxx-notes >
839904 </ cxx-function >
840905 </ cxx-section >
@@ -844,7 +909,6 @@ <h1>Transform inclusive scan</h1>
844909
845910 < cxx-function >
846911 < cxx-signature >
847- < ins >
848912 template<class InputIterator, class OutputIterator,
849913 class UnaryOperation,
850914 class BinaryOperation>
@@ -862,43 +926,32 @@ <h1>Transform inclusive scan</h1>
862926 OutputIterator result,
863927 UnaryOperation unary_op,
864928 BinaryOperation binary_op, T init);
865- </ ins >
866929 </ cxx-signature >
867930
868931 < cxx-effects >
869- < ins >
870932 Assigns through each iterator < code > i</ code > in < code > [result,result + (last - first))</ code > the value of
871933 < code > < em > GENERALIZED_NONCOMMUTATIVE_SUM</ em > (binary_op, unary_op(*first), ..., unary_op(*(first + (i - result))))</ code > or
872934 < code > < em > GENERALIZED_NONCOMMUTATIVE_SUM</ em > (binary_op, init, unary_op(*first), ..., unary_op(*(first + (i - result))))</ code >
873935 if < code > init</ code > is provided.
874- </ ins >
875936 </ cxx-effects >
876937
877938 < cxx-returns >
878- < ins >
879939 The end of the resulting range beginning at < code > result</ code > .
880- </ ins >
881940 </ cxx-returns >
882941
883942 < cxx-requires >
884- < ins >
885943 Neither < code > unary_op</ code > nor < code > binary_op</ code > shall invalidate iterators or subranges, or modify elements in the ranges < code > [first,last)</ code >
886944 or < code > [result,result + (last - first))</ code > .
887- </ ins >
888945 </ cxx-requires >
889946
890947 < cxx-complexity >
891- < ins >
892948 O(< code > last - first</ code > ) applications each of < code > unary_op</ code > and < code > binary_op</ code > .
893- </ ins >
894949 </ cxx-complexity >
895950
896951 < cxx-notes >
897- < ins >
898- The difference between < code > transform_exclusive_scan</ code > and < code > transform_inclusive_scan</ code > is that < code > transform_inclusive_scan</ code >
899- includes the ith input element from the ith sum. If < code > binary_op</ code > is not mathematically associative, the behavior of
900- < code > transform_inclusive_scan</ code > may be non-deterministic. < code > transform_inclusive_scan</ code > does not apply < code > unary_op</ code > to < code > init</ code > .
901- </ ins >
952+ The difference between < code > transform_exclusive_scan</ code > and < code > transform_inclusive_scan</ code > is that < code > transform_inclusive_scan</ code >
953+ includes the ith input element from the ith sum. If < code > binary_op</ code > is not mathematically associative, the behavior of
954+ < code > transform_inclusive_scan</ code > may be non-deterministic. < code > transform_inclusive_scan</ code > does not apply < code > unary_op</ code > to < code > init</ code > .
902955 </ cxx-notes >
903956 </ cxx-function >
904957 </ cxx-section >
0 commit comments