OpenCV453
公開メンバ関数 | 限定公開メンバ関数 | 限定公開変数類 | 全メンバ一覧
cv::ocl::Kernel クラス

公開メンバ関数

 Kernel (const char *kname, const Program &prog)
 
 Kernel (const char *kname, const ProgramSource &prog, const String &buildopts=String(), String *errmsg=0)
 
 Kernel (const Kernel &k)
 
Kerneloperator= (const Kernel &k)
 
 Kernel (Kernel &&k) CV_NOEXCEPT
 
Kerneloperator= (Kernel &&k) CV_NOEXCEPT
 
bool empty () const
 
bool create (const char *kname, const Program &prog)
 
bool create (const char *kname, const ProgramSource &prog, const String &buildopts, String *errmsg=0)
 
int set (int i, const void *value, size_t sz)
 
int set (int i, const Image2D &image2D)
 
int set (int i, const UMat &m)
 
int set (int i, const KernelArg &arg)
 
template<typename _Tp >
int set (int i, const _Tp &value)
 
template<typename... _Tps>
Kernelargs (const _Tps &... kernel_args)
 Setup OpenCL Kernel arguments. Avoid direct using of set(i, ...) methods. [詳解]
 
bool run (int dims, size_t globalsize[], size_t localsize[], bool sync, const Queue &q=Queue())
 Run the OpenCL kernel. [詳解]
 
bool runTask (bool sync, const Queue &q=Queue())
 
int64 runProfiling (int dims, size_t globalsize[], size_t localsize[], const Queue &q=Queue())
 Similar to synchronized run() call with returning of kernel execution time Separate OpenCL command queue may be used (with CL_QUEUE_PROFILING_ENABLE) [詳解]
 
size_t workGroupSize () const
 
size_t preferedWorkGroupSizeMultiple () const
 
bool compileWorkGroupSize (size_t wsz[]) const
 
size_t localMemSize () const
 
void * ptr () const
 

限定公開メンバ関数

template<typename _Tp0 >
int set_args_ (int i, const _Tp0 &a0)
 
template<typename _Tp0 , typename... _Tps>
int set_args_ (int i, const _Tp0 &a0, const _Tps &... rest_args)
 

限定公開変数類

Impl * p
 

関数詳解

◆ args()

template<typename... _Tps>
Kernel & cv::ocl::Kernel::args ( const _Tps &...  kernel_args)
inline

Setup OpenCL Kernel arguments. Avoid direct using of set(i, ...) methods.

bool ok = kernel
.args(
srcUMat, dstUMat,
(float)some_float_param
).run(ndims, globalSize, localSize);
if (!ok) return false;

◆ run()

bool cv::ocl::Kernel::run ( int  dims,
size_t  globalsize[],
size_t  localsize[],
bool  sync,
const Queue q = Queue() 
)

Run the OpenCL kernel.

引数
dimsthe work problem dimensions. It is the length of globalsize and localsize. It can be either 1, 2 or 3.
globalsizework items for each dimension. It is not the final globalsize passed to OpenCL. Each dimension will be adjusted to the nearest integer divisible by the corresponding value in localsize. If localsize is NULL, it will still be adjusted depending on dims. The adjusted values are greater than or equal to the original values.
localsizework-group size for each dimension.
syncspecify whether to wait for OpenCL computation to finish before return.
qcommand queue

◆ runProfiling()

int64 cv::ocl::Kernel::runProfiling ( int  dims,
size_t  globalsize[],
size_t  localsize[],
const Queue q = Queue() 
)

Similar to synchronized run() call with returning of kernel execution time Separate OpenCL command queue may be used (with CL_QUEUE_PROFILING_ENABLE)

戻り値
Execution time in nanoseconds or negative number on error

このクラス詳解は次のファイルから抽出されました: