[][src]Trait coaster::framework::IFramework

pub trait IFramework {
    type H: IHardware;
    type D: IDevice + Clone;
    type B: IBinary + Clone;
    fn ID() -> &'static str;
fn new() -> Self
    where
        Self: Sized
;
fn load_hardwares() -> Result<Vec<Self::H>, Error>;
fn hardwares(&self) -> &[Self::H];
fn binary(&self) -> &Self::B;
fn new_device(&self, _: &[Self::H]) -> Result<Self::D, Error>; }

Defines a Framework.

Associated Types

type H: IHardware

The Hardware representation for this Framework.

type D: IDevice + Clone

The Device representation for this Framework.

type B: IBinary + Clone

The Binary representation for this Framework.

Loading content...

Required methods

fn ID() -> &'static str

Defines the Framework by a Name.

For convention, let the ID be uppercase.
EXAMPLE: OPENCL

fn new() -> Self where
    Self: Sized

Initializes a new Framework.

Loads all the available hardwares

fn load_hardwares() -> Result<Vec<Self::H>, Error>

Initializes all the available hardwares.

fn hardwares(&self) -> &[Self::H]

Returns the cached and available hardwares.

fn binary(&self) -> &Self::B

Returns the initialized binary.

fn new_device(&self, _: &[Self::H]) -> Result<Self::D, Error>

Initializes a new Device from the provided hardwares.

Loading content...

Implementors

impl IFramework for Native[src]

type H = Hardware

type D = Cpu

type B = Binary

Loading content...