Skip to main content

Crate baracuda_cusparse

Crate baracuda_cusparse 

Source
Expand description

Safe Rust wrappers for NVIDIA cuSPARSE.

Covers the modern generic-API surface: Handle, SpMat (CSR/CSC/COO/BSR), DnMat, DnVec, and the family of op algorithms — SpMV, SpMM, SpGEMM, SpSV, SpSM, SDDMM — plus CSR↔CSC and sparse↔dense conversions, and the sparse BLAS-1 helpers (axpby, gather, scatter, rot).

All matrix/vector descriptors borrow the underlying DeviceBuffers and tie their lifetime to them so the buffers can’t be freed while cuSPARSE is still holding references.

Structs§

DnMat
DnVec
Handle
Owned cuSPARSE handle.
SpGEMMPlan
Per-plan handle for a 3-phase SpGEMM computation.
SpMat
A sparse-matrix descriptor (CSR / CSC / COO / BSR). The descriptor keeps pointers to externally-owned device buffers; the lifetime parameter ties those buffers to the descriptor.
SpSMPlan
SpSVPlan

Enums§

Csr2CscAlg
Diag
Fill
IndexBase
Op
Transpose / conjugate-transpose selector.
Order
Dense-matrix storage order.
SDDMMAlg
SpGEMMAlg
SpMMAlg
SpMVAlg
SpSMAlg
SpSVAlg

Traits§

SparseScalar
Types that cuSPARSE’s generic API accepts as element / compute type.

Functions§

axpby
csr2csc_ex2
Convert a CSR matrix to CSC format using the modern Ex2 entry point — supports algorithm selection (alg) and arbitrary value types.
csr2csc_ex2_buffer_size
Workspace size in bytes for csr2csc_ex2.
dense_to_sparse_analysis
dense_to_sparse_buffer_size
dense_to_sparse_convert
gather
rot
scatter
sddmm
sddmm_buffer_size
sddmm_preprocess
One-time preprocessing before sddmm. See spmm_preprocess for the rationale.
sparse_to_dense
sparse_to_dense_buffer_size
spgemm_compute
Phase 2: compute. Same two-step pattern for buffer2.
spgemm_copy
Phase 3: write output arrays into the pre-populated output SpMat.
spgemm_work_estimation
Phase 1: work-estimation. The caller provides buffer1 whose size is returned in size1; pass null the first time, then allocate & re-call.
spmm
spmm_buffer_size
Query buffer-size for C = alpha * op(A) * op(B) + beta * C, A sparse.
spmm_preprocess
One-time preprocessing before spmm. Pre-computes algorithm-specific state into workspace so subsequent spmm calls (with the same A sparsity pattern + dimensions) are faster. Use this when the same matrix is multiplied many times.
spmv
y = alpha * op(A) * x + beta * y.
spmv_buffer_size
Query buffer-size for y = alpha * op(A) * x + beta * y.
spsm_analysis
spsm_buffer_size
spsm_solve
spsv_analysis
spsv_buffer_size
spsv_solve

Type Aliases§

CsrMatrix
Legacy alias kept for callers from v0.1 — prefer SpMat::csr.
DenseVector
Legacy alias — prefer DnVec.
Error
Error type for cuSPARSE operations.
Result
Result alias.