Skip to main content

Module cusparse_compat

Module cusparse_compat 

Source
Expand description

cuSPARSE-compatible API shim over the crate’s host sparse kernels.

This module mirrors the shape of the core cuSPARSE generic-API entry points so that code written against cuSPARSE reads almost unchanged when ported to OxiCUDA. The naming is cuSPARSE-flavoured (a library handle with a create/destroy lifecycle and a scalar pointer mode, plus cusparse_spmv / cusparse_spgemm / cusparse_spsv operations) but the surface is fully idiomatic Rust: operations take & references, return SparseResult, validate their arguments, and expose no raw pointers or unsafe.

All operations act on the crate’s host CSR type HostCsr and delegate to its existing kernels:

The triangular descriptor is expressed with the crate’s existing FillMode and DiagType enums (re-exported from oxicuda-blas), the same descriptor types the GPU sptrsv uses.

Structs§

CusparseCompatHandle
A cuSPARSE-compatible library handle, analogous to cusparseHandle_t.

Enums§

CusparsePointerMode
How scalar arguments (alpha, beta) are interpreted, mirroring cusparsePointerMode_t.

Functions§

cusparse_spgemm
Computes the sparse-sparse product C = A * B, mirroring cusparseSpGEMM.
cusparse_spmv
Computes the sparse matrix-vector product y = alpha * A * x + beta * y, mirroring cusparseSpMV for a CSR operand.
cusparse_spsv
Solves the triangular system A * x = alpha * b, mirroring cusparseSpSV.