Device

Trait Device 

Source
pub trait Device: Sized {
    type Ptr<U, S: Shape>: PtrType;
    type Cache: CacheAble<Self>;

    // Required method
    fn new() -> Result<Self, Box<dyn Error + Sync + Send>>;

    // Provided method
    fn retrieve<T, S>(
        &self,
        len: usize,
        add_node: impl AddGraph,
    ) -> Buffer<'_, T, Self, S>
       where S: Shape,
             Self: for<'a> Alloc<'a, T, S> { ... }
}

Required Associated Types§

Source

type Ptr<U, S: Shape>: PtrType

Source

type Cache: CacheAble<Self>

Required Methods§

Source

fn new() -> Result<Self, Box<dyn Error + Sync + Send>>

Provided Methods§

Source

fn retrieve<T, S>( &self, len: usize, add_node: impl AddGraph, ) -> Buffer<'_, T, Self, S>
where S: Shape, Self: for<'a> Alloc<'a, T, S>,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Device for ()

Source§

type Ptr<U, S: Shape> = Num<U>

Source§

type Cache = ()

Source§

fn new() -> Result<(), Box<dyn Error + Sync + Send>>

Implementors§