pub struct DeviceManager {}Expand description
Device detection and management
Implementations§
Source§impl DeviceManager
impl DeviceManager
Sourcepub fn new() -> Result<DeviceManager, NdimageError>
pub fn new() -> Result<DeviceManager, NdimageError>
Create a new device manager and detect all available devices
Sourcepub fn get_best_device(&self, requiredmemory: usize) -> Option<(Backend, usize)>
pub fn get_best_device(&self, requiredmemory: usize) -> Option<(Backend, usize)>
Get the best available device for a given workload size
Sourcepub fn get_device_info(
&self,
backend: Backend,
device_id: usize,
) -> Option<&DeviceCapability>
pub fn get_device_info( &self, backend: Backend, device_id: usize, ) -> Option<&DeviceCapability>
Get device capabilities by backend and index
Sourcepub fn is_backend_available(&self, backend: Backend) -> bool
pub fn is_backend_available(&self, backend: Backend) -> bool
Check if a specific backend is available
Sourcepub fn device_count(&self, backend: Backend) -> usize
pub fn device_count(&self, backend: Backend) -> usize
Get the number of devices for a specific backend
Sourcepub fn get_capabilities(&self) -> SystemCapabilities
pub fn get_capabilities(&self) -> SystemCapabilities
Get overall system capabilities
Auto Trait Implementations§
impl Freeze for DeviceManager
impl RefUnwindSafe for DeviceManager
impl Send for DeviceManager
impl Sync for DeviceManager
impl Unpin for DeviceManager
impl UnsafeUnpin for DeviceManager
impl UnwindSafe for DeviceManager
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.