pub struct CudaDeviceId(/* private fields */);Expand description
Provider-qualified identity of a CUDA device ordinal.
A device ID is an opaque CUDA provider value. Use Self::ordinal only
when passing the selected ordinal to CUDA APIs. The ordinal is
process-visible and may change when CUDA_VISIBLE_DEVICES changes.
§Examples
use tenferro_gpu::cuda::CudaDeviceId;
let device = CudaDeviceId::from_ordinal(2);
assert_eq!(device.ordinal(), 2);Implementations§
Source§impl CudaDeviceId
impl CudaDeviceId
Sourcepub const fn from_ordinal(ordinal: u32) -> Self
pub const fn from_ordinal(ordinal: u32) -> Self
Construct a device ID from its CUDA ordinal.
§Examples
use tenferro_gpu::cuda::CudaDeviceId;
const DEVICE: CudaDeviceId = CudaDeviceId::from_ordinal(0);
assert_eq!(DEVICE.ordinal(), 0);Trait Implementations§
Source§impl Clone for CudaDeviceId
impl Clone for CudaDeviceId
Source§fn clone(&self) -> CudaDeviceId
fn clone(&self) -> CudaDeviceId
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 moreimpl Copy for CudaDeviceId
Source§impl Debug for CudaDeviceId
impl Debug for CudaDeviceId
impl Eq for CudaDeviceId
Source§impl Hash for CudaDeviceId
impl Hash for CudaDeviceId
Source§impl Ord for CudaDeviceId
impl Ord for CudaDeviceId
Source§fn cmp(&self, other: &CudaDeviceId) -> Ordering
fn cmp(&self, other: &CudaDeviceId) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for CudaDeviceId
impl PartialEq for CudaDeviceId
Source§fn eq(&self, other: &CudaDeviceId) -> bool
fn eq(&self, other: &CudaDeviceId) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for CudaDeviceId
impl PartialOrd for CudaDeviceId
impl StructuralPartialEq for CudaDeviceId
Auto Trait Implementations§
impl Freeze for CudaDeviceId
impl RefUnwindSafe for CudaDeviceId
impl Send for CudaDeviceId
impl Sync for CudaDeviceId
impl Unpin for CudaDeviceId
impl UnsafeUnpin for CudaDeviceId
impl UnwindSafe for CudaDeviceId
Blanket Implementations§
impl<T> Boilerplate for T
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> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<T> CompilationArg for T
impl<T> CompilationArg for T
§fn dynamic_cast<Arg>(&self) -> Argwhere
Arg: CompilationArg,
fn dynamic_cast<Arg>(&self) -> Argwhere
Arg: CompilationArg,
Compilation args should be the same even with different element types. However, it isn’t
possible to enforce it with the type system. So, we make the compilation args serializable
and dynamically cast them. Read more
impl<T> CubeComptime for T
§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