Skip to main content

xsyev_batched

Function xsyev_batched 

Source
pub fn xsyev_batched<TA: DataTypeLike, TW: DataTypeLike>(
    ctx: &Context,
    params: &Params,
    mode: EigenMode,
    fill_mode: FillMode,
    n: usize,
    a: MatrixMut<'_, TA>,
    w: &mut DeviceMemory<TW>,
    batch_count: usize,
    workspace: ByteWorkspaceMut<'_>,
    dev_info: &mut DeviceMemory<i32>,
) -> Result<()>
Expand description

Computes eigenvalues and eigenvectors of a sequence of symmetric (Hermitian) $n \times n$ matrices.

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 all matrices to have the same size n and be packed contiguously.

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\cdot j\ +\ lda\cdot n\cdot k\rbrack}$.

w contains the eigenvalues of each matrix contiguously.

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

Provide device and host workspace through workspace. Use xsyev_batched_buffer_size to determine the required sizes for workspace.device and workspace.host.

dev_info has one entry per batch item. If the call returns Status::InvalidValue, dev_info[0] == -i indicates that the ith parameter is invalid. Otherwise, dev_info[i] > 0 indicates that syevBatched did not converge on the ith matrix.

If mode is EigenMode::Vector, $A_{j}$ contains the orthonormal eigenvectors of the matrix $A_{j}$.

The problem size is limited by n * lda * batch_count <= INT32_MAX primarily due to the current implementation constraints.

Algorithms supported by xsyev_batched

AlgorithmNotes
AlgorithmMode::DefaultDefault; may switch between algorithms for best performance.
AlgorithmMode::Algorithm1Uses a single algorithm for consistent accuracy over all n.

List of input arguments for xsyev_batched_buffer_size and xsyev_batched:

The generic operation has three data types: data_type_a is the data type of matrix A, data_type_w is the data type of W, and compute_type is the compute type of the operation. xsyev_batched only supports the following four combinations:

Valid combination of data type and compute type

ยงErrors

Returns an error if cuSOLVER has not been initialized, if the matrix dimensions, leading dimension, eigen mode, fill mode, or batch size are invalid, or if cuSOLVER reports an internal failure.