Bolt  1.3
C++ template library with support for OpenCL
Functions
AMP-filling

Functions

template<typename ForwardIterator , typename T >
void bolt::amp::fill (const bolt::amp::control &ctl, ForwardIterator first, ForwardIterator last, const T &value)
 Fill assigns the value of value to each element in the range [first,last].
 
template<typename ForwardIterator , typename T >
void bolt::amp::fill (ForwardIterator first, ForwardIterator last, const T &value)
 
template<typename OutputIterator , typename Size , typename T >
OutputIterator bolt::amp::fill_n (const bolt::amp::control &ctl, OutputIterator first, Size n, const T &value)
 fill_n assigns the value value to every element in the range [first,first+n]. The return value is first + n.
 
template<typename OutputIterator , typename Size , typename T >
OutputIterator bolt::amp::fill_n (OutputIterator first, Size n, const T &value)
 

Detailed Description

Function Documentation

template<typename ForwardIterator , typename T >
void bolt::amp::fill ( const bolt::amp::control ctl,
ForwardIterator  first,
ForwardIterator  last,
const T &  value 
)

Fill assigns the value of value to each element in the range [first,last].

Parameters
ctlOptional Control structure to control accelerator, debug, tuning, etc.See bolt::amp::control.
firstThe first element in the range of interest.
lastThe last element in the range of interest.
valueSets this value to elements in the range [first,last].
Template Parameters
ForwardIteratoris a model of Forward Iterator, and InputIterator is mutable.
Tis a model of Assignable.

The following code snippet demonstrates how to fill a device_vector with a float value.

#include <bolt/amp/fill.h>
#include <stdlib.h>
...
bolt::amp::device_vector<float> v(10);
float x=25.0f;
bolt::amp::fill(v.begin(), v.end(), x);
// the elements of v are now assigned to the float value.
See Also
http://www.sgi.com/tech/stl/fill.html
template<typename OutputIterator , typename Size , typename T >
OutputIterator bolt::amp::fill_n ( const bolt::amp::control ctl,
OutputIterator  first,
Size  n,
const T &  value 
)

fill_n assigns the value value to every element in the range [first,first+n]. The return value is first + n.

Parameters
ctlOptional Control structure to control accelerator, debug, tuning, etc.See bolt::amp::control.
firstThe first element in the range of interest.
nThe size of the range of interest.
valueSets this value to elements in the range [first,first+n].
Template Parameters
OutputIteratoris a model of Output Iterator
Sizeis an integral type (either signed or unsigned).
Tis a model of Assignable
Returns
first+n.

The following code snippet demonstrates how to fill a device_vector with a float value.

#include <bolt/amp/fill.h>
#include <stdlib.h>
...
bolt::amp::device_vector<float> v(10);
float x=25.0f;
bolt::amp::fill_n(v.begin(), 10, x);
// the elements of v are now assigned to the float value.
See Also
http://www.sgi.com/tech/stl/fill_n.html