imate
C++/CUDA Reference
|
#include <cu_dense_affine_matrix_function.h>
Public Member Functions | |
cuDenseAffineMatrixFunction (const DataType *A_, const FlagType A_is_row_major_, const LongIndexType num_rows_, const LongIndexType num_colums_, const int num_gpu_devices_) | |
Constructor. Matrix B is assumed to be the identity matrix. More... | |
cuDenseAffineMatrixFunction (const DataType *A_, const FlagType A_is_row_major_, const LongIndexType num_rows_, const LongIndexType num_columns_, const DataType *B_, const FlagType B_is_row_major_, const int num_gpu_devices_) | |
virtual | ~cuDenseAffineMatrixFunction () |
virtual void | dot (const DataType *vector, DataType *product) |
Computes the matrix vector product: More... | |
virtual void | transpose_dot (const DataType *vector, DataType *product) |
Computes the matrix vector product: More... | |
Public Member Functions inherited from cuAffineMatrixFunction< DataType > | |
cuAffineMatrixFunction () | |
Constructor. More... | |
virtual | ~cuAffineMatrixFunction () |
Virtual destructor. More... | |
void | set_parameters (DataType *t) |
DataType | get_eigenvalue (const DataType *known_parameters, const DataType known_eigenvalue, const DataType *inquiry_parameters) const |
This function defines an analytic relationship between a given set of parameters and the corresponding eigenvalue of the operator. Namely, given a set of parameters and a known eigenvalue of the operator for that specific set of parameters, this function obtains the eigenvalue of the operator for an other given set of parameters. More... | |
Public Member Functions inherited from cuLinearOperator< DataType > | |
cuLinearOperator () | |
cuLinearOperator (int num_gpu_devices_) | |
Constructor with setting num_rows and num_columns . More... | |
virtual | ~cuLinearOperator () |
cublasHandle_t | get_cublas_handle () const |
This function returns a reference to the cublasHandle_t object. The object will be created, if it is not created already. More... | |
Public Member Functions inherited from cLinearOperator< DataType > | |
cLinearOperator () | |
Default constructor. More... | |
cLinearOperator (const LongIndexType num_rows_, const LongIndexType num_columns_) | |
Constructor with setting num_rows and num_columns . More... | |
virtual | ~cLinearOperator () |
LongIndexType | get_num_rows () const |
LongIndexType | get_num_columns () const |
void | set_parameters (DataType *parameters_) |
Sets the scalar parameter this->parameters . Parameter is initialized to NULL . However, before calling dot or transpose_dot functions, the parameters must be set. More... | |
IndexType | get_num_parameters () const |
FlagType | is_eigenvalue_relation_known () const |
Returns a flag that determines whether a relation between the parameters of the operator and its eigenvalue(s) is known. More... | |
Protected Attributes | |
cuDenseMatrix< DataType > | A |
cuDenseMatrix< DataType > | B |
Protected Attributes inherited from cuAffineMatrixFunction< DataType > | |
bool | B_is_identity |
Protected Attributes inherited from cuLinearOperator< DataType > | |
int | num_gpu_devices |
bool | copied_host_to_device |
cublasHandle_t * | cublas_handle |
cusparseHandle_t * | cusparse_handle |
Protected Attributes inherited from cLinearOperator< DataType > | |
const LongIndexType | num_rows |
const LongIndexType | num_columns |
FlagType | eigenvalue_relation_known |
DataType * | parameters |
IndexType | num_parameters |
Additional Inherited Members | |
Protected Member Functions inherited from cuAffineMatrixFunction< DataType > | |
void | _add_scaled_vector (const DataType *input_vector, const LongIndexType vector_size, const DataType scale, DataType *output_vector) const |
Performs the operation \( \boldsymbol{c} = \boldsymbol{c} + \alpha * \boldsymbol{b} \), where \( \boldsymbol{b} \) is an input vector scaled by \( \alpha \) and \( \boldsymbol{c} \) it the output vector. More... | |
Protected Member Functions inherited from cuLinearOperator< DataType > | |
int | query_gpu_devices () const |
Before any numerical computation, this method chechs if any gpu device is available on the machine, or notifies the user if nothing was found. More... | |
void | initialize_cublas_handle () |
Creates a cublasHandle_t object, if not created already. More... | |
void | initialize_cusparse_handle () |
Creates a cusparseHandle_t object, if not created already. More... | |
Definition at line 30 of file cu_dense_affine_matrix_function.h.
cuDenseAffineMatrixFunction< DataType >::cuDenseAffineMatrixFunction | ( | const DataType * | A_, |
const FlagType | A_is_row_major_, | ||
const LongIndexType | num_rows_, | ||
const LongIndexType | num_colums_, | ||
const int | num_gpu_devices_ | ||
) |
Constructor. Matrix B
is assumed to be the identity matrix.
Definition at line 30 of file cu_dense_affine_matrix_function.cu.
References cuAffineMatrixFunction< DataType >::B_is_identity, cLinearOperator< DataType >::eigenvalue_relation_known, and cuLinearOperator< DataType >::initialize_cublas_handle().
cuDenseAffineMatrixFunction< DataType >::cuDenseAffineMatrixFunction | ( | const DataType * | A_, |
const FlagType | A_is_row_major_, | ||
const LongIndexType | num_rows_, | ||
const LongIndexType | num_columns_, | ||
const DataType * | B_, | ||
const FlagType | B_is_row_major_, | ||
const int | num_gpu_devices_ | ||
) |
Definition at line 59 of file cu_dense_affine_matrix_function.cu.
References cuDenseAffineMatrixFunction< DataType >::B, cuAffineMatrixFunction< DataType >::B_is_identity, cLinearOperator< DataType >::eigenvalue_relation_known, and cuLinearOperator< DataType >::initialize_cublas_handle().
|
virtual |
Definition at line 92 of file cu_dense_affine_matrix_function.cu.
|
virtual |
Computes the matrix vector product:
\[ \boldsymbol{c} = (\mathbf{A} + t \mathbf{B}) \boldsymbol{b}. \]
[in] | vector | The input vector :math:\\boldsymbol{b} is given by vector . If \( \mathbf{A} \) and \( \mathbf{B} \) are \( m \times n \) matrices, the length of input c vector is n . |
[out] | product | The output of the product, \( \boldsymbol{c} \), is written in-place into this array. Let m be the number of rows of \( \mathbf{A} \) and \( \mathbf{B} \), then, the output vector product is 1D column array of length m . |
Implements cLinearOperator< DataType >.
Definition at line 118 of file cu_dense_affine_matrix_function.cu.
References ASSERT.
|
virtual |
Computes the matrix vector product:
\[ \boldsymbol{c} = (\mathbf{A} + t \mathbf{B})^{\intercal} \boldsymbol{b}. \]
[in] | vector | The input vector \( \boldsymbol{b} \) is given by vector . If \( \mathbf{A} \) and \( \mathbf{B} \) are \( m \times n \) matrices, the length of input vector is n . |
[out] | product | The output of the product, \( \boldsymbol{c} \), is written in-place into this array. Let n be the number of columns of \( \mathbf{A} \) and \( \mathbf{B} \), then, the output vector product is 1D column array of length m . |
Implements cLinearOperator< DataType >.
Definition at line 174 of file cu_dense_affine_matrix_function.cu.
References ASSERT.
|
protected |
Definition at line 64 of file cu_dense_affine_matrix_function.h.
|
protected |
Definition at line 65 of file cu_dense_affine_matrix_function.h.
Referenced by cuDenseAffineMatrixFunction< DataType >::cuDenseAffineMatrixFunction().