Skip to main content

cusolverDnXsygvd

Function cusolverDnXsygvd 

Source
pub unsafe extern "C" fn cusolverDnXsygvd(
    handle: cusolverDnHandle_t,
    params: cusolverDnParams_t,
    itype: cusolverEigType_t,
    jobz: cusolverEigMode_t,
    uplo: cublasFillMode_t,
    n: i64,
    dataTypeA: cudaDataType,
    d_A: *mut c_void,
    lda: i64,
    dataTypeB: cudaDataType,
    d_B: *mut c_void,
    ldb: i64,
    dataTypeW: cudaDataType,
    d_W: *mut c_void,
    computeType: cudaDataType,
    bufferOnDevice: *mut c_void,
    workspaceInBytesOnDevice: size_t,
    bufferOnHost: *mut c_void,
    workspaceInBytesOnHost: size_t,
    d_info: *mut c_int,
) -> cusolverStatus_t
Expand description

The helper functions below can calculate the sizes needed for pre-allocated buffer.

The following routine computes all the eigenvalues, and optionally, the eigenvectors of a generalized symmetric (Hermitian) definite eigenproblem.

The generalized symmetric (Hermitian) definite eigenvalue problem is: $$ \operatorname{eig}(A,B) = \begin{cases} A * V = B * V * \Lambda & \text{if } itype = \text{CUSOLVER_EIG_TYPE_1} \ A * B * V = V * \Lambda & \text{if } itype = \text{CUSOLVER_EIG_TYPE_2} \ B * A * V = V * \Lambda & \text{if } itype = \text{CUSOLVER_EIG_TYPE_3} \end{cases} $$

where the matrix A and B are $n \times n$; A is symmetric/Hermitian and B is symmetric/Hermitian positive definite. The eigenvalues of (A, B) are computed and stored in the W vector in ascending order. V is an $n \times n$ orthogonal matrix. The eigenvectors are normalized as follows:v: $$ \begin{cases} V^H * B * V = I & \text{if } itype = \text{CUSOLVER_EIG_TYPE_1 or CUSOLVER_EIG_TYPE_2} \ V^H * \operatorname{inv}(B) * V = I & \text{if } itype = \text{CUSOLVER_EIG_TYPE_3} \end{cases} $$

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 cusolverDnXsygvd_bufferSize.

If output parameter info = -i (less than zero), the i-th parameter is wrong (not counting handle). If info = i (i > 0 and i<=n) and jobz = cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR, i off-diagonal elements of an intermediate tridiagonal form did not converge to zero. If info = n + i (i > 0), then the leading minor of order i of B is not positive definite. The factorization of B could not be completed and no eigenvalues or eigenvectors were computed.

If jobz = cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR, A contains the orthonormal eigenvectors of the matrix A. The eigenvectors are computed by a divide and conquer algorithm.

Currently, cusolverDnXsygvd supports only the default algorithm.

Algorithms supported by cusolverDnXsygvd

cusolverAlgMode_t::CUSOLVER_ALG_0 or NULLDefault algorithm.

List of input arguments for cusolverDnXsygvd_bufferSize and cusolverDnXsygvd:

The generic API has four different data types, dataTypeA is data type of the matrix A, dataTypeB is data type of the matrix B, dataTypeW is data type of the matrix W and computeType is compute type of the operation. cusolverDnXsygvd only supports the following four combinations.

Valid combination of data type and compute type

DataTypeADataTypeBDataTypeWComputeTypeMeaning
CUDA_R_32FCUDA_R_32FCUDA_R_32FCUDA_R_32FSSYGVD
CUDA_R_64FCUDA_R_64FCUDA_R_64FCUDA_R_64FDSYGVD
CUDA_C_32FCUDA_C_32FCUDA_R_32FCUDA_C_32FCHEGVD
CUDA_C_64FCUDA_C_64FCUDA_R_64FCUDA_C_64FZHEGVD

§Parameters

§Return value