OpenCV 4.12.0
開源計算機視覺
載入中...
搜尋中...
無匹配項
cv::ocl::OpenCLExecutionContext 類參考

#include <opencv2/core/ocl.hpp>

cv::ocl::OpenCLExecutionContext 的協作圖

公共成員函式

 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
 
ContextgetContext () const
 
DevicegetDevice () const
 
QueuegetQueue () const
 
OpenCLExecutionContextoperator= (const OpenCLExecutionContext &)=default
 
OpenCLExecutionContextoperator= (OpenCLExecutionContext &&)=default
 
void release ()
 
void setUseOpenCL (bool flag)
 
bool useOpenCL () const
 

靜態公共成員函式

static OpenCLExecutionContext create (const Context &context, const Device &device)
 
static OpenCLExecutionContext create (const Context &context, const Device &device, const ocl::Queue &queue)
 建立 OpenCL 執行上下文。
 
static OpenCLExecutionContext create (const std::string &platformName, void *platformID, void *context, void *deviceID)
 建立 OpenCL 執行上下文。OpenCV 將檢查可用的 OpenCL 平臺是否具有 platformName 名稱,然後將上下文分配給 OpenCV。deviceID 裝置將用作目標裝置,並將建立一個新的命令佇列。
 
static OpenCLExecutionContextgetCurrent ()
 
static OpenCLExecutionContextgetCurrentRef ()
 

保護屬性

std::shared_ptr< Impl > p
 

建構函式 & 解構函式文件

◆ OpenCLExecutionContext() [1/3]

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

◆ ~OpenCLExecutionContext()

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

◆ OpenCLExecutionContext() [2/3]

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

◆ OpenCLExecutionContext() [3/3]

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

成員函式文件

◆ bind()

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

將此 OpenCL 執行上下文繫結到當前執行緒。

Context 不能為空。

注意
未為先前執行上下文的佇列呼叫 clFinish

◆ cloneWithNewQueue() [1/2]

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

這是一個過載的成員函式,為了方便而提供。它與上述函式的不同之處僅在於它接受的引數。

◆ cloneWithNewQueue() [2/2]

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

建立具有相同 OpenCV 上下文和裝置的新執行上下文

引數
qOpenCL 佇列

◆ create() [1/3]

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

這是一個過載的成員函式,為了方便而提供。它與上述函式的不同之處僅在於它接受的引數。

◆ create() [2/3]

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

建立 OpenCL 執行上下文。

引數
context非空的 OpenCL 上下文
device非空的 OpenCL 裝置(必須是上下文的一部分)
queue提供的上下文和裝置的非空 OpenCL 佇列

◆ create() [3/3]

static OpenCLExecutionContext cv::ocl::OpenCLExecutionContext::create ( const std::string & platformName,
void * platformID,
void * context,
void * deviceID )
static

建立 OpenCL 執行上下文。OpenCV 將檢查可用的 OpenCL 平臺是否具有 platformName 名稱,然後將上下文分配給 OpenCV。deviceID 裝置將用作目標裝置,並將建立一個新的命令佇列。

注意
成功後,將獲取上下文和裝置的一個引用的所有權。如果呼叫者希望繼續使用它們,則應另外呼叫 clRetainContext 和/或 clRetainDevice 以增加引用計數。
引數
platformName要附加的 OpenCL 平臺的名稱,此字串用於檢查平臺在執行時是否可用於 OpenCV
platformID附加上下文為其建立的平臺 ID (cl_platform_id)
context要附加到 OpenCV 的 OpenCL 上下文 (cl_context)
deviceIDOpenCL 裝置 (cl_device_id)

◆ empty()

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

◆ getContext()

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

獲取關聯的 ocl::Context

◆ getCurrent()

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

獲取當前執行緒的 OpenCL 執行上下文。

如果 OpenCL 執行上下文為空,則初始化它

  • 建立新的
  • 重用主執行緒的上下文(threadID = 0)

◆ getCurrentRef()

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

獲取當前執行緒的 OpenCL 執行上下文(可以為空)

◆ getDevice()

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

獲取單個預設關聯的 ocl::Device

◆ getQueue()

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

獲取與 ocl::Context 和單個預設 ocl::Device 關聯的單個 ocl::Queue

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ release()

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

◆ setUseOpenCL()

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

◆ useOpenCL()

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

成員資料文件

◆ p

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

此類文件由以下檔案生成