pub struct DeviceCapability {
pub compute_capability: (u32, u32),
pub total_memory: usize,
pub num_compute_units: u32,
pub max_threads_per_block: u32,
pub warp_size: u32,
pub has_tensor_cores: bool,
pub unified_memory: bool,
pub max_shared_memory: usize,
pub memory_bandwidth: f32,
pub peak_tflops: f32,
}Expand description
Device capability information
Fields§
§compute_capability: (u32, u32)Compute capability (e.g., 8.0 for A100)
total_memory: usizeTotal memory in bytes
num_compute_units: u32Number of SMs (for CUDA) or compute units
max_threads_per_block: u32Maximum threads per block
warp_size: u32Warp size (32 for CUDA, varies for others)
has_tensor_cores: boolWhether tensor cores are available
unified_memory: boolWhether unified memory is supported
Maximum shared memory per block
memory_bandwidth: f32Memory bandwidth (GB/s)
peak_tflops: f32Peak FLOPS (TF32)
Implementations§
Source§impl DeviceCapability
impl DeviceCapability
Sourcepub fn apple_silicon(total_memory: usize, gpu_cores: u32) -> Self
pub fn apple_silicon(total_memory: usize, gpu_cores: u32) -> Self
Create capability info for Apple Silicon (Metal)
Sourcepub fn can_fit_model(&self, model_size_bytes: usize) -> bool
pub fn can_fit_model(&self, model_size_bytes: usize) -> bool
Check if device can run a model of given size
Trait Implementations§
Source§impl Clone for DeviceCapability
impl Clone for DeviceCapability
Source§fn clone(&self) -> DeviceCapability
fn clone(&self) -> DeviceCapability
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 DeviceCapability
impl Debug for DeviceCapability
Auto Trait Implementations§
impl Freeze for DeviceCapability
impl RefUnwindSafe for DeviceCapability
impl Send for DeviceCapability
impl Sync for DeviceCapability
impl Unpin for DeviceCapability
impl UnsafeUnpin for DeviceCapability
impl UnwindSafe for DeviceCapability
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,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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