Bolt  1.3
C++ template library with support for OpenCL
Classes | Public Types | Public Member Functions | Public Attributes | Friends | List of all members
bolt::amp::device_vector< T, CONT > Class Template Reference

This defines the AMP version of a device_vector. More...

#include <device_vector.h>

Classes

class  const_reference_base
 
class  iterator_base
 Base class provided to encapsulate all the common functionality for constant and non-constant iterators. More...
 
class  reference_base
 A writeable element of the container The location of an element of the container may not actually reside in system memory, but rather in device memory, which may be in a partitioned memory space. Access to a reference of the container results in a mapping and unmapping operation of device memory. More...
 
class  reverse_iterator_base
 A reverse random access iterator in the classic sense. More...
 

Public Types

typedef T value_type
 
typedef ptrdiff_t difference_type
 
typedef difference_type distance_type
 
typedef int size_type
 
typedef
concurrency::array_view< T > 
arrayview_type
 
typedef concurrency::array< T > array_type
 
typedef CONT< T > container_type
 
typedef naked_pointer pointer
 
typedef const_naked_pointer const_pointer
 
typedef reference_base
< device_vector< value_type,
CONT > > 
reference
 Typedef to create the non-constant reference.
 
typedef const_reference_base
< device_vector< value_type,
CONT > > 
const_reference
 A non-writeable copy of an element of the container. Constant references are optimized to return a value_type, since it is certain that the value will not be modified.
 
typedef iterator_base
< device_vector< value_type,
CONT > > 
iterator
 Typedef to create the non-constant iterator.
 
typedef iterator_base< const
device_vector< value_type,
CONT > > 
const_iterator
 Typedef to create the constant iterator.
 
typedef reverse_iterator_base
< device_vector< value_type,
CONT > > 
reverse_iterator
 Typedef to create the non-constant reverse iterator.
 
typedef reverse_iterator_base
< const device_vector
< value_type, CONT > > 
const_reverse_iterator
 Typedef to create the constant reverse iterator.
 

Public Member Functions

 device_vector (control &ctl=control::getDefault())
 A default constructor that creates an empty device_vector.
 
 device_vector (size_type newSize, const value_type &initValue=value_type(), bool init=true, control &ctl=control::getDefault())
 A constructor that creates a new device_vector with the specified number of elements, with a specified initial value.
 
template<typename InputIterator >
 device_vector (const InputIterator begin, size_type newSize, bool discard=false, control &ctl=control::getDefault(), typename std::enable_if< !std::is_integral< InputIterator >::value &&std::is_same< arrayview_type, container_type >::value >::type *=0)
 A constructor that creates a new device_vector using a range specified by the user.
 
template<typename InputIterator >
 device_vector (const InputIterator begin, size_type newSize, bool discard=false, control &ctl=control::getDefault(), typename std::enable_if< !std::is_integral< InputIterator >::value &&std::is_same< array_type, container_type >::value >::type *=0)
 A constructor that creates a new device_vector using a range specified by the user.
 
template<typename T >
 device_vector (const device_vector< T, CONT > &cont, bool copy=true, control &ctl=control::getDefault())
 A constructor that creates a new device_vector from device_vector specified by user.
 
 device_vector (arrayview_type &cont)
 A constructor that creates a new device_vector using a pre-initialized array supplied by the user.
 
 device_vector (array_type &cont)
 A constructor that creates a new device_vector using a pre-initialized array_view supplied by the user.
 
template<typename InputIterator >
 device_vector (const InputIterator begin, const InputIterator end, bool discard=false, control &ctl=control::getDefault(), typename std::enable_if< std::is_same< arrayview_type, container_type >::value &&!std::is_integral< InputIterator >::value >::type *=0)
 A constructor that creates a new device_vector using a range specified by the user.
 
template<typename InputIterator >
 device_vector (const InputIterator begin, const InputIterator end, bool discard=false, control &ctl=control::getDefault(), typename std::enable_if< std::is_same< array_type, container_type >::value &&!std::is_integral< InputIterator >::value >::type *=0)
 A constructor that creates a new device_vector using a range specified by the user.
 
