pub unsafe extern "C" fn cusolverDnXsyevdx(
handle: cusolverDnHandle_t,
params: cusolverDnParams_t,
jobz: cusolverEigMode_t,
range: cusolverEigRange_t,
uplo: cublasFillMode_t,
n: i64,
dataTypeA: cudaDataType,
A: *mut c_void,
lda: i64,
vl: *mut c_void,
vu: *mut c_void,
il: i64,
iu: i64,
meig64: *mut 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 all or selection of the eigenvalues and optionally 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×h_meig diagonal matrix. V is an n×h_meig unitary matrix. h_meig is the number of eigenvalues/eigenvectors computed by the routine, h_meig is equal to n when the whole spectrum (e.g., range = cusolverEigRange_t::CUSOLVER_EIG_RANGE_ALL) is requested. 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 cusolverDnXsyevdx_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.
Currently, cusolverDnXsyevdx supports only the default algorithm.
Please visit cuSOLVER Library Samples - Xsyevdx for a code example.
Algorithms supported by cusolverDnXsyevdx
cusolverAlgMode_t::CUSOLVER_ALG_0 or NULL | Default algorithm. |
List of input arguments for cusolverDnXsyevdx_bufferSize and cusolverDnXsyevdx:
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. cusolverDnXsyevdx 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 | SSYEVDX |
CUDA_R_64F | CUDA_R_64F | CUDA_R_64F | DSYEVDX |
CUDA_C_32F | CUDA_R_32F | CUDA_C_32F | CHEEVDX |
CUDA_C_64F | CUDA_R_64F | CUDA_C_64F | ZHEEVDX |
§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.range: Specifies options to which selection of eigenvalues and optionally eigenvectors that need to be computed:range=cusolverEigRange_t::CUSOLVER_EIG_RANGE_ALL: all eigenvalues/eigenvectors will be found, will becomes the classical syevd/heevd routine;range=cusolverEigRange_t::CUSOLVER_EIG_RANGE_V: all eigenvalues/eigenvectors in the half-open interval (vl,vu] will be found;range=cusolverEigRange_t::CUSOLVER_EIG_RANGE_I: the il-th through iu-th eigenvalues/eigenvectors will be found;.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.ldais not less thanmax(1,n).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 bycusolverDnXsyevdx_bufferSize.bufferOnHost: Host workspace. Array of typevoidof sizeworkspaceInBytesOnHostbytes.workspaceInBytesOnHost: Size in bytes ofbufferOnHost, returned bycusolverDnXsyevdx_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, orrangeis notcusolverEigRange_t::CUSOLVER_EIG_RANGE_ALLorcusolverEigRange_t::CUSOLVER_EIG_RANGE_VorcusolverEigRange_t::CUSOLVER_EIG_RANGE_I, 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.