pub struct BackendEntry {
pub kind: BackendKind,
pub available: bool,
pub priority: u32,
pub capabilities: Capabilities,
}Expand description
A backend known to the registry, plus the runtime facts needed to pick it.
available is supplied by the caller (typically the result of a cheap
driver probe such as “did cuInit succeed?”). The registry never sets it
itself, so this crate stays free of any device dependency.
Fields§
§kind: BackendKindWhich concrete backend this describes.
available: boolWhether the backend is usable on this machine right now.
priority: u32Selection priority — higher wins. Defaults to
BackendKind::default_priority.
capabilities: CapabilitiesWhat the backend can do (filled from a driver query, or a sensible default for the CPU/portable backends).
Implementations§
Source§impl BackendEntry
impl BackendEntry
Sourcepub fn new(kind: BackendKind, available: bool) -> Self
pub fn new(kind: BackendKind, available: bool) -> Self
Create an entry using the kind’s default priority and CPU-profile
capabilities. Callers override capabilities after construction for
real GPU backends.
Sourcepub fn with_priority(self, priority: u32) -> Self
pub fn with_priority(self, priority: u32) -> Self
Builder-style override of the priority.
Sourcepub fn with_capabilities(self, capabilities: Capabilities) -> Self
pub fn with_capabilities(self, capabilities: Capabilities) -> Self
Builder-style override of the capability report.
Trait Implementations§
Source§impl Clone for BackendEntry
impl Clone for BackendEntry
Source§fn clone(&self) -> BackendEntry
fn clone(&self) -> BackendEntry
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more