rocsparse_sptrsv Interface Reference#
Sparse triangular solve. More...
Public Member Functions | |
| integer(kind(rocsparse_status_success)) function | rocsparse_sptrsv_ (handle, sptrsv_descr, a, x, y, sptrsv_stage, buffer_size_in_bytes, buffer, p_error) |
Detailed Description
Sparse triangular solve.
rocsparse_sptrsv solves a triangular linear system of equations defined by a sparse \(m
\times m\) square matrix \(op(A)\), such that
\[ op(A) \cdot y = \alpha \cdot x, \]
with
\[ op(A) = \left\{ \begin{array}{ll} A, & \text{if op == rocsparse_operation_none} \\% A^T, & \text{if op == rocsparse_operation_transpose} \\% A^H, & \text{if op == rocsparse_operation_conjugate_transpose} \\% \end{array} \right. \]
and where \(y\) is the dense solution vector and \(x\) is the dense right-hand side vector.
Performing the above operation requires two stages, the stage rocsparse_sptrsv_stage_analysis and the stage rocsparse_sptrsv_stage_compute. The stage rocsparse_sptrsv_stage_analysis is required to perform the stage rocsparse_sptrsv_stage_compute and only need to be called once for a given sparse matrix \(op(A)\), while the stage rocsparse_sptrsv_stage_compute can be repeatedly used with different \(x\) and \(y\) vectors.
rocsparse_sptrsv supports the following data types for \(op(A)\), \(x\), \(y\), and scalar \(\alpha\):
- Uniform Precisions:
-
Uniform Precisions A / X / Y / scalar rocsparse_datatype_f32_r rocsparse_datatype_f64_r rocsparse_datatype_f32_c rocsparse_datatype_f64_c
- Note
- The descriptor
rocsparse_sptrsv_descrneeds to be configured with rocsparse_sptrsv_set_input. -
The sparse matrix formats currently supported are:
rocsparse_format_coo,rocsparse_format_csr, androcsparse_format_csc. -
the
rocsparse_sptrsv_stage_computestage is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished. Therocsparse_sptrsv_stage_analysisstage is blocking with respect to the host. -
Currently, only
trans==rocsparse_operation_noneandtrans==rocsparse_operation_transposeare supported. Only therocsparse_sptrsv_stage_computestage supports execution in a hipGraph context. Therocsparse_sptrsv_stage_analysisstage does not support hipGraph. - This routine does not support batched computation.
- Parameters
-
[in] handle - handle to the rocSPARSE library context queue. [in] sptrsv_descr - descriptor of the routine. [in] A - matrix descriptor. [in] x - vector descriptor. [in,out] y - vector descriptor. [in] sptrsv_stage - stage for the SpTRSV computation. [in] buffer_size_in_bytes - number of bytes of the buffer. [in] buffer - buffer allocated by the user. [out] p_error - error descriptor created if the returned status is not rocsparse_status_success. A null pointer can be passed if the user is not interested in obtaining an error descriptor.
- Return values
-
rocsparse_status_success the operation completed successfully. rocsparse_status_invalid_handle the library context was not initialized. rocsparse_status_invalid_pointer sptrsv_descr,A,x, oryis invalid, orbufferis null andbuffer_size_in_bytesis non-zero, orbufferis not null andbuffer_size_in_bytesis zero.rocsparse_status_invalid_value sptrsv_stageis invalid.
- Example
Member Function/Subroutine Documentation
◆ rocsparse_sptrsv_()
| integer(kind(rocsparse_status_success)) function hipfort_rocsparse::rocsparse_sptrsv::rocsparse_sptrsv_ | ( | type(c_ptr), value | handle, |
| type(c_ptr), value | sptrsv_descr, | ||
| type(c_ptr), value | a, | ||
| type(c_ptr), value | x, | ||
| type(c_ptr), value | y, | ||
| integer(kind(rocsparse_sptrsv_stage_analysis)), value | sptrsv_stage, | ||
| integer(c_size_t), value | buffer_size_in_bytes, | ||
| type(c_ptr), value | buffer, | ||
| type(c_ptr) | p_error | ||
| ) |
The documentation for this interface was generated from the following file: