Skip to main content

cusolverDnXstedc

Function cusolverDnXstedc 

Source
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_t
Expand 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 NULLDefault 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

DataTypeDEDataTypeZComputeTypeMeaning
CUDA_R_32FCUDA_R_32FCUDA_R_32FSSTEDC
CUDA_R_64FCUDA_R_64FCUDA_R_64FDSTEDC
CUDA_R_32FCUDA_C_32FCUDA_C_32FCSTEDC
CUDA_R_64FCUDA_C_64FCUDA_C_64FZSTEDC

§Parameters

  • handle: Handle to the cuSolverDN library context.
  • params: Structure with information collected by cusolverDnSetAdvOptions.
  • compz: Computational mode: cusolverEigComp_t::CUSOLVER_EIG_COMP_N compute only 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 Z*Q; Z is typically from SYTRD.
  • n: Problem size. Vector D has length n, vector E has length n-1, and matrix Z is n by n.
  • dataTypeDE: Data type of vectors D and E.
  • D: Vector of length n. On input, the diagonal elements of the tridiagonal matrix. On output, if successful, the eigenvalues in ascending order.
  • E: Vector of length n-1. On input, the subdiagonal elements of the tridiagonal matrix. On output, the contents are destroyed.
  • dataTypeZ: Data type of array Z.
  • Z: Array of dimension ldz * n. If compz = cusolverEigComp_t::CUSOLVER_EIG_COMP_N, Z is not referenced. If compz = cusolverEigComp_t::CUSOLVER_EIG_COMP_I, Z holds the eigenvectors of the tridiagonal matrix. If compz = cusolverEigComp_t::CUSOLVER_EIG_COMP_V, Z is overwritten with Z*Q (Q = unitary from STEDC; Z typically from SYTRD).
  • ldz: Leading dimension of two-dimensional array used to store matrix Z. If compz = cusolverEigComp_t::CUSOLVER_EIG_COMP_I or cusolverEigComp_t::CUSOLVER_EIG_COMP_V ldz >= max(1,n). Otherwise, ldz >= 1.
  • computeType: Data type of computation.
  • bufferOnDevice: Device workspace. Array of type void of size workspaceInBytesOnDevice bytes.
  • workspaceInBytesOnDevice: Size in bytes of bufferOnDevice, returned by cusolverDnXstedc_bufferSize.
  • bufferOnHost: Host workspace. Array of type void of size workspaceInBytesOnHost bytes.
  • workspaceInBytesOnHost: Size in bytes of bufferOnHost, returned by cusolverDnXstedc_bufferSize.
  • info: If info = 0, the operation is successful. If info = -i, the i-th parameter is wrong (not counting handle). If info = i (i > 0), the algorithm failed to converge and did not compute all eigenvalues.

§Return value