pub enum ComputeDevice {
Cpu {
cores: u32,
threads_per_core: u32,
architecture: CpuArchitecture,
},
Gpu {
name: String,
memory_gb: f32,
compute_capability: Option<String>,
vendor: GpuVendor,
},
Tpu {
version: TpuVersion,
cores: u32,
},
AppleSilicon {
chip: AppleChip,
neural_engine_cores: u32,
gpu_cores: u32,
memory_gb: u32,
},
Edge {
name: String,
power_budget_watts: f32,
},
}Expand description
Compute device abstraction for heterogeneous hardware
Variants§
Cpu
Standard CPU execution
Fields
§
architecture: CpuArchitectureCPU architecture
Gpu
NVIDIA/AMD GPU acceleration
Fields
Tpu
Google TPU accelerator
AppleSilicon
Apple Silicon unified memory
Fields
Edge
Edge/embedded devices
Implementations§
Source§impl ComputeDevice
impl ComputeDevice
Sourcepub fn theoretical_flops(&self) -> f64
pub fn theoretical_flops(&self) -> f64
Calculate theoretical FLOPS for the device
Sourcepub fn estimated_power_watts(&self) -> f32
pub fn estimated_power_watts(&self) -> f32
Estimate power consumption in watts
Sourcepub fn default_cpu() -> Self
pub fn default_cpu() -> Self
Create a default CPU device based on current system
Trait Implementations§
Source§impl Clone for ComputeDevice
impl Clone for ComputeDevice
Source§fn clone(&self) -> ComputeDevice
fn clone(&self) -> ComputeDevice
Returns a duplicate of the value. Read more
1.0.0 · 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 ComputeDevice
impl Debug for ComputeDevice
Source§impl Default for ComputeDevice
impl Default for ComputeDevice
Source§impl<'de> Deserialize<'de> for ComputeDevice
impl<'de> Deserialize<'de> for ComputeDevice
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ComputeDevice
impl PartialEq for ComputeDevice
Source§impl Serialize for ComputeDevice
impl Serialize for ComputeDevice
impl StructuralPartialEq for ComputeDevice
Auto Trait Implementations§
impl Freeze for ComputeDevice
impl RefUnwindSafe for ComputeDevice
impl Send for ComputeDevice
impl Sync for ComputeDevice
impl Unpin for ComputeDevice
impl UnsafeUnpin for ComputeDevice
impl UnwindSafe for ComputeDevice
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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