pub unsafe extern "C" fn cusolverDnXstedc(
handle: cusolverDnHandle_t,
params: cusolverDnParams_t,
compz: cusolverEigComp_t,
n: i64,
dataTypeDE: cudaDataType,
D: *mut c_void,
E: *mut c_void,
dataTypeZ: cudaDataType,
Z: *mut c_void,
ldz: i64,
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 function below can calculate the sizes needed for the pre-allocated buffers.
The following routine
computes all eigenvalues and (optionally) eigenvectors of a real symmetric tridiagonal matrix using the divide and conquer algorithm. This function corresponds to the LAPACK routine STEDC.
The symmetric tridiagonal matrix is defined by the diagonal elements in vector D (length n) and the subdiagonal elements in vector E (length n-1). On successful completion, D contains the eigenvalues in ascending order.
The user has to provide device and host working spaces which are pointed to by input parameters bufferOnDevice and bufferOnHost. The input parameter workspaceInBytesOnDevice (and workspaceInBytesOnHost) is the size in bytes of the device (and host) working space, and it is returned by cusolverDnXstedc_bufferSize.
If output parameter info = -i (less than zero), the i-th parameter is wrong (not counting handle). If info = i (greater than zero), the algorithm did not converge and failed to compute all eigenvalues.
The parameter compz specifies the computational mode: cusolverEigComp_t::CUSOLVER_EIG_COMP_N compute only the eigenvalues; cusolverEigComp_t::CUSOLVER_EIG_COMP_I compute eigenvalues and eigenvectors of the tridiagonal matrix; cusolverEigComp_t::CUSOLVER_EIG_COMP_V compute eigenvalues and eigenvectors as the product of the input matrix Z and the unitary transformations applied during STEDC; typically Z is on entry the unitary matrix produced by SYTRD, and then on exit Z holds the eigenvectors of the original matrix.
Currently, cusolverDnXstedc supports only the default algorithm.
Algorithms supported by cusolverDnXstedc
cusolverAlgMode_t::CUSOLVER_ALG_0 or NULL | Default algorithm. |
List of input arguments for cusolverDnXstedc_bufferSize and cusolverDnXstedc:
The generic API uses dataTypeDE for the data type of the vectors D and E, dataTypeZ for the matrix Z, and computeType for the compute type of the operation. cusolverDnXstedc only supports the following four combinations.
Valid combination of data type and compute type
| DataTypeDE | DataTypeZ | ComputeType | Meaning |
|---|---|---|---|
CUDA_R_32F | CUDA_R_32F | CUDA_R_32F | SSTEDC |
CUDA_R_64F | CUDA_R_64F | CUDA_R_64F | DSTEDC |
CUDA_R_32F | CUDA_C_32F | CUDA_C_32F | CSTEDC |
CUDA_R_64F | CUDA_C_64F | CUDA_C_64F | ZSTEDC |
§Parameters
handle: Handle to the cuSolverDN library context.params: Structure with information collected bycusolverDnSetAdvOptions.compz: Computational mode:cusolverEigComp_t::CUSOLVER_EIG_COMP_Ncompute only eigenvalues;cusolverEigComp_t::CUSOLVER_EIG_COMP_Icompute eigenvalues and eigenvectors of the tridiagonal matrix;cusolverEigComp_t::CUSOLVER_EIG_COMP_Vcompute eigenvalues and eigenvectors as Z*Q; Z is typically from SYTRD.n: Problem size. VectorDhas lengthn, vectorEhas lengthn-1, and matrixZisnbyn.dataTypeDE: Data type of vectorsDandE.D: Vector of lengthn. On input, the diagonal elements of the tridiagonal matrix. On output, if successful, the eigenvalues in ascending order.E: Vector of lengthn-1. On input, the subdiagonal elements of the tridiagonal matrix. On output, the contents are destroyed.dataTypeZ: Data type of arrayZ.Z: Array of dimensionldz * n. Ifcompz=cusolverEigComp_t::CUSOLVER_EIG_COMP_N,Zis not referenced. Ifcompz=cusolverEigComp_t::CUSOLVER_EIG_COMP_I,Zholds the eigenvectors of the tridiagonal matrix. Ifcompz=cusolverEigComp_t::CUSOLVER_EIG_COMP_V,Zis overwritten withZ*Q(Q= unitary from STEDC;Ztypically from SYTRD).ldz: Leading dimension of two-dimensional array used to store matrixZ. Ifcompz=cusolverEigComp_t::CUSOLVER_EIG_COMP_IorcusolverEigComp_t::CUSOLVER_EIG_COMP_Vldz >= max(1,n). Otherwise,ldz >= 1.computeType: Data type of computation.bufferOnDevice: Device workspace. Array of typevoidof sizeworkspaceInBytesOnDevicebytes.workspaceInBytesOnDevice: Size in bytes ofbufferOnDevice, returned bycusolverDnXstedc_bufferSize.bufferOnHost: Host workspace. Array of typevoidof sizeworkspaceInBytesOnHostbytes.workspaceInBytesOnHost: Size in bytes ofbufferOnHost, returned bycusolverDnXstedc_bufferSize.info: Ifinfo = 0, the operation is successful. Ifinfo = -i, thei-thparameter is wrong (not counting handle). Ifinfo = i(i > 0), the algorithm failed to converge and did not compute all eigenvalues.
§Return value
cusolverStatus_t::CUSOLVER_STATUS_INTERNAL_ERROR: An internal operation failed.cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE: Invalid parameters were passed (e.g.n<0, orldz<max(1,n)whencompziscusolverEigComp_t::CUSOLVER_EIG_COMP_IorcusolverEigComp_t::CUSOLVER_EIG_COMP_V, orcompzis notcusolverEigComp_t::CUSOLVER_EIG_COMP_N,cusolverEigComp_t::CUSOLVER_EIG_COMP_I, orcusolverEigComp_t::CUSOLVER_EIG_COMP_V).cusolverStatus_t::CUSOLVER_STATUS_NOT_INITIALIZED: The library was not initialized.cusolverStatus_t::CUSOLVER_STATUS_SUCCESS: The operation completed successfully.