# Struct 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.

## Methods

### `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

ⓘThis example is not tested

    // 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

ⓘThis example is not tested

    // 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.

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)