OSDN Git Service

CUDA
[eos/hostdependX86LINUX64.git] / util / X86LINUX64 / cuda-6.5 / include / thrust / system / cpp / detail / reduce.h
1 /*
2  *  Copyright 2008-2013 NVIDIA Corporation
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 /*! \file reduce.h
19  *  \brief C++ implementation of reduce algorithms.
20  */
21
22 #pragma once
23
24 #include <thrust/detail/config.h>
25 #include <thrust/system/cpp/detail/execution_policy.h>
26 #include <thrust/system/detail/internal/scalar/reduce.h>
27
28 namespace thrust
29 {
30 namespace system
31 {
32 namespace cpp
33 {
34 namespace detail
35 {
36
37 template<typename DerivedPolicy,
38          typename InputIterator, 
39          typename OutputType,
40          typename BinaryFunction>
41   OutputType reduce(execution_policy<DerivedPolicy> &,
42                     InputIterator begin,
43                     InputIterator end,
44                     OutputType init,
45                     BinaryFunction binary_op)
46 {
47   return thrust::system::detail::internal::scalar::reduce(begin, end, init, binary_op);
48 }
49
50 } // end namespace detail
51 } // end namespace cpp
52 } // end namespace system
53 } // end namespace thrust
54