#include <opencv2/core/ocl.hpp>
|
| Kernel () CV_NOEXCEPT |
|
| 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) |
|
| Kernel (Kernel &&k) CV_NOEXCEPT |
|
| ~Kernel () |
|
template<typename... _Tps> |
Kernel & | args (const _Tps &... kernel_args) |
| Setup OpenCL Kernel arguments. Avoid direct using of set(i, ...) methods.
|
|
bool | compileWorkGroupSize (size_t wsz[]) const |
|
bool | create (const char *kname, const Program &prog) |
|
bool | create (const char *kname, const ProgramSource &prog, const String &buildopts, String *errmsg=0) |
|
bool | empty () const |
|
size_t | localMemSize () const |
|
Kernel & | operator= (const Kernel &k) |
|
Kernel & | operator= (Kernel &&k) CV_NOEXCEPT |
|
size_t | preferedWorkGroupSizeMultiple () const |
|
void * | ptr () const |
|
bool | run (int dims, size_t globalsize[], size_t localsize[], bool sync, const Queue &q=Queue()) |
| Run the OpenCL kernel (globalsize value may be adjusted)
|
|
bool | run_ (int dims, size_t globalsize[], size_t localsize[], bool sync, const Queue &q=Queue()) |
| Run the OpenCL kernel.
|
|
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.
|
|
bool | runTask (bool sync, const Queue &q=Queue()) |
|
template<typename _Tp > |
int | set (int i, const _Tp &value) |
|
int | set (int i, const Image2D &image2D) |
|
int | set (int i, const KernelArg &arg) |
|
int | set (int i, const UMat &m) |
|
int | set (int i, const void *value, size_t sz) |
|
size_t | workGroupSize () 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) |
|
◆ Kernel() [1/5]
cv::ocl::Kernel::Kernel |
( |
| ) |
|
◆ Kernel() [2/5]
cv::ocl::Kernel::Kernel |
( |
const char * | kname, |
|
|
const Program & | prog ) |
◆ Kernel() [3/5]
◆ ~Kernel()
cv::ocl::Kernel::~Kernel |
( |
| ) |
|
◆ Kernel() [4/5]
cv::ocl::Kernel::Kernel |
( |
const Kernel & | k | ) |
|
◆ Kernel() [5/5]
cv::ocl::Kernel::Kernel |
( |
Kernel && | k | ) |
|
◆ 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;
◆ compileWorkGroupSize()
bool cv::ocl::Kernel::compileWorkGroupSize |
( |
size_t | wsz[] | ) |
const |
◆ create() [1/2]
bool cv::ocl::Kernel::create |
( |
const char * | kname, |
|
|
const Program & | prog ) |
◆ create() [2/2]
bool cv::ocl::Kernel::create |
( |
const char * | kname, |
|
|
const ProgramSource & | prog, |
|
|
const String & | buildopts, |
|
|
String * | errmsg = 0 ) |
◆ empty()
bool cv::ocl::Kernel::empty |
( |
| ) |
const |
◆ localMemSize()
size_t cv::ocl::Kernel::localMemSize |
( |
| ) |
const |
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ preferedWorkGroupSizeMultiple()
size_t cv::ocl::Kernel::preferedWorkGroupSizeMultiple |
( |
| ) |
const |
◆ ptr()
void * cv::ocl::Kernel::ptr |
( |
| ) |
const |
◆ run()
bool cv::ocl::Kernel::run |
( |
int | dims, |
|
|
size_t | globalsize[], |
|
|
size_t | localsize[], |
|
|
bool | sync, |
|
|
const Queue & | q = Queue() ) |
Run the OpenCL kernel (globalsize value may be adjusted)
- Parameters
-
dims | the work problem dimensions. It is the length of globalsize and localsize. It can be either 1, 2 or 3. |
globalsize | work 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. |
localsize | work-group size for each dimension. |
sync | specify whether to wait for OpenCL computation to finish before return. |
q | command queue |
- Note
- Use run_() if your kernel code doesn't support adjusted globalsize.
◆ run_()
bool cv::ocl::Kernel::run_ |
( |
int | dims, |
|
|
size_t | globalsize[], |
|
|
size_t | localsize[], |
|
|
bool | sync, |
|
|
const Queue & | q = Queue() ) |
Run the OpenCL kernel.
- Parameters
-
dims | the work problem dimensions. It is the length of globalsize and localsize. It can be either 1, 2 or 3. |
globalsize | work items for each dimension. This value is passed to OpenCL without changes. |
localsize | work-group size for each dimension. |
sync | specify whether to wait for OpenCL computation to finish before return. |
q | command 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)
- Returns
- Execution time in nanoseconds or negative number on error
◆ runTask()
bool cv::ocl::Kernel::runTask |
( |
bool | sync, |
|
|
const Queue & | q = Queue() ) |
◆ set() [1/5]
int cv::ocl::Kernel::set |
( |
int | i, |
|
|
const _Tp & | value ) |
|
inline |
◆ set() [2/5]
int cv::ocl::Kernel::set |
( |
int | i, |
|
|
const Image2D & | image2D ) |
◆ set() [3/5]
int cv::ocl::Kernel::set |
( |
int | i, |
|
|
const KernelArg & | arg ) |
◆ set() [4/5]
int cv::ocl::Kernel::set |
( |
int | i, |
|
|
const UMat & | m ) |
◆ set() [5/5]
int cv::ocl::Kernel::set |
( |
int | i, |
|
|
const void * | value, |
|
|
size_t | sz ) |
◆ set_args_() [1/2]
template<typename _Tp0 >
int cv::ocl::Kernel::set_args_ |
( |
int | i, |
|
|
const _Tp0 & | a0 ) |
|
inlineprotected |
◆ set_args_() [2/2]
template<typename _Tp0 , typename... _Tps>
int cv::ocl::Kernel::set_args_ |
( |
int | i, |
|
|
const _Tp0 & | a0, |
|
|
const _Tps &... | rest_args ) |
|
inlineprotected |
◆ workGroupSize()
size_t cv::ocl::Kernel::workGroupSize |
( |
| ) |
const |
The documentation for this class was generated from the following file: