[][src]Enum autograph::Device

pub enum Device {
    Cpu(Arc<Cpu>),
}

Device is an enum that is used to select whether to store and execute operations on the cpu or a gpu.

You can use the From trait to create a device from a Cpu or CudaGpu:

let cpu = Device::from(Cpu::new());

Device can be cloned, which copies the pointer. Each Tensor will have a copy of the Device so that it can execute operations.

Variants

Cpu(Arc<Cpu>)

Implementations

impl Device[src]

pub fn synchronize(&self)[src]

For cpu does nothing. For cuda, blocks until all operations on the device are finished. Only necessary for timing ie for benchmarks. Any tranfers back to the cpu will implicitly synchronize.

Trait Implementations

impl Clone for Device[src]

impl Debug for Device[src]

impl From<Arc<Cpu>> for Device[src]

impl PartialEq<Device> for Device[src]

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,