Struct parenchyma::OpenCL [] [src]

pub struct OpenCL {
    pub available_hardware: Vec<Hardware>,
    // some fields omitted
}

Provides the OpenCL framework.

Flow

Since multiple platforms can exist, the first available platform is selected during the initialization. A list of available devices are then provided for your choosing. Then, the provided selection of devices are used to create a context, with a command queue for each device. At this stage, a program(s) is compiled. A (host) program is essentially a collection of kernels. A kernel is the smallest unit of execution.

In OpenCL, the host code can read in a kernel binary (i.e., compiled off-line) or a kernel source file (i.e., compile on-line). More information on on-line/off-line compilation can be found here. Kernels are expensive to start, so they're typically used to do a large amount of work. Memory allocated on an OpenCL device can be used when executing kernels, and then transfered back.

Work-groups, a collection of work-items, are assigned to execute on compute-units. A work-item is an instance of a kernel as runtime. That kernel instance is at a point in an index, which can be thought of as a grid and the work-groups which contain the work-items can be thought of as sub-grids within the grid. The work-groups can be defined explicitly or implicitly by simply specifying the number of work-items, both dealing with data parallelism. In terms of task parallelism, kernels are executed independent of an index space. It should also be noted that there are built-in scalar data types along with built-in functions.

Fields

A list of available devices for the first platform found.

Platforms are defined by the implementation. Platforms enables the host to interact with OpenCL-capable devices.

Trait Implementations

impl Debug for OpenCL
[src]

Formats the value using the given formatter.

impl Framework for OpenCL
[src]

The name of the framework. Read more

Returns the cached and available hardware.

impl<X> BoxContext<X> for OpenCL where X: ExtensionPackage + Build<OpenCLContext<Uninitialized>>,
        OpenCLContext<X>: Unsize<X::Extension>
[src]

Create a context from a selection of hardware devices and then wrap it in a box.

impl TryDefault for OpenCL
[src]

The type returned in the event of an error.

Returns the default value for a type.