template<typename T, typename MemorySpace>
class cusp::array1d< T, MemorySpace >
The array1d class is a 1D vector container that may contain elements stored in "host" or "device" memory space.
- Template Parameters
-
T | value_type of the array |
MemorySpace | memory space of the array (cusp::host_memory or cusp::device_memory) |
- Overview
- A array1d vector is a container that supports random access to elements. The memory associated with a array1d vector may reside in either "host" or "device" memory depending on the supplied allocator embedded in the MemorySpace template argument. array1d vectors inherit a considerable amount of functionality from the thrust::detail::vector_base case.
- See Also
- http://thrust.github.io/doc/classthrust_1_1host__vector.html
-
http://thrust.github.io/doc/classthrust_1_1device__vector.html
- Example
int main()
{
a[0] = 0;
a[1] = 1;
}
- Examples:
- array1d.cu, blas.cu, csr_view.cu, maximal_independent_set.cu, monitor.cu, multiply.cu, stencil.cu, unordered_triplets.cu, and verbose_monitor.cu.
Definition at line 98 of file array1d.h.
|
| array1d (void) |
|
| array1d (size_type n) |
|
| array1d (size_type n, const value_type &value) |
|
| array1d (const array1d &v) |
|
array1d & | operator= (const array1d &v) |
|
template<typename OtherT , typename OtherMem > |
| array1d (const array1d< OtherT, OtherMem > &v) |
|
template<typename OtherT , typename OtherMem > |
array1d & | operator= (const array1d< OtherT, OtherMem > &v) |
|
template<typename OtherT , typename OtherAlloc > |
| array1d (const std::vector< OtherT, OtherAlloc > &v) |
|
template<typename OtherT , typename OtherAlloc > |
array1d & | operator= (const std::vector< OtherT, OtherAlloc > &v) |
|
template<typename OtherT , typename OtherAlloc > |
| array1d (const thrust::host_vector< OtherT, OtherAlloc > &v) |
|
template<typename OtherT , typename OtherAlloc > |
array1d & | operator= (const thrust::host_vector< OtherT, OtherAlloc > &v) |
|
template<typename OtherT , typename OtherAlloc > |
| array1d (const thrust::device_vector< OtherT, OtherAlloc > &v) |
|
template<typename OtherT , typename OtherAlloc > |
array1d & | operator= (const thrust::device_vector< OtherT, OtherAlloc > &v) |
|
template<typename InputIterator > |
| array1d (InputIterator first, InputIterator last) |
|
template<typename InputIterator > |
| array1d (const array1d_view< InputIterator > &v) |
|
view | subarray (size_type start_index, size_type num_entries) |
|
const_view | subarray (size_type start_index, size_type num_entries) const |
|
template<typename T, typename MemorySpace>
template<typename OtherT , typename OtherAlloc >
Copy constructor copies from an exemplar std::vector
with different type
- Template Parameters
-
OtherT | Type of std::vector |
OtherAlloc | Allocator of std::vector |
- Parameters
-
v | The std::vector to copy. |
Definition at line 180 of file array1d.h.
template<typename T, typename MemorySpace>
template<typename OtherT , typename OtherAlloc >
Copy constructor copies from an exemplar thrust::host_vector
with different type
- Template Parameters
-
OtherT | Type of thrust::host_vector |
OtherAlloc | Allocator of thrust::host_vector |
- Parameters
-
v | The thrust::host_vector to copy. |
Definition at line 198 of file array1d.h.
template<typename T, typename MemorySpace>
template<typename OtherT , typename OtherAlloc >
Copy constructor copies from an exemplar thrust::device_vector
with different type
- Template Parameters
-
OtherT | Type of thrust::device_vector |
OtherAlloc | Allocator of thrust::device_vector |
- Parameters
-
v | The thrust::device_vector to copy. |
Definition at line 216 of file array1d.h.
template<typename T, typename MemorySpace>
template<typename OtherT , typename OtherAlloc >
Assign operator copies from an exemplar std::vector
.
- Template Parameters
-
OtherT | Type of std::vector |
OtherAlloc | Allocator of std::vector |
- Parameters
-
v | The std::vector to copy. |
Definition at line 189 of file array1d.h.
template<typename T, typename MemorySpace>
template<typename OtherT , typename OtherAlloc >
array1d& cusp::array1d< T, MemorySpace >::operator= |
( |
const thrust::host_vector< OtherT, OtherAlloc > & |
v | ) |
|
|
inline |
Assign operator copies from an exemplar thrust::host_vector
.
- Template Parameters
-
OtherT | Type of thrust::host_vector |
OtherAlloc | Allocator of thrust::host_vector |
- Parameters
-
v | The thrust::host_vector to copy. |
Definition at line 207 of file array1d.h.
template<typename T, typename MemorySpace>
template<typename OtherT , typename OtherAlloc >
array1d& cusp::array1d< T, MemorySpace >::operator= |
( |
const thrust::device_vector< OtherT, OtherAlloc > & |
v | ) |
|
|
inline |
Assign operator copies from an exemplar thrust::device_vector
.
- Template Parameters
-
OtherT | Type of thrust::device_vector |
OtherAlloc | Allocator of thrust::device_vector |
- Parameters
-
v | The thrust::device_vector to copy. |
Definition at line 225 of file array1d.h.