|
thrust
|
#include <device_vector.h>
Public Member Functions | |
| __host__ | device_vector (void) |
| __host__ | device_vector (size_type n, const value_type &value=value_type()) |
| __host__ | device_vector (const device_vector &v) |
| template<typename OtherT , typename OtherAlloc > | |
| __device__ | device_vector (const device_vector< OtherT, OtherAlloc > &v) |
| template<typename OtherT , typename OtherAlloc > | |
| __device__ device_vector & | operator= (const device_vector< OtherT, OtherAlloc > &v) |
| template<typename OtherT , typename OtherAlloc > | |
| __host__ | device_vector (const std::vector< OtherT, OtherAlloc > &v) |
| template<typename OtherT , typename OtherAlloc > | |
| __host__ device_vector & | operator= (const std::vector< OtherT, OtherAlloc > &v) |
| template<typename OtherT , typename OtherAlloc > | |
| __host__ | device_vector (const host_vector< OtherT, OtherAlloc > &v) |
| template<typename InputIterator > | |
| __host__ | device_vector (InputIterator first, InputIterator last) |
| void | resize (size_type new_size, const value_type &x=value_type()) |
| Resizes this vector to the specified number of elements. | |
| size_type | size (void) const |
| size_type | max_size (void) const |
| void | reserve (size_type n) |
| If n is less than or equal to capacity(), this call has no effect. Otherwise, this method is a request for allocation of additional memory. If the request is successful, then capacity() is greater than or equal to n; otherwise, capacity() is unchanged. In either case, size() is unchanged. | |
| size_type | capacity (void) const |
| void | shrink_to_fit (void) |
| reference | operator[] (size_type n) |
| Subscript access to the data contained in this vector_dev. | |
| const_reference | operator[] (size_type n) const |
| Subscript read access to the data contained in this vector_dev. | |
| iterator | begin (void) |
| const_iterator | begin (void) const |
| const_iterator | cbegin (void) const |
| reverse_iterator | rbegin (void) |
| const_reverse_iterator | rbegin (void) const |
| const_reverse_iterator | crbegin (void) const |
| iterator | end (void) |
| const_iterator | end (void) const |
| const_iterator | cend (void) const |
| reverse_iterator | rend (void) |
| const_reverse_iterator | rend (void) const |
| const_reverse_iterator | crend (void) const |
| const_reference | front (void) const |
| reference | front (void) |
| const_reference | back (void) const |
| reference | back (void) |
| pointer | data (void) |
| const_pointer | data (void) const |
| void | clear (void) |
| bool | empty (void) const |
| void | push_back (const value_type &x) |
| void | pop_back (void) |
| void | swap (device_vector &v) |
| iterator | erase (iterator pos) |
| iterator | erase (iterator first, iterator last) |
| iterator | insert (iterator position, const T &x) |
| void | insert (iterator position, size_type n, const T &x) |
| template<typename InputIterator > | |
| void | insert (iterator position, InputIterator first, InputIterator last) |
| void | assign (size_type n, const T &x) |
| template<typename InputIterator > | |
| void | assign (InputIterator first, InputIterator last) |
| allocator_type | get_allocator (void) const |
A device_vector is a container that supports random access to elements, constant time removal of elements at the end, and linear time insertion and removal of elements at the beginning or in the middle. The number of elements in a device_vector may vary dynamically; memory management is automatic. The memory associated with a device_vector resides in the memory space of a parallel device.
| __host__ thrust::device_vector< T, Alloc >::device_vector | ( | void | ) | [inline] |
This constructor creates an empty device_vector.
| __host__ thrust::device_vector< T, Alloc >::device_vector | ( | size_type | n, |
| const value_type & | value = value_type() |
||
| ) | [inline, explicit] |
This constructor creates a device_vector with copies of an exemplar element.
| n | The number of elements to initially create. |
| value | An element to copy. |
| __host__ thrust::device_vector< T, Alloc >::device_vector | ( | const device_vector< T, Alloc > & | v | ) | [inline] |
Copy constructor copies from an exemplar device_vector.
| v | The device_vector to copy. |
| __device__ thrust::device_vector< T, Alloc >::device_vector | ( | const device_vector< OtherT, OtherAlloc > & | v | ) | [inline] |
Copy constructor copies from an exemplar device_vector with different type.
| v | The device_vector to copy. |
| __host__ thrust::device_vector< T, Alloc >::device_vector | ( | const std::vector< OtherT, OtherAlloc > & | v | ) | [inline] |
Copy constructor copies from an exemplar std::vector.
| v | The std::vector to copy. |
| __host__ thrust::device_vector< T, Alloc >::device_vector | ( | const host_vector< OtherT, OtherAlloc > & | v | ) |
Copy constructor copies from an exemplar host_vector with possibly different type.
| v | The host_vector to copy. |
| __host__ thrust::device_vector< T, Alloc >::device_vector | ( | InputIterator | first, |
| InputIterator | last | ||
| ) | [inline] |
This constructor builds a device_vector from a range.
| first | The beginning of the range. |
| last | The end of the range. |
| void thrust::device_vector< T, Alloc >::assign | ( | size_type | n, |
| const T & | x | ||
| ) |
This version of assign replicates a given exemplar n times into this vector.
| n | The number of times to copy x. |
| x | The exemplar element to replicate. |
| void thrust::device_vector< T, Alloc >::assign | ( | InputIterator | first, |
| InputIterator | last | ||
| ) |
This version of assign makes this vector a copy of a given input range.
| first | The beginning of the range to copy. |
| last | The end of the range to copy. |
| InputIterator | is a model of Input Iterator. |
| const_reference thrust::device_vector< T, Alloc >::back | ( | void | ) | const |
This method returns a const reference pointing to the last element of this vector.
| reference thrust::device_vector< T, Alloc >::back | ( | void | ) |
This method returns a reference referring to the last element of this vector_dev.
| iterator thrust::device_vector< T, Alloc >::begin | ( | void | ) |
This method returns an iterator pointing to the beginning of this vector.
| const_iterator thrust::device_vector< T, Alloc >::begin | ( | void | ) | const |
This method returns a const_iterator pointing to the beginning of this vector.
| size_type thrust::device_vector< T, Alloc >::capacity | ( | void | ) | const |
Returns the number of elements which have been reserved in this vector.
| const_iterator thrust::device_vector< T, Alloc >::cbegin | ( | void | ) | const |
This method returns a const_iterator pointing to the beginning of this vector.
| const_iterator thrust::device_vector< T, Alloc >::cend | ( | void | ) | const |
| void thrust::device_vector< T, Alloc >::clear | ( | void | ) |
This method resizes this vector to 0.
| const_reverse_iterator thrust::device_vector< T, Alloc >::crbegin | ( | void | ) | const |
This method returns a const_reverse_iterator pointing to the beginning of this vector's reversed sequence.
| const_reverse_iterator thrust::device_vector< T, Alloc >::crend | ( | void | ) | const |
| pointer thrust::device_vector< T, Alloc >::data | ( | void | ) |
This method returns a pointer to this vector's first element.
| const_pointer thrust::device_vector< T, Alloc >::data | ( | void | ) | const |
This method returns a const_pointer to this vector's first element.
| bool thrust::device_vector< T, Alloc >::empty | ( | void | ) | const |
| iterator thrust::device_vector< T, Alloc >::end | ( | void | ) |
| const_iterator thrust::device_vector< T, Alloc >::end | ( | void | ) | const |
| iterator thrust::device_vector< T, Alloc >::erase | ( | iterator | pos | ) |
This method removes the element at position pos.
| pos | The position of the element of interest. |
| iterator thrust::device_vector< T, Alloc >::erase | ( | iterator | first, |
| iterator | last | ||
| ) |
This method removes the range of elements [first,last) from this vector.
| first | The beginning of the range of elements to remove. |
| last | The end of the range of elements to remove. |
| const_reference thrust::device_vector< T, Alloc >::front | ( | void | ) | const |
This method returns a const_reference referring to the first element of this vector.
| reference thrust::device_vector< T, Alloc >::front | ( | void | ) |
This method returns a reference pointing to the first element of this vector.
| allocator_type thrust::device_vector< T, Alloc >::get_allocator | ( | void | ) | const |
This method returns a copy of this vector's allocator.
| iterator thrust::device_vector< T, Alloc >::insert | ( | iterator | position, |
| const T & | x | ||
| ) |
This method inserts a single copy of a given exemplar value at the specified position in this vector.
| position | The insertion position. |
| x | The exemplar element to copy & insert. |
| void thrust::device_vector< T, Alloc >::insert | ( | iterator | position, |
| InputIterator | first, | ||
| InputIterator | last | ||
| ) |
This method inserts a copy of an input range at the specified position in this vector.
| position | The insertion position. |
| first | The beginning of the range to copy. |
| last | The end of the range to copy. |
| InputIterator | is a model of <a href="http://www.sgi.com/tech/stl/InputIterator.html>Input Iterator</a>, and \p InputIterator's \c value_type is a model of <a href="http://www.sgi.com/tech/stl/Assignable.html">Assignable. |
| void thrust::device_vector< T, Alloc >::insert | ( | iterator | position, |
| size_type | n, | ||
| const T & | x | ||
| ) |
This method inserts a copy of an exemplar value to a range at the specified position in this vector.
| position | The insertion position |
| n | The number of insertions to perform. |
| x | The value to replicate and insert. |
| size_type thrust::device_vector< T, Alloc >::max_size | ( | void | ) | const |
| __device__ device_vector& thrust::device_vector< T, Alloc >::operator= | ( | const device_vector< OtherT, OtherAlloc > & | v | ) | [inline] |
Assign operator copies from an exemplar device_vector with different type.
| v | The device_vector to copy. |
Referenced by thrust::device_vector< T, Alloc >::operator=().
| __host__ device_vector& thrust::device_vector< T, Alloc >::operator= | ( | const std::vector< OtherT, OtherAlloc > & | v | ) | [inline] |
Assign operator copies from an exemplar std::vector.
| v | The std::vector to copy. |
References thrust::device_vector< T, Alloc >::operator=().
| reference thrust::device_vector< T, Alloc >::operator[] | ( | size_type | n | ) |
Subscript access to the data contained in this vector_dev.
| n | The index of the element for which data should be accessed. |
This operator allows for easy, array-style, data access. Note that data access with this operator is unchecked and out_of_range lookups are not defined.
| const_reference thrust::device_vector< T, Alloc >::operator[] | ( | size_type | n | ) | const |
Subscript read access to the data contained in this vector_dev.
| n | The index of the element for which data should be accessed. |
This operator allows for easy, array-style, data access. Note that data access with this operator is unchecked and out_of_range lookups are not defined.
| void thrust::device_vector< T, Alloc >::pop_back | ( | void | ) |
This method erases the last element of this vector, invalidating all iterators and references to it.
| void thrust::device_vector< T, Alloc >::push_back | ( | const value_type & | x | ) |
This method appends the given element to the end of this vector.
| x | The element to append. |
| reverse_iterator thrust::device_vector< T, Alloc >::rbegin | ( | void | ) |
This method returns a reverse_iterator pointing to the beginning of this vector's reversed sequence.
| const_reverse_iterator thrust::device_vector< T, Alloc >::rbegin | ( | void | ) | const |
This method returns a const_reverse_iterator pointing to the beginning of this vector's reversed sequence.
| const_reverse_iterator thrust::device_vector< T, Alloc >::rend | ( | void | ) | const |
| reverse_iterator thrust::device_vector< T, Alloc >::rend | ( | void | ) |
This method returns a reverse_iterator pointing to one element past the last of this vector's reversed sequence.
| void thrust::device_vector< T, Alloc >::reserve | ( | size_type | n | ) |
If n is less than or equal to capacity(), this call has no effect. Otherwise, this method is a request for allocation of additional memory. If the request is successful, then capacity() is greater than or equal to n; otherwise, capacity() is unchanged. In either case, size() is unchanged.
| std::length_error | If n exceeds max_size(). |
| void thrust::device_vector< T, Alloc >::resize | ( | size_type | new_size, |
| const value_type & | x = value_type() |
||
| ) |
Resizes this vector to the specified number of elements.
| new_size | Number of elements this vector should contain. |
| x | Data with which new elements should be populated. |
| std::length_error | If n exceeds max_size(). |
This method will resize this vector to the specified number of elements. If the number is smaller than this vector's current size this vector is truncated, otherwise this vector is extended and new elements are populated with given data.
| void thrust::device_vector< T, Alloc >::shrink_to_fit | ( | void | ) |
This method shrinks the capacity of this vector to exactly fit its elements.
| size_type thrust::device_vector< T, Alloc >::size | ( | void | ) | const |
Returns the number of elements in this vector.
| void thrust::device_vector< T, Alloc >::swap | ( | device_vector< T, Alloc > & | v | ) |
This method swaps the contents of this vector_base with another vector.
| v | The vector with which to swap. |
1.7.4