Expand description
Host-resident CSR matrix and shared CPU kernels for advanced solvers.
The public CsrMatrix stores its arrays in GPU device memory and
therefore cannot be constructed or manipulated without a live CUDA context.
The classical sparse linear-algebra algorithms in this crate – incomplete
Cholesky with level-of-fill (ick), the
LOBPCG eigensolver (lobpcg), and
smoothed-aggregation algebraic multigrid (amg)
– are inherently iterative host-driven procedures: they repeatedly form
Galerkin products, solve small dense subproblems, and run sweeps that
interleave CPU control flow with linear-algebra primitives.
This module provides HostCsr, a lightweight CPU-side CSR container
holding plain Vec<i32>/Vec<f64> arrays, together with the shared
building blocks (SpMV, transpose, sparse-sparse product, triangular solves,
and a dense Gaussian-elimination solver) that the three algorithms reuse.
A HostCsr can be lifted from a GPU CsrMatrix via
HostCsr::from_gpu (which downloads the arrays through to_host) and
materialised back onto the device through HostCsr::to_gpu.
Structs§
- HostCsr
- A square or rectangular sparse matrix stored on the host in CSR layout.
Functions§
- dense_
solve - Solves the dense linear system
A x = bvia Gaussian elimination with partial pivoting.ais row-majorn × n;bhas lengthn. - f64_
to_ gpu - Converts an
f64to aGpuFloatstorage value. - gpu_
to_ f64 - Converts a
GpuFloatstorage value tof64using the crate’s bit-cast convention (matching the conversion helpers in the IC(0)/ILU(k) modules).