Skip to main content

dgetrf

Function dgetrf 

Source
pub fn dgetrf(
    ctx: &Context,
    m: usize,
    n: usize,
    a: &mut DeviceMemory<f64>,
    lda: usize,
    workspace: &mut DeviceMemory<f64>,
    pivots: Option<&mut DeviceMemory<i32>>,
    dev_info: &mut DeviceMemory<i32>,
) -> Result<()>
Expand description

Use the matching buffer-size helper to calculate the required workspace size.

The S and D data types are real single and double precision, respectively.

The C and Z data types are complex valued single and double precision, respectively.

Computes the LU factorization of an $m \times n$ matrix

where A is an $m \times n$ matrix, P is a permutation matrix, L is a lower triangular matrix with unit diagonal, and U is an upper triangular matrix.

Provide workspace through workspace. Use the corresponding *_buffer_size helper to query the required workspace length.

If LU factorization failed, that is, matrix A (U) is singular, dev_info = i indicates U(i,i) = 0.

If the reported dev_info value is -i, the ith parameter is invalid.

If pivots is None, no pivoting is performed. The factorization is A=L*U, which is not numerically stable.

Whether LU factorization succeeds or fails, pivots contains the pivoting sequence. Row i is interchanged with row pivots[i].

Callers can combine getrf and getrs to complete a linear solver.

getrf uses the fastest implementation with a large workspace of size m * n. Callers can choose the legacy implementation with minimal workspace by calling Params::set_adv_options with Function::Getrf and AlgorithmMode::Algorithm1.

ยงErrors

Returns an error if cuSOLVER has not been initialized, if the matrix dimensions or leading dimension are invalid, if the current GPU architecture is unsupported, or if cuSOLVER reports an internal failure.