Struct parenchyma::Backend
[−]
[src]
pub struct Backend<X = Unextended> { /* fields omitted */ }
The heart of Parenchyma - provides an interface for running parallel computations on one or more devices.
The Backend
type is an abstraction over a framework and is used as
a way to interact with your devices. A backend provides you with the functionality of managing
the memory of the devices and copying memory objects to/from the host. Additionally, backends
allow you to execute operations in parallel through kernel functions on devices.
Architecture
Backends are initialized by providing a framework and a selection of devices compatible with
the framework to the Backend::new
associated function, or by simply
calling Backend::default
. The framework determines which devices are
available and how parallel kernel functions can be executed.
Methods
impl<X> Backend<X> where X: ExtensionPackage
[src]
fn new<F>() -> Result<Self> where F: BoxContext<X> + Framework + TryDefault<Err=Error>
Initialize a new backend.
fn with<F>(fwrk: F, selection: Vec<Hardware>) -> Result<Self> where F: BoxContext<X> + Framework
Constructs a backend from the specified framework
and selection
.
fn set_active(&mut self, index: usize) -> Result
Set the device at the specified index
as the active device.
Only one device can be the active device - the device in which operations are executed.
Trait Implementations
impl<X: Debug> Debug for Backend<X>
[src]
impl<X> Deref for Backend<X> where X: ExtensionPackage
[src]
type Target = X::Extension
The resulting type after dereferencing
fn deref<'a>(&'a self) -> &'a X::Extension
The method called to dereference a value