Skip to main content

CudaDeviceInfo

Struct CudaDeviceInfo 

Source
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

Source

pub fn id(&self) -> CudaDeviceId

Return this device’s provider-qualified ID.

§Examples
use tenferro_gpu::cuda::CudaDeviceInfo;

let _id = CudaDeviceInfo::id;
Source

pub fn name(&self) -> &str

Borrow this device’s display name.

§Examples
use tenferro_gpu::cuda::CudaDeviceInfo;

let _name = CudaDeviceInfo::name;
Source

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;
Source

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;
Source

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

Source§

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)

Performs copy-assignment from source. Read more
Source§

impl Debug for CudaDeviceInfo

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for CudaDeviceInfo

Source§

impl PartialEq for CudaDeviceInfo

Source§

fn eq(&self, other: &CudaDeviceInfo) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for CudaDeviceInfo

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> ByRef<T> for T

§

fn by_ref(&self) -> &T

§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<C> CloneExpand for C
where C: Clone,

§

fn __expand_clone_method(&self, _scope: &mut Scope) -> C

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Imply<T> for U
where T: ?Sized, U: ?Sized,

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> IntoComptime for T

§

fn comptime(self) -> Self

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
§

impl<T> MaybeSend for T
where T: Send,

§

impl<T> MaybeSendSync for T
where T: Send + Sync,

§

impl<T> MaybeSync for T
where T: Sync,

§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> TuneInputs for T
where T: Clone + Send + Sync + 'static,

§

type At<'a> = T

The concrete input type at lifetime 'a.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<T> WasmNotSend for T
where T: Send,

§

impl<T> WasmNotSendSync for T
where T: WasmNotSend + WasmNotSync,

§

impl<T> WasmNotSync for T
where T: Sync,