Enum numa_gpu::utils::DeviceType
source · [−]pub enum DeviceType<T, U> {
Cpu(T),
Gpu(U),
}
Expand description
A device type specifier
The device type is sometimes useful to specify, e.g., on which device type a function should be executed. The per-device generic payload stores additional metadata, such as a closure or function parameters.
Variants
Cpu(T)
CPU device type
Gpu(U)
GPU device type
Implementations
sourceimpl<T, U> DeviceType<T, U>
impl<T, U> DeviceType<T, U>
sourcepub fn cpu_or_else<F: FnOnce(U) -> T>(self, f: F) -> T
pub fn cpu_or_else<F: FnOnce(U) -> T>(self, f: F) -> T
Returns the contained T
for a CPU, or computes it from the closure
sourcepub fn gpu_or_else<F: FnOnce(T) -> U>(self, f: F) -> U
pub fn gpu_or_else<F: FnOnce(T) -> U>(self, f: F) -> U
Returns the contained U
for a GPU, or computes it from the closure
Trait Implementations
sourceimpl<T: Clone, U: Clone> Clone for DeviceType<T, U>
impl<T: Clone, U: Clone> Clone for DeviceType<T, U>
sourcefn clone(&self) -> DeviceType<T, U>
fn clone(&self) -> DeviceType<T, U>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<T: Debug, U: Debug> Debug for DeviceType<T, U>
impl<T: Debug, U: Debug> Debug for DeviceType<T, U>
sourceimpl<T: PartialEq, U: PartialEq> PartialEq<DeviceType<T, U>> for DeviceType<T, U>
impl<T: PartialEq, U: PartialEq> PartialEq<DeviceType<T, U>> for DeviceType<T, U>
sourcefn eq(&self, other: &DeviceType<T, U>) -> bool
fn eq(&self, other: &DeviceType<T, U>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &DeviceType<T, U>) -> bool
fn ne(&self, other: &DeviceType<T, U>) -> bool
This method tests for !=
.
impl<T: Copy, U: Copy> Copy for DeviceType<T, U>
impl<T: Eq, U: Eq> Eq for DeviceType<T, U>
impl<T, U> StructuralEq for DeviceType<T, U>
impl<T, U> StructuralPartialEq for DeviceType<T, U>
Auto Trait Implementations
impl<T, U> RefUnwindSafe for DeviceType<T, U> where
T: RefUnwindSafe,
U: RefUnwindSafe,
impl<T, U> Send for DeviceType<T, U> where
T: Send,
U: Send,
impl<T, U> Sync for DeviceType<T, U> where
T: Sync,
U: Sync,
impl<T, U> Unpin for DeviceType<T, U> where
T: Unpin,
U: Unpin,
impl<T, U> UnwindSafe for DeviceType<T, U> where
T: UnwindSafe,
U: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more