-
aoclsparse_status aoclsparse_scsrmv(aoclsparse_operation trans, const float *alpha, aoclsparse_int m, aoclsparse_int n, aoclsparse_int nnz, const float *csr_val, const aoclsparse_int *csr_col_ind, const aoclsparse_int *csr_row_ptr, const aoclsparse_mat_descr descr, const float *x, const float *beta, float *y)#
-
aoclsparse_status aoclsparse_dcsrmv(aoclsparse_operation trans, const double *alpha, aoclsparse_int m, aoclsparse_int n, aoclsparse_int nnz, const double *csr_val, const aoclsparse_int *csr_col_ind, const aoclsparse_int *csr_row_ptr, const aoclsparse_mat_descr descr, const double *x, const double *beta, double *y)#
Real single and double precision sparse matrix-vector multiplication using CSR storage format.
aoclsparse_?csrmvmultiplies the scalar \(\alpha\) with a sparse \(m \times n\) matrix, defined in CSR storage format, and the dense vector \(x\) and adds the result to the dense vector \(y\) that is multiplied by the scalar \(\beta\), such that\[ y = \alpha \, op(A) \, x + \beta \, y, \]with\[\begin{split} op(A) = \left\{ \begin{array}{ll} A, & \text{if } {\bf\mathsf{trans}} = \text{aoclsparse}\_\text{operation}\_\text{none} \\ A^T, & \text{if } {\bf\mathsf{trans}} = \text{aoclsparse}\_\text{operation}\_\text{transpose} \\ A^H, & \text{if } {\bf\mathsf{trans}} = \text{aoclsparse}\_\text{operation}\_\text{conjugate}\_\text{transpose} \end{array} \right. \end{split}\]- Parameters:
trans – [in] matrix operation type.
alpha – [in] scalar \(\alpha\).
m – [in] number of rows of the sparse CSR matrix.
n – [in] number of columns of the sparse CSR matrix.
nnz – [in] number of non-zero entries of the sparse CSR matrix.
csr_val – [in] array of
nnzelements of the sparse CSR matrix.csr_col_ind – [in] array of
nnzelements containing the column indices of the sparse CSR matrix.csr_row_ptr – [in] array of
m+1 elements that point to the start of every row of the sparse CSR matrix.descr – [in] descriptor of the sparse CSR matrix. Currently, only aoclsparse_matrix_type_general and aoclsparse_matrix_type_symmetric is supported.
x – [in] array of
nelements ( \(op(A) = A\)) ormelements ( \(op(A) = A^T\) or \(op(A) = A^H\)).beta – [in] scalar \(\beta\).
y – [inout] array of
melements ( \(op(A) = A\)) ornelements ( \(op(A) = A^T\) or \(op(A) = A^H\)).
- Return values:
aoclsparse_status_success – the operation completed successfully.
aoclsparse_status_invalid_size –
m,nornnzis invalid.aoclsparse_status_invalid_pointer –
descr,alpha,csr_val,csr_row_ptr,csr_col_ind,x,betaorypointer is invalid.aoclsparse_status_not_implemented –
transis not aoclsparse_operation_none andtransis not aoclsparse_operation_transpose. aoclsparse_matrix_type is not aoclsparse_matrix_type_general, or aoclsparse_matrix_type is not aoclsparse_matrix_type_symmetric.