Trait popcorn::device::Device [] [src]

pub trait Device {
    type H: Hardware;
    type M: Memory;
    type Error: Debug + Clone;
    fn id(&self) -> isize;
    fn hardware(&self) -> &Self::H;
    fn alloc_memory(&self, size: usize) -> Result<Self::M, Self::Error>;
    fn sync_from_vec<T: Send + Copy + Sized + 'static>(
        &self,
        mem: Self::M,
        vec: Vec<T>
    ) -> Box<Future<Item = Self::M, Error = Self::Error>>; fn sync_to_vec<T: Send + Copy + Sized + 'static>(
        &self,
        mem: Self::M
    ) -> Box<Future<Item = (Self::M, Vec<T>), Error = Self::Error>>; }

Specifies Hardware behavior across frameworks.

Associated Types

The Hardware representation for this Device.

The Memory representation for this Device.

The Error representation for this Device.

Required Methods

Returns the unique identifier of the Device.

Returns the hardware, which defines the Device.

Allocates a new buffer on the Device.

Sync data from Vec into memory

Sync data from device to Vec

Implementors