| 29 | /// Space complexity: \Omega(1) |
| 30 | template<class OutputIterator, class Generator> |
| 31 | inline void generate(OutputIterator first, |
| 32 | OutputIterator last, |
| 33 | Generator generator, |
| 34 | command_queue &queue = system::default_queue()) |
| 35 | { |
| 36 | BOOST_STATIC_ASSERT(is_device_iterator<OutputIterator>::value); |
| 37 | size_t count = detail::iterator_range_size(first, last); |
| 38 | if(count == 0){ |
| 39 | return; |
| 40 | } |
| 41 | |
| 42 | ::boost::compute::copy( |
| 43 | ::boost::compute::make_function_input_iterator(generator, |
| 44 | first.get_index()), |
| 45 | ::boost::compute::make_function_input_iterator(generator, |
| 46 | last.get_index()), |
| 47 | first, |
| 48 | queue |
| 49 | ); |
| 50 | } |
| 51 | |
| 52 | } // end compute namespace |
| 53 | } // end boost namespace |