[][src]Struct opencl3::kernel::Kernel

pub struct Kernel { /* fields omitted */ }

An OpenCL kernel object.
It stores the number of arguments required by the kernel for the ExecuteKernel builder to verify kernel execution.
Implements the Drop trait to call release_kernel when the object is dropped.

Implementations

impl Kernel[src]

pub fn new(kernel: cl_kernel) -> Result<Kernel, cl_int>[src]

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.

pub fn get(&self) -> cl_kernel[src]

Get the underlying OpenCL cl_kernel.

pub fn set_arg<T>(&self, arg_index: cl_uint, arg: &T) -> Result<(), cl_int>[src]

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.

pub fn set_arg_local_buffer(
    &self,
    arg_index: cl_uint,
    size: size_t
) -> Result<(), cl_int>
[src]

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.

pub fn set_arg_svm_pointer(
    &self,
    arg_index: cl_uint,
    arg_ptr: *const c_void
) -> Result<(), cl_int>
[src]

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<(), cl_int>
[src]

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.

pub fn function_name(&self) -> Result<CString, cl_int>[src]

pub fn attributes(&self) -> Result<CString, cl_int>[src]

pub fn num_args(&self) -> cl_uint[src]

pub fn reference_count(&self) -> Result<cl_uint, cl_int>[src]

pub fn context(&self) -> Result<intptr_t, cl_int>[src]

pub fn program(&self) -> Result<intptr_t, cl_int>[src]

pub fn get_arg_address_qualifier(
    &self,
    arg_indx: cl_uint
) -> Result<cl_uint, cl_int>
[src]

pub fn get_arg_access_qualifier(
    &self,
    arg_indx: cl_uint
) -> Result<cl_uint, cl_int>
[src]

pub fn get_arg_type_qualifier(
    &self,
    arg_indx: cl_uint
) -> Result<cl_uint, cl_int>
[src]

pub fn get_arg_type_name(&self, arg_indx: cl_uint) -> Result<CString, cl_int>[src]

pub fn get_arg_name(&self, arg_indx: cl_uint) -> Result<CString, cl_int>[src]

pub fn get_work_group_size(
    &self,
    device: cl_device_id
) -> Result<size_t, cl_int>
[src]

pub fn get_work_group_size_multiple(
    &self,
    device: cl_device_id
) -> Result<size_t, cl_int>
[src]

pub fn get_compile_work_group_size(
    &self,
    device: cl_device_id
) -> Result<Vec<size_t>, cl_int>
[src]

pub fn get_local_mem_size(
    &self,
    device: cl_device_id
) -> Result<cl_ulong, cl_int>
[src]

pub fn get_private_mem_size(
    &self,
    device: cl_device_id
) -> Result<cl_ulong, cl_int>
[src]

Trait Implementations

impl Drop for Kernel[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.