Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.
PrevUpHomeNext

Function template fill

boost::compute::fill

Synopsis

// In header: <boost/compute/algorithm/fill.hpp>


template<typename BufferIterator, typename T> 
  void fill(BufferIterator first, BufferIterator last, const T & value, 
            command_queue & queue = system::default_queue());

Description

Fills the range [first, last) with value.

For example, to fill a vector on the device with sevens:

 // vector on the device
 boost::compute::vector<int> vec(10, context);

 // fill vector with sevens
 boost::compute::fill(vec.begin(), vec.end(), 7, queue);

See Also:

boost::compute::fill_n()

Parameters:

first

first element in the range to fill

last

last element in the range to fill

queue

command queue to perform the operation

value

value to copy to each element


PrevUpHomeNext