[−][src]Struct opencl3::kernel::Kernel
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]
&self,
arg_index: cl_uint,
size: size_t
) -> Result<(), cl_int>
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]
&self,
arg_index: cl_uint,
arg_ptr: *const c_void
) -> Result<(), cl_int>
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]
&self,
param_name: cl_kernel_exec_info,
param_ptr: *const T
) -> Result<(), cl_int>
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]
&self,
arg_indx: cl_uint
) -> Result<cl_uint, cl_int>
pub fn get_arg_access_qualifier(
&self,
arg_indx: cl_uint
) -> Result<cl_uint, cl_int>
[src]
&self,
arg_indx: cl_uint
) -> Result<cl_uint, cl_int>
pub fn get_arg_type_qualifier(
&self,
arg_indx: cl_uint
) -> Result<cl_uint, cl_int>
[src]
&self,
arg_indx: cl_uint
) -> Result<cl_uint, cl_int>
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]
&self,
device: cl_device_id
) -> Result<size_t, cl_int>
pub fn get_work_group_size_multiple(
&self,
device: cl_device_id
) -> Result<size_t, cl_int>
[src]
&self,
device: cl_device_id
) -> Result<size_t, cl_int>
pub fn get_compile_work_group_size(
&self,
device: cl_device_id
) -> Result<Vec<size_t>, cl_int>
[src]
&self,
device: cl_device_id
) -> Result<Vec<size_t>, cl_int>
pub fn get_local_mem_size(
&self,
device: cl_device_id
) -> Result<cl_ulong, cl_int>
[src]
&self,
device: cl_device_id
) -> Result<cl_ulong, cl_int>
pub fn get_private_mem_size(
&self,
device: cl_device_id
) -> Result<cl_ulong, cl_int>
[src]
&self,
device: cl_device_id
) -> Result<cl_ulong, cl_int>
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Kernel
[src]
impl !Send for Kernel
[src]
impl !Sync for Kernel
[src]
impl Unpin for Kernel
[src]
impl UnwindSafe for Kernel
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,