pub struct OpenCLExecutionContext { /* private fields */ }

Implementations§

source§

impl OpenCLExecutionContext

source

pub fn default() -> OpenCLExecutionContext

source

pub fn copy(unnamed: &OpenCLExecutionContext) -> OpenCLExecutionContext

source

pub fn copy_mut(unnamed: OpenCLExecutionContext) -> OpenCLExecutionContext

source

pub fn get_current() -> Result<OpenCLExecutionContext>

Get OpenCL execution context of current thread.

Initialize OpenCL execution context if it is empty

  • create new
  • reuse context of the main thread (threadID = 0)
source

pub fn get_current_ref() -> Result<OpenCLExecutionContext>

Get OpenCL execution context of current thread (can be empty)

source

pub unsafe fn create( platform_name: &str, platform_id: *mut c_void, context: *mut c_void, device_id: *mut c_void ) -> Result<OpenCLExecutionContext>

Creates OpenCL execution context OpenCV will check if available OpenCL platform has platformName name, then assign context to OpenCV. The deviceID device will be used as target device and a new command queue will be created.

Note: On success, ownership of one reference of the context and device is taken. The caller should additionally call clRetainContext and/or clRetainDevice to increase the reference count if it wishes to continue using them.

Parameters
  • platformName: name of OpenCL platform to attach, this string is used to check if platform is available to OpenCV at runtime
  • platformID: ID of platform attached context was created for (cl_platform_id)
  • context: OpenCL context to be attached to OpenCV (cl_context)
  • deviceID: OpenCL device (cl_device_id)
source

pub fn create_1( context: &Context, device: &Device, queue: &Queue ) -> Result<OpenCLExecutionContext>

Creates OpenCL execution context

Parameters
  • context: non-empty OpenCL context
  • device: non-empty OpenCL device (must be a part of context)
  • queue: non-empty OpenCL queue for provided context and device
source

pub fn create_2( context: &Context, device: &Device ) -> Result<OpenCLExecutionContext>

Creates OpenCL execution context

Parameters
  • context: non-empty OpenCL context
  • device: non-empty OpenCL device (must be a part of context)
  • queue: non-empty OpenCL queue for provided context and device
Overloaded parameters

Trait Implementations§

source§

impl Boxed for OpenCLExecutionContext

source§

unsafe fn from_raw(ptr: *mut c_void) -> Self

Wrap the specified raw pointer Read more
source§

fn into_raw(self) -> *mut c_void

Return an the underlying raw pointer while consuming this wrapper. Read more
source§

fn as_raw(&self) -> *const c_void

Return the underlying raw pointer. Read more
source§

fn as_raw_mut(&mut self) -> *mut c_void

Return the underlying mutable raw pointer Read more
source§

impl Default for OpenCLExecutionContext

source§

fn default() -> Self

Forwards to infallible Self::default()

source§

impl Drop for OpenCLExecutionContext

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl OpenCLExecutionContextTrait for OpenCLExecutionContext

source§

impl OpenCLExecutionContextTraitConst for OpenCLExecutionContext

source§

fn as_raw_OpenCLExecutionContext(&self) -> *const c_void

source§

fn get_context(&self) -> Result<Context>

Get associated ocl::Context
source§

fn get_device(&self) -> Result<Device>

Get the single default associated ocl::Device
source§

fn get_queue(&self) -> Result<Queue>

Get the single ocl::Queue that is associated with the ocl::Context and the single default ocl::Device
source§

fn use_opencl(&self) -> Result<bool>

source§

fn bind(&self) -> Result<()>

Bind this OpenCL execution context to current thread. Read more
source§

fn clone_with_new_queue(&self, q: &Queue) -> Result<OpenCLExecutionContext>

Creates new execution context with same OpenCV context and device Read more
source§

fn clone_with_new_queue_1(&self) -> Result<OpenCLExecutionContext>

Creates new execution context with same OpenCV context and device Read more
source§

fn empty(&self) -> Result<bool>

source§

impl Send for OpenCLExecutionContext

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, 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.