Struct rust_gpu_tools::Device
source · [−]pub struct Device { /* private fields */ }
Expand description
A device that may have a CUDA and/or OpenCL GPU associated with it.
Implementations
sourceimpl Device
impl Device
sourcepub fn compute_units(&self) -> u32
pub fn compute_units(&self) -> u32
Returns the number of compute units of the GPU.
sourcepub fn compute_capability(&self) -> Option<(u32, u32)>
pub fn compute_capability(&self) -> Option<(u32, u32)>
Returns the major and minor version of the compute capability (only available on Nvidia GPUs).
sourcepub fn unique_id(&self) -> UniqueId
pub fn unique_id(&self) -> UniqueId
Returns the best possible unique identifier, a UUID is preferred over a PCI ID.
sourcepub fn framework(&self) -> Framework
pub fn framework(&self) -> Framework
Returns the preferred framework (CUDA or OpenCL) to use.
CUDA will be be preferred over OpenCL. The returned framework will work on the device.
E.g. it won’t return Framework::Cuda
for an AMD device.
sourcepub fn cuda_device(&self) -> Option<&Device>
pub fn cuda_device(&self) -> Option<&Device>
Returns the underlying CUDA device if it is available.
sourcepub fn opencl_device(&self) -> Option<&Device>
pub fn opencl_device(&self) -> Option<&Device>
Returns the underlying OpenCL device if it is available.
sourcepub fn by_pci_id(pci_id: PciId) -> Option<&'static Device>
pub fn by_pci_id(pci_id: PciId) -> Option<&'static Device>
Returns the device matching the PCI ID if there is one.
sourcepub fn by_uuid(uuid: DeviceUuid) -> Option<&'static Device>
pub fn by_uuid(uuid: DeviceUuid) -> Option<&'static Device>
Returns the device matching the UUID if there is one.
sourcepub fn by_unique_id(unique_id: UniqueId) -> Option<&'static Device>
pub fn by_unique_id(unique_id: UniqueId) -> Option<&'static Device>
Returns the device matching the unique ID if there is one.
Trait Implementations
impl Eq for Device
impl StructuralEq for Device
impl StructuralPartialEq for Device
Auto Trait Implementations
impl RefUnwindSafe for Device
impl Send for Device
impl Sync for Device
impl Unpin for Device
impl UnwindSafe for Device
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more