Struct opencl3::kernel::ExecuteKernel [−][src]
pub struct ExecuteKernel<'a> {
pub kernel: &'a Kernel,
pub num_args: cl_uint,
pub global_work_offsets: Vec<size_t>,
pub global_work_sizes: Vec<size_t>,
pub local_work_sizes: Vec<size_t>,
pub event_wait_list: Vec<cl_event>,
// some fields omitted
}
Expand description
A struct that implements the builder pattern to simplify setting up Kernel arguments and the NDRange when enqueueing a Kernel on a CommandQueue.
Fields
kernel: &'a Kernel
num_args: cl_uint
global_work_offsets: Vec<size_t>
global_work_sizes: Vec<size_t>
local_work_sizes: Vec<size_t>
event_wait_list: Vec<cl_event>
Implementations
Set the next argument of the kernel.
Calls self.kernel.set_arg
to set the next unset kernel argument.
Panics
Panics if too many arguments have been set.
arg
- a reference to the data for the kernel argument.
returns a reference to self.
Set the next argument of the kernel as a local buffer
Calls self.kernel.set_arg_local_buffer
to set the next unset kernel argument.
Panics
Panics if too many arguments have been set.
size
- the size of the local memory buffer in bytes.
returns a reference to self.
Set the next argument of the kernel.
Calls self.kernel.set_arg
to set the next unset kernel argument.
Panics
Panics if too many arguments have been set.
arg
- a reference to the data for the kernel argument.
returns a reference to self.
pub fn set_exec_info<T>(
&mut self,
param_name: cl_kernel_exec_info,
param_ptr: *const T
) -> &mut Self
pub fn set_exec_info<T>(
&mut self,
param_name: cl_kernel_exec_info,
param_ptr: *const T
) -> &mut Self
Pass additional information other than argument values to a kernel.
param_name
- the information to be passed to kernel, see: Kernel Execution Properties.param_ptr
- pointer to the data for the param_name.
returns a reference to self.
Set a global work offset for a call to clEnqueueNDRangeKernel.
size
- the size of the global work offset.
returns a reference to self.
Set the global work offsets for a call to clEnqueueNDRangeKernel.
Panics
Panics if global_work_offsets is already set.
sizes
- the sizes of the global work offset.
returns a reference to self.
Set a global work size for a call to clEnqueueNDRangeKernel.
size
- the size of the global work size.
returns a reference to self.
Set the global work sizes for a call to clEnqueueNDRangeKernel.
Panics
Panics if global_work_sizes is already set.
sizes
- the sizes of the global work sizes.
returns a reference to self.
Set a local work size for a call to clEnqueueNDRangeKernel.
size
- the size of the local work size.
returns a reference to self.
Set the local work sizes for a call to clEnqueueNDRangeKernel.
Panics
Panics if local_work_sizes is already set.
sizes
- the sizes of the local work sizes.
returns a reference to self.
Set an event for the event_wait_list in a call to clEnqueueNDRangeKernel.
event
- the Event to add to the event_wait_list.
returns a reference to self.
Set the event_wait_list in a call to clEnqueueNDRangeKernel.
Panics
Panics if event_wait_list is already set.
events
- the cl_events in the call to clEnqueueNDRangeKernel.
returns a reference to self.
Calls clEnqueueNDRangeKernel on the given with CommandQueue with the global and local work sizes and the global work offsets together with an events wait list.
Panics
Panics if:
-
too few kernel arguments have been set
-
no global_work_sizes have been set
-
too many global_work_sizes have been set
-
global_work_offsets have been set and their dimensions do not match global_work_sizes
-
local_work_sizes have been set and their dimensions do not match global_work_sizes
-
queue
- the CommandQueue to enqueue the Kernel on.
return the Event for this command or the error code from the OpenCL C API function.