[][src]Struct fil_ocl::ProQue

pub struct ProQue { /* fields omitted */ }

An all-in-one chimera of the Program, Queue, Context and (optionally) SpatialDims types.

Handy when you only need a single context, program, and queue for your project or when using a unique context and program on each device.

All ProQue functionality is also provided separately by the Context, Queue, Program, and SpatialDims types.

Creation

There are two ways to create a ProQue:

  1. [Recommended] Use ProQue::builder or ProQueBuilder::new().
  2. Call ::new and pass pre-created components.

Destruction

Now handled automatically. Freely use, store, clone, discard, share among threads... put some on your toast... whatever.

Methods

impl ProQue[src]

pub fn builder<'b>() -> ProQueBuilder<'b>[src]

Returns a new ProQueBuilder.

This is the recommended way to create a new ProQue.

Calling ProQueBuilder::build() will return a new ProQue.

pub fn new<D: Into<SpatialDims>>(
    context: Context,
    queue: Queue,
    program: Program,
    dims: Option<D>
) -> ProQue
[src]

Creates a new ProQue from individual parts.

Use ::builder instead unless you know what you're doing. Creating from components associated with different devices or contexts will cause errors later on.

pub fn kernel_builder<S>(&self, name: S) -> KernelBuilder where
    S: Into<String>, 
[src]

Returns a new KernelBuilder with the name, program, default queue, and global work size pre-configured.

Use ::arg to specify arguments and ::build to build the kernel.

Example

This example is not tested
let kernel = pro_que.kernel_builder("add")
   .arg(&buffer)
   .arg(&10.0f32)
   .build()?;

See KernelBuilder documentation for more

pub fn create_buffer<T: OclPrm>(&self) -> OclResult<Buffer<T>>[src]

Returns a new buffer.

The default dimensions and queue from this ProQue will be used.

The buffer will be filled with zeros upon creation, blocking the current thread until completion.

Use Buffer::builder() (or BufferBuilder::new()) for access to the full range of buffer creation options.

Errors

This ProQue must have been pre-configured with default dimensions. If not, set them with ::set_dims, or just create a buffer using Buffer::builder() instead.

pub fn buffer_builder<T: OclPrm>(&self) -> BufferBuilder<T>[src]

Returns a new BufferBuilder with the default queue and length pre-configured.

Use .fill_val(Default::default()) to fill buffer with zeros.

Use .build() to create the buffer.

Panics

This ProQue must have been pre-configured with default dimensions. If not, set them with ::set_dims, or just create a buffer using Buffer::builder() instead.

pub fn set_dims<S: Into<SpatialDims>>(&mut self, dims: S)[src]

Sets the default dimensions used when creating buffers and kernels.

pub fn max_wg_size(&self) -> OclResult<usize>[src]

Returns the maximum workgroup size supported by the device associated with this ProQue.

[UNSTABLE]: Evaluate usefulness.

pub fn queue(&self) -> &Queue[src]

Returns a reference to the queue associated with this ProQue.

pub fn context(&self) -> &Context[src]

Returns the contained context.

pub fn program(&self) -> &Program[src]

Returns the current program build.

pub fn dims(&self) -> &SpatialDims[src]

Returns the current dims or panics.

[UNSTABLE]: Evaluate which 'dims' method to keep. Leaning towards this version at the moment.

pub fn dims_result(&self) -> OclResult<&SpatialDims>[src]

Returns the current dims or an error.

[UNSTABLE]: Evaluate which 'dims' method to keep. Leaning towards the above, panicking version at the moment.

Methods from Deref<Target = Queue>

pub fn flush(&self) -> OclResult<()>[src]

Issues all previously queued OpenCL commands to the device.

pub fn finish(&self) -> OclResult<()>[src]

Blocks until all commands in this queue have completed before returning.

pub fn enqueue_marker<Ewl>(&self, ewait: Option<Ewl>) -> OclResult<Event> where
    Ewl: ClWaitListPtr
[src]

Enqueues a marker command which waits for either a list of events to complete, or all previously enqueued commands to complete.

pub fn as_core(&self) -> &CommandQueueCore[src]

Returns a reference to the core pointer wrapper, usable by functions in the core module.

pub fn context(&self) -> Context[src]

Returns a copy of the Context associated with this queue.

pub fn device(&self) -> Device[src]

Returns the OpenCL device associated with this queue.

pub fn device_version(&self) -> OpenclVersion[src]

Returns the cached device version.

pub fn info(
    &self,
    info_kind: CommandQueueInfo
) -> OclCoreResult<CommandQueueInfoResult>
[src]

Returns info about this queue.

Trait Implementations

impl WorkDims for ProQue[src]

impl MemLen for ProQue[src]

impl Clone for ProQue[src]

impl Debug for ProQue[src]

impl Deref for ProQue[src]

type Target = Queue

The resulting type after dereferencing.

Auto Trait Implementations

impl Send for ProQue

impl Sync for ProQue

impl Unpin for ProQue

impl UnwindSafe for ProQue

impl RefUnwindSafe for ProQue

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]