Thrust
for_each.h
Go to the documentation of this file.
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  * * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 
21 #pragma once
22 
23 #include <thrust/detail/config.h>
24 #include <thrust/detail/type_traits.h>
25 #include <thrust/detail/execution_policy.h>
26 
27 THRUST_NAMESPACE_BEGIN
28 
89 template<typename DerivedPolicy,
90  typename InputIterator,
91  typename UnaryFunction>
92 __host__ __device__
93 InputIterator for_each(const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
94  InputIterator first,
95  InputIterator last,
96  UnaryFunction f);
97 
98 
152 template<typename DerivedPolicy,
153  typename InputIterator,
154  typename Size,
155  typename UnaryFunction>
156 __host__ __device__
157 InputIterator for_each_n(const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
158  InputIterator first,
159  Size n,
160  UnaryFunction f);
161 
210 template<typename InputIterator,
211  typename UnaryFunction>
212 InputIterator for_each(InputIterator first,
213  InputIterator last,
214  UnaryFunction f);
215 
216 
265 template<typename InputIterator,
266  typename Size,
267  typename UnaryFunction>
268 InputIterator for_each_n(InputIterator first,
269  Size n,
270  UnaryFunction f);
271 
275 THRUST_NAMESPACE_END
276 
277 #include <thrust/detail/for_each.inl>
278 
InputIterator for_each_n(InputIterator first, Size n, UnaryFunction f)
InputIterator for_each(InputIterator first, InputIterator last, UnaryFunction f)