rocsparse_spsv Interface Reference#
hipfort_rocsparse::rocsparse_spsv Interface Reference
Sparse triangular solve. More...
Public Member Functions | |
integer(kind(rocsparse_status_success)) function | rocsparse_spsv_ (handle, trans, alpha, mat, x, y, compute_type, alg, stage, buffer_size, temp_buffer) |
Detailed Description
Sparse triangular solve.
rocsparse_spsv_solve
solves a sparse triangular linear system of a sparse \(m \times m\) matrix, defined in CSR or COO storage format, a dense solution vector \(y\) and the right-hand side \(x\) that is multiplied by \(\alpha\), such that
\[ op(A) \cdot y = \alpha \cdot x, \]
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
- SpSV requires three stages to complete. The first stage
rocsparse_spsv_stage_buffer_size
will return the size of the temporary storage buffer that is required for subsequent calls. The second stagerocsparse_spsv_stage_preprocess
will preprocess data that would be saved in the temporary storage buffer. In the final stagerocsparse_spsv_stage_compute
, the actual computation is performed. -
If
rocsparse_spsv_stage_auto
is selected, rocSPARSE will automatically detect which stage is required based on the following indicators: Iftemp_buffer
is equal tonullptr
, the required buffer size will be returned. Ifbuffer_size
is equal tonullptr
, analysis will be performed. Otherwise, the SpSV preprocess and the SpSV algorithm will be executed. - This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
-
Currently, only
trans
==rocsparse_operation_none
andtrans
==rocsparse_operation_transpose
is supported.
- 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,out] y vector descriptor. [in] compute_type floating point precision for the SpSV computation. [in] alg SpSV algorithm for the SpSV computation. [in] stage SpSV stage for the SpSV computation. [out] buffer_size number of bytes of the temporary storage buffer. [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 SpSV 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
,y
,descr
orbuffer_size
pointer is invalid.rocsparse_status_not_implemented trans
,compute_type
,stage
oralg
is currently not supported.
Member Function/Subroutine Documentation
◆ rocsparse_spsv_()
integer(kind(rocsparse_status_success)) function hipfort_rocsparse::rocsparse_spsv::rocsparse_spsv_ | ( | 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 | y, | ||
integer(kind(rocsparse_datatype_f32_r)), value | compute_type, | ||
integer(kind(rocsparse_spsv_alg_default)), value | alg, | ||
integer(kind(rocsparse_spsv_stage_auto)), value | stage, | ||
integer(c_size_t) | buffer_size, | ||
type(c_ptr), value | temp_buffer | ||
) |
The documentation for this interface was generated from the following file: