pub enum RuntimeContext {
Cpu(CpuContext),
Cuda(CudaContext),
Rocm(RocmContext),
}Expand description
Runtime execution context used by builder .run() entry points.
§Examples
use ad_tensors_rs::{set_default_runtime, RuntimeContext};
use tenferro_prims::CpuContext;
let _guard = set_default_runtime(RuntimeContext::Cpu(CpuContext::new(1)));Variants§
Cpu(CpuContext)
CPU runtime context.
Cuda(CudaContext)
CUDA runtime context.
Rocm(RocmContext)
ROCm runtime context.
Implementations§
Trait Implementations§
Source§impl From<CpuContext> for RuntimeContext
impl From<CpuContext> for RuntimeContext
Source§impl From<CudaContext> for RuntimeContext
impl From<CudaContext> for RuntimeContext
Auto Trait Implementations§
impl Freeze for RuntimeContext
impl !RefUnwindSafe for RuntimeContext
impl !Send for RuntimeContext
impl !Sync for RuntimeContext
impl Unpin for RuntimeContext
impl !UnwindSafe for RuntimeContext
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
Mutably borrows from an owned value. Read more
§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>
Converts
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>
Converts
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