1 //---------------------------------------------------------------------------//
2 // Copyright (c) 2013 Kyle Lutz <kyle.r.lutz@gmail.com>
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
8 // See http://boostorg.github.com/compute for more information.
9 //---------------------------------------------------------------------------//
11 #ifndef BOOST_COMPUTE_EXPERIMENTAL_TABULATE_HPP
12 #define BOOST_COMPUTE_EXPERIMENTAL_TABULATE_HPP
16 #include <boost/compute/algorithm/transform.hpp>
17 #include <boost/compute/iterator/counting_iterator.hpp>
21 namespace experimental {
23 template<class Iterator, class UnaryFunction>
24 inline void tabulate(Iterator first,
26 UnaryFunction function,
29 size_t n = detail::iterator_range_size(first, last);
31 ::boost::compute::transform(
32 ::boost::compute::make_counting_iterator<int>(0),
33 ::boost::compute::make_counting_iterator<int>(n),
40 } // end experimental namespace
41 } // end compute namespace
42 } // end boost namespace
44 #endif // BOOST_COMPUTE_EXPERIMENTAL_TABULATE_HPP