]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/compute/algorithm/for_each_n.hpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / boost / compute / algorithm / for_each_n.hpp
1 //---------------------------------------------------------------------------//
2 // Copyright (c) 2013-2014 Kyle Lutz <kyle.r.lutz@gmail.com>
3 //
4 // Distributed under the Boost Software License, Version 1.0
5 // See accompanying file LICENSE_1_0.txt or copy at
6 // http://www.boost.org/LICENSE_1_0.txt
7 //
8 // See http://boostorg.github.com/compute for more information.
9 //---------------------------------------------------------------------------//
10
11 #ifndef BOOST_COMPUTE_ALGORITHM_FOR_EACH_N_HPP
12 #define BOOST_COMPUTE_ALGORITHM_FOR_EACH_N_HPP
13
14 #include <boost/compute/algorithm/for_each.hpp>
15
16 namespace boost {
17 namespace compute {
18
19 /// Calls \p function on each element in the range [\p first, \p first
20 /// \c + \p count).
21 ///
22 /// Space complexity: \Omega(1)
23 ///
24 /// \see for_each()
25 template<class InputIterator, class Size, class UnaryFunction>
26 inline UnaryFunction for_each_n(InputIterator first,
27 Size count,
28 UnaryFunction function,
29 command_queue &queue = system::default_queue())
30 {
31 return ::boost::compute::for_each(first, first + count, function, queue);
32 }
33
34 } // end compute namespace
35 } // end boost namespace
36
37 #endif // BOOST_COMPUTE_ALGORITHM_FOR_EACH_N_HPP