Skip to main content

cusolverDnXsyevd

Function cusolverDnXsyevd 

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

DataTypeADataTypeWComputeTypeMeaning
CUDA_R_32FCUDA_R_32FCUDA_R_32FSSYEVD
CUDA_R_64FCUDA_R_64FCUDA_R_64FDSYEVD
CUDA_C_32FCUDA_R_32FCUDA_C_32FCHEEVD
CUDA_C_64FCUDA_R_64FCUDA_C_64FZHEEVD

§Parameters

  • handle: Handle to the cuSolverDN library context.
  • params: Structure with information collected by cusolverDnSetAdvOptions.
  • 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 of A is stored. uplo = cublasFillMode_t::CUBLAS_FILL_MODE_LOWER: Lower triangle of A is stored. uplo = cublasFillMode_t::CUBLAS_FILL_MODE_UPPER: Upper triangle of A is stored.
  • n: Number of rows (or columns) of matrix A.
  • dataTypeA: Data type of array A.
  • A: Array of dimension lda * n with lda is not less than max(1,n). If uplo = cublasFillMode_t::CUBLAS_FILL_MODE_UPPER, the leading n-by-n upper triangular part of A contains the upper triangular part of the matrix A. If uplo = cublasFillMode_t::CUBLAS_FILL_MODE_LOWER, the leading n-by-n lower triangular part of A contains the lower triangular part of the matrix A. On exit, if jobz = cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR, and info = 0, A contains the orthonormal eigenvectors of the matrix A. If jobz = cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR, the contents of A are destroyed.
  • lda: Leading dimension of two-dimensional array used to store matrix A.
  • dataTypeW: Data type of array W.
  • W: A real array of dimension n. The eigenvalue values of A, in ascending order, i.e., sorted so that W(i) <= W(i+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 cusolverDnXsyevd_bufferSize.
  • bufferOnHost: Host workspace. Array of type void of size workspaceInBytesOnHost bytes.
  • workspaceInBytesOnHost: Size in bytes of bufferOnHost, returned by cusolverDnXsyevd_bufferSize.
  • info: If info = 0, the operation is successful. If info = -i, the i-th parameter is wrong (not counting handle). If info = i (> 0), info indicates i off-diagonal elements of an intermediate tridiagonal form did not converge to zero.

§Return value