Bolt  1.3
C++ template library with support for OpenCL
reduce.h
Go to the documentation of this file.
1 /***************************************************************************
2 * © 2012,2014 Advanced Micro Devices, Inc. All rights reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 
16 ***************************************************************************/
17 
18 #if !defined( BOLT_CL_REDUCE_H )
19 #define BOLT_CL_REDUCE_H
20 #pragma once
21 
22 #include "bolt/cl/device_vector.h"
23 #include "bolt/cl/functional.h"
24 
31 namespace bolt {
32  namespace cl {
33 
86  template<typename InputIterator>
87  typename std::iterator_traits<InputIterator>::value_type
89  InputIterator first,
90  InputIterator last,
91  const std::string& cl_code="");
92 
93  template<typename InputIterator>
94  typename std::iterator_traits<InputIterator>::value_type
95  reduce(InputIterator first,
96  InputIterator last,
97  const std::string& cl_code="");
98 
99 
138  template<typename InputIterator, typename T>
139  T reduce(bolt::cl::control &ctl,
140  InputIterator first,
141  InputIterator last,
142  T init,
143  const std::string& cl_code="");
144 
145  template<typename InputIterator, typename T>
146  T reduce(InputIterator first,
147  InputIterator last,
148  T init,
149  const std::string& cl_code="");
150 
188  template<typename InputIterator, typename T, typename BinaryFunction>
189  T reduce(bolt::cl::control &ctl,
190  InputIterator first,
191  InputIterator last,
192  T init,
193  BinaryFunction binary_op=bolt::cl::plus<T>(),
194  const std::string& cl_code="") ;
195 
196  template<typename InputIterator, typename T, typename BinaryFunction>
197  T reduce(InputIterator first,
198  InputIterator last,
199  T init,
200  BinaryFunction binary_op,
201  const std::string& cl_code="") ;
202 
205  };
206 };
207 
208 #include <bolt/cl/detail/reduce.inl>
209 #endif