Class cv::ocl::OpenCLExecutionContext#

Collaboration diagram for cv::ocl::OpenCLExecutionContext:

Constructor & Destructor Documentation#

OpenCLExecutionContext()#

cv::ocl::OpenCLExecutionContext::OpenCLExecutionContext()

OpenCLExecutionContext()#

cv::ocl::OpenCLExecutionContext::OpenCLExecutionContext(const OpenCLExecutionContext &)

OpenCLExecutionContext()#

cv::ocl::OpenCLExecutionContext::OpenCLExecutionContext(OpenCLExecutionContext &&)

~OpenCLExecutionContext()#

cv::ocl::OpenCLExecutionContext::~OpenCLExecutionContext()

Member Function Documentation#

bind()#

void cv::ocl::OpenCLExecutionContext::bind()

Bind this OpenCL execution context to current thread.

Context can’t be empty.

Note

clFinish is not called for queue of previous execution context

cloneWithNewQueue()#

OpenCLExecutionContext cv::ocl::OpenCLExecutionContext::cloneWithNewQueue()

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

cloneWithNewQueue()#

OpenCLExecutionContext cv::ocl::OpenCLExecutionContext::cloneWithNewQueue(const ocl::Queue & q)

Creates new execution context with same OpenCV context and device

Parameters

  • q — OpenCL queue

empty()#

bool cv::ocl::OpenCLExecutionContext::empty()

getContext()#

Context & cv::ocl::OpenCLExecutionContext::getContext()

Get associated ocl::Context

getDevice()#

Device & cv::ocl::OpenCLExecutionContext::getDevice()

Get the single default associated ocl::Device

getQueue()#

Queue & cv::ocl::OpenCLExecutionContext::getQueue()

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

operator=()#

OpenCLExecutionContext & cv::ocl::OpenCLExecutionContext::operator=(const OpenCLExecutionContext &)

operator=()#

OpenCLExecutionContext & cv::ocl::OpenCLExecutionContext::operator=(OpenCLExecutionContext &&)

release()#

void cv::ocl::OpenCLExecutionContext::release()

setUseOpenCL()#

void cv::ocl::OpenCLExecutionContext::setUseOpenCL(bool flag)

useOpenCL()#

bool cv::ocl::OpenCLExecutionContext::useOpenCL()

create()#

static OpenCLExecutionContext cv::ocl::OpenCLExecutionContext::create(
const Context & context,
const Device & device )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

create()#

static OpenCLExecutionContext cv::ocl::OpenCLExecutionContext::create(
const Context & context,
const Device & device,
const ocl::Queue & queue )

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()#

static OpenCLExecutionContext cv::ocl::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.

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)

getCurrent()#

static OpenCLExecutionContext & cv::ocl::OpenCLExecutionContext::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()#

static OpenCLExecutionContext & cv::ocl::OpenCLExecutionContext::getCurrentRef()

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

Member Data Documentation#

p#

std::shared_ptr< Impl > cv::ocl::OpenCLExecutionContext::p

Source file#

The documentation for this class was generated from the following file: