#[repr(C)]pub struct Kernel(/* private fields */);
Expand description
cl_kernel
Thread Safety
Currently not thread safe: does not implement Send
or Sync
. It’s
probably possible to implement one or both with some work but it’s
potentially problematic on certain (all?) platforms due to issues while
setting arguments. If you need to transfer a kernel you’re better off
creating another one in the other thread or using some other mechanism
such as channels to manipulate kernels in other threads. This issue will
be revisited in the future (please provide input by filing an issue if you
have any thoughts on the matter).
[UPDATE]: Enabling Send
for a while to test.
Implementations§
source§impl Kernel
impl Kernel
sourcepub unsafe fn from_raw_create_ptr(ptr: cl_kernel) -> Kernel
pub unsafe fn from_raw_create_ptr(ptr: cl_kernel) -> Kernel
Only call this when passing the original newly created pointer
directly from clCreate...
. Do not use this to clone or copy.
sourcepub unsafe fn from_raw_copied_ptr(ptr: cl_kernel) -> Kernel
pub unsafe fn from_raw_copied_ptr(ptr: cl_kernel) -> Kernel
Only call this when passing a copied pointer such as from an
clGet*****Info
function.
sourcepub fn program(&self) -> OclCoreResult<Program>
pub fn program(&self) -> OclCoreResult<Program>
Returns the program associated with this kernel.