arrayview_type getBuffer () const
 A get accessor function to return the encapsulated device buffer for const objects. This member function allows access to the Buffer object, which can be retrieved through a reference or an iterator. This is necessary to allow library functions to get the encapsulated C++ AMP array object as a pass by reference argument to the C++ AMP parallel_for_each constructs.
 
arrayview_type getBuffer (const_iterator itr, unsigned int size) const
 A get accessor function to return the encapsulated device buffer for const objects based on the iterator getIndex() and size. This member function allows access to the Buffer object, which can be retrieved through a reference or an iterator. This is necessary to allow library functions to get the encapsulated C++ AMP array object as a pass by reference argument to the C++ AMP parallel_for_each constructs.
 
arrayview_type getBuffer (const_reverse_iterator itr, unsigned int size) const
 
void resize (size_type reqSize, const value_type &val=value_type())
 Change the number of elements in device_vector to reqSize. If the new requested size is less than the original size, the data is truncated and lost. If the new size is greater than the original size, the extra paddign will be initialized with the value specified by the user.
 
size_type size (void) const
 Return the number of known elements.
 
void reserve (size_type reqSize)
 Request a change in the capacity of the device_vector. If reserve completes successfully, this device_vector object guarantees that the it can store the requested amount of elements without another reallocation, until the device_vector size exceeds n.
 
size_type capacity (void) const
 Return the maximum possible number of elements without reallocation.
 
void shrink_to_fit ()
 Shrink the capacity( ) of this device_vector to just fit its elements. This makes the size( ) of the vector equal to its capacity( ).
 
