#[repr(u8)]pub enum RuntimeKind {
Sync = 0,
Async = 1,
NoStd = 2,
}Expand description
How the host program is being driven.
Set once near program start with set_runtime_kind; read anywhere with
runtime_kind. Defaults to RuntimeKind::Sync.
Variants§
Sync = 0
Synchronous, thread-based runtime (the default).
Blocking readbacks are fine here, so tensor reads may defer the device→host copy lazily and materialize it on first access.
Async = 1
Asynchronous runtime (e.g. tokio).
Blocking a runtime worker starves the executor, so tensor reads must materialize eagerly inside the awaited future rather than deferring a blocking copy.
NoStd = 2
Restricted no-std environment.
Trait Implementations§
Source§impl Clone for RuntimeKind
impl Clone for RuntimeKind
Source§fn clone(&self) -> RuntimeKind
fn clone(&self) -> RuntimeKind
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for RuntimeKind
Source§impl Debug for RuntimeKind
impl Debug for RuntimeKind
Source§impl Default for RuntimeKind
impl Default for RuntimeKind
Source§fn default() -> RuntimeKind
fn default() -> RuntimeKind
Returns the “default value” for a type. Read more
impl Eq for RuntimeKind
Source§impl PartialEq for RuntimeKind
impl PartialEq for RuntimeKind
impl StructuralPartialEq for RuntimeKind
Auto Trait Implementations§
impl Freeze for RuntimeKind
impl RefUnwindSafe for RuntimeKind
impl Send for RuntimeKind
impl Sync for RuntimeKind
impl Unpin for RuntimeKind
impl UnsafeUnpin for RuntimeKind
impl UnwindSafe for RuntimeKind
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.