Skip to main content

cusolverDnXsyevBatched

Function cusolverDnXsyevBatched 

Source
pub unsafe extern "C" fn cusolverDnXsyevBatched(
    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,
    batchSize: i64,
) -> 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 sequence of symmetric (Hermitian) $n \times n$ matrices: $$ A_j\V_j = V_j\\Lambda_j $$

where $\Lambda_j$ is a real $n \times n$ diagonal matrix. $V_j$ is an $n \times n$ unitary matrix. The diagonal elements of $\Lambda_j$ are the eigenvalues of $A_j$ in ascending order.

syevBatched performs an eigendecomposition on each matrix. It requires that all matrices are of the same size n and are packed in a contiguous way, $$ \begin{split}A = \begin{pmatrix} {A0} & {A1} & \cdots \\ \end{pmatrix}\end{split} $$

Each matrix is column-major with leading dimension lda, so the formula for random access is $A_{k}\operatorname{(i,j)} = {A\lbrack\ i\ +\ lda\*j\ +\ lda\*n\*k\rbrack}$.

The parameter W also contains the eigenvalues of each matrix in a contiguous way, $$ \begin{split}W = \begin{pmatrix} {W0} & {W1} & \cdots \\ \end{pmatrix}\end{split} $$

The formula for random access of W is $W_{k}\operatorname{(j)} = {W\lbrack\ j\ +\ n\*k\rbrack}$.

The user has to provide device and host working space which are pointed to by the input parameters bufferOnDevice and bufferOnHost. The input parameters workspaceInBytesOnDevice and workspaceInBytesOnHost denote the size in bytes of the device and host working space, and returned by cusolverDnXsyevBatched_bufferSize.

The output parameter info is an integer array of size batchSize. If the function returns cusolverStatus_t::CUSOLVER_STATUS_INVALID_VALUE, the first element info\[0\] = -i (less than zero) indicates the i-th parameter is wrong (not counting handle). Otherwise, if info\[i\] > 0, syevBatched does not converge on the i-th matrix.

If jobz = cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR, $A_{j}$ contains the orthonormal eigenvectors of the matrix $A_{j}$.

Note that the problem size is limited by the condition nldabatchSize<=INT32_MAX primarily due to the current implementation constraints.

Algorithms supported by cusolverDnXsyevBatched

cusolverAlgMode_t::CUSOLVER_ALG_0 or NULLDefault. May switch between algorithms for best performance.
cusolverAlgMode_t::CUSOLVER_ALG_1Uses a single algorithm for consistent accuracy over all n.

List of input arguments for cusolverDnXsyevBatched_bufferSize and cusolverDnXsyevBatched:

The generic API has three different types, dataTypeA is data type of the matrix A, dataTypeW is data type of the array W and computeType is compute type of the operation. cusolverDnXsyevBatched only supports the following four combinations:

Valid combination of data type and compute type

DataTypeADataTypeWComputeTypeMeaning
CUDA_R_32FCUDA_R_32FCUDA_R_32FSSYEVBATCHED
CUDA_R_64FCUDA_R_64FCUDA_R_64FDSYEVBATCHED
CUDA_C_32FCUDA_R_32FCUDA_C_32FCSYEVBATCHED
CUDA_C_64FCUDA_R_64FCUDA_C_64FZSYEVBATCHED

§Parameters

§Return value