1 // -*- C++ -*-
2 //===-- glue_numeric_defs.h -----------------------------------------------===//
3 //
4 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5 // See https://llvm.org/LICENSE.txt for license information.
6 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #ifndef _PSTL_GLUE_NUMERIC_DEFS_H
11 #define _PSTL_GLUE_NUMERIC_DEFS_H
12 
13 #include "execution_defs.h"
14 
15 namespace std
16 {
17 // [reduce]
18 
19 template <class _ExecutionPolicy, class _ForwardIterator, class _Tp, class _BinaryOperation>
20 __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _Tp>
21 reduce(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Tp __init,
22        _BinaryOperation __binary_op);
23 
24 template <class _ExecutionPolicy, class _ForwardIterator, class _Tp>
25 __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _Tp>
26 reduce(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Tp __init);
27 
28 template <class _ExecutionPolicy, class _ForwardIterator>
29 __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy,
30                                                  typename iterator_traits<_ForwardIterator>::value_type>
31 reduce(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last);
32 
33 template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Tp>
34 __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _Tp>
35 transform_reduce(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
36                  _ForwardIterator2 __first2, _Tp __init);
37 
38 template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Tp, class _BinaryOperation1,
39           class _BinaryOperation2>
40 __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _Tp>
41 transform_reduce(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
42                  _ForwardIterator2 __first2, _Tp __init, _BinaryOperation1 __binary_op1,
43                  _BinaryOperation2 __binary_op2);
44 
45 template <class _ExecutionPolicy, class _ForwardIterator, class _Tp, class _BinaryOperation, class _UnaryOperation>
46 __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _Tp>
47 transform_reduce(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Tp __init,
48                  _BinaryOperation __binary_op, _UnaryOperation __unary_op);
49 
50 // [exclusive.scan]
51 
52 template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Tp>
53 __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
54 exclusive_scan(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last,
55                _ForwardIterator2 __result, _Tp __init);
56 
57 template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Tp, class _BinaryOperation>
58 __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
59 exclusive_scan(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last,
60                _ForwardIterator2 __result, _Tp __init, _BinaryOperation __binary_op);
61 
62 // [inclusive.scan]
63 
64 template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2>
65 __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
66 inclusive_scan(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last,
67                _ForwardIterator2 __result);
68 
69 template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _BinaryOperation>
70 __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
71 inclusive_scan(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last,
72                _ForwardIterator2 __result, _BinaryOperation __binary_op);
73 
74 template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Tp, class _BinaryOperation>
75 __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
76 inclusive_scan(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last,
77                _ForwardIterator2 __result, _BinaryOperation __binary_op, _Tp __init);
78 
79 // [transform.exclusive.scan]
80 
81 template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Tp, class _BinaryOperation,
82           class _UnaryOperation>
83 __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
84 transform_exclusive_scan(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last,
85                          _ForwardIterator2 __result, _Tp __init, _BinaryOperation __binary_op,
86                          _UnaryOperation __unary_op);
87 
88 // [transform.inclusive.scan]
89 
90 template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _BinaryOperation,
91           class _UnaryOperation, class _Tp>
92 __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
93 transform_inclusive_scan(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last,
94                          _ForwardIterator2 __result, _BinaryOperation __binary_op, _UnaryOperation __unary_op,
95                          _Tp __init);
96 
97 template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _UnaryOperation,
98           class _BinaryOperation>
99 __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
100 transform_inclusive_scan(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last,
101                          _ForwardIterator2 __result, _BinaryOperation __binary_op, _UnaryOperation __unary_op);
102 
103 // [adjacent.difference]
104 
105 template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _BinaryOperation>
106 __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
107 adjacent_difference(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last,
108                     _ForwardIterator2 __d_first, _BinaryOperation op);
109 
110 template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2>
111 __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
112 adjacent_difference(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last,
113                     _ForwardIterator2 __d_first);
114 
115 } // namespace std
116 #endif /* _PSTL_GLUE_NUMERIC_DEFS_H */
117