pub enum BackendKind {
Scirs,
OxiCuda,
// some variants omitted
}Expand description
Discriminant for the active compute backend.
Only BackendKind::Scirs and BackendKind::OxiCuda are fully supported in
Round 5. All other variants are doc-hidden stubs that will be enabled in Round 6.
Variants§
Scirs
CPU backend powered by SciRS2-Core. Always available.
OxiCuda
NVIDIA GPU backend. Requires feature = "gpu" on tensorlogic-oxicuda-backend.
Implementations§
Source§impl BackendKind
impl BackendKind
Sourcepub fn default_backend() -> Self
pub fn default_backend() -> Self
Returns OxiCuda when the environment variable TENSORLOGIC_BACKEND is set
to "oxicuda", otherwise returns Scirs.
This is the recommended entry-point for runtime backend selection.
Sourcepub fn from_env() -> Self
pub fn from_env() -> Self
Reads TENSORLOGIC_BACKEND and maps it to a BackendKind.
Recognised values (case-insensitive):
"oxicuda","gpu","cuda"→BackendKind::OxiCuda- anything else (including unset) →
BackendKind::Scirs
Non-NVIDIA variants (metal, vulkan, rocm, webgpu, levelzero) are
parsed correctly by BackendKind::from_str but always fail
BackendKind::validate with BackendKindError::Unimplemented.
Sourcepub fn supports_autodiff(&self) -> bool
pub fn supports_autodiff(&self) -> bool
Returns true when this backend supports automatic differentiation.
In Round 5 only Scirs and OxiCuda implement autodiff; all other
variants are stubs.
Sourcepub fn as_str(&self) -> &'static str
pub fn as_str(&self) -> &'static str
Returns a human-readable, stable identifier for the backend.
Sourcepub fn available_backends() -> Vec<Self>
pub fn available_backends() -> Vec<Self>
Returns all currently enumerated backends.
Scirs is always fully supported. The remaining backends are listed for
completeness but are not yet implemented (Round 6).
Sourcepub fn validate(&self) -> Result<(), BackendKindError>
pub fn validate(&self) -> Result<(), BackendKindError>
Validates that this backend is fully implemented and can be activated.
Returns Ok(()) for Scirs and OxiCuda; returns
BackendKindError::Unimplemented for all Round-5 stubs.
Trait Implementations§
Source§impl Clone for BackendKind
impl Clone for BackendKind
Source§fn clone(&self) -> BackendKind
fn clone(&self) -> BackendKind
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BackendKind
impl Debug for BackendKind
Source§impl FromStr for BackendKind
impl FromStr for BackendKind
Source§fn from_str(s: &str) -> Result<Self, Self::Err>
fn from_str(s: &str) -> Result<Self, Self::Err>
Parses a backend name string into a BackendKind.
Accepted aliases (all case-insensitive):
| Input | Result |
|---|---|
"scirs", "cpu" | Scirs |
"oxicuda", "gpu", "cuda" | OxiCuda |
"metal" | Metal |
"vulkan" | Vulkan |
"rocm", "hip" | Rocm |
"webgpu" | Webgpu |
"levelzero", "level_zero" | Levelzero |
| anything else | Err(BackendKindError::UnknownName) |
Source§type Err = BackendKindError
type Err = BackendKindError
Source§impl Hash for BackendKind
impl Hash for BackendKind
Source§impl PartialEq for BackendKind
impl PartialEq for BackendKind
impl Copy for BackendKind
impl Eq for BackendKind
impl StructuralPartialEq for BackendKind
Auto Trait Implementations§
impl Freeze for BackendKind
impl RefUnwindSafe for BackendKind
impl Send for BackendKind
impl Sync for BackendKind
impl Unpin for BackendKind
impl UnsafeUnpin for BackendKind
impl UnwindSafe for BackendKind
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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