![]() |
OpenCV 4.14.0
Open Source Computer Vision
|
#include <opencv2/core/ocl.hpp>
Public Member Functions | |
| OpenCLExecutionContext ()=default | |
| OpenCLExecutionContext (const OpenCLExecutionContext &)=default | |
| OpenCLExecutionContext (OpenCLExecutionContext &&)=default | |
| ~OpenCLExecutionContext ()=default | |
| void | bind () const |
| OpenCLExecutionContext | cloneWithNewQueue () const |
| OpenCLExecutionContext | cloneWithNewQueue (const ocl::Queue &q) const |
| bool | empty () const |
| Context & | getContext () const |
| Device & | getDevice () const |
| Queue & | getQueue () const |
| OpenCLExecutionContext & | operator= (const OpenCLExecutionContext &)=default |
| OpenCLExecutionContext & | operator= (OpenCLExecutionContext &&)=default |
| void | release () |
| void | setUseOpenCL (bool flag) |
| bool | useOpenCL () const |
Static Public Member Functions | |
| static OpenCLExecutionContext | create (const Context &context, const Device &device) |
| static OpenCLExecutionContext | create (const Context &context, const Device &device, const ocl::Queue &queue) |
| Creates OpenCL execution context. | |
| static OpenCLExecutionContext | create (const std::string &platformName, void *platformID, void *context, void *deviceID) |
| 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. | |
| static OpenCLExecutionContext & | getCurrent () |
| static OpenCLExecutionContext & | getCurrentRef () |
Protected Attributes | |
| std::shared_ptr< Impl > | p |
|
default |
|
default |
|
default |
|
default |
| void cv::ocl::OpenCLExecutionContext::bind | ( | ) | const |
Bind this OpenCL execution context to current thread.
Context can't be empty.
| OpenCLExecutionContext cv::ocl::OpenCLExecutionContext::cloneWithNewQueue | ( | ) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| OpenCLExecutionContext cv::ocl::OpenCLExecutionContext::cloneWithNewQueue | ( | const ocl::Queue & | q | ) | const |
Creates new execution context with same OpenCV context and device
| q | OpenCL queue |
|
static |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
static |
Creates OpenCL execution context.
| 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 |
|
static |
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.
| 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) |
|
inline |
| Context & cv::ocl::OpenCLExecutionContext::getContext | ( | ) | const |
Get associated ocl::Context
|
static |
Get OpenCL execution context of current thread.
Initialize OpenCL execution context if it is empty
|
static |
Get OpenCL execution context of current thread (can be empty)
| Device & cv::ocl::OpenCLExecutionContext::getDevice | ( | ) | const |
Get the single default associated ocl::Device
| Queue & cv::ocl::OpenCLExecutionContext::getQueue | ( | ) | const |
Get the single ocl::Queue that is associated with the ocl::Context and the single default ocl::Device
|
default |
|
default |
| void cv::ocl::OpenCLExecutionContext::release | ( | ) |
| void cv::ocl::OpenCLExecutionContext::setUseOpenCL | ( | bool | flag | ) |
| bool cv::ocl::OpenCLExecutionContext::useOpenCL | ( | ) | const |
|
protected |