rocsparse_scoomv Interface Reference#
Sparse matrix vector multiplication using the COO storage format. More...
Public Member Functions | |
| integer(kind(rocsparse_status_success)) function | rocsparse_scoomv_ (handle, trans, m, n, nnz, alpha, descr, coo_val, coo_row_ind, coo_col_ind, x, beta, y) |
| integer(kind(rocsparse_status_success)) function | rocsparse_scoomv_rank_0 (handle, trans, m, n, nnz, alpha, descr, coo_val, coo_row_ind, coo_col_ind, x, beta, y) |
| integer(kind(rocsparse_status_success)) function | rocsparse_scoomv_rank_1 (handle, trans, m, n, nnz, alpha, descr, coo_val, coo_row_ind, coo_col_ind, x, beta, y) |
Detailed Description
Sparse matrix vector multiplication using the COO storage format.
rocsparse_coomv multiplies the scalar \(\alpha\) with a sparse \(m \times n\) matrix, defined in COO 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 \cdot op(A) \cdot x + \beta \cdot y, \]
with
\[ op(A) = \left\{ \begin{array}{ll} A, & \text{if trans == rocsparse_operation_none} \\% A^T, & \text{if trans == rocsparse_operation_transpose} \\% A^H, & \text{if trans == rocsparse_operation_conjugate_transpose} \end{array} \right. \]
The COO matrix has to be sorted by row indices. This can be achieved by using rocsparse_coosort_by_row().
- Note
- This function does not produce deterministic results when A is transposed.
- This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.
- This routine supports execution in a hipGraph context.
- Parameters
-
[in] handle - handle to the rocSPARSE library context queue. [in] trans - matrix operation type. [in] m - number of rows of the sparse COO matrix. [in] n - number of columns of the sparse COO matrix. [in] nnz - number of non-zero entries of the sparse COO matrix. [in] alpha - scalar \(\alpha\). [in] descr - descriptor of the sparse COO matrix. Currently, only rocsparse_matrix_type_generalis supported.[in] coo_val - array of nnzelements of the sparse COO matrix.[in] coo_row_ind - array of nnzelements containing the row indices of the sparse COO matrix.[in] coo_col_ind - array of nnzelements containing the column indices of the sparse COO matrix.[in] x - array of nelements ( \(op(A) = A\)) ormelements ( \(op(A) = A^T\) or \(op(A) = A^H\)).[in] beta - scalar \(\beta\). [in,out] y - array of melements ( \(op(A) = A\)) ornelements ( \(op(A) = A^T\) or \(op(A) = A^H\)).
- Return values
-
rocsparse_status_success the operation completed successfully. rocsparse_status_invalid_handle the library context was not initialized. rocsparse_status_invalid_size m,n, ornnzis invalid.rocsparse_status_invalid_pointer descr,alpha,coo_val,coo_row_ind,coo_col_ind,x,beta, orypointer is invalid.rocsparse_status_arch_mismatch the device is not supported. rocsparse_status_not_implemented rocsparse_matrix_type!=rocsparse_matrix_type_general.
- Example
- This example performs a sparse matrix vector multiplication in COO format.
Member Function/Subroutine Documentation
◆ rocsparse_scoomv_()
| integer(kind(rocsparse_status_success)) function hipfort_rocsparse::rocsparse_scoomv::rocsparse_scoomv_ | ( | type(c_ptr), value | handle, |
| integer(kind(rocsparse_operation_none)), value | trans, | ||
| integer(c_int), value | m, | ||
| integer(c_int), value | n, | ||
| integer(c_int), value | nnz, | ||
| real(c_float) | alpha, | ||
| type(c_ptr), value | descr, | ||
| type(c_ptr), value | coo_val, | ||
| type(c_ptr), value | coo_row_ind, | ||
| type(c_ptr), value | coo_col_ind, | ||
| type(c_ptr), value | x, | ||
| real(c_float) | beta, | ||
| type(c_ptr), value | y | ||
| ) |
◆ rocsparse_scoomv_rank_0()
| integer(kind(rocsparse_status_success)) function hipfort_rocsparse::rocsparse_scoomv::rocsparse_scoomv_rank_0 | ( | type(c_ptr) | handle, |
| integer(kind(rocsparse_operation_none)) | trans, | ||
| integer(c_int) | m, | ||
| integer(c_int) | n, | ||
| integer(c_int) | nnz, | ||
| real(c_float) | alpha, | ||
| type(c_ptr) | descr, | ||
| real(c_float), target | coo_val, | ||
| integer(c_int), target | coo_row_ind, | ||
| integer(c_int), target | coo_col_ind, | ||
| real(c_float), target | x, | ||
| real(c_float) | beta, | ||
| real(c_float), target | y | ||
| ) |
◆ rocsparse_scoomv_rank_1()
| integer(kind(rocsparse_status_success)) function hipfort_rocsparse::rocsparse_scoomv::rocsparse_scoomv_rank_1 | ( | type(c_ptr) | handle, |
| integer(kind(rocsparse_operation_none)) | trans, | ||
| integer(c_int) | m, | ||
| integer(c_int) | n, | ||
| integer(c_int) | nnz, | ||
| real(c_float) | alpha, | ||
| type(c_ptr) | descr, | ||
| real(c_float), dimension(:), target | coo_val, | ||
| integer(c_int), dimension(:), target | coo_row_ind, | ||
| integer(c_int), dimension(:), target | coo_col_ind, | ||
| real(c_float), dimension(:), target | x, | ||
| real(c_float) | beta, | ||
| real(c_float), dimension(:), target | y | ||
| ) |
The documentation for this interface was generated from the following file: