Struct opencv::core::OpenCLExecutionContext
source · pub struct OpenCLExecutionContext { /* private fields */ }Implementations§
source§impl OpenCLExecutionContext
impl OpenCLExecutionContext
pub fn default() -> OpenCLExecutionContext
pub fn copy(unnamed: &OpenCLExecutionContext) -> OpenCLExecutionContext
pub fn copy_mut(unnamed: OpenCLExecutionContext) -> OpenCLExecutionContext
sourcepub fn get_current() -> Result<OpenCLExecutionContext>
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)
sourcepub fn get_current_ref() -> Result<OpenCLExecutionContext>
pub fn get_current_ref() -> Result<OpenCLExecutionContext>
Get OpenCL execution context of current thread (can be empty)
sourcepub unsafe fn create(
platform_name: &str,
platform_id: *mut c_void,
context: *mut c_void,
device_id: *mut c_void
) -> Result<OpenCLExecutionContext>
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)
sourcepub fn create_1(
context: &Context,
device: &Device,
queue: &Queue
) -> Result<OpenCLExecutionContext>
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
sourcepub fn create_2(
context: &Context,
device: &Device
) -> Result<OpenCLExecutionContext>
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
impl Boxed for OpenCLExecutionContext
source§impl Default for OpenCLExecutionContext
impl Default for OpenCLExecutionContext
source§impl Drop for OpenCLExecutionContext
impl Drop for OpenCLExecutionContext
source§impl OpenCLExecutionContextTraitConst for OpenCLExecutionContext
impl OpenCLExecutionContextTraitConst for OpenCLExecutionContext
fn as_raw_OpenCLExecutionContext(&self) -> *const c_void
source§fn get_context(&self) -> Result<Context>
fn get_context(&self) -> Result<Context>
Get associated ocl::Context
source§fn get_device(&self) -> Result<Device>
fn get_device(&self) -> Result<Device>
Get the single default associated ocl::Device
source§fn get_queue(&self) -> Result<Queue>
fn get_queue(&self) -> Result<Queue>
Get the single ocl::Queue that is associated with the ocl::Context and
the single default ocl::Device
fn use_opencl(&self) -> Result<bool>
source§fn clone_with_new_queue(&self, q: &Queue) -> Result<OpenCLExecutionContext>
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>
fn clone_with_new_queue_1(&self) -> Result<OpenCLExecutionContext>
Creates new execution context with same OpenCV context and device Read more
fn empty(&self) -> Result<bool>
impl Send for OpenCLExecutionContext
Auto Trait Implementations§
impl RefUnwindSafe for OpenCLExecutionContext
impl !Sync for OpenCLExecutionContext
impl Unpin for OpenCLExecutionContext
impl UnwindSafe for OpenCLExecutionContext
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more