Module coaster::backend [] [src]

Provides the interface for running parallel computations on one ore many devices.

This is the abstraction over which you are interacting with your devices. You can create a backend for computation by first choosing a specific Framework such as OpenCL and afterwards selecting one or many available hardwares to create a backend.

A backend provides you with the functionality of managing the memory of the devices and copying your objects from host to devices and the other way around. Additionally you can execute operations in parallel through kernel functions on the device(s) of the backend.

Architecture

The initialization of a backend happens through the BackendConfig, which defines which framework should be used and which programs should be available for parallel execution.

Examples

extern crate coaster as co;
use co::framework::*;
use co::backend::{Backend, BackendConfig};
use co::frameworks::Native;
#[allow(unused_variables)]
fn main() {
    // Initialize a new Framewok.
    let framework = Native::new();
    // After initialization, the available hardware through the Framework can be obtained.
    let hardwares = &framework.hardwares().to_vec();
    // Create a Backend configuration with
    // - a Framework and
    // - the available hardwares you would like to use for computation (turn into a device).
    let backend_config = BackendConfig::new(framework, hardwares);
    // Create a ready to go backend from the configuration.
    let backend = Backend::new(backend_config);
}

Structs

Backend

Defines the main and highest struct of Coaster.

BackendConfig

Provides Backend Configuration.

Traits

IBackend

Describes a Backend.