Skip to main content

cusolverDnXtrtri

Function cusolverDnXtrtri 

Source
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_t
Expand 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

DataTypeAMeaning
CUDA_R_32FSTRTRI
CUDA_R_64FDTRTRI
CUDA_C_32FCTRTRI
CUDA_C_64FZTRTRI

§Parameters

  • handle: Handle to the cuSolverDN library context.
  • uplo: Indicates if matrix A lower or upper part is stored, the other part is not referenced.
  • diag: The enumerated unit diagonal type.
  • n: Number of rows and columns of matrix A.
  • dataTypeA: Data type of array A.
  • A: Array of dimension lda * n with lda is not less than max(1,n).
  • lda: Leading dimension of two-dimensional array used to store matrix A.
  • bufferOnDevice: Device workspace. Array of type void of size workspaceInBytesOnDevice bytes.
  • workspaceInBytesOnDevice: Size in bytes of bufferOnDevice, returned by cusolverDnXtrtri_bufferSize.
  • bufferOnHost: Host workspace. Array of type void of size workspaceInBytesOnHost bytes.
  • workspaceInBytesOnHost: Size in bytes of bufferOnHost, returned by cusolverDnXtrtri_bufferSize.

§Return value