rocsparse_spilu0 Interface Reference

rocsparse_spilu0 Interface Reference#

HIPFORT API Reference: hipfort_rocsparse::rocsparse_spilu0 Interface Reference
hipfort_rocsparse::rocsparse_spilu0 Interface Reference

Incomplete LU factorization with 0 fill-ins and no pivoting. More...

Public Member Functions

integer(kind(rocsparse_status_success)) function rocsparse_spilu0_ (handle, spilu0_descr, a, p, spilu0_stage, buffer_size_in_bytes, buffer, p_error)
 

Detailed Description

Incomplete LU factorization with 0 fill-ins and no pivoting.

rocsparse_spilu0 computes the incomplete LU factorization with 0 fill-ins and no pivoting of a sparse \(m \times m\) matrix \(A\), such that

\[ A \approx LU \]

where the lower triangular matrix \(L\) and the upper triangular matrix \(U\) are computed using:

\[ \begin{array}{ll} L_{ij} = \frac{1}{U_{jj}}(A_{ij} - \sum_{k=0}^{j-1}L_{ik} \times U_{kj}), & \text{if i > j} \\% U_{ij} = (A_{ij} - \sum_{k=0}^{j-1}L_{ik} \times U_{kj}), & \text{if i <= j} \end{array} \]

for each entry found in the matrix \(A\).

Performing the above operation requires two stages, the stage rocsparse_spilu0_stage_analysis and the stage rocsparse_spilu0_stage_compute. The stage rocsparse_spilu0_stage_analysis is required to perform the stage rocsparse_spilu0_stage_compute and only needs to be called once for a given sparse matrix \(A\), while the stage rocsparse_spilu0_stage_compute can be repeatedly used with different matrices \(A\) that have the same sparsity pattern.

rocsparse_spilu0 supports the following data types for A : rocsparse_datatype_f32_r, rocsparse_datatype_f64_r, rocsparse_datatype_f32_c, and rocsparse_datatype_f64_c.

Note
The descriptor spilu0_descr needs to be configured with rocsparse_spilu0_set_input.
The sparse matrix formats currently supported are rocsparse_format_csr and rocsparse_format_bsr.
the rocsparse_spilu0_stage_compute stage is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished. The rocsparse_spilu0_stage_analysis stage is blocking with respect to the host.
Only the rocsparse_spilu0_stage_compute stage supports execution in a hipGraph context. The rocsparse_spilu0_stage_analysis stage does not support hipGraph.
This routine only supports uniform batched computation, that is, same sparsity pattern but batched values of the matrices.
Parameters
[in]handle- handle to the rocSPARSE library context queue.
[in]spilu0_descr- Spilu0 descriptor.
[in]A- descriptor of the matrix to factorize.
[out]P- descriptor of the factorization.
[in]spilu0_stage- stage for the Spilu0 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 an error descriptor is not required.
Return values
rocsparse_status_successthe operation completed successfully.
rocsparse_status_invalid_handlethe library context was not initialized.
rocsparse_status_not_implementedthe sparse format is invalid or the preconditioner P is not identical to the matrix to factorize A.
rocsparse_status_invalid_valuethe spilu0_stage value is invalid.
rocsparse_status_invalid_pointerspilu0_descr, A, P, or buffer_size_in_bytes pointer is invalid.
Example

Member Function/Subroutine Documentation

◆ rocsparse_spilu0_()

integer(kind(rocsparse_status_success)) function hipfort_rocsparse::rocsparse_spilu0::rocsparse_spilu0_ ( type(c_ptr), value  handle,
type(c_ptr), value  spilu0_descr,
type(c_ptr), value  a,
type(c_ptr), value  p,
integer(kind(rocsparse_spilu0_stage_analysis)), value  spilu0_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: