pub enum SvdDriver {
Auto,
Gesvdj,
Gesvd,
Xgesvdp,
}Expand description
cuSOLVER SVD routine selection used by SvdOptions on the CUDA backend.
The driver changes speed and numerical behavior; Self::Xgesvdp may
perturb near-singular inputs. Gauge handling and AD rule selection are
unchanged. CPU providers have a single SVD kernel and ignore the driver.
Equivalent to jax.lax.linalg.svd(..., algorithm=...) and
torch.linalg.svd(..., driver=...).
§Examples
use tenferro_linalg::{SvdDriver, SvdOptions};
let options = SvdOptions::default().driver(SvdDriver::Gesvd);
assert_eq!(options.driver, SvdDriver::Gesvd);
assert_eq!(SvdOptions::default().driver, SvdDriver::Auto);Variants§
Auto
The backend’s default policy. On CUDA this is the JAX-compatible rule:
gesvdj when both matrix dimensions are at most 1024, otherwise
gesvd.
Gesvdj
cuSOLVER’s Jacobi driver (cusolverDn<t>gesvdj) regardless of size.
Gesvd
cuSOLVER’s QR-based driver (cusolverDn<t>gesvd) regardless of size.
Xgesvdp
cuSOLVER’s polar-decomposition driver (cusolverDnXgesvdp).
Explicit only: Self::Auto never selects this routine. Near-singular
inputs may be perturbed by cuSOLVER, shifting small singular values.
The perturbation magnitude (h_err_sigma) is discarded, not returned
with the factors. CPU providers accept and ignore this selection.
Accuracy is input-dependent, not uniformly better or worse than
Self::Gesvd. On ten-decade spectra built as U diag(s) Vᴴ it was
the most accurate of the three drivers on an A100, but on a
circulant-like matrix with the same spectrum it lost about two digits
against gesvd. Measure on your own inputs before relying on it for
small singular values.
Trait Implementations§
impl Copy for SvdDriver
impl Eq for SvdDriver
impl StructuralPartialEq for SvdDriver
Auto Trait Implementations§
impl Freeze for SvdDriver
impl RefUnwindSafe for SvdDriver
impl Send for SvdDriver
impl Sync for SvdDriver
impl Unpin for SvdDriver
impl UnsafeUnpin for SvdDriver
impl UnwindSafe for SvdDriver
Blanket Implementations§
impl<T> Boilerplate for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
impl<T, U> Imply<T> for U
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more