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
15namespace std
16{
17// [reduce]
18
19template <class _ExecutionPolicy, class _ForwardIterator, class _Tp, class _BinaryOperation>
20__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _Tp>
21reduce(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Tp __init,
22 _BinaryOperation __binary_op);
23
24template <class _ExecutionPolicy, class _ForwardIterator, class _Tp>
25__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _Tp>
26reduce(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Tp __init);
27
28template <class _ExecutionPolicy, class _ForwardIterator>
29__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy,
30 typename iterator_traits<_ForwardIterator>::value_type>
31reduce(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last);
32
33template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Tp>
34__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _Tp>
35transform_reduce(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
36 _ForwardIterator2 __first2, _Tp __init);
37
38template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Tp, class _BinaryOperation1,
39 class _BinaryOperation2>
40__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _Tp>
41transform_reduce(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
42 _ForwardIterator2 __first2, _Tp __init, _BinaryOperation1 __binary_op1,
43 _BinaryOperation2 __binary_op2);
44
45template <class _ExecutionPolicy, class _ForwardIterator, class _Tp, class _BinaryOperation, class _UnaryOperation>
46__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _Tp>
47transform_reduce(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Tp __init,
48 _BinaryOperation __binary_op, _UnaryOperation __unary_op);
49
50// [exclusive.scan]
51
52template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Tp>
53__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
54exclusive_scan(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last,
55 _ForwardIterator2 __result, _Tp __init);
56
57template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Tp, class _BinaryOperation>
58__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
59exclusive_scan(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last,
60 _ForwardIterator2 __result, _Tp __init, _BinaryOperation __binary_op);
61
62// [inclusive.scan]
63
64template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2>
65__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
66inclusive_scan(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last,
67 _ForwardIterator2 __result);
68
69template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _BinaryOperation>
70__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
71inclusive_scan(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last,
72 _ForwardIterator2 __result, _BinaryOperation __binary_op);
73
74template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Tp, class _BinaryOperation>
75__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
76inclusive_scan(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last,
77 _ForwardIterator2 __result, _BinaryOperation __binary_op, _Tp __init);
78
79// [transform.exclusive.scan]
80
81template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Tp, class _BinaryOperation,
82 class _UnaryOperation>
83__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
84transform_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
90template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _BinaryOperation,
91 class _UnaryOperation, class _Tp>
92__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
93transform_inclusive_scan(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last,
94 _ForwardIterator2 __result, _BinaryOperation __binary_op, _UnaryOperation __unary_op,
95 _Tp __init);
96
97template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _UnaryOperation,
98 class _BinaryOperation>
99__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
100transform_inclusive_scan(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last,
101 _ForwardIterator2 __result, _BinaryOperation __binary_op, _UnaryOperation __unary_op);
102
103// [adjacent.difference]
104
105template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _BinaryOperation>
106__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
107adjacent_difference(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last,
108 _ForwardIterator2 __d_first, _BinaryOperation __op);
109
110template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2>
111__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
112adjacent_difference(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last,
113 _ForwardIterator2 __d_first);
114
115} // namespace std
116#endif /* _PSTL_GLUE_NUMERIC_DEFS_H */
117