Struct opencl3::kernel::Kernel [−][src]
pub struct Kernel { /* fields omitted */ }
Expand description
An OpenCL kernel object.
Implements the Drop trait to call release_kernel when the object is dropped.
Implementations
Create a Kernel from an OpenCL cl_kernel.
kernel
- a valid OpenCL cl_kernel.
returns a Result containing the new Kernel or the error code from the OpenCL C API function to get the number of kernel arguments.
Create a Kernel from an OpenCL Program.
program
- a built OpenCL Program.name
- the name of the OpenCL kernel.
returns a Result containing the new Kernel or the error code from the OpenCL C API function to get the number of kernel arguments.
Set the argument value for a specific argument of a kernel.
arg_index
- the kernel argument index.arg
- a reference to the data for the argument at arg_index.
returns an empty Result or the error code from the OpenCL C API function.
Create a local memory buffer for a specific argument of a kernel.
arg_index
- the kernel argument index.size
- the size of the local memory buffer in bytes.
returns an empty Result or the error code from the OpenCL C API function.
Set set a SVM pointer as the argument value for a specific argument of a kernel.
arg_index
- the kernel argument index.arg_ptr
- the SVM pointer to the data for the argument at arg_index.
returns an empty Result or the error code from the OpenCL C API function.
pub fn set_exec_info<T>(
&self,
param_name: cl_kernel_exec_info,
param_ptr: *const T
) -> Result<()>
pub fn set_exec_info<T>(
&self,
param_name: cl_kernel_exec_info,
param_ptr: *const T
) -> Result<()>
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 an empty Result or the error code from the OpenCL C API function.
Get data about an OpenCL kernel. Calls clGetKernelInfo to get the desired data about the kernel.
pub fn get_arg_data(
&self,
arg_indx: cl_uint,
param_name: cl_kernel_arg_access_qualifier
) -> Result<Vec<u8>>
pub fn get_arg_data(
&self,
arg_indx: cl_uint,
param_name: cl_kernel_arg_access_qualifier
) -> Result<Vec<u8>>
Get data about arguments of an OpenCL kernel. Calls clGetKernelArgInfo to get the desired data about arguments of the kernel.
pub fn get_work_group_data(
&self,
device: cl_device_id,
param_name: cl_kernel_work_group_info
) -> Result<Vec<u8>>
pub fn get_work_group_data(
&self,
device: cl_device_id,
param_name: cl_kernel_work_group_info
) -> Result<Vec<u8>>
Get data about work groups of an OpenCL kernel. Calls clGetKernelArgInfo to get the desired data about work groups of the kernel.