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]
'q: 'k,
Q: 'k + AsRef<CommandQueueCore>,
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]
: 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]
: 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]
: 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]
'e: 'k,
Ewl: Into<ClWaitListPtrEnum<'e>>,
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]
'e: 'k,
En: Into<ClNullEventPtrEnum<'e>>,
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.