A dense matrix of values of type T
stored on the gpu.
More...
#include <shark/LinAlg/BLAS/gpu/matrix.hpp>
Public Types | |
typedef value_type | const_reference |
typedef value_type | reference |
typedef elementwise< dense_tag > | evaluation_category |
typedef L | orientation |
typedef boost::compute::strided_iterator< typename boost::compute::vector< T >::iterator > | row_iterator |
typedef boost::compute::strided_iterator< typename boost::compute::vector< T >::iterator > | column_iterator |
typedef boost::compute::strided_iterator< typename boost::compute::vector< T >::const_iterator > | const_row_iterator |
typedef boost::compute::strided_iterator< typename boost::compute::vector< T >::const_iterator > | const_column_iterator |
Public Member Functions | |
matrix (boost::compute::command_queue &queue=boost::compute::system::default_queue()) | |
Constructor of a matrix with a default queue. More... | |
matrix (size_type size1, size_type size2, boost::compute::command_queue &queue=boost::compute::system::default_queue()) | |
Constructor of a matrix with a predefined size By default, its elements are uninitialized. More... | |
matrix (size_type size1, size_type size2, value_type const &init, boost::compute::command_queue &queue=boost::compute::system::default_queue()) | |
Constructor of a matrix with a predefined size initialized to a value. More... | |
matrix (matrix &&m) | |
Move-constructor of a matrix. More... | |
matrix (matrix const &m) | |
Copy-constructor of a matrix. More... | |
template<class E > | |
matrix (matrix_expression< E, gpu_tag > const &e) | |
Copy-constructor of a matrix from a matrix_expression. More... | |
matrix & | operator= (matrix const &m) |
Assign a full matrix (RHS-matrix) to the current matrix (LHS-matrix) Assign a full matrix (RHS-matrix) to the current matrix (LHS-matrix). This method does not create any temporary. More... | |
matrix & | operator= (matrix &&m) |
Move-Assign a full matrix (RHS-matrix) to the current matrix (LHS-matrix) More... | |
template<class C > | |
matrix & | operator= (matrix_container< C, gpu_tag > const &m) |
Assign a full matrix (RHS-matrix) to the current matrix (LHS-matrix) Assign a full matrix (RHS-matrix) to the current matrix (LHS-matrix). This method does not create any temporary. More... | |
template<class E > | |
matrix & | operator= (matrix_expression< E, gpu_tag > const &e) |
Assign the result of a matrix_expression to the matrix. More... | |
size_type | size1 () const |
Returns the number of rows of the matrix. More... | |
size_type | size2 () const |
Returns the number of columns of the matrix. 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... | |
template<class IndexExpr1 , class IndexExpr2 > | |
detail::induced_matrix_element< IndexExpr1, IndexExpr2, T > | operator() (IndexExpr1 const &i, IndexExpr2 const &j) const |
void | resize (size_type size1, size_type size2) |
Resize the matrix. More... | |
void | resize (size_type size1, size_type size2, value_type init) |
Resize the matrix. More... | |
void | clear () |
const_row_iterator | row_begin (size_type i) const |
const_row_iterator | row_end (size_type i) const |
const_row_iterator | column_begin (size_type j) const |
const_column_iterator | column_end (size_type j) const |
row_iterator | row_begin (size_type i) |
row_iterator | row_end (size_type i) |
row_iterator | column_begin (size_type j) |
column_iterator | column_end (size_type j) |
Public Member Functions inherited from remora::matrix_container< matrix< T, L, gpu_tag >, gpu_tag > | |
const container_type & | operator() () const |
container_type & | operator() () |
Public Member Functions inherited from remora::matrix_expression< matrix< T, L, gpu_tag >, gpu_tag > | |
const expression_type & | operator() () const |
expression_type & | operator() () |
Friends | |
void | swap (matrix &m1, matrix &m2) |
Swap the content of two matrixs. More... | |
A dense matrix of values of type T
stored on the gpu.
For a \((m \times n)\)-dimensional matrix and \( 0 \leq i < m, 0 \leq j < n\), every element \( m_{i,j} \) is mapped to the \((i.n + j)\)-th element of the container for row major orientation or the \( (i + j.m) \)-th element of the container for column major orientation. In a dense matrix all elements are represented in memory in a contiguous chunk of memory by definition.
Orientation can also be specified, otherwise a row_major
is used.
T | the type of object stored in the matrix (like double, float, complex, etc...) |
L | the storage organization. It can be either row_major or column_major . Default is row_major |
Definition at line 71 of file matrix.hpp.
typedef boost::compute::strided_iterator<typename boost::compute::vector<T>::iterator > remora::matrix< T, L, gpu_tag >::column_iterator |
Definition at line 271 of file matrix.hpp.
typedef boost::compute::strided_iterator<typename boost::compute::vector<T>::const_iterator > remora::matrix< T, L, gpu_tag >::const_column_iterator |
Definition at line 273 of file matrix.hpp.
typedef value_type remora::matrix< T, L, gpu_tag >::const_reference |
Definition at line 89 of file matrix.hpp.
typedef boost::compute::strided_iterator<typename boost::compute::vector<T>::const_iterator > remora::matrix< T, L, gpu_tag >::const_row_iterator |
Definition at line 272 of file matrix.hpp.
typedef elementwise<dense_tag> remora::matrix< T, L, gpu_tag >::evaluation_category |
Definition at line 97 of file matrix.hpp.
typedef L remora::matrix< T, L, gpu_tag >::orientation |
Definition at line 98 of file matrix.hpp.
typedef value_type remora::matrix< T, L, gpu_tag >::reference |
Definition at line 90 of file matrix.hpp.
typedef boost::compute::strided_iterator<typename boost::compute::vector<T>::iterator > remora::matrix< T, L, gpu_tag >::row_iterator |
Definition at line 270 of file matrix.hpp.
|
inline |
Constructor of a matrix with a default queue.
note that for all operations for which matrix is on the left hand side, the kernels are enqueued on the supplied queue in case of a multi-queue setup.
Definition at line 106 of file matrix.hpp.
|
inlineexplicit |
Constructor of a matrix with a predefined size By default, its elements are uninitialized.
size1 | number of rows |
size2 | number of columns |
queue | the opencl queue to use by this matrix |
Definition at line 115 of file matrix.hpp.
|
inline |
Constructor of a matrix with a predefined size initialized to a value.
size1 | number of rows |
size2 | number of columns |
init | value to assign to each element of the matrix |
queue | the opencl queue to use by this matrix |
Definition at line 126 of file matrix.hpp.
|
inline |
Move-constructor of a matrix.
m | is the matrix to be moved |
Definition at line 134 of file matrix.hpp.
|
inline |
Copy-constructor of a matrix.
m | is the matrix to be duplicated |
Definition at line 142 of file matrix.hpp.
|
inline |
Copy-constructor of a matrix from a matrix_expression.
e | the matrix_expression whose values will be duplicated into the matrix |
Definition at line 151 of file matrix.hpp.
References remora::detail::assign().
|
inline |
Definition at line 265 of file matrix.hpp.
|
inline |
Definition at line 282 of file matrix.hpp.
|
inline |
Definition at line 296 of file matrix.hpp.
|
inline |
Definition at line 285 of file matrix.hpp.
|
inline |
Definition at line 299 of file matrix.hpp.
|
inline |
Definition at line 232 of file matrix.hpp.
|
inline |
Assign a full matrix (RHS-matrix) to the current matrix (LHS-matrix) Assign a full matrix (RHS-matrix) to the current matrix (LHS-matrix). This method does not create any temporary.
m | is the source matrix container |
Definition at line 167 of file matrix.hpp.
References remora::detail::assign().
|
inline |
Move-Assign a full matrix (RHS-matrix) to the current matrix (LHS-matrix)
m | is the source matrix container |
Definition at line 175 of file matrix.hpp.
|
inline |
Assign a full matrix (RHS-matrix) to the current matrix (LHS-matrix) Assign a full matrix (RHS-matrix) to the current matrix (LHS-matrix). This method does not create any temporary.
m | is the source matrix container |
Definition at line 188 of file matrix.hpp.
References remora::detail::assign().
|
inline |
Assign the result of a matrix_expression to the matrix.
e | is a const reference to the matrix_expression |
Definition at line 198 of file matrix.hpp.
References shark::swap().
|
inline |
Definition at line 217 of file matrix.hpp.
|
inline |
Returns the underlying storage structure for low level access.
Definition at line 221 of file matrix.hpp.
|
inline |
Returns the underlying storage structure for low level access.
Definition at line 226 of file matrix.hpp.
|
inline |
Resize the matrix.
This might erase all data stored in the matrix
size1 | new number of rows |
size2 | new number of columns |
Definition at line 243 of file matrix.hpp.
|
inline |
Resize the matrix.
This will erase all data stored in the matrix and reinitialize it with the supplied value of init
size1 | new number of rows |
size2 | new number of columns |
init | the value of all elements |
Definition at line 260 of file matrix.hpp.
|
inline |
Definition at line 275 of file matrix.hpp.
|
inline |
Definition at line 289 of file matrix.hpp.
|
inline |
Definition at line 278 of file matrix.hpp.
|
inline |
Definition at line 292 of file matrix.hpp.
|
inline |
Returns the number of rows of the matrix.
Definition at line 209 of file matrix.hpp.
|
inline |
Returns the number of columns of the matrix.
Definition at line 213 of file matrix.hpp.
|
friend |
Swap the content of two matrixs.
m1 | is the first matrix. It takes values from m2 |
m2 | is the second matrix It takes values from m1 |
Definition at line 307 of file matrix.hpp.