Module blaze_rs::context

source ·
Expand description

Contexts

A Blaze context is the owner of a single OpenCL context and one or more OpenCL command queues, all of them associated to the context.

It’s task is to manage the distribution of command queues amongst the various enqueue functions, maximizing performance by distributing the work amongst them.

The simplified signature of the Context trait is the following:

pub trait Context {
    fn as_raw (&self) -> &RawContext;
    fn queues (&self) -> &[RawCommandQueue];
    fn next_queue (&self) -> &RawCommandQueue;
}

The queues method returns a list with all the command queues owned by the context.
The next_queue method returns the next command queue to be used in an enqueue function.

Macros

  • Creates a new scope for spawining scoped events.

Structs

Traits

  • An object that can be used as a Blaze context, with a similar syntax to Rust allocators.
    Blaze contexts are similar to OpenCL contexts, except they’re also in charge of administrating and supplying their various command queues. This allows Blaze contexts to manage the load between the various devices in an OpenCL context.

Functions

  • Creates a new scope with the specified context to enqueue events in. All events that haven’t completed by the end of the function will be automatically joined before the function returns.
  • Creates a new scope with the global context to enqueue events in. All events that haven’t completed by the end of the function will be automatically awaitad before the function returns.