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_tExpand 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 NULL | Default 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
| DataTypeA | DataTypeB | DataTypeW | ComputeType | Meaning |
|---|---|---|---|---|
CUDA_R_32F | CUDA_R_32F | CUDA_R_32F | CUDA_R_32F | SSYGVD |
CUDA_R_64F | CUDA_R_64F | CUDA_R_64F | CUDA_R_64F | DSYGVD |
CUDA_C_32F | CUDA_C_32F | CUDA_R_32F | CUDA_C_32F | CHEGVD |
CUDA_C_64F | CUDA_C_64F | CUDA_R_64F | CUDA_C_64F | ZHEGVD |
§Parameters
handle: Handle to the cuSolverDN library context.params: Structure with information collected bycusolverDnSetAdvOptions.itype: Specifies the problem type to be solved: *itype=cusolverEigType_t::CUSOLVER_EIG_TYPE_1: A*x = (lambda)*B*x. *itype=cusolverEigType_t::CUSOLVER_EIG_TYPE_2: A*B*x = (lambda)*x. *itype=cusolverEigType_t::CUSOLVER_EIG_TYPE_3: B*A*x = (lambda)*x.jobz: Specifies options to either compute eigenvalue only or compute eigen-pair:jobz=cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR: Compute eigenvalues only;jobz=cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR: Compute eigenvalues and eigenvectors.uplo: Specifies which part ofAis stored.uplo=cublasFillMode_t::CUBLAS_FILL_MODE_LOWER: Lower triangle ofAis stored.uplo=cublasFillMode_t::CUBLAS_FILL_MODE_UPPER: Upper triangle ofAis stored.n: Number of rows (or columns) of matrixA.dataTypeA: Data type of arrayA.lda: Leading dimension of two-dimensional array used to store matrixA.dataTypeB: Data type of arrayB.ldb: Leading dimension of two-dimensional array used to store matrixB.dataTypeW: Data type of arrayW.computeType: Data type of computation.bufferOnDevice: Device workspace. Array of typevoidof sizeworkspaceInBytesOnDevicebytes.workspaceInBytesOnDevice: Size in bytes ofbufferOnDevice, returned bycusolverDnXsygvd_bufferSize.bufferOnHost: Host workspace. Array of typevoidof sizeworkspaceInBytesOnHostbytes.workspaceInBytesOnHost: Size in bytes ofbufferOnHost, returned bycusolverDnXsygvd_bufferSize.
§Return value
cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR: An internal operation failed.cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE: Invalid parameters were passed (n<0, orlda<max(1,n), orldb<max(1,n), oritypeis not 1, 2 or 3, orjobzis notcusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTORorcusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR, oruplois notcublasFillMode_t::CUBLAS_FILL_MODE_LOWERorcublasFillMode_t::CUBLAS_FILL_MODE_UPPER), or the combination ofdataType{A,B,C}andcomputeTypeare not supported.cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED: The library was not initialized.cusolverStatus_t::CUSOLVER_STATUS_SUCCESS: The operation completed successfully.