CUSPARSE
Public
CUDA.CUSPARSE.CuSparseMatrix — TypeUtility union type of CuSparseMatrixCSC, CuSparseMatrixCSR, CuSparseMatrixBSR, CuSparseMatrixCOO.
CUDA.CUSPARSE.CuSparseMatrixBSR — TypeCuSparseMatrixBSRContainer to hold sparse matrices in block compressed sparse row (BSR) format on the GPU. BSR format is also used in Intel MKL, and is suited to matrices that are "block" sparse - rare blocks of non-sparse regions.
CUDA.CUSPARSE.CuSparseMatrixCOO — TypeCuSparseMatrixCOOContainer to hold sparse matrices in coordinate (COO) format on the GPU. COO format is mainly useful to initially construct sparse matrices, afterwards switch to CuSparseMatrixCSR for more functionality.
CUDA.CUSPARSE.CuSparseMatrixCSC — TypeCuSparseMatrixCSCContainer to hold sparse matrices in compressed sparse column (CSC) format on the GPU.
CUDA.CUSPARSE.CuSparseMatrixCSR — TypeCuSparseMatrixCSR{Tv, Ti} <: AbstractCuSparseMatrix{Tv, Ti}Container to hold sparse matrices in compressed sparse row (CSR) format on the GPU.
CUDA.CUSPARSE.axpby! — Methodaxpby!(alpha::Number, X::CuSparseVector, beta::Number, Y::CuVector, index::SparseChar)Computes alpha * X + beta * Y for sparse X and dense Y.
CUDA.CUSPARSE.axpby — Methodaxpby(alpha::Number, x::CuSparseVector, beta::Number, y::CuSparseVector, index::SparseChar)Performs z = alpha * x + beta * y. x and y are sparse vectors.
CUDA.CUSPARSE.color — Functioncolor(A::CuSparseMatrixCSC, index::SparseChar; percentage::Number=1.0)
color(A::CuSparseMatrixCSR, index::SparseChar; percentage::Number=1.0)This function performs the coloring of the adjacency graph associated with the matrix A. The coloring is an assignment of colors (integer numbers) to nodes, such that neighboring nodes have distinct colors. An approximate coloring algorithm is used in this routine, and is stopped when a certain percentage of nodes has been colored. The rest of the nodes are assigned distinct colors (an increasing sequence of integers numbers, starting from the last integer used previously). The reordering is such that nodes that have been assigned the same color are reordered to be next to each other.
The matrix A passed to this routine, must be stored as a general matrix and have a symmetric sparsity pattern. If the matrix is non-symmetric the user should pass A + Aᵀ as a parameter to this routine.
CUDA.CUSPARSE.gather! — Methodgather!(X::CuSparseVector, Y::CuVector, index::SparseChar)Sets the nonzero elements of X equal to the nonzero elements of Y at the same indices.
CUDA.CUSPARSE.geam — Methodgeam(alpha::Number, A::CuSparseMatrix, beta::Number, B::CuSparseMatrix, index::SparseChar)Performs C = alpha * A + beta * B. A and B are sparse matrices defined in CSR or CSC storage formats.
CUDA.CUSPARSE.gemv — Functiony = gemv(transa, alpha, A, x, index, [algo])Perform a product between a CuSparseMatrix and a CuSparseVector, returning a CuSparseVector. This function should only be used for highly sparse matrices and vectors, as the result is expected to have many non-zeros in practice. For this reason, high-level functions like mul! and * internally convert the sparse vector into a dense vector to use a more efficient CUSPARSE routine.
Supported formats for the sparse matrix are CuSparseMatrixCSC and CuSparseMatrixCSR.
CUDA.CUSPARSE.gtsv2! — Functiongtsv2!(dl::CuVector, d::CuVector, du::CuVector, B::CuVecOrMat, index::SparseChar='O'; pivoting::Bool=true)Solve the linear system A * X = B where A is a tridiagonal matrix defined by three vectors corresponding to its lower (dl), main (d), and upper (du) diagonals. With pivoting, the solution is more accurate but also more expensive. Note that the solution X overwrites the right-hand side B.
CUDA.CUSPARSE.ic02! — Functionic02!(A::CuSparseMatrix, index::SparseChar='O')Incomplete Cholesky factorization with no pivoting. Preserves the sparse layout of matrix A.
CUDA.CUSPARSE.ilu02! — Functionilu02!(A::CuSparseMatrix, index::SparseChar='O')Incomplete LU factorization with no pivoting. Preserves the sparse layout of matrix A.
CUDA.CUSPARSE.mm! — Functionmm!(transa::SparseChar, transb::SparseChar, alpha::Number, A::CuSparseMatrix, B::CuMatrix, beta::Number, C::CuMatrix, index::SparseChar)
mm!(transa::SparseChar, transb::SparseChar, alpha::Number, A::CuMatrix, B::Union{CuSparseMatrixCSC,CuSparseMatrixCSR,CuSparseMatrixCOO}, beta::Number, C::CuMatrix, index::SparseChar)Performs C = alpha * op(A) * op(B) + beta * C, where op can be nothing (transa = N), tranpose (transa = T) or conjugate transpose (transa = C).
CUDA.CUSPARSE.mv! — Functionmv!(transa::SparseChar, alpha::Number, A::CuSparseMatrix, X::CuVector, beta::Number, Y::CuVector, index::SparseChar)Performs Y = alpha * op(A) * X + beta * Y, where op can be nothing (transa = N), tranpose (transa = T) or conjugate transpose (transa = C). X and Y are dense vectors.
CUDA.CUSPARSE.rot! — Methodrot!(X::CuSparseVector, Y::CuVector, c::Number, s::Number, index::SparseChar)Performs the Givens rotation specified by c and s to sparse X and dense Y.
CUDA.CUSPARSE.scatter! — Methodscatter!(Y::CuVector, X::CuSparseVector, index::SparseChar)Set Y[:] = X[:] for dense Y and sparse X.
CUDA.CUSPARSE.sm2! — Methodsm2!(transa::SparseChar, transxy::SparseChar, uplo::SparseChar, diag::SparseChar, alpha::BlasFloat, A::CuSparseMatrixBSR, X::CuMatrix, index::SparseChar)Performs X = alpha * op(A) \ op(X), where op can be nothing (transa = N), tranpose (transa = T) or conjugate transpose (transa = C). X is a dense matrix, and uplo tells sm2! which triangle of the block sparse matrix A to reference. If the triangle has unit diagonal, set diag to 'U'.
CUDA.CUSPARSE.sv2! — Methodsv2!(transa::SparseChar, uplo::SparseChar, diag::SparseChar, alpha::BlasFloat, A::CuSparseMatrixBSR, X::CuVector, index::SparseChar)Performs X = alpha * op(A) \ X, where op can be nothing (transa = N), tranpose (transa = T) or conjugate transpose (transa = C). X is a dense vector, and uplo tells sv2! which triangle of the block sparse matrix A to reference. If the triangle has unit diagonal, set diag to 'U'.
Private
CUDA.CUSPARSE.chkbmmdims — Methodcheck that the dimensions of arrays B and C make sense for a batched matrix-matrix multiplication
CUDA.CUSPARSE.chkmmdims — Methodcheck that the dimensions of matrices B and C make sense for a multiplication
CUDA.CUSPARSE.chkmvdims — Methodcheck that the dimensions of matrix X and vector Y make sense for a multiplication
SparseArrays.sparse — Methodsparse(x::DenseCuMatrix; fmt=:csc)
sparse(I::CuVector, J::CuVector, V::CuVector, [m, n]; fmt=:csc)Return a sparse cuda matrix, with type determined by fmt. Possible formats are :csc, :csr, :bsr, and :coo.