pub enum RuntimeContext {
Cpu(CpuContext),
Cuda(CudaContext),
Rocm(RocmContext),
}Expand description
Runtime execution context used by builder .run() entry points.
Current status:
Cpu: supported by builder.run()paths.Cuda/Rocm: accepted as context values, but current builder execution paths may reject runtime-specific operations elsewhere.
§Examples
use tenferro_internal_runtime::{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§fn from(value: CpuContext) -> Self
fn from(value: CpuContext) -> Self
Converts to this type from the input type.
Source§impl From<CudaContext> for RuntimeContext
impl From<CudaContext> for RuntimeContext
Source§fn from(value: CudaContext) -> Self
fn from(value: CudaContext) -> Self
Converts to this type from the input type.
Source§impl From<RocmContext> for RuntimeContext
impl From<RocmContext> for RuntimeContext
Source§fn from(value: RocmContext) -> Self
fn from(value: RocmContext) -> Self
Converts to this type from the input type.
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