| Home | Libraries | People | FAQ | More

## 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