pub struct DeviceInfo {
pub ordinal: usize,
pub name: String,
pub compute_capability: (u32, u32),
pub total_memory_bytes: u64,
pub memory_kind: MemoryKind,
pub capabilities: Capabilities,
}Expand description
A single device exposed by a backend, in a backend-agnostic shape.
compute_capability is interpreted per backend: (major, minor) for
CUDA, the GCN/RDNA arch level for ROCm, the shader-model for Vulkan/
Metal/WebGPU, etc. A value of (0, 0) means “not applicable” (e.g. the
CPU reference device).
Fields§
§ordinal: usizeBackend-local device ordinal (0-based).
name: StringHuman-readable device name.
compute_capability: (u32, u32)(major, minor) capability/shader-model, or (0, 0) if N/A.
total_memory_bytes: u64Total memory available on the device in bytes.
memory_kind: MemoryKindPredominant memory kind for buffers on this device.
capabilities: CapabilitiesPer-device capability report.
Implementations§
Source§impl DeviceInfo
impl DeviceInfo
Sourcepub fn cpu_reference(total_memory_bytes: u64) -> Self
pub fn cpu_reference(total_memory_bytes: u64) -> Self
Build the canonical descriptor for the host CPU reference device.
Trait Implementations§
Source§impl Clone for DeviceInfo
impl Clone for DeviceInfo
Source§fn clone(&self) -> DeviceInfo
fn clone(&self) -> DeviceInfo
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 moreSource§impl Debug for DeviceInfo
impl Debug for DeviceInfo
Source§impl Display for DeviceInfo
impl Display for DeviceInfo
impl Eq for DeviceInfo
Source§impl PartialEq for DeviceInfo
impl PartialEq for DeviceInfo
Source§fn eq(&self, other: &DeviceInfo) -> bool
fn eq(&self, other: &DeviceInfo) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for DeviceInfo
Auto Trait Implementations§
impl Freeze for DeviceInfo
impl RefUnwindSafe for DeviceInfo
impl Send for DeviceInfo
impl Sync for DeviceInfo
impl Unpin for DeviceInfo
impl UnsafeUnpin for DeviceInfo
impl UnwindSafe for DeviceInfo
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