Skip to main content

xgeqrf

Function xgeqrf 

Source
pub fn xgeqrf<TA: DataTypeLike, TTau: DataTypeLike>(
    ctx: &Context,
    params: &Params,
    m: usize,
    n: usize,
    a: MatrixMut<'_, TA>,
    tau: VectorMut<'_, TTau>,
    compute_type: DataType,
    workspace: ByteWorkspaceMut<'_>,
    dev_info: &mut DeviceMemory<i32>,
) -> Result<()>
Expand description

Use xgeqrf_buffer_size to calculate the sizes needed for pre-allocated workspace.

Computes the QR factorization of an $m \times n$ matrix.

Here A is an $m \times n$ matrix, Q is an $m \times n$ matrix, and R is an $n \times n$ upper triangular matrix.

Provide device and host workspace through workspace. Use xgeqrf_buffer_size to determine the required sizes for workspace.device and workspace.host.

The matrix R overwrites the upper triangular part of A, including the diagonal elements.

The matrix Q is not formed explicitly. Instead, a sequence of Householder vectors is stored in the lower triangular part of A. The leading nonzero element of the Householder vector is assumed to be 1, so tau contains the scaling factor τ. If v is the original Householder vector, q is the new Householder vector corresponding to τ.

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

Currently, xgeqrf supports only the default algorithm.

Algorithms supported by xgeqrf

AlgorithmNotes
AlgorithmMode::DefaultDefault algorithm.

List of input arguments for xgeqrf_buffer_size and xgeqrf:

The generic cuSOLVER routine separates matrix, tau-vector, and compute data types: data_type_a is the data type of matrix A, data_type_tau is the data type of tau, and compute_type is the operation’s compute type. xgeqrf only supports the following four combinations.

Valid combination of data type and compute type

§Errors

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