| OpenCV 5.0.0alpha Open Source Computer Vision

Loading...
Searching...
No Matches
Classes | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
cv::ocl::Context Class Reference
Core functionality » OpenCL support

`#include <opencv2/core/ocl.hpp>`

Collaboration diagram for cv::ocl::Context:

## Classes
class | UserContext

## Public Member Functions
| Context () CV_NOEXCEPT
| Context (const Context &c)
| Context (Context &&c) CV_NOEXCEPT
| Context (int dtype)
| ~Context ()
bool | create ()
bool | create (int dtype)
Device & | device (size_t idx) const
bool | empty () const
Impl * | getImpl () const
void * | getOpenCLContextProperty (int propertyId) const
| Get OpenCL context property specified on context creation.
Program | getProg (const ProgramSource &prog, const String &buildopt, String &errmsg)
template<typename T >
std::shared_ptr< T > | getUserContext ()
std::shared_ptr< UserContext > | getUserContext (std::type_index typeId)
size_t | ndevices () const
Context & | operator= (const Context &c)
Context & | operator= (Context &&c) CV_NOEXCEPT
void * | ptr () const
void | release ()
template<typename T >
void | setUserContext (const std::shared_ptr< T > &userContext)
void | setUserContext (std::type_index typeId, const std::shared_ptr< UserContext > &userContext)
void | setUseSVM (bool enabled)
void | unloadProg (Program &prog)
bool | useSVM () const

## Static Public Member Functions
static Context | create (const std::string &configuration)
static Context | fromDevice (const ocl::Device &device)
static Context | fromHandle (void *context)
static Context & | getDefault ()

## Protected Attributes
Impl * | p

## Constructor & Destructor Documentation

## ◆ Context() [1/4]

cv::ocl::Context::Context | ( |  | ) |

## ◆ Context() [2/4]

cv::ocl::Context::Context | ( | int | dtype | ) |
| explicit

Deprecated

## ◆ ~Context()

cv::ocl::Context::~Context | ( |  | ) |

## ◆ Context() [3/4]

cv::ocl::Context::Context | ( | const Context & | c | ) |

## ◆ Context() [4/4]

cv::ocl::Context::Context | ( | Context && | c | ) |

## Member Function Documentation

## ◆ create() [1/3]

bool cv::ocl::Context::create | ( |  | ) |

Deprecated

## ◆ create() [2/3]

static Context cv::ocl::Context::create | ( | const std::string & | configuration | ) |
| static

## ◆ create() [3/3]

bool cv::ocl::Context::create | ( | int | dtype | ) |

Deprecated

## ◆ device()

Device & cv::ocl::Context::device | ( | size_t | idx | ) | const

## ◆ empty()

bool cv::ocl::Context::empty | ( |  | ) | const
| inline

## ◆ fromDevice()

static Context cv::ocl::Context::fromDevice | ( | const ocl::Device & | device | ) |
| static

## ◆ fromHandle()

static Context cv::ocl::Context::fromHandle | ( | void * | context | ) |
| static

Parameters

  context | OpenCL handle (cl_context). clRetainContext() is called on success

## ◆ getDefault()

static Context & cv::ocl::Context::getDefault | ( |  | ) |
| static

Get thread-local OpenCL context (initialize if necessary)

## ◆ getImpl()

Impl * cv::ocl::Context::getImpl | ( |  | ) | const
| inline

## ◆ getOpenCLContextProperty()

void * cv::ocl::Context::getOpenCLContextProperty | ( | int | propertyId | ) | const

Get OpenCL context property specified on context creation.

Parameters

  propertyId | Property id (CL_CONTEXT_* as defined in cl_context_properties type)

Returns
  Property value if property was specified on clCreateContext, or NULL if context created without the property

## ◆ getProg()

Program cv::ocl::Context::getProg | ( | const ProgramSource & | prog,
|  | const String & | buildopt,
|  | String & | errmsg )

## ◆ getUserContext() [1/2]

template<typename T >

std::shared_ptr< T > cv::ocl::Context::getUserContext | ( |  | ) |
| inline

## ◆ getUserContext() [2/2]

std::shared_ptr< UserContext > cv::ocl::Context::getUserContext | ( | std::type_index | typeId | ) |

## ◆ ndevices()

size_t cv::ocl::Context::ndevices | ( |  | ) | const

## ◆ operator=() [1/2]

Context & cv::ocl::Context::operator= | ( | const Context & | c | ) |

## ◆ operator=() [2/2]

Context & cv::ocl::Context::operator= | ( | Context && | c | ) |

## ◆ ptr()

void * cv::ocl::Context::ptr | ( |  | ) | const

Returns
  cl_context value

## ◆ release()

void cv::ocl::Context::release | ( |  | ) |

## ◆ setUserContext() [1/2]

template<typename T >

void cv::ocl::Context::setUserContext | ( | const std::shared_ptr< T > & | userContext | ) |
| inline

## ◆ setUserContext() [2/2]

void cv::ocl::Context::setUserContext | ( | std::type_index | typeId,
|  | const std::shared_ptr< UserContext > & | userContext )

## ◆ setUseSVM()

void cv::ocl::Context::setUseSVM | ( | bool | enabled | ) |

## ◆ unloadProg()

void cv::ocl::Context::unloadProg | ( | Program & | prog | ) |

## ◆ useSVM()

bool cv::ocl::Context::useSVM | ( |  | ) | const

## Member Data Documentation

## ◆ p

Impl* cv::ocl::Context::p
| protected

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

- opencv2/core/ocl.hpp