rocsparse_spmv Interface Reference#
hipfort_rocsparse::rocsparse_spmv Interface Reference
Sparse matrix vector multiplication. More...
Public Member Functions | |
integer(kind(rocsparse_status_success)) function | rocsparse_spmv_ (handle, trans, alpha, mat, x, beta, y, compute_type, alg, buffer_size, temp_buffer) |
Detailed Description
Sparse matrix vector multiplication.
rocsparse_spmv
multiplies the scalar \alpha with a sparse m \times n matrix 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} \newline A^T, & \text{if trans == rocsparse_operation_transpose} \newline A^H, & \text{if trans == rocsparse_operation_conjugate_transpose} \end{array} \right.
- Note
- This function writes the required allocation size (in bytes) to
buffer_size
and returns without performing the SpMV operation, when a nullptr is passed fortemp_buffer
. - This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
- Parameters
-
[in] handle handle to the rocsparse library context queue. [in] trans matrix operation type. [in] alpha scalar \alpha. [in] mat matrix descriptor. [in] x vector descriptor. [in] beta scalar \beta. [in,out] y vector descriptor. [in] compute_type floating point precision for the SpMV computation. [in] alg SpMV algorithm for the SpMV computation. [out] buffer_size number of bytes of the temporary storage buffer. buffer_size is set when temp_buffer
is nullptr.[in] temp_buffer temporary storage buffer allocated by the user. When a nullptr is passed, the required allocation size (in bytes) is written to buffer_size
and function returns without performing the SpMV operation.
- Return values
-
rocsparse_status_success the operation completed successfully. rocsparse_status_invalid_handle the library context was not initialized. rocsparse_status_invalid_pointer alpha
,mat
,x
,beta
,y
orbuffer_size
pointer is invalid.rocsparse_status_not_implemented compute_type
oralg
is currently not supported.
Member Function/Subroutine Documentation
◆ rocsparse_spmv_()
integer(kind(rocsparse_status_success)) function hipfort_rocsparse::rocsparse_spmv::rocsparse_spmv_ | ( | type(c_ptr), value | handle, |
integer(kind(rocsparse_operation_none)), value | trans, | ||
type(c_ptr), value | alpha, | ||
type(c_ptr), value | mat, | ||
type(c_ptr), value | x, | ||
type(c_ptr), value | beta, | ||
type(c_ptr), value | y, | ||
integer(kind(rocsparse_datatype_f32_r)), value | compute_type, | ||
integer(kind(rocsparse_spmv_alg_default)), value | alg, | ||
integer(c_size_t) | buffer_size, | ||
type(c_ptr), value | temp_buffer | ||
) |
The documentation for this interface was generated from the following file: