Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:29:56

0001 //---------------------------------------------------------------------------//
0002 // Copyright (c) 2013 Kyle Lutz <kyle.r.lutz@gmail.com>
0003 //
0004 // Distributed under the Boost Software License, Version 1.0
0005 // See accompanying file LICENSE_1_0.txt or copy at
0006 // http://www.boost.org/LICENSE_1_0.txt
0007 //
0008 // See http://boostorg.github.com/compute for more information.
0009 //---------------------------------------------------------------------------//
0010 
0011 #ifndef BOOST_COMPUTE_ALGORITHM_GENERATE_N_HPP
0012 #define BOOST_COMPUTE_ALGORITHM_GENERATE_N_HPP
0013 
0014 #include <boost/compute/system.hpp>
0015 #include <boost/compute/command_queue.hpp>
0016 #include <boost/compute/algorithm/generate.hpp>
0017 
0018 namespace boost {
0019 namespace compute {
0020 
0021 /// Stores the result of \p generator for each element in the range
0022 /// [\p first, \p first + \p count).
0023 ///
0024 /// Space complexity: \Omega(1)
0025 template<class OutputIterator, class Size, class Generator>
0026 inline void generate_n(OutputIterator first,
0027                        Size count,
0028                        Generator generator,
0029                        command_queue &queue = system::default_queue())
0030 {
0031     ::boost::compute::generate(first, first + count, generator, queue);
0032 }
0033 
0034 } // end compute namespace
0035 } // end boost namespace
0036 
0037 #endif // BOOST_COMPUTE_ALGORITHM_GENERATE_N_HPP