Template Class host_vector¶
Defined in File device_vector.h
Class Documentation¶
-
template<typename
T, typenameAlloc= std::allocator<T>>
classhost_vector: public detail::vector_base<T, Alloc>¶ A
host_vectoris 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 ahost_vectormay vary dynamically; memory management is automatic. The memory associated with ahost_vectorresides in the memory space of the host associated with a parallel device.Public Functions
-
__host__
host_vector(void)¶ This constructor creates an empty
host_vector.
-
__host__
~host_vector(void)¶ The destructor erases the elements.
-
__host__
host_vector(size_type n)¶ This constructor creates a
host_vectorwith the given size.- Parameters
n: The number of elements to initially create.
-
__host__
host_vector(size_type n, const value_type &value)¶ This constructor creates a
host_vectorwith copies of an exemplar element.- Parameters
n: The number of elements to initially create.value: An element to copy.
-
__host__
host_vector(const host_vector &v)¶ Copy constructor copies from an exemplar
host_vector.- Parameters
v: Thehost_vectorto copy.
-
__host__ host_vector& thrust::host_vector::operator=(const host_vector & v) Assign operator copies from an exemplar
host_vector.- Parameters
v: Thehost_vectorto copy.
-
template<typename
OtherT, typenameOtherAlloc>
__host__host_vector(const host_vector<OtherT, OtherAlloc> &v)¶ Copy constructor copies from an exemplar
host_vectorwith different type.- Parameters
v: Thehost_vectorto copy.
-
template<typename OtherT, typename OtherAlloc>__host__ host_vector& thrust::host_vector::operator=(const host_vector < OtherT, OtherAlloc > & v) Assign operator copies from an exemplar
host_vectorwith different type.- Parameters
v: Thehost_vectorto copy.
-
template<typename
OtherT, typenameOtherAlloc>
__host__host_vector(const std::vector<OtherT, OtherAlloc> &v)¶ Copy constructor copies from an exemplar
std::vector.- Parameters
v: Thestd::vectorto copy.
-
template<typename OtherT, typename OtherAlloc>__host__ host_vector& thrust::host_vector::operator=(const std::vector< OtherT, OtherAlloc > & v) Assign operator copies from an exemplar
std::vector.- Parameters
v: Thestd::vectorto copy.
-
template<typename
OtherT, typenameOtherAlloc>
__host__host_vector(const device_vector<OtherT, OtherAlloc> &v)¶ Copy constructor copies from an exemplar
device_vectorwith possibly different type.- Parameters
v: Thedevice_vectorto copy.
-
template<typename OtherT, typename OtherAlloc>__host__ host_vector& thrust::host_vector::operator=(const device_vector < OtherT, OtherAlloc > & v) Assign operator copies from an exemplar
device_vector.- Parameters
v: Thedevice_vectorto copy.
-
template<typename
InputIterator>
__host__host_vector(InputIterator first, InputIterator last)¶ This constructor builds a
host_vectorfrom a range.- Parameters
first: The beginning of the range.last: The end of the range.
-
__host__