A dense vector of values of type T
sored on the GPU.
More...
#include <shark/LinAlg/BLAS/gpu/vector.hpp>
Public Types | |
typedef value_type | const_reference |
typedef value_type | reference |
typedef elementwise< dense_tag > | evaluation_category |
typedef boost::compute::vector< T >::iterator | iterator |
typedef boost::compute::vector< T >::const_iterator | const_iterator |
Public Member Functions | |
vector (boost::compute::command_queue &queue=boost::compute::system::default_queue()) | |
Constructor of a vector with a default queue. More... | |
vector (size_type size, boost::compute::command_queue &queue=boost::compute::system::default_queue()) | |
Constructor of a vector with a predefined size By default, its elements are uninitialized. More... | |
vector (size_type size, value_type const &init, boost::compute::command_queue &queue=boost::compute::system::default_queue()) | |
Constructor of a vector with a predefined size and a unique initial value. More... | |
vector (vector &&v) | |
Move-constructor of a vector. More... | |
vector (vector const &v)=default | |
Copy-constructor of a vector. More... | |
template<class E > | |
vector (vector_expression< E, gpu_tag > const &e) | |
Copy-constructor of a vector from a vector_expression. More... | |
template<class E > | |
vector (vector_expression< E, gpu_tag > const &e, boost::compute::command_queue &queue) | |
Copy-constructor of a vector from a vector_expression on a given queue. More... | |
template<class IndexExpr > | |
detail::induced_vector_element< IndexExpr, T > | operator() (IndexExpr const &i) const |
vector & | operator= (vector const &v) |
Assign a full vector (RHS-vector) to the current vector (LHS-vector) Assign a full vector (RHS-vector) to the current vector (LHS-vector). This method does not create any temporary. More... | |
vector & | operator= (vector &&v) |
Move-Assign a full vector (RHS-vector) to the current vector (LHS-vector) More... | |
template<class C > | |
vector & | operator= (vector_container< C, gpu_tag > const &v) |
Assign a full vector (RHS-vector) to the current vector (LHS-vector) Assign a full vector (RHS-vector) to the current vector (LHS-vector). This method does not create any temporary. More... | |
template<class E > | |
vector & | operator= (vector_expression< E, gpu_tag > const &e) |
Assign the result of a vector_expression to the vector. More... | |
size_type | size () const |
Return the size of the vector. More... | |
boost::compute::command_queue & | queue () const |
const_storage_type | raw_storage () const |
Returns the underlying storage structure for low level access. More... | |
storage_type | raw_storage () |
Returns the underlying storage structure for low level access. More... | |
void | resize (size_type size) |
Resize the vector. More... | |
void | resize (size_type size, value_type init) |
Resize the vector. More... | |
void | clear () |
bool | empty () const |
const_iterator | cbegin () const |
return an iterator on the first element of the vector More... | |
const_iterator | cend () const |
return an iterator after the last element of the vector More... | |
const_iterator | begin () const |
return an iterator on the first element of the vector More... | |
const_iterator | end () const |
return an iterator after the last element of the vector More... | |
iterator | begin () |
Return an iterator on the first element of the vector. More... | |
iterator | end () |
Return an iterator at the end of the vector. More... | |
Public Member Functions inherited from remora::vector_container< vector< T, gpu_tag >, gpu_tag > | |
const container_type & | operator() () const |
container_type & | operator() () |
Public Member Functions inherited from remora::vector_expression< vector< T, gpu_tag >, gpu_tag > | |
const expression_type & | operator() () const |
expression_type & | operator() () |
Friends | |
void | swap (vector &v1, vector &v2) |
Swap the content of two vectors. More... | |
A dense vector of values of type T
sored on the GPU.
For a \(n\)-dimensional vector \(v\) and \(0\leq i < n\) every element \(v_i\) is mapped to the \(i\)-th element of the container.
T | type of the objects stored in the vector (like int, double, complex,...) |
Definition at line 65 of file vector.hpp.
typedef boost::compute::vector<T>::const_iterator remora::vector< T, gpu_tag >::const_iterator |
Definition at line 243 of file vector.hpp.
typedef value_type remora::vector< T, gpu_tag >::const_reference |
Definition at line 68 of file vector.hpp.
typedef elementwise<dense_tag> remora::vector< T, gpu_tag >::evaluation_category |
Definition at line 76 of file vector.hpp.
typedef boost::compute::vector<T>::iterator remora::vector< T, gpu_tag >::iterator |
Definition at line 242 of file vector.hpp.
typedef value_type remora::vector< T, gpu_tag >::reference |
Definition at line 69 of file vector.hpp.
|
inline |
Constructor of a vector with a default queue.
note that for all operations for which vector is on the left hand side, the kernels are enqueued on the supplied queue in case of a multi-queue setup.
Definition at line 84 of file vector.hpp.
|
inlineexplicit |
Constructor of a vector with a predefined size By default, its elements are uninitialized.
size | initial size of the vector |
queue | the opencl queue to use by this vector |
Definition at line 91 of file vector.hpp.
|
inline |
Constructor of a vector with a predefined size and a unique initial value.
size | of the vector |
init | value to assign to each element of the vector |
queue | the opencl queue to use by this vector |
Definition at line 98 of file vector.hpp.
|
inline |
Move-constructor of a vector.
v | is the vector to be moved |
Definition at line 103 of file vector.hpp.
|
default |
Copy-constructor of a vector.
v | is the vector to be duplicated |
|
inline |
Copy-constructor of a vector from a vector_expression.
e | the vector_expression whose values will be duplicated into the vector |
Definition at line 114 of file vector.hpp.
References remora::detail::assign().
|
inline |
Copy-constructor of a vector from a vector_expression on a given queue.
e | the vector_expression whose values will be duplicated into the vector |
queue | the queue which should perform the task |
Definition at line 124 of file vector.hpp.
References remora::detail::assign().
|
inline |
return an iterator on the first element of the vector
Definition at line 256 of file vector.hpp.
|
inline |
Return an iterator on the first element of the vector.
Definition at line 266 of file vector.hpp.
|
inline |
return an iterator on the first element of the vector
Definition at line 246 of file vector.hpp.
|
inline |
return an iterator after the last element of the vector
Definition at line 251 of file vector.hpp.
|
inline |
Definition at line 224 of file vector.hpp.
|
inline |
Definition at line 228 of file vector.hpp.
|
inline |
return an iterator after the last element of the vector
Definition at line 261 of file vector.hpp.
|
inline |
Return an iterator at the end of the vector.
Definition at line 271 of file vector.hpp.
|
inline |
Definition at line 132 of file vector.hpp.
|
inline |
Assign a full vector (RHS-vector) to the current vector (LHS-vector) Assign a full vector (RHS-vector) to the current vector (LHS-vector). This method does not create any temporary.
v | is the source vector container |
Definition at line 144 of file vector.hpp.
References remora::detail::assign().
|
inline |
Move-Assign a full vector (RHS-vector) to the current vector (LHS-vector)
v | is the source vector container |
Definition at line 152 of file vector.hpp.
|
inline |
Assign a full vector (RHS-vector) to the current vector (LHS-vector) Assign a full vector (RHS-vector) to the current vector (LHS-vector). This method does not create any temporary.
v | is the source vector container |
Definition at line 163 of file vector.hpp.
References remora::detail::assign().
|
inline |
Assign the result of a vector_expression to the vector.
e | is a const reference to the vector_expression |
Definition at line 173 of file vector.hpp.
References shark::swap().
|
inline |
Definition at line 188 of file vector.hpp.
|
inline |
Returns the underlying storage structure for low level access.
Definition at line 192 of file vector.hpp.
|
inline |
Returns the underlying storage structure for low level access.
Definition at line 197 of file vector.hpp.
|
inline |
Resize the vector.
This might erase all data stored in the vector
size | new size of the vector |
Definition at line 206 of file vector.hpp.
|
inline |
Resize the vector.
This will erase all data stored in the vector and reinitialize it with the supplied value of init
size | new size of the vector |
init | the value of all elements |
Definition at line 219 of file vector.hpp.
|
inline |
Return the size of the vector.
Definition at line 184 of file vector.hpp.
Swap the content of two vectors.
v1 | is the first vector. It takes values from v2 |
v2 | is the second vector It takes values from v1 |
Definition at line 235 of file vector.hpp.