Struct fil_ocl::builders::KernelCmd[][src]

#[must_use = "commands do nothing unless enqueued"]pub struct KernelCmd<'k> { /* fields omitted */ }

A kernel command builder used to enqueue a kernel with a mix of default and optionally specified arguments.

Implementations

impl<'k> KernelCmd<'k>[src]

A kernel enqueue command.

pub fn queue<'q, Q>(self, queue: &'q Q) -> KernelCmd<'k> where
    'q: 'k,
    Q: 'k + AsRef<CommandQueueCore>, 
[src]

Specifies a queue to use for this call only.

Overrides the kernel’s default queue if one is set. If no default queue is set, this method must be called before enqueuing the kernel.

pub fn gwo<D: Into<SpatialDims>>(self, gwo: D) -> KernelCmd<'k>[src]

👎 Deprecated since 0.18.0:

Use ::global_work_offset instead.

Specifies a global work offset for this call only.

pub fn gws<D: Into<SpatialDims>>(self, gws: D) -> KernelCmd<'k>[src]

👎 Deprecated since 0.18.0:

Use ::global_work_size instead.

Specifies a global work size for this call only.

pub fn lws<D: Into<SpatialDims>>(self, lws: D) -> KernelCmd<'k>[src]

👎 Deprecated since 0.18.0:

Use ::local_work_size instead.

Specifies a local work size for this call only.

pub fn global_work_offset<D: Into<SpatialDims>>(self, gwo: D) -> KernelCmd<'k>[src]

Specifies a global work offset for this call only.

pub fn global_work_size<D: Into<SpatialDims>>(self, gws: D) -> KernelCmd<'k>[src]

Specifies a global work size for this call only.

pub fn local_work_size<D: Into<SpatialDims>>(self, lws: D) -> KernelCmd<'k>[src]

Specifies a local work size for this call only.

pub fn ewait<'e, Ewl>(self, ewait: Ewl) -> KernelCmd<'k> where
    'e: 'k,
    Ewl: Into<ClWaitListPtrEnum<'e>>, 
[src]

Specifies an event or list of events to wait on before the command will run.

When events generated using the ::enew method of other, previously enqueued commands are passed here (either individually or as part of an EventList), this command will not execute until those commands have completed.

Using events can compliment the use of queues to order commands by creating temporal dependencies between them (where commands in one queue must wait for the completion of commands in another). Events can also supplant queues altogether when, for example, using out-of-order queues.

Example

// Create an event list:
let mut event_list = EventList::new();
// Enqueue a kernel on `queue_1`, creating an event representing the kernel
// command in our list:
kernel.cmd().queue(&queue_1).enew(&mut event_list).enq()?;
// Read from a buffer using `queue_2`, ensuring the read does not begin until
// after the kernel command has completed:
buffer.read(rwvec.clone()).queue(&queue_2).ewait(&event_list).enq_async()?;

pub fn enew<'e, En>(self, new_event_dest: En) -> KernelCmd<'k> where
    'e: 'k,
    En: Into<ClNullEventPtrEnum<'e>>, 
[src]

Specifies the destination to store a new, optionally created event associated with this command.

The destination can be a mutable reference to an empty event (created using Event::empty) or a mutable reference to an event list.

After this command is enqueued, the event in the destination can be passed to the ::ewait method of another command. Doing so will cause the other command to wait until this command has completed before executing.

Using events can compliment the use of queues to order commands by creating temporal dependencies between them (where commands in one queue must wait for the completion of commands in another). Events can also supplant queues altogether when, for example, using out-of-order queues.

Example

// Create an event list:
let mut event = Event::empty();
// Enqueue a kernel on `queue_1`, creating an event representing the kernel
// command in our list:
kernel.cmd().queue(&queue_1).enew(&mut event).enq()?;
// Read from a buffer using `queue_2`, ensuring the read does not begin until
// after the kernel command has completed:
buffer.read(rwvec.clone()).queue(&queue_2).ewait(&event).enq_async()?;

pub unsafe fn enq(self) -> OclResult<()>[src]

Enqueues this kernel command.

Safety

All kernel code must be considered untrusted. Therefore the act of calling this function contains implied unsafety even though the API itself is safe.

Auto Trait Implementations

impl<'k> !RefUnwindSafe for KernelCmd<'k>

impl<'k> !Send for KernelCmd<'k>

impl<'k> !Sync for KernelCmd<'k>

impl<'k> Unpin for KernelCmd<'k>

impl<'k> !UnwindSafe for KernelCmd<'k>

Blanket Implementations

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

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

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

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

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

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.