pub unsafe extern "C" fn cusolverDnXpotrf(
handle: cusolverDnHandle_t,
params: cusolverDnParams_t,
uplo: cublasFillMode_t,
n: i64,
dataTypeA: cudaDataType,
A: *mut c_void,
lda: i64,
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 Cholesky factorization of a Hermitian positive-definite matrix using the generic API interface.
A is a $n \times n$ Hermitian matrix, only lower or upper part is meaningful. The input parameter uplo indicates which part of the matrix is used. The function will leave the other part untouched.
If input parameter uplo is cublasFillMode_t::CUBLAS_FILL_MODE_LOWER, only lower triangular part of A is processed, and replaced by lower triangular Cholesky factor L.
$$
A = L\*L^{H}
$$
If input parameter uplo is cublasFillMode_t::CUBLAS_FILL_MODE_UPPER, only upper triangular part of A is processed, and replaced by upper triangular Cholesky factor U.
$$
A = U^{H}\*U
$$
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 cusolverDnXpotrf_bufferSize.
If Cholesky factorization failed, i.e. some leading minor of A is not positive definite, or equivalently some diagonal elements of L or U is not a real number. The output parameter info would indicate smallest leading minor of A which is not positive definite.
If output parameter info = -i (less than zero), the i-th parameter is wrong (not counting handle).
Currently, cusolverDnXpotrf supports only the default algorithm.
Please visit cuSOLVER Library Samples - Xpotrf for a code example.
Algorithms supported by cusolverDnXpotrf
cusolverAlgMode_t::CUSOLVER_ALG_0 or NULL | Default algorithm. |
List of input arguments for cusolverDnXpotrf_bufferSize and cusolverDnXpotrf:
The generic API has two different types, dataTypeA is data type of the matrix A, computeType is compute type of the operation. cusolverDnXpotrf only supports the following four combinations.
Valid combination of data type and compute type
| DataTypeA | ComputeType | Meaning |
|---|---|---|
CUDA_R_32F | CUDA_R_32F | SPOTRF |
CUDA_R_64F | CUDA_R_64F | DPOTRF |
CUDA_C_32F | CUDA_C_32F | CPOTRF |
CUDA_C_64F | CUDA_C_64F | ZPOTRF |
§Parameters
handle: Handle to the cuSolverDN library context.params: Structure with information collected bycusolverDnSetAdvOptions.uplo: Indicates if matrixAlower or upper part is stored, the other part is not referenced.n: Number of rows and columns of matrixA.dataTypeA: Data type of arrayA.A: Array of dimensionlda * nwithldais not less thanmax(1,n).lda: Leading dimension of two-dimensional array used to store matrixA.computeType: Data type of computation.bufferOnDevice: Device workspace. Array of typevoidof sizeworkspaceInBytesOnDevicebytes.workspaceInBytesOnDevice: Size in bytes ofbufferOnDevice, returned bycusolverDnXpotrf_bufferSize.bufferOnHost: Host workspace. Array of typevoidof sizeworkspaceInBytesOnHostbytes.workspaceInBytesOnHost: Size in bytes ofbufferOnHost, returned bycusolverDnXpotrf_bufferSize.info: Ifinfo = 0, the Cholesky factorization is successful. Ifinfo = -i, thei-thparameter is wrong (not counting handle). Ifinfo = i, the leading minor of orderiis not positive definite.
§Return value
cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR: An internal operation failed.cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE: Invalid parameters were passed (n<0orlda<max(1,n)).cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED: The library was not initialized.cusolverStatus_t::CUSOLVER_STATUS_SUCCESS: The operation completed successfully.