#[non_exhaustive]pub struct DeviceInfo {
pub name: String,
pub architecture: String,
pub generation: Option<u32>,
pub class: Option<char>,
pub recommended_working_set: u64,
pub max_threads_per_threadgroup: usize,
pub physical_memory: u64,
}Expand description
What the GPU is and what it can do.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringMarketing name, e.g. Apple M4 Pro.
architecture: StringMetal’s architecture string, e.g. applegpu_g16s.
generation: Option<u32>GPU generation parsed from the architecture string (16 for applegpu_g16s), if any.
Neural-accelerator kernels need generation 17 or later.
class: Option<char>Class letter after the generation (s for applegpu_g16s), if any. Kept verbatim:
the letter-to-tier mapping is not documented by Apple.
recommended_working_set: u64Bytes the GPU can use without hurting performance.
max_threads_per_threadgroup: usizeMaximum threads per threadgroup along one dimension.
physical_memory: u64The machine’s physical memory in bytes (unified memory: shared by the CPU and the
GPU; hw.memsize, MLX’s device_info()["memory_size"]).
Trait Implementations§
Source§impl Clone for DeviceInfo
impl Clone for DeviceInfo
Source§impl Debug for DeviceInfo
impl Debug for DeviceInfo
impl Eq for DeviceInfo
Source§impl PartialEq for DeviceInfo
impl PartialEq for DeviceInfo
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§
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
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