pub struct GpuDevice {
pub id: usize,
pub name: String,
pub backend: GpuBackend,
pub total_memory: usize,
pub available_memory: usize,
pub compute_capability: String,
pub compute_units: usize,
}Expand description
GPU device information
Fields§
§id: usizeDevice ID
name: StringDevice name
backend: GpuBackendBackend type
total_memory: usizeTotal memory in bytes
available_memory: usizeAvailable memory in bytes
compute_capability: StringCompute capability (backend-specific)
compute_units: usizeNumber of compute units
Implementations§
Source§impl GpuDevice
impl GpuDevice
Sourcepub fn new(id: usize, name: String, backend: GpuBackend) -> Self
pub fn new(id: usize, name: String, backend: GpuBackend) -> Self
Create a new GPU device descriptor
Sourcepub fn has_memory(&self, required: usize) -> bool
pub fn has_memory(&self, required: usize) -> bool
Check if device has sufficient memory
Sourcepub fn memory_utilization(&self) -> f32
pub fn memory_utilization(&self) -> f32
Get memory utilization as a percentage
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GpuDevice
impl RefUnwindSafe for GpuDevice
impl Send for GpuDevice
impl Sync for GpuDevice
impl Unpin for GpuDevice
impl UnwindSafe for GpuDevice
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> 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