]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/compute/include/boost/compute/algorithm/rotate_copy.hpp
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / compute / include / boost / compute / algorithm / rotate_copy.hpp
1 //---------------------------------------------------------------------------//
2 // Copyright (c) 2014 Roshan <thisisroshansmail@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_ROTATE_COPY_HPP
12 #define BOOST_COMPUTE_ALGORITHM_ROTATE_COPY_HPP
13
14 #include <boost/compute/system.hpp>
15 #include <boost/compute/algorithm/copy.hpp>
16
17 namespace boost {
18 namespace compute {
19
20 /// Performs left rotation such that element at n_first comes to the
21 /// beginning and the output is stored in range starting at result.
22 ///
23 /// \see rotate()
24 template<class InputIterator, class OutputIterator>
25 inline void rotate_copy(InputIterator first,
26 InputIterator n_first,
27 InputIterator last,
28 OutputIterator result,
29 command_queue &queue = system::default_queue())
30 {
31 size_t count = detail::iterator_range_size(first, n_first);
32 size_t count2 = detail::iterator_range_size(n_first, last);
33
34 ::boost::compute::copy(first+count, last, result, queue);
35 ::boost::compute::copy(first, first+count, result+count2, queue);
36 }
37
38 } //end compute namespace
39 } //end boost namespace
40
41 #endif // BOOST_COMPUTE_ALGORITHM_ROTATE_COPY_HPP