Trait collenchyma::device::IDevice [] [src]

pub trait IDevice {
    type H: IHardware;
    type M: IMemory;
    fn id(&self) -> &isize;
    fn hardwares(&self) -> &Vec<Self::H>;
    fn alloc_memory(&self, size: usize) -> Result<Self::M, Error>;
    fn sync_in(
        &self,
        source: &DeviceType,
        source_data: &MemoryType,
        dest_data: &mut Self::M
    ) -> Result<(), Error>; }

Specifies Hardware behavior across frameworks.

Associated Types

The Hardware representation for this Device.

The Memory representation for this Device.

Required Methods

Returns the unique identifier of the Device.

Returns the hardwares, which define the Device.

Allocate memory on the Device.

Synchronize memory from source_data to the memory at dest_data.

Defines how data is synchronized into the device. All Frameworks, except Native(host), are also defining a sync_out method.

Implementors