This page contains proposed changes for a future release of ROCm. Read the latest Linux release of ROCm documentation for your production environments.

rocsparse_spsv Interface Reference

rocsparse_spsv Interface Reference#

HIPFORT API Reference: hipfort_rocsparse::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 stage rocsparse_spsv_stage_preprocess will preprocess data that would be saved in the temporary storage buffer. In the final stage rocsparse_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: If temp_buffer is equal to nullptr, the required buffer size will be returned. If buffer_size is equal to nullptr, 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 and trans == rocsparse_operation_transpose is supported.
Parameters
[in]handlehandle to the rocsparse library context queue.
[in]transmatrix operation type.
[in]alphascalar \(\alpha\).
[in]matmatrix descriptor.
[in]xvector descriptor.
[in,out]yvector descriptor.
[in]compute_typefloating point precision for the SpSV computation.
[in]algSpSV algorithm for the SpSV computation.
[in]stageSpSV stage for the SpSV computation.
[out]buffer_sizenumber of bytes of the temporary storage buffer.
[in]temp_buffertemporary 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_successthe operation completed successfully.
rocsparse_status_invalid_handlethe library context was not initialized.
rocsparse_status_invalid_pointeralpha, mat, x, y, descr or buffer_size pointer is invalid.
rocsparse_status_not_implementedtrans, compute_type, stage or alg 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: