Struct ocl_core::types::abs::Kernel

source ·
#[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

source

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.

source

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.

source

pub fn as_ptr(&self) -> cl_kernel

Returns a pointer, do not store it.

source

pub fn program(&self) -> OclCoreResult<Program>

Returns the program associated with this kernel.

source

pub fn devices(&self) -> OclCoreResult<Vec<DeviceId>>

Trait Implementations§

source§

impl ClVersions for Kernel

source§

impl Clone for Kernel

source§

fn clone(&self) -> Kernel

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Kernel

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for Kernel

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl Send for Kernel

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.