Expand description
Automatic GPU dispatch shim for dense linear algebra hot kernels.
Every try_* entry point in this module is invoked unconditionally from
gam_linalg::faer_ndarray before the CPU fast-path runs. The decision to send
the kernel to a device is fully automatic and never requires a user-facing
flag — it depends only on:
- Lossless runtime resolution returning an available device.
- The kernel being large enough to amortize launch/PCIe overhead, per
the thresholds in
policy::GpuDispatchPolicy. - cudarc successfully dynamically loading
libcudaat process startup via itsfallback-dynamic-loadingfeature. When the loader fails (no driver, no toolkit installed), Auto receives typed absence and everytry_*returnsNoneso the caller falls through to the existing faer CPU kernel. Probe faults and Required absence fail loudly instead of being reclassified as an optional decline.
The wiring lives here so solver/pirls.rs and the family Hessian
assemblers can stay backend-agnostic: they call gam_linalg::faer_ndarray::fast_*
and get GPU acceleration automatically whenever it is profitable.
Structs§
- Cuda
Gemm Dispatch - Resident
Design Gram - #1017 Phase 3: a device-resident design matrix for repeated
Xᵀ·diag(w)·XGram evaluations that uploadsXto the device ONCE.
Enums§
- Dispatch
Op - Discriminator used by
route_through_gputo apply the right size threshold fromsuper::policy::GpuDispatchPolicy.
Functions§
- route_
through_ gpu - Returns
Some(runtime)when a device is available and policy admits the operation. Auto applies calibrated profitability thresholds; Required deliberately bypasses those thresholds because a CPU continuation would violate the requested execution policy. - route_
through_ gpu_ with_ policy - Per-request counterpart of
route_through_gpu. This is the device seam for solvers whose policy is part of an immutable fit request rather than the legacy process-wide configuration. - try_
cholesky_ batched_ lower_ inplace - try_
cholesky_ batched_ lower_ inplace_ with_ policy - try_
cholesky_ lower_ inplace - try_
fast_ ab - try_
fast_ ab_ broadcast_ b_ batched - try_
fast_ abt_ strided_ batched - try_
fast_ abt_ strided_ batched_ with_ policy - try_
fast_ atb - try_
fast_ atb_ on_ ordinal Aᵀ·Bon a specific device ordinal, for pool-tiled callers that already own the ordinal (the worker thread has bound that ordinal’s context). Semantics are identical totry_fast_atb—aism×k,bism×n, output is thek×nproductaᵀ·b— but the kernel is pinned toordinalinstead of the probe-selected primary device. Auto returnsNoneonly when CUDA is absent or the shape is below policy threshold, so the caller can run its CPU path. A post-admission backend failure is fatal under every policy; Required also makes pre-admission absence fatal. f64 only.- try_
fast_ atv - try_
fast_ av - try_
fast_ joint_ hessian_ 2x2 - try_
fast_ spectral_ leverage_ diagonal - GPU-offloaded spectral leverage diagonal
h[i] = ‖(X G)_{i,:}‖². - try_
fast_ xt_ diag_ x - try_
fast_ xt_ diag_ y - try_
solve_ lower_ triangular_ matrix - try_
solve_ upper_ triangular_ matrix