pub struct BackendRegistry { /* private fields */ }Expand description
Registry of available compute backends.
Current behavior: Only the CPU backend is available.
load_cutensor and
load_hiptensor always return
errors. GPU backend loading is not yet implemented.
When GPU support is implemented, this registry will hold the CPU backend (always available) and optional GPU backends loaded at runtime.
§Examples
// Aspirational API — GPU loading not yet functional.
use tenferro_prims::BackendRegistry;
let mut registry = BackendRegistry::new(); // CPU only
registry.load_cutensor("/usr/lib/libcutensor.so").unwrap();
assert!(registry.cuda().is_some());Implementations§
Source§impl BackendRegistry
impl BackendRegistry
Sourcepub fn load_cutensor(&mut self, _path: &str) -> Result<()>
pub fn load_cutensor(&mut self, _path: &str) -> Result<()>
Load the cuTENSOR library from the given path.
Status: Not available. The cuda feature is not enabled.
Rebuild with --features cuda to enable cuTENSOR support.
Sourcepub fn load_hiptensor(&mut self, _path: &str) -> Result<()>
pub fn load_hiptensor(&mut self, _path: &str) -> Result<()>
Load the hipTENSOR library from the given path.
Status: Not yet implemented. Always returns
Err(DeviceError).
When implemented, the caller (Julia, Python, or standalone Rust) will provide the path to the shared library. No auto-search.
Sourcepub fn cpu(&self) -> &CpuBackend
pub fn cpu(&self) -> &CpuBackend
Returns a reference to the CPU backend.
Sourcepub fn cuda(&self) -> Option<&CudaBackend>
pub fn cuda(&self) -> Option<&CudaBackend>
Returns a reference to the CUDA backend, if loaded.
Sourcepub fn rocm(&self) -> Option<&RocmBackend>
pub fn rocm(&self) -> Option<&RocmBackend>
Returns a reference to the ROCm backend, if loaded.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BackendRegistry
impl RefUnwindSafe for BackendRegistry
impl Send for BackendRegistry
impl Sync for BackendRegistry
impl Unpin for BackendRegistry
impl UnwindSafe for BackendRegistry
Blanket Implementations§
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
§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
fn rand<T>(&self, rng: &mut (impl Rng + ?Sized)) -> Twhere
Self: Distribution<T>,
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