rocsparse_sgemvi Interface Reference#
Dense matrix sparse vector multiplication. More...
Public Member Functions | |
| integer(kind(rocsparse_status_success)) function | rocsparse_sgemvi_ (handle, trans, m, n, alpha, a, lda, nnz, x_val, x_ind, beta, y, idx_base, temp_buffer) |
| integer(kind(rocsparse_status_success)) function | rocsparse_sgemvi_rank_0 (handle, trans, m, n, alpha, a, lda, nnz, x_val, x_ind, beta, y, idx_base, temp_buffer) |
| integer(kind(rocsparse_status_success)) function | rocsparse_sgemvi_rank_1 (handle, trans, m, n, alpha, a, lda, nnz, x_val, x_ind, beta, y, idx_base, temp_buffer) |
| integer(kind(rocsparse_status_success)) function | rocsparse_sgemvi_full_rank (handle, trans, m, n, alpha, a, lda, nnz, x_val, x_ind, beta, y, idx_base, temp_buffer) |
Detailed Description
Dense matrix sparse vector multiplication.
rocsparse_gemvi multiplies the scalar \(\alpha\) with a dense \(m \times n\) matrix \(A\) and the sparse 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} \end{array} \right. \]
Performing the above operation involves two steps. First, call rocsparse_Xgemvi_buffer_size() to determine the size of the temporary storage buffer. Next, allocate this temporary buffer and pass it to rocsparse_gemvi to complete the computation. After all calls to rocsparse_gemvi are complete, the temporary storage buffer can be freed.
- Note
- This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.
-
Currently, only
trans==rocsparse_operation_noneis supported. - 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 dense matrix. [in] n - number of columns of the dense matrix. [in] alpha - scalar \(\alpha\). [in] A - pointer to the dense matrix. [in] lda - leading dimension of the dense matrix. [in] nnz - number of non-zero entries in the sparse vector. [in] x_val - array of nnzelements containing the values of the sparse vector.[in] x_ind - array of nnzelements containing the indices of the sparse vector.[in] beta - scalar \(\beta\). [in,out] y - array of melements ( \(op(A) == A\)) ornelements ( \(op(A) == A^T\) or \(op(A) == A^H\)).[in] idx_base - rocsparse_index_base_zero or rocsparse_index_base_one. [in] temp_buffer - temporary storage buffer.
- 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,lda, ornnzis invalid.rocsparse_status_invalid_pointer alpha,A,x_val,x_ind,beta,y, ortemp_bufferpointer is invalid.rocsparse_status_not_implemented trans!=rocsparse_operation_noneorrocsparse_matrix_type!=rocsparse_matrix_type_general.
- Example
Member Function/Subroutine Documentation
◆ rocsparse_sgemvi_()
| integer(kind(rocsparse_status_success)) function hipfort_rocsparse::rocsparse_sgemvi::rocsparse_sgemvi_ | ( | type(c_ptr), value | handle, |
| integer(kind(rocsparse_operation_none)), value | trans, | ||
| integer(c_int), value | m, | ||
| integer(c_int), value | n, | ||
| real(c_float) | alpha, | ||
| type(c_ptr), value | a, | ||
| integer(c_int), value | lda, | ||
| integer(c_int), value | nnz, | ||
| type(c_ptr), value | x_val, | ||
| type(c_ptr), value | x_ind, | ||
| real(c_float) | beta, | ||
| type(c_ptr), value | y, | ||
| integer(kind(rocsparse_index_base_zero)), value | idx_base, | ||
| type(c_ptr), value | temp_buffer | ||
| ) |
◆ rocsparse_sgemvi_full_rank()
| integer(kind(rocsparse_status_success)) function hipfort_rocsparse::rocsparse_sgemvi::rocsparse_sgemvi_full_rank | ( | type(c_ptr) | handle, |
| integer(kind(rocsparse_operation_none)) | trans, | ||
| integer(c_int) | m, | ||
| integer(c_int) | n, | ||
| real(c_float) | alpha, | ||
| real(c_float), dimension(:,:), target | a, | ||
| integer(c_int) | lda, | ||
| integer(c_int) | nnz, | ||
| real(c_float), dimension(:), target | x_val, | ||
| integer(c_int), dimension(:), target | x_ind, | ||
| real(c_float) | beta, | ||
| real(c_float), dimension(:), target | y, | ||
| integer(kind(rocsparse_index_base_zero)) | idx_base, | ||
| type(c_ptr) | temp_buffer | ||
| ) |
◆ rocsparse_sgemvi_rank_0()
| integer(kind(rocsparse_status_success)) function hipfort_rocsparse::rocsparse_sgemvi::rocsparse_sgemvi_rank_0 | ( | type(c_ptr) | handle, |
| integer(kind(rocsparse_operation_none)) | trans, | ||
| integer(c_int) | m, | ||
| integer(c_int) | n, | ||
| real(c_float) | alpha, | ||
| real(c_float), target | a, | ||
| integer(c_int) | lda, | ||
| integer(c_int) | nnz, | ||
| real(c_float), target | x_val, | ||
| integer(c_int), target | x_ind, | ||
| real(c_float) | beta, | ||
| real(c_float), target | y, | ||
| integer(kind(rocsparse_index_base_zero)) | idx_base, | ||
| type(c_ptr) | temp_buffer | ||
| ) |
◆ rocsparse_sgemvi_rank_1()
| integer(kind(rocsparse_status_success)) function hipfort_rocsparse::rocsparse_sgemvi::rocsparse_sgemvi_rank_1 | ( | type(c_ptr) | handle, |
| integer(kind(rocsparse_operation_none)) | trans, | ||
| integer(c_int) | m, | ||
| integer(c_int) | n, | ||
| real(c_float) | alpha, | ||
| real(c_float), dimension(:), target | a, | ||
| integer(c_int) | lda, | ||
| integer(c_int) | nnz, | ||
| real(c_float), dimension(:), target | x_val, | ||
| integer(c_int), dimension(:), target | x_ind, | ||
| real(c_float) | beta, | ||
| real(c_float), dimension(:), target | y, | ||
| integer(kind(rocsparse_index_base_zero)) | idx_base, | ||
| type(c_ptr) | temp_buffer | ||
| ) |
The documentation for this interface was generated from the following file: