pub enum StreamPriority {
Default,
Low,
High,
}Expand description
Stream priority hint, mapped to the backend’s native priority range.
CUDA convention is that lower numerical priorities run first; this enum is
the portable abstraction so other runtimes can adopt it without changing
their public surface. Backends clamp to their supported range — passing
StreamPriority::Low on a device whose only priority bucket is the
default is harmless.
The motivating use case is sharing a single GPU with a desktop compositor (WSL2, dev laptops, single-GPU workstations): running long compute batches on a low-priority stream lets the compositor preempt cleanly and keeps the UI responsive.
Variants§
Default
Default backend priority — current behavior on every backend.
Low
Lowest priority the backend supports. Useful when sharing the GPU with an interactive workload such as a compositor; long-running compute batches yield to higher-priority work like UI rendering.
High
Highest priority the backend supports. Useful for latency-critical foreground work that must not be preempted by background batches.
Trait Implementations§
Source§impl Clone for StreamPriority
impl Clone for StreamPriority
Source§fn clone(&self) -> StreamPriority
fn clone(&self) -> StreamPriority
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for StreamPriority
Source§impl Debug for StreamPriority
impl Debug for StreamPriority
Source§impl Default for StreamPriority
impl Default for StreamPriority
Source§fn default() -> StreamPriority
fn default() -> StreamPriority
Source§impl<'de> Deserialize<'de> for StreamPriority
impl<'de> Deserialize<'de> for StreamPriority
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for StreamPriority
Source§impl PartialEq for StreamPriority
impl PartialEq for StreamPriority
Source§impl Serialize for StreamPriority
impl Serialize for StreamPriority
impl StructuralPartialEq for StreamPriority
Auto Trait Implementations§
impl Freeze for StreamPriority
impl RefUnwindSafe for StreamPriority
impl Send for StreamPriority
impl Sync for StreamPriority
impl Unpin for StreamPriority
impl UnsafeUnpin for StreamPriority
impl UnwindSafe for StreamPriority
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> CacheValue for T
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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
key and return true if they are equal.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