OpenCV 4.5.3(日本語機械翻訳)
公開メンバ関数 | 限定公開メンバ関数 | 限定公開変数類 | 全メンバ一覧
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)
Kernel & operator= (const Kernel &k)
Kernel (Kernel &&k) CV_NOEXCEPT
Kernel & operator= (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>
Kernel & args (const _Tps &... kernel_args)
OpenCL のセットアップKernel引数を使用します。set(i, ...)メソッドの直接使用は避けてください。[【詳解】(英語]
bool run (int dims, size_t globalsize[], size_t localsize[], bool sync, const Queue &q=Queue())
OpenCLカーネルを実行する。[【詳解】(英語]
bool runTask (bool sync, const Queue &q=Queue())
int64 runProfiling (int dims, size_t globalsize[], size_t localsize[], const Queue &q=Queue())
同期呼び出しと同様にrun()呼び出しと同様に、カーネルの実行時間を返します 別のOpenCLコマンド・キューを使用することもできます(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

OpenCL のセットアップKernel引数を使用します。set(i, ...)メソッドの直接使用は避けてください。

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

OpenCLカーネルを実行する。

引数
dims 作業問題の寸法を指定します。globalsizeとlocalsizeの長さです。1、2、3のいずれかです。
globalsize 各次元の作業項目。OpenCLに渡される最終的なglobalizeではありません。各次元は、localsizeの対応する値で割り切れる最も近い整数に調整されます。localsizeがNULLの場合は、dimsに応じて調整されます。調整された値は、元の値と同じかそれ以上になります。
localsize 各次元のワークグループのサイズを指定します。
sync OpenCL の計算が終了するのを待ってから戻るかどうかを指定します。
q コマンドキュー

runProfiling()

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

同期呼び出しと同様にrun()呼び出しと同様に、カーネルの実行時間を返します 別のOpenCLコマンド・キューを使用することもできます(CL_QUEUE_PROFILING_ENABLEを使用)。

戻り値
実行時間の単位はナノ秒、エラー時は負の数

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