Struct ocl::Kernel
[−]
[src]
pub struct Kernel { // some fields omitted }
A kernel.
Destruction
Releases kernel object automatically upon drop.
Thread Safety
Do not share the kernel object pointer obj
between threads.
Specifically, do not attempt to create or modify kernel arguments
from more than one thread for a kernel.
TODO: Add more details, examples, etc. TODO: Add information about panics and errors.
Methods
impl Kernel
[src]
fn new<S: Into<String>, D: Into<SimpleDims>>(name: S, program: &Program, queue: &Queue, gws: D) -> OclResult<Kernel>
Returns a new kernel.
fn gwo(self, gwo: SimpleDims) -> Kernel
Sets the global work offset (builder-style).
fn lws(self, lws: SimpleDims) -> Kernel
Sets the local work size (builder-style).
fn arg_buf<T: OclNum>(self, buffer: &Buffer<T>) -> Kernel
Adds a new argument to the kernel specifying the buffer object represented by 'buffer' (builder-style). Argument is added to the bottom of the argument order.
fn arg_img(self, image: &Image) -> Kernel
Adds a new argument to the kernel specifying the image object represented by 'image' (builder-style). Argument is added to the bottom of the argument order.
fn arg_scl<T: OclNum>(self, scalar: T) -> Kernel
Adds a new argument specifying the value: scalar
(builder-style). Argument
is added to the bottom of the argument order.
fn arg_loc<T: OclNum>(self, length: usize) -> Kernel
Adds a new argument specifying the allocation of a local variable of size
length * sizeof(T)
bytes (builder_style).
Local variables are used to share data between work items in the same workgroup.
fn arg_scl_named<T: OclNum>(self, name: &'static str, scalar_opt: Option<T>) -> Kernel
Adds a new named argument (in order) specifying the value: scalar
(builder-style).
Named arguments can be easily modified later using ::set_arg_scl_named()
.
fn arg_buf_named<T: OclNum>(self, name: &'static str, buffer_opt: Option<&Buffer<T>>) -> Kernel
Adds a new named buffer argument specifying the buffer object represented by 'buffer' (builder-style). Argument is added to the bottom of the argument order.
Named arguments can be easily modified later using ::set_arg_scl_named()
.
fn arg_img_named(self, name: &'static str, image_opt: Option<&Image>) -> Kernel
Adds a new named image argument specifying the image object represented by 'image' (builder-style). Argument is added to the bottom of the argument order.
Named arguments can be easily modified later using ::set_arg_scl_named()
.
fn set_arg_scl_named<T: OclNum>(&mut self, name: &'static str, scalar: T) -> OclResult<()>
Modifies the kernel argument named: name
.
fn set_arg_buf_named<T: OclNum>(&mut self, name: &'static str, buffer_opt: Option<&Buffer<T>>) -> OclResult<()>
Modifies the kernel argument named: name
.
fn enqueue_with(&self, queue: Option<&Queue>, wait_list: Option<&EventList>, dest_list: Option<&mut EventList>) -> OclResult<()>
Enqueues kernel on the default command queue.
Execution of the kernel on the device will not occur until the events
in wait_list
have completed if it is specified.
Specify dest_list
to have a new event added to that list associated
with the completion of this kernel task.
TODO: Implement 'alternative queue' version of this function.
fn enqueue(&self)
Enqueues kernel on the default command queue with no event lists.
Equivalent to ::enqueue_with_events(None, None)
.
TODO: Implement 'alternative queue' version of this function.
fn arg_count(&self) -> u32
Returns the number of arguments specified for this kernel.
fn core_as_ref(&self) -> &KernelCore
fn info(&self, info_kind: KernelInfo) -> KernelInfoResult
Returns info about this kernel.