pub struct CudaDeviceInfo { /* private fields */ }Expand description
Immutable metadata describing one CUDA device.
Equality and debug output are deterministic only while the process-visible CUDA topology remains unchanged; they do not provide stable identity across topology changes.
§Examples
use tenferro_gpu::cuda::CudaDeviceInfo;
let _type_name = std::any::type_name::<CudaDeviceInfo>();Implementations§
Source§impl CudaDeviceInfo
impl CudaDeviceInfo
Sourcepub fn id(&self) -> CudaDeviceId
pub fn id(&self) -> CudaDeviceId
Return this device’s provider-qualified ID.
§Examples
use tenferro_gpu::cuda::CudaDeviceInfo;
let _id = CudaDeviceInfo::id;Sourcepub fn name(&self) -> &str
pub fn name(&self) -> &str
Borrow this device’s display name.
§Examples
use tenferro_gpu::cuda::CudaDeviceInfo;
let _name = CudaDeviceInfo::name;Sourcepub fn uuid(&self) -> CudaDeviceUuid
pub fn uuid(&self) -> CudaDeviceUuid
Return the stable physical/MIG identity of this device.
The UUID is a durable comparison identity independent of the process-visible ordinal. It is used for diagnostics, topology, and explicit cross-runtime/cross-device placement decisions.
§Examples
use tenferro_gpu::cuda::cuda_devices;
// `cudarc` panics when the CUDA driver library is absent, so the call
// is guarded (the same pattern `gpu_available` uses).
let devices = std::panic::catch_unwind(cuda_devices)
.unwrap_or_else(|_| Ok(Vec::new()))
.unwrap_or_default();
let uuids: Vec<_> = devices.iter().map(|info| info.uuid()).collect();
let _ = uuids;Sourcepub fn compute_capability(&self) -> CudaComputeCapability
pub fn compute_capability(&self) -> CudaComputeCapability
Return the compute capability of this device.
§Examples
use tenferro_gpu::cuda::cuda_devices;
// `cudarc` panics when the CUDA driver library is absent, so the call
// is guarded (the same pattern `gpu_available` uses).
let devices = std::panic::catch_unwind(cuda_devices)
.unwrap_or_else(|_| Ok(Vec::new()))
.unwrap_or_default();
let capabilities: Vec<_> = devices
.iter()
.map(|info| info.compute_capability())
.collect();
let _ = capabilities;Sourcepub fn total_memory_bytes(&self) -> u64
pub fn total_memory_bytes(&self) -> u64
Return the total device memory in bytes.
§Examples
use tenferro_gpu::cuda::cuda_devices;
// `cudarc` panics when the CUDA driver library is absent, so the call
// is guarded (the same pattern `gpu_available` uses).
let devices = std::panic::catch_unwind(cuda_devices)
.unwrap_or_else(|_| Ok(Vec::new()))
.unwrap_or_default();
let memory: Vec<u64> = devices
.iter()
.map(|info| info.total_memory_bytes())
.collect();
let _ = memory;Trait Implementations§
Source§impl Clone for CudaDeviceInfo
impl Clone for CudaDeviceInfo
Source§fn clone(&self) -> CudaDeviceInfo
fn clone(&self) -> CudaDeviceInfo
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 CudaDeviceInfo
impl Debug for CudaDeviceInfo
impl Eq for CudaDeviceInfo
Source§impl PartialEq for CudaDeviceInfo
impl PartialEq for CudaDeviceInfo
Source§fn eq(&self, other: &CudaDeviceInfo) -> bool
fn eq(&self, other: &CudaDeviceInfo) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for CudaDeviceInfo
Auto Trait Implementations§
impl Freeze for CudaDeviceInfo
impl RefUnwindSafe for CudaDeviceInfo
impl Send for CudaDeviceInfo
impl Sync for CudaDeviceInfo
impl Unpin for CudaDeviceInfo
impl UnsafeUnpin for CudaDeviceInfo
impl UnwindSafe for CudaDeviceInfo
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
§impl<C> CloneExpand for Cwhere
C: Clone,
impl<C> CloneExpand for Cwhere
C: Clone,
fn __expand_clone_method(&self, _scope: &mut Scope) -> C
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
impl<T, U> Imply<T> for U
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