value_type & operator[] (size_type n) restrict(cpu
 Retrieves the value stored at index n.
 
value_type & operator[] (size_type ix) const restrict(cpu
 Retrieves a constant value stored at index n.
 
iterator begin (void)
 Retrieves an iterator for this container that points at the beginning element.
 
const_iterator begin (void) const
 Retrieves an iterator for this container that points at the beginning constant element. No operation through this iterator may modify the contents of the referenced container.
 
const_iterator cbegin (void) const
 Retrieves an iterator for this container that points at the beginning constant element. No operation through this iterator may modify the contents of the referenced container.
 
reverse_iterator rbegin (void)
 Retrieves a reverse_iterator for this container that points at the last element.
 
const_reverse_iterator rbegin (void) const
 Retrieves a reverse_iterator for this container that points at the last constant element. No operation through this iterator may modify the contents of the referenced container.
 
const_reverse_iterator crbegin (void) const
 Retrieves an iterator for this container that points at the last constant element. No operation through this iterator may modify the contents of the referenced container.
 
iterator end (void)
 Retrieves an iterator for this container that points at the last element.
 
const_iterator end (void) const
 Retrieves an iterator for this container that points at the last constant element. No operation through this iterator may modify the contents of the referenced container.
 
const_iterator cend (void) const
 Retrieves an iterator for this container that points at the last constant element. No operation through this iterator may modify the contents of the referenced container.
 
reverse_iterator rend (void)
 Retrieves a reverse_iterator for this container that points at the beginning element.
 
const_reverse_iterator rend (void) const
 Retrieves a reverse_iterator for this container that points at the beginning constant element. No operation through this iterator may modify the contents of the referenced container.
 
const_reverse_iterator crend (void) const
 Retrieves a reverse_iterator for this container that points at the beginning constant element. No operation through this iterator may modify the contents of the referenced container.
 
value_type & front (void)
 Retrieves the value stored at index 0.
 
const value_type & front (void) const
 Retrieves the value stored at index 0.
 
value_type & back (void)
 Retrieves the value stored at index size( ) - 1.
 
const value_type & back (void) const
 Retrieves the value stored at index size( ) - 1.
 
pointer data (void)
 
const_pointer data (void) const
 
void clear (void)
 Removes all elements (makes the device_vector empty).
 
bool empty (void) const
 Test whether the container is empty.
 
void push_back (const value_type &value)
 Appends a copy of the value to the container.
 
void pop_back (void)
 Removes the last element, but does not return it.
 
void swap (device_vector &vec)
 Swaps the contents of two device_vectors in an efficient manner.
 
iterator erase (const_iterator index)
 Removes an element.
 
iterator erase (const_iterator first, const_iterator last)
 Removes a range of elements.
 
iterator insert (const_iterator index, const value_type &value)
 Insert a new element into the container.
 
void insert (const_iterator index, size_type n, const value_type &value)
 Inserts n copies of the new element into the container.
 
template<typename InputIterator >
void insert (const_iterator index, InputIterator begin, InputIterator end)
 
void assign (size_type newSize, const value_type &value)
 Assigns newSize copies of element value.
 
template<typename InputIterator >
std::enable_if
< std::_Is_iterator
< InputIterator >::value, void >
::type 
assign (InputIterator begin, InputIterator end)
 Assigns a range of values to device_vector, replacing all previous elements.
 

Public Attributes

value_type amp
 

Friends

class reference
 

Detailed Description

template<typename T, template< typename, int RANK=1 > class CONT = concurrency::array_view>
class bolt::amp::device_vector< T, CONT >

This defines the AMP version of a device_vector.

A device_vector is an abstract data type that provides random access to a flat, sequential region of memory that is performant for the device. This can imply different memories for different devices. For discrete class graphics, devices, this is most likely video memory; for APU devices, this can imply zero-copy memory; for CPU devices, this can imply standard host memory.

See Also
http://www.sgi.com/tech/stl/Vector.html

Member Typedef Documentation

template<typename T, template< typename, int RANK=1 > class CONT = concurrency::array_view>
typedef const_reference_base< device_vector< value_type, CONT > > bolt::amp::device_vector< T, CONT >::const_reference

A non-writeable copy of an element of the container. Constant references are optimized to return a value_type, since it is certain that the value will not be modified.

Note
A const_reference actually returns a value, not a reference.

Constructor & Destructor Documentation

template<typename T, template< typename, int RANK=1 > class CONT = concurrency::array_view>
bolt::amp::device_vector< T, CONT >::device_vector ( control ctl = control::getDefault( ))
inline

A default constructor that creates an empty device_vector.

Parameters
ctlAn Bolt control class used to perform copy operations; a default is used if not supplied by the user
Todo:
Find a way to be able to unambiguously specify memory flags for this constructor, that is not confused with the size constructor below.
template<typename T, template< typename, int RANK=1 > class CONT = concurrency::array_view>
bolt::amp::device_vector< T, CONT >::device_vector ( size_type  newSize,
const value_type &  initValue = value_type( ),
bool  init = true,
control ctl = control::getDefault( ) 
)
inline

A constructor that creates a new device_vector with the specified number of elements, with a specified initial value.

Parameters
newSizeThe number of elements of the new device_vector
valueThe value with which to initialize new elements.
initBoolean value to indicate whether to initialize device memory from initValue.
ctlA Bolt control class for copy operations; a default is used if not supplied by the user.
Warning
The ::cl::CommandQueue is not an STD reserve( ) parameter.
template<typename T, template< typename, int RANK=1 > class CONT = concurrency::array_view>
template<typename InputIterator >
bolt::amp::device_vector< T, CONT >::device_vector ( const InputIterator  begin,
size_type  newSize,
bool  discard = false,
control ctl = control::getDefault( ),
typename std::enable_if< !std::is_integral< InputIterator >::value &&std::is_same< arrayview_type, container_type >::value >::type *  = 0 
)
inline

A constructor that creates a new device_vector using a range specified by the user.

Parameters
beginAn iterator pointing at the beginning of the range.
newSizeThe number of elements of the new device_vector
discardBoolean value to whether the container data will be discarded for read operation.
ctlA Bolt control class used to perform copy operations; a default is used if not supplied by the user.
Note
Ignore the enable_if<> parameter; it prevents this constructor from being called with integral types.
template<typename T, template< typename, int RANK=1 > class CONT = concurrency::array_view>
template<typename InputIterator >
bolt::amp::device_vector< T, CONT >::device_vector ( const InputIterator  begin,
size_type  newSize,
bool  discard = false,
control ctl = control::getDefault( ),
typename std::enable_if< !std::is_integral< InputIterator >::value &&std::is_same< array_type, container_type >::value >::type *  = 0 
)
inline

A constructor that creates a new device_vector using a range specified by the user.

Parameters
beginAn iterator pointing at the beginning of the range.
newSizeThe number of elements of the new device_vector
discardBoolean value to whether the container data will be discarded for read operation.
ctlA Bolt control class used to perform copy operations; a default is used if not supplied by the user.
Note
Ignore the enable_if<> parameter; it prevents this constructor from being called with integral types.
template<typename T, template< typename, int RANK=1 > class CONT = concurrency::array_view>
template<typename T >
bolt::amp::device_vector< T, CONT >::device_vector ( const device_vector< T, CONT > &  cont,
bool  copy = true,
control ctl = control::getDefault( ) 
)
inline

A constructor that creates a new device_vector from device_vector specified by user.

Parameters
contAn device_vector object that has both .data() and .size() members
copyBoolean value to decide whether new device_vector will be shallow copy or deep copy
ctlA Bolt control class used to perform copy operations; a default is used if not supplied by the user.
template<typename T, template< typename, int RANK=1 > class CONT = concurrency::array_view>
bolt::amp::device_vector< T, CONT >::device_vector ( arrayview_type &  cont)
inline

A constructor that creates a new device_vector using a pre-initialized array supplied by the user.

Parameters
contAn concurrency::array object.
template<typename T, template< typename, int RANK=1 > class CONT = concurrency::array_view>
bolt::amp::device_vector< T, CONT >::device_vector ( array_type &  cont)
inline

A constructor that creates a new device_vector using a pre-initialized array_view supplied by the user.

Parameters
contAn concurrency::array_view object.
template<typename T, template< typename, int RANK=1 > class CONT = concurrency::array_view>
template<typename InputIterator >
bolt::amp::device_vector< T, CONT >::device_vector ( const InputIterator  begin,
const InputIterator  end,
bool  discard = false,
control ctl = control::getDefault( ),
typename std::enable_if< std::is_same< arrayview_type, container_type >::value &&!std::is_integral< InputIterator >::value >::type *  = 0 
)
inline

A constructor that creates a new device_vector using a range specified by the user.

Parameters
beginAn iterator pointing at the beginning of the range.
endAn iterator pointing at the end of the range.
discardBoolean value to whether the container data will be discarded for read operation.
ctlA Bolt control class used to perform copy operations; a default is used if not supplied by the user.
Note
concurrency::array_view specialization Ignore the enable_if<> parameter; it prevents this constructor from being called with integral types.
template<typename T, template< typename, int RANK=1 > class CONT = concurrency::array_view>
template<typename InputIterator >
bolt::amp::device_vector< T, CONT >::device_vector ( const InputIterator  begin,
const InputIterator  end,
bool  discard = false,
control ctl = control::getDefault( ),
typename std::enable_if< std::is_same< array_type, container_type >::value &&!std::is_integral< InputIterator >::value >::type *  = 0 
)
inline

A constructor that creates a new device_vector using a range specified by the user.

Parameters
beginAn iterator pointing at the beginning of the range.
endAn iterator pointing at the end of the range.
discardBoolean value to whether the container data will be discarded for read operation.
ctlA Bolt control class used to perform copy operations; a default is used if not supplied by the user.
Note
concurrency::array specializationIgnore the enable_if<> parameter; it prevents this constructor from being called with integral types.

Member Function Documentation

template<typename T, template< typename, int RANK=1 > class CONT = concurrency::array_view>
void bolt::amp::device_vector< T, CONT >::assign ( size_type  newSize,
const value_type &  value 
)
inline

Assigns newSize copies of element value.

Parameters
newSizeThe new size of the device_vector.
valueThe value of the element that is replicated newSize times.
Warning
All previous iterators, references, and pointers are invalidated.
template<typename T, template< typename, int RANK=1 > class CONT = concurrency::array_view>
template<typename InputIterator >
std::enable_if< std::_Is_iterator<InputIterator>::value, void>::type bolt::amp::device_vector< T, CONT >::assign ( InputIterator  begin,
InputIterator  end 
)
inline

Assigns a range of values to device_vector, replacing all previous elements.

Parameters
beginThe iterator position signifiying the beginning of the range.
endThe iterator position signifying the end of the range (exclusive).
Warning
All previous iterators, references, and pointers are invalidated.
template<typename T, template< typename, int RANK=1 > class CONT = concurrency::array_view>
value_type& bolt::amp::device_vector< T, CONT >::back ( void  )
inline

Retrieves the value stored at index size( ) - 1.

Note
This returns a proxy object, to control when device memory gets mapped.
template<typename T, template< typename, int RANK=1 > class CONT = concurrency::array_view>
const value_type& bolt::amp::device_vector< T, CONT >::back ( void  ) const
inline

Retrieves the value stored at index size( ) - 1.

Returns
Returns a const_reference, which is not a proxy object.
template<typename T, template< typename, int RANK=1 > class CONT = concurrency::array_view>
iterator bolt::amp::device_vector< T, CONT >::begin ( void  )
inline

Retrieves an iterator for this container that points at the beginning element.

Returns
A device_vector< value_type >::iterator.
template<typename T, template< typename, int RANK=1 > class CONT = concurrency::array_view>
const_iterator bolt::amp::device_vector< T, CONT >::begin ( void  ) const
inline

Retrieves an iterator for this container that points at the beginning constant element. No operation through this iterator may modify the contents of the referenced container.

Returns
A device_vector< value_type >::const_iterator
template<typename T, template< typename, int RANK=1 > class CONT = concurrency::array_view>
size_type bolt::amp::device_vector< T, CONT >::capacity ( void  ) const
inline

Return the maximum possible number of elements without reallocation.

Note
Capacity() differs from size(), in that capacity() returns the number of elements that could be stored in the memory currently allocated.
Returns
The size of the memory held by device_vector, counted in elements.
template<typename T, template< typename, int RANK=1 > class CONT = concurrency::array_view>
const_iterator bolt::amp::device_vector< T, CONT >::cbegin ( void  ) const
inline

Retrieves an iterator for this container that points at the beginning constant element. No operation through this iterator may modify the contents of the referenced container.

Note
This method may return a constant iterator from a non-constant container.
Returns
A device_vector< value_type >::const_iterator.
template<typename T, template< typename, int RANK=1 > class CONT = concurrency::array_view>
const_iterator bolt::amp::device_vector< T, CONT >::cend ( void  ) const
inline

Retrieves an iterator for this container that points at the last constant element. No operation through this iterator may modify the contents of the referenced container.

Note
This method may return a constant iterator from a non-constant container.
Returns
A device_vector< value_type >::const_iterator.
template<typename T, template< typename, int RANK=1 > class CONT = concurrency::array_view>
void bolt::amp::device_vector< T, CONT >::clear ( void  )
inline

Removes all elements (makes the device_vector empty).

Note
All previous iterators, references and pointers are invalidated.
template<typename T, template< typename, int RANK=1 > class CONT = concurrency::array_view>
const_reverse_iterator bolt::amp::device_vector< T, CONT >::crbegin ( void  ) const
inline

Retrieves an iterator for this container that points at the last constant element. No operation through this iterator may modify the contents of the referenced container.

Note
This method may return a constant iterator from a non-constant container.
Returns
A device_vector< value_type >::const_reverse_iterator.
template<typename T, template< typename, int RANK=1 > class CONT = concurrency::array_view>
const_reverse_iterator bolt::amp::device_vector< T, CONT >::crend ( void  ) const
inline

Retrieves a reverse_iterator for this container that points at the beginning constant element. No operation through this iterator may modify the contents of the referenced container.

Note
This method may return a constant iterator from a non-constant container.
Returns
A device_vector< value_type >::const_reverse_iterator.
template<typename T, template< typename, int RANK=1 > class CONT = concurrency::array_view>
pointer bolt::amp::device_vector< T, CONT >::data ( void  )
inline

need to understand what Array_view.data is returning. Who should free the pointer?

template<typename T, template< typename, int RANK=1 > class CONT = concurrency::array_view>
bool bolt::amp::device_vector< T, CONT >::empty ( void  ) const
inline

Test whether the container is empty.

Returns
Returns true if size( ) == 0
template<typename T, template< typename, int RANK=1 > class CONT = concurrency::array_view>
iterator bolt::amp::device_vector< T, CONT >::end ( void  )
inline

Retrieves an iterator for this container that points at the last element.

Returns
A device_vector< value_type >::iterator.
template<typename T, template< typename, int RANK=1 > class CONT = concurrency::array_view>
const_iterator bolt::amp::device_vector< T, CONT >::end ( void  ) const
inline

Retrieves an iterator for this container that points at the last constant element. No operation through this iterator may modify the contents of the referenced container.

Returns
A device_vector< value_type >::const_iterator.
template<typename T, template< typename, int RANK=1 > class CONT = concurrency::array_view>
iterator bolt::amp::device_vector< T, CONT >::erase ( const_iterator  index)
inline

Removes an element.

Parameters
indexThe iterator position in which to remove the element.
Returns
The iterator position after the deleted element.
template<typename T, template< typename, int RANK=1 > class CONT = concurrency::array_view>
iterator bolt::amp::device_vector< T, CONT >::erase ( const_iterator  first,
const_iterator  last 
)
inline

Removes a range of elements.

Parameters
beginThe iterator position signifiying the beginning of the range.
endThe iterator position signifying the end of the range (exclusive).
Returns
The iterator position after the deleted range.
template<typename T, template< typename, int RANK=1 > class CONT = concurrency::array_view>
value_type& bolt::amp::device_vector< T, CONT >::front ( void  )
inline

Retrieves the value stored at index 0.

Note
This returns a proxy object, to control when device memory gets mapped.
template<typename T, template< typename, int RANK=1 > class CONT = concurrency::array_view>
const value_type& bolt::amp::device_vector< T, CONT >::front ( void  ) const
inline

Retrieves the value stored at index 0.

Returns
Returns a const_reference, which is not a proxy object.
template<typename T, template< typename, int RANK=1 > class CONT = concurrency::array_view>
arrayview_type bolt::amp::device_vector< T, CONT >::getBuffer ( ) const
inline

A get accessor function to return the encapsulated device buffer for const objects. This member function allows access to the Buffer object, which can be retrieved through a reference or an iterator. This is necessary to allow library functions to get the encapsulated C++ AMP array object as a pass by reference argument to the C++ AMP parallel_for_each constructs.

Note
This get function could be implemented in the iterator, but the reference object is usually a temporary rvalue, so this location seems less intrusive to the design of the vector class.
template<typename T, template< typename, int RANK=1 > class CONT = concurrency::array_view>
arrayview_type bolt::amp::device_vector< T, CONT >::getBuffer ( const_iterator  itr,
unsigned int  size 
) const
inline

A get accessor function to return the encapsulated device buffer for const objects based on the iterator getIndex() and size. This member function allows access to the Buffer object, which can be retrieved through a reference or an iterator. This is necessary to allow library functions to get the encapsulated C++ AMP array object as a pass by reference argument to the C++ AMP parallel_for_each constructs.

Parameters
itrAn iterator pointing at the beginning of the range.
sizeSize of buffer.
Note
This get function could be implemented in the iterator, but the reference object is usually a temporary rvalue, so this location seems less intrusive to the design of the vector class.
template<typename T, template< typename, int RANK=1 > class CONT = concurrency::array_view>
iterator bolt::amp::device_vector< T, CONT >::insert ( const_iterator  index,
const value_type &  value 
)
inline

Insert a new element into the container.

Parameters
indexThe iterator position to insert a copy of the element.
valueThe element to insert.
Returns
The position of the new element.
Note
Only iterators before the insertion point remain valid after the insertion.
If the container must grow to contain the new value, all iterators and references are invalidated.
template<typename T, template< typename, int RANK=1 > class CONT = concurrency::array_view>
void bolt::amp::device_vector< T, CONT >::insert ( const_iterator  index,
size_type  n,
const value_type &  value 
)
inline

Inserts n copies of the new element into the container.

Parameters
indexThe iterator position to insert n copies of the element.
nThe number of copies of element.
valueThe element to insert.
Note
Only iterators before the insertion point remain valid after the insertion.
If the container must grow to contain the new value, all iterators and references are invalidated.
template<typename T, template< typename, int RANK=1 > class CONT = concurrency::array_view>
value_type& bolt::amp::device_vector< T, CONT >::operator[] ( size_type  n)

Retrieves the value stored at index n.

Returns
Returns a proxy reference object, to control when device memory gets mapped.
template<typename T, template< typename, int RANK=1 > class CONT = concurrency::array_view>
value_type& bolt::amp::device_vector< T, CONT >::operator[] ( size_type  ix) const

Retrieves a constant value stored at index n.

Returns
Returns a const_reference, which is not a proxy object.
template<typename T, template< typename, int RANK=1 > class CONT = concurrency::array_view>
void bolt::amp::device_vector< T, CONT >::push_back ( const value_type &  value)
inline

Appends a copy of the value to the container.

Parameters
valueThe element to append
template<typename T, template< typename, int RANK=1 > class CONT = concurrency::array_view>
reverse_iterator bolt::amp::device_vector< T, CONT >::rbegin ( void  )
inline

Retrieves a reverse_iterator for this container that points at the last element.

Returns
A device_vector< value_type >::reverse_iterator.
template<typename T, template< typename, int RANK=1 > class CONT = concurrency::array_view>
const_reverse_iterator bolt::amp::device_vector< T, CONT >::rbegin ( void  ) const
inline

Retrieves a reverse_iterator for this container that points at the last constant element. No operation through this iterator may modify the contents of the referenced container.

Returns
A device_vector< value_type >::const_reverse_iterator
template<typename T, template< typename, int RANK=1 > class CONT = concurrency::array_view>
reverse_iterator bolt::amp::device_vector< T, CONT >::rend ( void  )
inline

Retrieves a reverse_iterator for this container that points at the beginning element.

Returns
A device_vector< value_type >::reverse_iterator.
template<typename T, template< typename, int RANK=1 > class CONT = concurrency::array_view>
const_reverse_iterator bolt::amp::device_vector< T, CONT >::rend ( void  ) const
inline

Retrieves a reverse_iterator for this container that points at the beginning constant element. No operation through this iterator may modify the contents of the referenced container.

Returns
A device_vector< value_type >::const_reverse_iterator.
template<typename T, template< typename, int RANK=1 > class CONT = concurrency::array_view>
void bolt::amp::device_vector< T, CONT >::reserve ( size_type  reqSize)
inline

Request a change in the capacity of the device_vector. If reserve completes successfully, this device_vector object guarantees that the it can store the requested amount of elements without another reallocation, until the device_vector size exceeds n.

Parameters
nThe requested size of the device_vector in elements
Note
capacity( ) may exceed n, but will not be less than n.
Contents are preserved, and the size( ) of the vector is not affected.
Warning
if the device_vector must reallocate, all previous iterators, references, and pointers are invalidated.
The ::cl::CommandQueue is not a STD reserve( ) parameter what if reqSize < the size of the original buffer
template<typename T, template< typename, int RANK=1 > class CONT = concurrency::array_view>
void bolt::amp::device_vector< T, CONT >::resize ( size_type  reqSize,
const value_type &  val = value_type( ) 
)
inline

Change the number of elements in device_vector to reqSize. If the new requested size is less than the original size, the data is truncated and lost. If the new size is greater than the original size, the extra paddign will be initialized with the value specified by the user.

Parameters
reqSizeThe requested size of the device_vector in elements.
valAll new elements are initialized with this new value.
Note
capacity( ) may exceed n, but is not less than n.
Warning
If the device_vector must reallocate, all previous iterators, references, and pointers are invalidated.
The ::cl::CommandQueue is not a STD reserve( ) parameter
template<typename T, template< typename, int RANK=1 > class CONT = concurrency::array_view>
void bolt::amp::device_vector< T, CONT >::shrink_to_fit ( )
inline

Shrink the capacity( ) of this device_vector to just fit its elements. This makes the size( ) of the vector equal to its capacity( ).

Note
Contents are preserved.
Warning
if the device_vector must reallocate, all previous iterators, references, and pointers are invalidated.
template<typename T, template< typename, int RANK=1 > class CONT = concurrency::array_view>
size_type bolt::amp::device_vector< T, CONT >::size ( void  ) const
inline

Return the number of known elements.

Note
size( ) differs from capacity( ), in that size( ) returns the number of elements between begin() & end()
Returns
Number of valid elements
template<typename T, template< typename, int RANK=1 > class CONT = concurrency::array_view>
void bolt::amp::device_vector< T, CONT >::swap ( device_vector< T, CONT > &  vec)
inline

Swaps the contents of two device_vectors in an efficient manner.

Parameters
vecThe device_vector to swap with.

Member Data Documentation

template<typename T, template< typename, int RANK=1 > class CONT = concurrency::array_view>
value_type bolt::amp::device_vector< T, CONT >::amp
Initial value:
{
return m_devMemory[n]

The documentation for this class was generated from the following file: