pub unsafe extern "C" fn cusolverDnXtrtri(
handle: cusolverDnHandle_t,
uplo: cublasFillMode_t,
diag: cublasDiagType_t,
n: i64,
dataTypeA: cudaDataType,
A: *mut c_void,
lda: i64,
bufferOnDevice: *mut c_void,
workspaceInBytesOnDevice: size_t,
bufferOnHost: *mut c_void,
workspaceInBytesOnHost: size_t,
devInfo: *mut c_int,
) -> cusolverStatus_tExpand description
The helper functions below can calculate the sizes needed for pre-allocated buffers.
The following routine:
computes the inverse of a triangular matrix using the generic API interface.
A is an $n \times n$ triangular 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 inverse.
If input parameter uplo is cublasFillMode_t::CUBLAS_FILL_MODE_UPPER, only upper triangular part of A is processed, and replaced by upper triangular inverse.
The user has to provide device and host work spaces which are pointed by input parameters bufferOnDevice and bufferOnHost. The input parameters workspaceInBytesOnDevice and workspaceInBytesOnHost are sizes in bytes of the device and host work spaces, and they are returned by cusolverDnXtrtri_bufferSize.
If matrix inversion fails, the output parameter info = i shows A(i,i) = 0.
If output parameter info = -i (less than zero), the i-th parameter is wrong (not counting handle).
Please visit cuSOLVER Library Samples - Xtrtri for a code example.
List of input arguments for cusolverDnXtrtri_bufferSize and cusolverDnXtrtri:
Valid data types
DataTypeA | Meaning |
CUDA_R_32F | STRTRI |
CUDA_R_64F | DTRTRI |
CUDA_C_32F | CTRTRI |
CUDA_C_64F | ZTRTRI |
§Parameters
handle: Handle to the cuSolverDN library context.uplo: Indicates if matrixAlower or upper part is stored, the other part is not referenced.diag: The enumerated unit diagonal type.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.bufferOnDevice: Device workspace. Array of typevoidof sizeworkspaceInBytesOnDevicebytes.workspaceInBytesOnDevice: Size in bytes ofbufferOnDevice, returned bycusolverDnXtrtri_bufferSize.bufferOnHost: Host workspace. Array of typevoidof sizeworkspaceInBytesOnHostbytes.workspaceInBytesOnHost: Size in bytes ofbufferOnHost, returned bycusolverDnXtrtri_bufferSize.
§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_NOT_SUPPORTED: Data type is not supported.cusolverStatus_t::CUSOLVER_STATUS_SUCCESS: The operation completed successfully.