cv::ocl::OpenCLExecutionContext Class ReferenceCore functionality » OpenCL support Примеры с cv2.imshow требуют сборки OpenCV с GUI. В ноутбуке с headless-версией используйте вывод изображений через Matplotlib.
cv::ocl::OpenCLExecutionContext Class Reference
#include <opencv2/core/ocl.hpp>
Collaboration diagram for cv::ocl::OpenCLExecutionContext:
The documentation for this class was generated from the following file:
Protected Attributesstd::shared_ptr< Impl > p
Constructor & Destructor Documentation
OpenCLExecutionContext() [1/3]
cv::ocl::OpenCLExecutionContext::OpenCLExecutionContext ( )
default
~OpenCLExecutionContext()
cv::ocl::OpenCLExecutionContext::~OpenCLExecutionContext ( )
default
OpenCLExecutionContext() [2/3]
OpenCLExecutionContext() [3/3]
Member Function Documentation
bind()
void cv::ocl::OpenCLExecutionContext::bind ( ) const
Bind this OpenCL execution context to current thread.
Context can't be empty.
clFinish is not called for queue of previous execution context
cloneWithNewQueue() [1/2]
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
cloneWithNewQueue() [2/2]
Creates new execution context with same OpenCV context and device
Parameters
create() [1/3]
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
create() [2/3]
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
create() [3/3]
static OpenCLExecutionContext cv::ocl::OpenCLExecutionContext::create ( const std::string & platformName , void * platformID , void * context , void * deviceID )
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.
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)
empty()
bool cv::ocl::OpenCLExecutionContext::empty ( ) const
inline
getContext()
Context & cv::ocl::OpenCLExecutionContext::getContext ( ) const
getCurrent()
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)
getCurrentRef()
Get OpenCL execution context of current thread (can be empty)
getDevice()
Device & cv::ocl::OpenCLExecutionContext::getDevice ( ) const
getQueue()
Queue & cv::ocl::OpenCLExecutionContext::getQueue ( ) const
operator=() [1/2]
operator=() [2/2]
release()
void cv::ocl::OpenCLExecutionContext::release ( )
setUseOpenCL()
void cv::ocl::OpenCLExecutionContext::setUseOpenCL ( bool flag )
useOpenCL()
bool cv::ocl::OpenCLExecutionContext::useOpenCL ( ) const
Member Data Documentation
p
std::shared_ptr<Impl> cv::ocl::OpenCLExecutionContext::p
protected
deviceID OpenCL device (cl_device_id)