pub unsafe extern "C" fn cusolverDnXgeqrf(
handle: cusolverDnHandle_t,
params: cusolverDnParams_t,
m: i64,
n: i64,
dataTypeA: cudaDataType,
A: *mut c_void,
lda: i64,
dataTypeTau: cudaDataType,
tau: *mut c_void,
computeType: cudaDataType,
bufferOnDevice: *mut c_void,
workspaceInBytesOnDevice: size_t,
bufferOnHost: *mut c_void,
workspaceInBytesOnHost: size_t,
info: *mut c_int,
) -> cusolverStatus_tExpand description
The helper functions below can calculate the sizes needed for pre-allocated buffer.
The following routine:
computes the QR factorization of a $m \times n$ matrix: $$ A = Q\*R $$
where A is an $m \times n$ matrix, Q is a $m \times n$ matrix, and R is an $n \times n$ upper triangular matrix using the generic API interface.
The user has to provide device and host working spaces which are pointed by input parameters bufferOnDevice and bufferOnHost. The input parameters workspaceInBytesOnDevice (and workspaceInBytesOnHost) is size in bytes of the device (and host) working space, and it is returned by cusolverDnXgeqrf_bufferSize.
The matrix R is overwritten in upper triangular part of A, including diagonal elements.
The matrix Q is not formed explicitly, instead, a sequence of householder vectors are stored in lower triangular part of A. The leading nonzero element of householder vector is assumed to be 1 such that output parameter TAU contains the scaling factor τ. If v is original householder vector, q is the new householder vector corresponding to τ, satisfying the following relation:
$$
I - 2\*v\*v^{H} = I - \tau\*q\*q^{H}
$$
If output parameter info = -i (less than zero), the i-th parameter is wrong (not counting handle).
Currently, cusolverDnXgeqrf supports only the default algorithm.
Please visit cuSOLVER Library Samples - Xgeqrf for a code example.
Algorithms supported by cusolverDnXgeqrf
cusolverAlgMode_t::CUSOLVER_ALG_0 or NULL | Default algorithm. |
List of input arguments for cusolverDnXgeqrf_bufferSize and cusolverDnXgeqrf:
The generic API has two different types, dataTypeA is data type of the matrix A, dataTypeTau is data type of the array tau and computeType is compute type of the operation. cusolverDnXgeqrf only supports the following four combinations.
Valid combination of data type and compute type
| DataTypeA | ComputeType | Meaning |
|---|---|---|
CUDA_R_32F | CUDA_R_32F | SGEQRF |
CUDA_R_64F | CUDA_R_64F | DGEQRF |
CUDA_C_32F | CUDA_C_32F | CGEQRF |
CUDA_C_64F | CUDA_C_64F | ZGEQRF |
§Parameters
handle: Handle to the cuSolverDN library context.params: Structure with information collected bycusolverDnSetAdvOptions.m: Number of rows of matrixA.n: Number of columns of matrixA.dataTypeA: Data type of arrayA.A: Array of dimensionlda * nwithldais not less thanmax(1,m).lda: Leading dimension of two-dimensional array used to store matrixA.dataTypeTau: Data type of arraytau.tau: Array of dimension at leastmin(m,n).computeType: Data type of computation.bufferOnDevice: Device workspace. Array of typevoidof sizeworkspaceInBytesOnDevicebytes.workspaceInBytesOnDevice: Size in bytes ofbufferOnDevice, returned bycusolverDnXgeqrf_bufferSize.bufferOnHost: Host workspace. Array of typevoidof sizeworkspaceInBytesOnHostbytes.workspaceInBytesOnHost: Size in bytes ofbufferOnHost, returned bycusolverDnXgeqrf_bufferSize.info: Ifinfo = 0, the QR factorization is successful. Ifinfo = -i, thei-thparameter is wrong (not counting handle).
§Return value
cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR: An internal operation failed.cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE: Invalid parameters were passed (m,n<0orlda<max(1,m)).cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED: The library was not initialized.cusolverStatus_t::CUSOLVER_STATUS_SUCCESS: The operation completed successfully.