pub unsafe extern "C" fn cusolverDnXsyevd(
handle: cusolverDnHandle_t,
params: cusolverDnParams_t,
jobz: cusolverEigMode_t,
uplo: cublasFillMode_t,
n: i64,
dataTypeA: cudaDataType,
A: *mut c_void,
lda: i64,
dataTypeW: cudaDataType,
W: *mut c_void,
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 eigenvalues and eigenvectors of a symmetric (Hermitian) $n \times n$ matrix A using the generic API interface. The standard symmetric eigenvalue problem is:
$$
A\V = V\\Lambda
$$
where Λ is a real $n \times n$ diagonal matrix. V is an $n \times n$ unitary matrix. The diagonal elements of Λ are the eigenvalues of A in ascending order.
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 cusolverDnXsyevd_bufferSize.
If output parameter info = -i (less than zero), the i-th parameter is wrong (not counting handle). If info = i (greater than zero), i off-diagonal elements of an intermediate tridiagonal form did not converge to zero.
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.
Please visit cuSOLVER Library Samples - Xsyevd for a code example.
Currently, cusolverDnXsyevd supports only the default algorithm.
Algorithms supported by cusolverDnXsyevd
cusolverAlgMode_t::CUSOLVER_ALG_0 or NULL | Default algorithm. |
List of input arguments for cusolverDnXsyevd_bufferSize and cusolverDnXsyevd:
The generic API has three different types, dataTypeA is data type of the matrix A, dataTypeW is data type of the matrix W and computeType is compute type of the operation. cusolverDnXsyevd only supports the following four combinations.
Valid combination of data type and compute type
| DataTypeA | DataTypeW | ComputeType | Meaning |
|---|---|---|---|
CUDA_R_32F | CUDA_R_32F | CUDA_R_32F | SSYEVD |
CUDA_R_64F | CUDA_R_64F | CUDA_R_64F | DSYEVD |
CUDA_C_32F | CUDA_R_32F | CUDA_C_32F | CHEEVD |
CUDA_C_64F | CUDA_R_64F | CUDA_C_64F | ZHEEVD |
§Parameters
handle: Handle to the cuSolverDN library context.params: Structure with information collected bycusolverDnSetAdvOptions.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.A: Array of dimensionlda * nwithldais not less thanmax(1,n). Ifuplo=cublasFillMode_t::CUBLAS_FILL_MODE_UPPER, the leading n-by-n upper triangular part ofAcontains the upper triangular part of the matrixA. Ifuplo=cublasFillMode_t::CUBLAS_FILL_MODE_LOWER, the leading n-by-n lower triangular part ofAcontains the lower triangular part of the matrixA. On exit, ifjobz=cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR, andinfo= 0,Acontains the orthonormal eigenvectors of the matrixA. Ifjobz=cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR, the contents ofAare destroyed.lda: Leading dimension of two-dimensional array used to store matrixA.dataTypeW: Data type of arrayW.W: A real array of dimensionn. The eigenvalue values ofA, in ascending order, i.e., sorted so thatW(i) <= W(i+1).computeType: Data type of computation.bufferOnDevice: Device workspace. Array of typevoidof sizeworkspaceInBytesOnDevicebytes.workspaceInBytesOnDevice: Size in bytes ofbufferOnDevice, returned bycusolverDnXsyevd_bufferSize.bufferOnHost: Host workspace. Array of typevoidof sizeworkspaceInBytesOnHostbytes.workspaceInBytesOnHost: Size in bytes ofbufferOnHost, returned bycusolverDnXsyevd_bufferSize.info: Ifinfo = 0, the operation is successful. Ifinfo = -i, thei-thparameter is wrong (not counting handle). Ifinfo = i (> 0),infoindicatesioff-diagonal elements of an intermediate tridiagonal form did not converge to zero.
§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), orjobzis notcusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTORorcusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR, oruplois notcublasFillMode_t::CUBLAS_FILL_MODE_LOWERorcublasFillMode_t::CUBLAS_FILL_MODE_UPPER).cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED: The library was not initialized.cusolverStatus_t::CUSOLVER_STATUS_SUCCESS: The operation completed successfully.