All modules (except ocl and gpu) compiles and pass tests
This commit is contained in:
@@ -103,7 +103,7 @@ namespace cv
|
||||
~Info();
|
||||
void release();
|
||||
Info &operator = (const Info &m);
|
||||
std::vector<std::string> DeviceName;
|
||||
std::vector<cv::String> DeviceName;
|
||||
};
|
||||
//////////////////////////////// Initialization & Info ////////////////////////
|
||||
//this function may be obsoleted
|
||||
@@ -161,7 +161,7 @@ namespace cv
|
||||
|
||||
//! Calls a kernel, by string. Pass globalThreads = NULL, and cleanUp = true, to finally clean-up without executing.
|
||||
CV_EXPORTS double openCLExecuteKernelInterop(Context *clCxt ,
|
||||
const char **source, std::string kernelName,
|
||||
const char **source, cv::String kernelName,
|
||||
size_t globalThreads[3], size_t localThreads[3],
|
||||
std::vector< std::pair<size_t, const void *> > &args,
|
||||
int channels, int depth, const char *build_options,
|
||||
@@ -170,7 +170,7 @@ namespace cv
|
||||
|
||||
//! Calls a kernel, by file. Pass globalThreads = NULL, and cleanUp = true, to finally clean-up without executing.
|
||||
CV_EXPORTS double openCLExecuteKernelInterop(Context *clCxt ,
|
||||
const char **fileName, const int numFiles, std::string kernelName,
|
||||
const char **fileName, const int numFiles, cv::String kernelName,
|
||||
size_t globalThreads[3], size_t localThreads[3],
|
||||
std::vector< std::pair<size_t, const void *> > &args,
|
||||
int channels, int depth, const char *build_options,
|
||||
|
@@ -79,18 +79,18 @@ namespace cv
|
||||
cl_mem CV_EXPORTS openCLCreateBuffer(Context *clCxt, size_t flag, size_t size);
|
||||
void CV_EXPORTS openCLReadBuffer(Context *clCxt, cl_mem dst_buffer, void *host_buffer, size_t size);
|
||||
cl_kernel CV_EXPORTS openCLGetKernelFromSource(const Context *clCxt,
|
||||
const char **source, std::string kernelName);
|
||||
const char **source, cv::String kernelName);
|
||||
cl_kernel CV_EXPORTS openCLGetKernelFromSource(const Context *clCxt,
|
||||
const char **source, std::string kernelName, const char *build_options);
|
||||
const char **source, cv::String kernelName, const char *build_options);
|
||||
void CV_EXPORTS openCLVerifyKernel(const Context *clCxt, cl_kernel kernel, size_t *localThreads);
|
||||
void CV_EXPORTS openCLExecuteKernel(Context *clCxt , const char **source, std::string kernelName, std::vector< std::pair<size_t, const void *> > &args,
|
||||
void CV_EXPORTS openCLExecuteKernel(Context *clCxt , const char **source, cv::String kernelName, std::vector< std::pair<size_t, const void *> > &args,
|
||||
int globalcols , int globalrows, size_t blockSize = 16, int kernel_expand_depth = -1, int kernel_expand_channel = -1);
|
||||
void CV_EXPORTS openCLExecuteKernel_(Context *clCxt , const char **source, std::string kernelName,
|
||||
void CV_EXPORTS openCLExecuteKernel_(Context *clCxt , const char **source, cv::String kernelName,
|
||||
size_t globalThreads[3], size_t localThreads[3],
|
||||
std::vector< std::pair<size_t, const void *> > &args, int channels, int depth, const char *build_options);
|
||||
void CV_EXPORTS openCLExecuteKernel(Context *clCxt , const char **source, std::string kernelName, size_t globalThreads[3],
|
||||
void CV_EXPORTS openCLExecuteKernel(Context *clCxt , const char **source, cv::String kernelName, size_t globalThreads[3],
|
||||
size_t localThreads[3], std::vector< std::pair<size_t, const void *> > &args, int channels, int depth);
|
||||
void CV_EXPORTS openCLExecuteKernel(Context *clCxt , const char **source, std::string kernelName, size_t globalThreads[3],
|
||||
void CV_EXPORTS openCLExecuteKernel(Context *clCxt , const char **source, cv::String kernelName, size_t globalThreads[3],
|
||||
size_t localThreads[3], std::vector< std::pair<size_t, const void *> > &args, int channels,
|
||||
int depth, const char *build_options);
|
||||
|
||||
@@ -108,9 +108,9 @@ namespace cv
|
||||
DISABLE
|
||||
};
|
||||
|
||||
void CV_EXPORTS openCLExecuteKernel2(Context *clCxt , const char **source, std::string kernelName, size_t globalThreads[3],
|
||||
void CV_EXPORTS openCLExecuteKernel2(Context *clCxt , const char **source, cv::String kernelName, size_t globalThreads[3],
|
||||
size_t localThreads[3], std::vector< std::pair<size_t, const void *> > &args, int channels, int depth, FLUSH_MODE finish_mode = DISABLE);
|
||||
void CV_EXPORTS openCLExecuteKernel2(Context *clCxt , const char **source, std::string kernelName, size_t globalThreads[3],
|
||||
void CV_EXPORTS openCLExecuteKernel2(Context *clCxt , const char **source, cv::String kernelName, size_t globalThreads[3],
|
||||
size_t localThreads[3], std::vector< std::pair<size_t, const void *> > &args, int channels,
|
||||
int depth, char *build_options, FLUSH_MODE finish_mode = DISABLE);
|
||||
// bind oclMat to OpenCL image textures
|
||||
|
@@ -129,7 +129,7 @@ inline int divUp(int total, int grain)
|
||||
/////////////////////// add subtract multiply divide /////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
template<typename T>
|
||||
void arithmetic_run(const oclMat &src1, const oclMat &src2, oclMat &dst, std::string kernelName, const char **kernelString, void *_scalar)
|
||||
void arithmetic_run(const oclMat &src1, const oclMat &src2, oclMat &dst, cv::String kernelName, const char **kernelString, void *_scalar)
|
||||
{
|
||||
if(!src1.clCxt->supportsFeature(Context::CL_DOUBLE) && src1.type() == CV_64F)
|
||||
{
|
||||
@@ -188,11 +188,11 @@ void arithmetic_run(const oclMat &src1, const oclMat &src2, oclMat &dst, std::st
|
||||
|
||||
openCLExecuteKernel(clCxt, kernelString, kernelName, globalThreads, localThreads, args, -1, depth);
|
||||
}
|
||||
static void arithmetic_run(const oclMat &src1, const oclMat &src2, oclMat &dst, std::string kernelName, const char **kernelString)
|
||||
static void arithmetic_run(const oclMat &src1, const oclMat &src2, oclMat &dst, cv::String kernelName, const char **kernelString)
|
||||
{
|
||||
arithmetic_run<char>(src1, src2, dst, kernelName, kernelString, (void *)NULL);
|
||||
}
|
||||
static void arithmetic_run(const oclMat &src1, const oclMat &src2, oclMat &dst, const oclMat &mask, std::string kernelName, const char **kernelString)
|
||||
static void arithmetic_run(const oclMat &src1, const oclMat &src2, oclMat &dst, const oclMat &mask, cv::String kernelName, const char **kernelString)
|
||||
{
|
||||
if(!src1.clCxt->supportsFeature(Context::CL_DOUBLE) && src1.type() == CV_64F)
|
||||
{
|
||||
@@ -266,7 +266,7 @@ void cv::ocl::subtract(const oclMat &src1, const oclMat &src2, oclMat &dst, cons
|
||||
{
|
||||
arithmetic_run(src1, src2, dst, mask, "arithm_sub_with_mask", &arithm_sub);
|
||||
}
|
||||
typedef void (*MulDivFunc)(const oclMat &src1, const oclMat &src2, oclMat &dst, std::string kernelName,
|
||||
typedef void (*MulDivFunc)(const oclMat &src1, const oclMat &src2, oclMat &dst, cv::String kernelName,
|
||||
const char **kernelString, void *scalar);
|
||||
|
||||
void cv::ocl::multiply(const oclMat &src1, const oclMat &src2, oclMat &dst, double scalar)
|
||||
@@ -286,7 +286,7 @@ void cv::ocl::divide(const oclMat &src1, const oclMat &src2, oclMat &dst, double
|
||||
|
||||
}
|
||||
template <typename WT , typename CL_WT>
|
||||
void arithmetic_scalar_run(const oclMat &src1, const Scalar &src2, oclMat &dst, const oclMat &mask, std::string kernelName, const char **kernelString, int isMatSubScalar)
|
||||
void arithmetic_scalar_run(const oclMat &src1, const Scalar &src2, oclMat &dst, const oclMat &mask, cv::String kernelName, const char **kernelString, int isMatSubScalar)
|
||||
{
|
||||
if(!src1.clCxt->supportsFeature(Context::CL_DOUBLE) && src1.type() == CV_64F)
|
||||
{
|
||||
@@ -358,7 +358,7 @@ void arithmetic_scalar_run(const oclMat &src1, const Scalar &src2, oclMat &dst,
|
||||
openCLExecuteKernel(clCxt, kernelString, kernelName, globalThreads, localThreads, args, channels, depth);
|
||||
}
|
||||
|
||||
static void arithmetic_scalar_run(const oclMat &src, oclMat &dst, std::string kernelName, const char **kernelString, double scalar)
|
||||
static void arithmetic_scalar_run(const oclMat &src, oclMat &dst, cv::String kernelName, const char **kernelString, double scalar)
|
||||
{
|
||||
if(!src.clCxt->supportsFeature(Context::CL_DOUBLE) && src.type() == CV_64F)
|
||||
{
|
||||
@@ -415,10 +415,10 @@ static void arithmetic_scalar_run(const oclMat &src, oclMat &dst, std::string ke
|
||||
openCLExecuteKernel(clCxt, kernelString, kernelName, globalThreads, localThreads, args, -1, depth);
|
||||
}
|
||||
|
||||
typedef void (*ArithmeticFuncS)(const oclMat &src1, const Scalar &src2, oclMat &dst, const oclMat &mask, std::string kernelName, const char **kernelString, int isMatSubScalar);
|
||||
typedef void (*ArithmeticFuncS)(const oclMat &src1, const Scalar &src2, oclMat &dst, const oclMat &mask, cv::String kernelName, const char **kernelString, int isMatSubScalar);
|
||||
|
||||
|
||||
static void arithmetic_scalar(const oclMat &src1, const Scalar &src2, oclMat &dst, const oclMat &mask, std::string kernelName, const char **kernelString, int isMatSubScalar)
|
||||
static void arithmetic_scalar(const oclMat &src1, const Scalar &src2, oclMat &dst, const oclMat &mask, cv::String kernelName, const char **kernelString, int isMatSubScalar)
|
||||
{
|
||||
static ArithmeticFuncS tab[8] =
|
||||
{
|
||||
@@ -436,14 +436,14 @@ static void arithmetic_scalar(const oclMat &src1, const Scalar &src2, oclMat &ds
|
||||
cv::ocl::error("Unsupported arithmetic operation", __FILE__, __LINE__);
|
||||
func(src1, src2, dst, mask, kernelName, kernelString, isMatSubScalar);
|
||||
}
|
||||
static void arithmetic_scalar(const oclMat &src1, const Scalar &src2, oclMat &dst, const oclMat &mask, std::string kernelName, const char **kernelString)
|
||||
static void arithmetic_scalar(const oclMat &src1, const Scalar &src2, oclMat &dst, const oclMat &mask, cv::String kernelName, const char **kernelString)
|
||||
{
|
||||
arithmetic_scalar(src1, src2, dst, mask, kernelName, kernelString, 0);
|
||||
}
|
||||
|
||||
void cv::ocl::add(const oclMat &src1, const Scalar &src2, oclMat &dst, const oclMat &mask)
|
||||
{
|
||||
std::string kernelName = mask.data ? "arithm_s_add_with_mask" : "arithm_s_add";
|
||||
cv::String kernelName = mask.data ? "arithm_s_add_with_mask" : "arithm_s_add";
|
||||
const char **kernelString = mask.data ? &arithm_add_scalar_mask : &arithm_add_scalar;
|
||||
|
||||
arithmetic_scalar( src1, src2, dst, mask, kernelName, kernelString);
|
||||
@@ -451,13 +451,13 @@ void cv::ocl::add(const oclMat &src1, const Scalar &src2, oclMat &dst, const ocl
|
||||
|
||||
void cv::ocl::subtract(const oclMat &src1, const Scalar &src2, oclMat &dst, const oclMat &mask)
|
||||
{
|
||||
std::string kernelName = mask.data ? "arithm_s_sub_with_mask" : "arithm_s_sub";
|
||||
cv::String kernelName = mask.data ? "arithm_s_sub_with_mask" : "arithm_s_sub";
|
||||
const char **kernelString = mask.data ? &arithm_sub_scalar_mask : &arithm_sub_scalar;
|
||||
arithmetic_scalar( src1, src2, dst, mask, kernelName, kernelString, 1);
|
||||
}
|
||||
void cv::ocl::subtract(const Scalar &src2, const oclMat &src1, oclMat &dst, const oclMat &mask)
|
||||
{
|
||||
std::string kernelName = mask.data ? "arithm_s_sub_with_mask" : "arithm_s_sub";
|
||||
cv::String kernelName = mask.data ? "arithm_s_sub_with_mask" : "arithm_s_sub";
|
||||
const char **kernelString = mask.data ? &arithm_sub_scalar_mask : &arithm_sub_scalar;
|
||||
arithmetic_scalar( src1, src2, dst, mask, kernelName, kernelString, -1);
|
||||
}
|
||||
@@ -469,7 +469,7 @@ void cv::ocl::divide(double scalar, const oclMat &src, oclMat &dst)
|
||||
return;
|
||||
}
|
||||
|
||||
std::string kernelName = "arithm_s_div";
|
||||
cv::String kernelName = "arithm_s_div";
|
||||
arithmetic_scalar_run(src, dst, kernelName, &arithm_div, scalar);
|
||||
}
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
@@ -481,14 +481,14 @@ void cv::ocl::absdiff(const oclMat &src1, const oclMat &src2, oclMat &dst)
|
||||
}
|
||||
void cv::ocl::absdiff(const oclMat &src1, const Scalar &src2, oclMat &dst)
|
||||
{
|
||||
std::string kernelName = "arithm_s_absdiff";
|
||||
cv::String kernelName = "arithm_s_absdiff";
|
||||
oclMat mask;
|
||||
arithmetic_scalar( src1, src2, dst, mask, kernelName, &arithm_absdiff);
|
||||
}
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
///////////////////////////////// compare ///////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
static void compare_run(const oclMat &src1, const oclMat &src2, oclMat &dst, std::string kernelName, const char **kernelString)
|
||||
static void compare_run(const oclMat &src1, const oclMat &src2, oclMat &dst, cv::String kernelName, const char **kernelString)
|
||||
{
|
||||
dst.create(src1.size(), CV_8UC1);
|
||||
CV_Assert(src1.oclchannels() == 1);
|
||||
@@ -528,7 +528,7 @@ void cv::ocl::compare(const oclMat &src1, const oclMat &src2, oclMat &dst , int
|
||||
std::cout << "Selected device do not support double" << std::endl;
|
||||
return;
|
||||
}
|
||||
std::string kernelName;
|
||||
cv::String kernelName;
|
||||
const char **kernelString = NULL;
|
||||
switch( cmpOp )
|
||||
{
|
||||
@@ -700,7 +700,7 @@ void cv::ocl::meanStdDev(const oclMat &src, Scalar &mean, Scalar &stddev)
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////// minMax /////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
static void arithmetic_minMax_run(const oclMat &src, const oclMat &mask, cl_mem &dst, int vlen , int groupnum, std::string kernelName)
|
||||
static void arithmetic_minMax_run(const oclMat &src, const oclMat &mask, cl_mem &dst, int vlen , int groupnum, cv::String kernelName)
|
||||
{
|
||||
std::vector<std::pair<size_t , const void *> > args;
|
||||
int all_cols = src.step / (vlen * src.elemSize1());
|
||||
@@ -737,7 +737,7 @@ static void arithmetic_minMax_run(const oclMat &src, const oclMat &mask, cl_mem
|
||||
}
|
||||
|
||||
|
||||
static void arithmetic_minMax_mask_run(const oclMat &src, const oclMat &mask, cl_mem &dst, int vlen, int groupnum, std::string kernelName)
|
||||
static void arithmetic_minMax_mask_run(const oclMat &src, const oclMat &mask, cl_mem &dst, int vlen, int groupnum, cv::String kernelName)
|
||||
{
|
||||
std::vector<std::pair<size_t , const void *> > args;
|
||||
size_t gt[3] = {groupnum * 256, 1, 1}, lt[3] = {256, 1, 1};
|
||||
@@ -891,7 +891,7 @@ double cv::ocl::norm(const oclMat &src1, const oclMat &src2, int normType)
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
////////////////////////////////// flip //////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
static void arithmetic_flip_rows_run(const oclMat &src, oclMat &dst, std::string kernelName)
|
||||
static void arithmetic_flip_rows_run(const oclMat &src, oclMat &dst, cv::String kernelName)
|
||||
{
|
||||
if(!src.clCxt->supportsFeature(Context::CL_DOUBLE) && src.type() == CV_64F)
|
||||
{
|
||||
@@ -940,7 +940,7 @@ static void arithmetic_flip_rows_run(const oclMat &src, oclMat &dst, std::string
|
||||
|
||||
openCLExecuteKernel(clCxt, &arithm_flip, kernelName, globalThreads, localThreads, args, -1, depth);
|
||||
}
|
||||
static void arithmetic_flip_cols_run(const oclMat &src, oclMat &dst, std::string kernelName, bool isVertical)
|
||||
static void arithmetic_flip_cols_run(const oclMat &src, oclMat &dst, cv::String kernelName, bool isVertical)
|
||||
{
|
||||
if(!src.clCxt->supportsFeature(Context::CL_DOUBLE) && src.type() == CV_64F)
|
||||
{
|
||||
@@ -1011,7 +1011,7 @@ void cv::ocl::flip(const oclMat &src, oclMat &dst, int flipCode)
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
////////////////////////////////// LUT //////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
static void arithmetic_lut_run(const oclMat &src1, const oclMat &src2, oclMat &dst, std::string kernelName)
|
||||
static void arithmetic_lut_run(const oclMat &src1, const oclMat &src2, oclMat &dst, cv::String kernelName)
|
||||
{
|
||||
Context *clCxt = src1.clCxt;
|
||||
int channels = src1.oclchannels();
|
||||
@@ -1105,14 +1105,14 @@ void cv::ocl::LUT(const oclMat &src, const oclMat &lut, oclMat &dst)
|
||||
CV_Assert((lut.oclchannels() == 1 || lut.oclchannels() == cn) && lut.rows == 1 && lut.cols == 256);
|
||||
dst.create(src.size(), CV_MAKETYPE(lut.depth(), cn));
|
||||
//oclMat _lut(lut);
|
||||
std::string kernelName = "LUT";
|
||||
cv::String kernelName = "LUT";
|
||||
arithmetic_lut_run(src, lut, dst, kernelName);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////// exp log /////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
static void arithmetic_exp_log_run(const oclMat &src, oclMat &dst, std::string kernelName, const char **kernelString)
|
||||
static void arithmetic_exp_log_run(const oclMat &src, oclMat &dst, cv::String kernelName, const char **kernelString)
|
||||
{
|
||||
dst.create(src.size(), src.type());
|
||||
CV_Assert(src.cols == dst.cols &&
|
||||
@@ -1161,7 +1161,7 @@ void cv::ocl::log(const oclMat &src, oclMat &dst)
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
////////////////////////////// magnitude phase ///////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
static void arithmetic_magnitude_phase_run(const oclMat &src1, const oclMat &src2, oclMat &dst, std::string kernelName)
|
||||
static void arithmetic_magnitude_phase_run(const oclMat &src1, const oclMat &src2, oclMat &dst, cv::String kernelName)
|
||||
{
|
||||
if(!src1.clCxt->supportsFeature(Context::CL_DOUBLE) && src1.type() == CV_64F)
|
||||
{
|
||||
@@ -1209,7 +1209,7 @@ void cv::ocl::magnitude(const oclMat &src1, const oclMat &src2, oclMat &dst)
|
||||
arithmetic_magnitude_phase_run(src1, src2, dst, "arithm_magnitude");
|
||||
}
|
||||
|
||||
static void arithmetic_phase_run(const oclMat &src1, const oclMat &src2, oclMat &dst, std::string kernelName, const char **kernelString)
|
||||
static void arithmetic_phase_run(const oclMat &src1, const oclMat &src2, oclMat &dst, cv::String kernelName, const char **kernelString)
|
||||
{
|
||||
if(!src1.clCxt->supportsFeature(Context::CL_DOUBLE) && src1.type() == CV_64F)
|
||||
{
|
||||
@@ -1256,7 +1256,7 @@ void cv::ocl::phase(const oclMat &x, const oclMat &y, oclMat &Angle , bool angle
|
||||
{
|
||||
CV_Assert(x.type() == y.type() && x.size() == y.size() && (x.depth() == CV_32F || x.depth() == CV_64F));
|
||||
Angle.create(x.size(), x.type());
|
||||
std::string kernelName = angleInDegrees ? "arithm_phase_indegrees" : "arithm_phase_inradians";
|
||||
cv::String kernelName = angleInDegrees ? "arithm_phase_indegrees" : "arithm_phase_inradians";
|
||||
if(angleInDegrees)
|
||||
{
|
||||
arithmetic_phase_run(x, y, Angle, kernelName, &arithm_phase);
|
||||
@@ -1273,7 +1273,7 @@ void cv::ocl::phase(const oclMat &x, const oclMat &y, oclMat &Angle , bool angle
|
||||
////////////////////////////////// cartToPolar ///////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
static void arithmetic_cartToPolar_run(const oclMat &src1, const oclMat &src2, oclMat &dst_mag, oclMat &dst_cart,
|
||||
std::string kernelName, bool angleInDegrees)
|
||||
cv::String kernelName, bool angleInDegrees)
|
||||
{
|
||||
if(!src1.clCxt->supportsFeature(Context::CL_DOUBLE) && src1.type() == CV_64F)
|
||||
{
|
||||
@@ -1328,7 +1328,7 @@ void cv::ocl::cartToPolar(const oclMat &x, const oclMat &y, oclMat &mag, oclMat
|
||||
////////////////////////////////// polarToCart ///////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
static void arithmetic_ptc_run(const oclMat &src1, const oclMat &src2, oclMat &dst1, oclMat &dst2, bool angleInDegrees,
|
||||
std::string kernelName)
|
||||
cv::String kernelName)
|
||||
{
|
||||
if(!src1.clCxt->supportsFeature(Context::CL_DOUBLE) && src1.type() == CV_64F)
|
||||
{
|
||||
@@ -1530,7 +1530,7 @@ void cv::ocl::minMaxLoc(const oclMat &src, double *minVal, double *maxVal,
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
///////////////////////////// countNonZero ///////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
static void arithmetic_countNonZero_run(const oclMat &src, cl_mem &dst, int vlen , int groupnum, std::string kernelName)
|
||||
static void arithmetic_countNonZero_run(const oclMat &src, cl_mem &dst, int vlen , int groupnum, cv::String kernelName)
|
||||
{
|
||||
std::vector<std::pair<size_t , const void *> > args;
|
||||
int all_cols = src.step / (vlen * src.elemSize1());
|
||||
@@ -1568,7 +1568,7 @@ int cv::ocl::countNonZero(const oclMat &src)
|
||||
int vlen = 8 , dbsize = groupnum * vlen;
|
||||
//cl_ulong start, end;
|
||||
Context *clCxt = src.clCxt;
|
||||
std::string kernelName = "arithm_op_nonzero";
|
||||
cv::String kernelName = "arithm_op_nonzero";
|
||||
int *p = new int[dbsize], nonzero = 0;
|
||||
cl_mem dstBuffer = openCLCreateBuffer(clCxt, CL_MEM_WRITE_ONLY, dbsize * sizeof(int));
|
||||
arithmetic_countNonZero_run(src, dstBuffer, vlen, groupnum, kernelName);
|
||||
@@ -1587,7 +1587,7 @@ int cv::ocl::countNonZero(const oclMat &src)
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
////////////////////////////////bitwise_op////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
static void bitwise_run(const oclMat &src1, oclMat &dst, std::string kernelName, const char **kernelString)
|
||||
static void bitwise_run(const oclMat &src1, oclMat &dst, cv::String kernelName, const char **kernelString)
|
||||
{
|
||||
dst.create(src1.size(), src1.type());
|
||||
|
||||
@@ -1629,7 +1629,7 @@ static void bitwise_run(const oclMat &src1, oclMat &dst, std::string kernelName,
|
||||
|
||||
|
||||
template<typename T>
|
||||
void bitwise_run(const oclMat &src1, const oclMat &src2, oclMat &dst, std::string kernelName, const char **kernelString, void *_scalar)
|
||||
void bitwise_run(const oclMat &src1, const oclMat &src2, oclMat &dst, cv::String kernelName, const char **kernelString, void *_scalar)
|
||||
{
|
||||
dst.create(src1.size(), src1.type());
|
||||
CV_Assert(src1.cols == src2.cols && src2.cols == dst.cols &&
|
||||
@@ -1681,11 +1681,11 @@ void bitwise_run(const oclMat &src1, const oclMat &src2, oclMat &dst, std::strin
|
||||
|
||||
openCLExecuteKernel(clCxt, kernelString, kernelName, globalThreads, localThreads, args, -1, depth);
|
||||
}
|
||||
static void bitwise_run(const oclMat &src1, const oclMat &src2, oclMat &dst, std::string kernelName, const char **kernelString)
|
||||
static void bitwise_run(const oclMat &src1, const oclMat &src2, oclMat &dst, cv::String kernelName, const char **kernelString)
|
||||
{
|
||||
bitwise_run<char>(src1, src2, dst, kernelName, kernelString, (void *)NULL);
|
||||
}
|
||||
static void bitwise_run(const oclMat &src1, const oclMat &src2, oclMat &dst, const oclMat &mask, std::string kernelName, const char **kernelString)
|
||||
static void bitwise_run(const oclMat &src1, const oclMat &src2, oclMat &dst, const oclMat &mask, cv::String kernelName, const char **kernelString)
|
||||
{
|
||||
dst.create(src1.size(), src1.type());
|
||||
CV_Assert(src1.cols == src2.cols && src2.cols == dst.cols &&
|
||||
@@ -1738,7 +1738,7 @@ static void bitwise_run(const oclMat &src1, const oclMat &src2, oclMat &dst, con
|
||||
|
||||
|
||||
template <typename WT , typename CL_WT>
|
||||
void bitwise_scalar_run(const oclMat &src1, const Scalar &src2, oclMat &dst, const oclMat &mask, std::string kernelName, const char **kernelString, int isMatSubScalar)
|
||||
void bitwise_scalar_run(const oclMat &src1, const Scalar &src2, oclMat &dst, const oclMat &mask, cv::String kernelName, const char **kernelString, int isMatSubScalar)
|
||||
{
|
||||
dst.create(src1.size(), src1.type());
|
||||
|
||||
@@ -1804,10 +1804,10 @@ void bitwise_scalar_run(const oclMat &src1, const Scalar &src2, oclMat &dst, con
|
||||
}
|
||||
|
||||
|
||||
typedef void (*BitwiseFuncS)(const oclMat &src1, const Scalar &src2, oclMat &dst, const oclMat &mask, std::string kernelName, const char **kernelString, int isMatSubScalar);
|
||||
typedef void (*BitwiseFuncS)(const oclMat &src1, const Scalar &src2, oclMat &dst, const oclMat &mask, cv::String kernelName, const char **kernelString, int isMatSubScalar);
|
||||
|
||||
|
||||
static void bitwise_scalar(const oclMat &src1, const Scalar &src2, oclMat &dst, const oclMat &mask, std::string kernelName, const char **kernelString, int isMatSubScalar)
|
||||
static void bitwise_scalar(const oclMat &src1, const Scalar &src2, oclMat &dst, const oclMat &mask, cv::String kernelName, const char **kernelString, int isMatSubScalar)
|
||||
{
|
||||
static BitwiseFuncS tab[8] =
|
||||
{
|
||||
@@ -1837,7 +1837,7 @@ static void bitwise_scalar(const oclMat &src1, const Scalar &src2, oclMat &dst,
|
||||
cv::ocl::error("Unsupported arithmetic operation", __FILE__, __LINE__);
|
||||
func(src1, src2, dst, mask, kernelName, kernelString, isMatSubScalar);
|
||||
}
|
||||
static void bitwise_scalar(const oclMat &src1, const Scalar &src2, oclMat &dst, const oclMat &mask, std::string kernelName, const char **kernelString)
|
||||
static void bitwise_scalar(const oclMat &src1, const Scalar &src2, oclMat &dst, const oclMat &mask, cv::String kernelName, const char **kernelString)
|
||||
{
|
||||
bitwise_scalar(src1, src2, dst, mask, kernelName, kernelString, 0);
|
||||
}
|
||||
@@ -1850,7 +1850,7 @@ void cv::ocl::bitwise_not(const oclMat &src, oclMat &dst)
|
||||
return;
|
||||
}
|
||||
dst.create(src.size(), src.type());
|
||||
std::string kernelName = "arithm_bitwise_not";
|
||||
cv::String kernelName = "arithm_bitwise_not";
|
||||
bitwise_run(src, dst, kernelName, &arithm_bitwise_not);
|
||||
}
|
||||
|
||||
@@ -1863,7 +1863,7 @@ void cv::ocl::bitwise_or(const oclMat &src1, const oclMat &src2, oclMat &dst, co
|
||||
return;
|
||||
}
|
||||
oclMat emptyMat;
|
||||
std::string kernelName = mask.empty() ? "arithm_bitwise_or" : "arithm_bitwise_or_with_mask";
|
||||
cv::String kernelName = mask.empty() ? "arithm_bitwise_or" : "arithm_bitwise_or_with_mask";
|
||||
if (mask.empty())
|
||||
bitwise_run(src1, src2, dst, kernelName, &arithm_bitwise_or);
|
||||
else
|
||||
@@ -1878,7 +1878,7 @@ void cv::ocl::bitwise_or(const oclMat &src1, const Scalar &src2, oclMat &dst, co
|
||||
std::cout << "Selected device do not support double" << std::endl;
|
||||
return;
|
||||
}
|
||||
std::string kernelName = mask.data ? "arithm_s_bitwise_or_with_mask" : "arithm_s_bitwise_or";
|
||||
cv::String kernelName = mask.data ? "arithm_s_bitwise_or_with_mask" : "arithm_s_bitwise_or";
|
||||
if (mask.data)
|
||||
bitwise_scalar( src1, src2, dst, mask, kernelName, &arithm_bitwise_or_scalar_mask);
|
||||
else
|
||||
@@ -1895,7 +1895,7 @@ void cv::ocl::bitwise_and(const oclMat &src1, const oclMat &src2, oclMat &dst, c
|
||||
}
|
||||
oclMat emptyMat;
|
||||
|
||||
std::string kernelName = mask.empty() ? "arithm_bitwise_and" : "arithm_bitwise_and_with_mask";
|
||||
cv::String kernelName = mask.empty() ? "arithm_bitwise_and" : "arithm_bitwise_and_with_mask";
|
||||
|
||||
if (mask.empty())
|
||||
bitwise_run(src1, src2, dst, kernelName, &arithm_bitwise_and);
|
||||
@@ -1910,7 +1910,7 @@ void cv::ocl::bitwise_and(const oclMat &src1, const Scalar &src2, oclMat &dst, c
|
||||
std::cout << "Selected device do not support double" << std::endl;
|
||||
return;
|
||||
}
|
||||
std::string kernelName = mask.data ? "arithm_s_bitwise_and_with_mask" : "arithm_s_bitwise_and";
|
||||
cv::String kernelName = mask.data ? "arithm_s_bitwise_and_with_mask" : "arithm_s_bitwise_and";
|
||||
if (mask.data)
|
||||
bitwise_scalar(src1, src2, dst, mask, kernelName, &arithm_bitwise_and_scalar_mask);
|
||||
else
|
||||
@@ -1925,7 +1925,7 @@ void cv::ocl::bitwise_xor(const oclMat &src1, const oclMat &src2, oclMat &dst, c
|
||||
return;
|
||||
}
|
||||
oclMat emptyMat;
|
||||
std::string kernelName = mask.empty() ? "arithm_bitwise_xor" : "arithm_bitwise_xor_with_mask";
|
||||
cv::String kernelName = mask.empty() ? "arithm_bitwise_xor" : "arithm_bitwise_xor_with_mask";
|
||||
|
||||
|
||||
if (mask.empty())
|
||||
@@ -1943,7 +1943,7 @@ void cv::ocl::bitwise_xor(const oclMat &src1, const Scalar &src2, oclMat &dst, c
|
||||
std::cout << "Selected device do not support double" << std::endl;
|
||||
return;
|
||||
}
|
||||
std::string kernelName = mask.data ? "arithm_s_bitwise_xor_with_mask" : "arithm_s_bitwise_xor";
|
||||
cv::String kernelName = mask.data ? "arithm_s_bitwise_xor_with_mask" : "arithm_s_bitwise_xor";
|
||||
if (mask.data)
|
||||
bitwise_scalar( src1, src2, dst, mask, kernelName, &arithm_bitwise_xor_scalar_mask);
|
||||
else
|
||||
@@ -2033,7 +2033,7 @@ oclMatExpr::operator oclMat() const
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
#define TILE_DIM (32)
|
||||
#define BLOCK_ROWS (256/TILE_DIM)
|
||||
static void transpose_run(const oclMat &src, oclMat &dst, std::string kernelName)
|
||||
static void transpose_run(const oclMat &src, oclMat &dst, cv::String kernelName)
|
||||
{
|
||||
if(!src.clCxt->supportsFeature(Context::CL_DOUBLE) && src.type() == CV_64F)
|
||||
{
|
||||
@@ -2250,7 +2250,7 @@ void cv::ocl::magnitudeSqr(const oclMat &src1, oclMat &dst)
|
||||
openCLExecuteKernel(clCxt, &arithm_magnitudeSqr, "magnitudeSqr", globalThreads, localThreads, args, 2, depth);
|
||||
}
|
||||
|
||||
static void arithmetic_pow_run(const oclMat &src1, double p, oclMat &dst, std::string kernelName, const char **kernelString)
|
||||
static void arithmetic_pow_run(const oclMat &src1, double p, oclMat &dst, cv::String kernelName, const char **kernelString)
|
||||
{
|
||||
CV_Assert(src1.cols == dst.cols && src1.rows == dst.rows);
|
||||
CV_Assert(src1.type() == dst.type());
|
||||
@@ -2301,7 +2301,7 @@ void cv::ocl::pow(const oclMat &x, double p, oclMat &y)
|
||||
|
||||
CV_Assert((x.type() == y.type() && x.size() == y.size() && x.depth() == CV_32F) || x.depth() == CV_64F);
|
||||
y.create(x.size(), x.type());
|
||||
std::string kernelName = "arithm_pow";
|
||||
cv::String kernelName = "arithm_pow";
|
||||
|
||||
arithmetic_pow_run(x, p, y, kernelName, &arithm_pow);
|
||||
}
|
||||
|
@@ -68,13 +68,13 @@ namespace cv
|
||||
}
|
||||
|
||||
//lookup the binary given the file name
|
||||
cl_program progLookup(std::string srcsign);
|
||||
cl_program progLookup(cv::String srcsign);
|
||||
|
||||
//add program to the cache
|
||||
void addProgram(std::string srcsign, cl_program program);
|
||||
void addProgram(cv::String srcsign, cl_program program);
|
||||
void releaseProgram();
|
||||
|
||||
std::map <std::string, cl_program> codeCache;
|
||||
std::map <cv::String, cl_program> codeCache;
|
||||
unsigned int cacheSize;
|
||||
//The presumed watermark for the cache volume (256MB). Is it enough?
|
||||
//We may need more delicate algorithms when necessary later.
|
||||
|
@@ -85,7 +85,7 @@ void cv::ocl::blendLinear(const oclMat &img1, const oclMat &img2, const oclMat &
|
||||
args.push_back( std::make_pair( sizeof(cl_int), (void *)&cols ));
|
||||
args.push_back( std::make_pair( sizeof(cl_int), (void *)&istep ));
|
||||
args.push_back( std::make_pair( sizeof(cl_int), (void *)&wstep ));
|
||||
std::string kernelName = "BlendLinear";
|
||||
cv::String kernelName = "BlendLinear";
|
||||
|
||||
openCLExecuteKernel(ctx, &blend_linear, kernelName, globalSize, localSize, args, channels, depth);
|
||||
}
|
||||
|
@@ -88,7 +88,7 @@ void matchUnrolledCached(const oclMat &query, const oclMat &train, const oclMat
|
||||
args.push_back( std::make_pair( sizeof(cl_int), (void *)&query.step ));
|
||||
args.push_back( std::make_pair( sizeof(cl_int), (void *)&distType ));
|
||||
|
||||
std::string kernelName = "BruteForceMatch_UnrollMatch";
|
||||
cv::String kernelName = "BruteForceMatch_UnrollMatch";
|
||||
|
||||
openCLExecuteKernel(ctx, &brute_force_match, kernelName, globalSize, localSize, args, -1, -1);
|
||||
}
|
||||
@@ -127,7 +127,7 @@ void match(const oclMat &query, const oclMat &train, const oclMat &/*mask*/,
|
||||
args.push_back( std::make_pair( sizeof(cl_int), (void *)&query.step ));
|
||||
args.push_back( std::make_pair( sizeof(cl_int), (void *)&distType ));
|
||||
|
||||
std::string kernelName = "BruteForceMatch_Match";
|
||||
cv::String kernelName = "BruteForceMatch_Match";
|
||||
|
||||
openCLExecuteKernel(ctx, &brute_force_match, kernelName, globalSize, localSize, args, -1, -1);
|
||||
}
|
||||
@@ -173,7 +173,7 @@ void matchUnrolledCached(const oclMat &query, const oclMat &train, float maxDist
|
||||
args.push_back( std::make_pair( sizeof(cl_int), (void *)&trainIdx.step ));
|
||||
args.push_back( std::make_pair( sizeof(cl_int), (void *)&distType ));
|
||||
|
||||
std::string kernelName = "BruteForceMatch_RadiusUnrollMatch";
|
||||
cv::String kernelName = "BruteForceMatch_RadiusUnrollMatch";
|
||||
|
||||
openCLExecuteKernel(ctx, &brute_force_match, kernelName, globalSize, localSize, args, -1, -1);
|
||||
}
|
||||
@@ -211,7 +211,7 @@ void radius_match(const oclMat &query, const oclMat &train, float maxDistance, c
|
||||
args.push_back( std::make_pair( sizeof(cl_int), (void *)&trainIdx.step ));
|
||||
args.push_back( std::make_pair( sizeof(cl_int), (void *)&distType ));
|
||||
|
||||
std::string kernelName = "BruteForceMatch_RadiusMatch";
|
||||
cv::String kernelName = "BruteForceMatch_RadiusMatch";
|
||||
|
||||
openCLExecuteKernel(ctx, &brute_force_match, kernelName, globalSize, localSize, args, -1, -1);
|
||||
//float *dis = (float *)clEnqueueMapBuffer(ctx->impl->clCmdQueue, (cl_mem)distance.data, CL_TRUE, CL_MAP_READ, 0, 8, 0, NULL, NULL, NULL);
|
||||
@@ -498,7 +498,7 @@ void knn_matchUnrolledCached(const oclMat &query, const oclMat &train, const ocl
|
||||
args.push_back( std::make_pair( sizeof(cl_int), (void *)&query.step ));
|
||||
args.push_back( std::make_pair( sizeof(cl_int), (void *)&distType ));
|
||||
|
||||
std::string kernelName = "BruteForceMatch_knnUnrollMatch";
|
||||
cv::String kernelName = "BruteForceMatch_knnUnrollMatch";
|
||||
|
||||
openCLExecuteKernel(ctx, &brute_force_match, kernelName, globalSize, localSize, args, -1, -1);
|
||||
}
|
||||
@@ -531,7 +531,7 @@ void knn_match(const oclMat &query, const oclMat &train, const oclMat &/*mask*/,
|
||||
args.push_back( std::make_pair( sizeof(cl_int), (void *)&query.step ));
|
||||
args.push_back( std::make_pair( sizeof(cl_int), (void *)&distType ));
|
||||
|
||||
std::string kernelName = "BruteForceMatch_knnMatch";
|
||||
cv::String kernelName = "BruteForceMatch_knnMatch";
|
||||
|
||||
openCLExecuteKernel(ctx, &brute_force_match, kernelName, globalSize, localSize, args, -1, -1);
|
||||
}
|
||||
@@ -564,7 +564,7 @@ void calcDistanceUnrolled(const oclMat &query, const oclMat &train, const oclMat
|
||||
args.push_back( std::make_pair( sizeof(cl_int), (void *)&query.step ));
|
||||
args.push_back( std::make_pair( sizeof(cl_int), (void *)&distType ));
|
||||
|
||||
std::string kernelName = "BruteForceMatch_calcDistanceUnrolled";
|
||||
cv::String kernelName = "BruteForceMatch_calcDistanceUnrolled";
|
||||
|
||||
openCLExecuteKernel(ctx, &brute_force_match, kernelName, globalSize, localSize, args, -1, -1);
|
||||
}
|
||||
@@ -595,7 +595,7 @@ void calcDistance(const oclMat &query, const oclMat &train, const oclMat &/*mask
|
||||
args.push_back( std::make_pair( sizeof(cl_int), (void *)&query.step ));
|
||||
args.push_back( std::make_pair( sizeof(cl_int), (void *)&distType ));
|
||||
|
||||
std::string kernelName = "BruteForceMatch_calcDistance";
|
||||
cv::String kernelName = "BruteForceMatch_calcDistance";
|
||||
|
||||
openCLExecuteKernel(ctx, &brute_force_match, kernelName, globalSize, localSize, args, -1, -1);
|
||||
}
|
||||
@@ -670,7 +670,7 @@ void findKnnMatch(int k, const oclMat &trainIdx, const oclMat &distance, const o
|
||||
size_t globalSize[] = {trainIdx.rows * BLOCK_SIZE, 1, 1};
|
||||
size_t localSize[] = {BLOCK_SIZE, 1, 1};
|
||||
int block_size = BLOCK_SIZE;
|
||||
std::string kernelName = "BruteForceMatch_findBestMatch";
|
||||
cv::String kernelName = "BruteForceMatch_findBestMatch";
|
||||
|
||||
for (int i = 0; i < k; ++i)
|
||||
{
|
||||
|
@@ -83,7 +83,7 @@ void cv::ocl::buildWarpPlaneMaps(Size /*src_size*/, Rect dst_roi, const Mat &K,
|
||||
int tl_v = dst_roi.tl().y;
|
||||
|
||||
Context *clCxt = Context::getContext();
|
||||
std::string kernelName = "buildWarpPlaneMaps";
|
||||
cv::String kernelName = "buildWarpPlaneMaps";
|
||||
std::vector< std::pair<size_t, const void *> > args;
|
||||
|
||||
args.push_back( std::make_pair( sizeof(cl_mem), (void *)&map_x.data));
|
||||
@@ -123,7 +123,7 @@ void cv::ocl::buildWarpCylindricalMaps(Size /*src_size*/, Rect dst_roi, const Ma
|
||||
int tl_v = dst_roi.tl().y;
|
||||
|
||||
Context *clCxt = Context::getContext();
|
||||
std::string kernelName = "buildWarpCylindricalMaps";
|
||||
cv::String kernelName = "buildWarpCylindricalMaps";
|
||||
std::vector< std::pair<size_t, const void *> > args;
|
||||
|
||||
args.push_back( std::make_pair( sizeof(cl_mem), (void *)&map_x.data));
|
||||
@@ -162,7 +162,7 @@ void cv::ocl::buildWarpSphericalMaps(Size /*src_size*/, Rect dst_roi, const Mat
|
||||
int tl_v = dst_roi.tl().y;
|
||||
|
||||
Context *clCxt = Context::getContext();
|
||||
std::string kernelName = "buildWarpSphericalMaps";
|
||||
cv::String kernelName = "buildWarpSphericalMaps";
|
||||
std::vector< std::pair<size_t, const void *> > args;
|
||||
|
||||
args.push_back( std::make_pair( sizeof(cl_mem), (void *)&map_x.data));
|
||||
@@ -205,7 +205,7 @@ void cv::ocl::buildWarpAffineMaps(const Mat &M, bool inverse, Size dsize, oclMat
|
||||
oclMat coeffsOclMat(coeffsMat.reshape(1, 1));
|
||||
|
||||
Context *clCxt = Context::getContext();
|
||||
std::string kernelName = "buildWarpAffineMaps";
|
||||
cv::String kernelName = "buildWarpAffineMaps";
|
||||
std::vector< std::pair<size_t, const void *> > args;
|
||||
|
||||
args.push_back( std::make_pair( sizeof(cl_mem), (void *)&xmap.data));
|
||||
@@ -244,7 +244,7 @@ void cv::ocl::buildWarpPerspectiveMaps(const Mat &M, bool inverse, Size dsize, o
|
||||
oclMat coeffsOclMat(coeffsMat.reshape(1, 1));
|
||||
|
||||
Context *clCxt = Context::getContext();
|
||||
std::string kernelName = "buildWarpPerspectiveMaps";
|
||||
cv::String kernelName = "buildWarpPerspectiveMaps";
|
||||
std::vector< std::pair<size_t, const void *> > args;
|
||||
|
||||
args.push_back( std::make_pair( sizeof(cl_mem), (void *)&xmap.data));
|
||||
|
@@ -216,7 +216,7 @@ void cv::ocl::Canny(const oclMat &dx, const oclMat &dy, CannyBuf &buf, oclMat &d
|
||||
void canny::calcSobelRowPass_gpu(const oclMat &src, oclMat &dx_buf, oclMat &dy_buf, int rows, int cols)
|
||||
{
|
||||
Context *clCxt = src.clCxt;
|
||||
std::string kernelName = "calcSobelRowPass";
|
||||
cv::String kernelName = "calcSobelRowPass";
|
||||
std::vector< std::pair<size_t, const void *> > args;
|
||||
|
||||
args.push_back( std::make_pair( sizeof(cl_mem), (void *)&src.data));
|
||||
@@ -239,7 +239,7 @@ void canny::calcSobelRowPass_gpu(const oclMat &src, oclMat &dx_buf, oclMat &dy_b
|
||||
void canny::calcMagnitude_gpu(const oclMat &dx_buf, const oclMat &dy_buf, oclMat &dx, oclMat &dy, oclMat &mag, int rows, int cols, bool L2Grad)
|
||||
{
|
||||
Context *clCxt = dx_buf.clCxt;
|
||||
std::string kernelName = "calcMagnitude_buf";
|
||||
cv::String kernelName = "calcMagnitude_buf";
|
||||
std::vector< std::pair<size_t, const void *> > args;
|
||||
|
||||
args.push_back( std::make_pair( sizeof(cl_mem), (void *)&dx_buf.data));
|
||||
@@ -273,7 +273,7 @@ void canny::calcMagnitude_gpu(const oclMat &dx_buf, const oclMat &dy_buf, oclMat
|
||||
void canny::calcMagnitude_gpu(const oclMat &dx, const oclMat &dy, oclMat &mag, int rows, int cols, bool L2Grad)
|
||||
{
|
||||
Context *clCxt = dx.clCxt;
|
||||
std::string kernelName = "calcMagnitude";
|
||||
cv::String kernelName = "calcMagnitude";
|
||||
std::vector< std::pair<size_t, const void *> > args;
|
||||
|
||||
args.push_back( std::make_pair( sizeof(cl_mem), (void *)&dx.data));
|
||||
@@ -324,7 +324,7 @@ void canny::calcMap_gpu(oclMat &dx, oclMat &dy, oclMat &mag, oclMat &map, int ro
|
||||
|
||||
|
||||
size_t globalThreads[3] = {cols, rows, 1};
|
||||
std::string kernelName = "calcMap";
|
||||
cv::String kernelName = "calcMap";
|
||||
size_t localThreads[3] = {16, 16, 1};
|
||||
|
||||
openCLExecuteKernel2(clCxt, &imgproc_canny, kernelName, globalThreads, localThreads, args, -1, -1);
|
||||
@@ -333,7 +333,7 @@ void canny::calcMap_gpu(oclMat &dx, oclMat &dy, oclMat &mag, oclMat &map, int ro
|
||||
void canny::edgesHysteresisLocal_gpu(oclMat &map, oclMat &st1, void *counter, int rows, int cols)
|
||||
{
|
||||
Context *clCxt = map.clCxt;
|
||||
std::string kernelName = "edgesHysteresisLocal";
|
||||
cv::String kernelName = "edgesHysteresisLocal";
|
||||
std::vector< std::pair<size_t, const void *> > args;
|
||||
|
||||
args.push_back( std::make_pair( sizeof(cl_mem), (void *)&map.data));
|
||||
@@ -355,7 +355,7 @@ void canny::edgesHysteresisGlobal_gpu(oclMat &map, oclMat &st1, oclMat &st2, voi
|
||||
unsigned int count;
|
||||
openCLSafeCall(clEnqueueReadBuffer((cl_command_queue)getoclCommandQueue(), (cl_mem)counter, 1, 0, sizeof(float), &count, 0, NULL, NULL));
|
||||
Context *clCxt = map.clCxt;
|
||||
std::string kernelName = "edgesHysteresisGlobal";
|
||||
cv::String kernelName = "edgesHysteresisGlobal";
|
||||
std::vector< std::pair<size_t, const void *> > args;
|
||||
size_t localThreads[3] = {128, 1, 1};
|
||||
|
||||
@@ -387,7 +387,7 @@ void canny::edgesHysteresisGlobal_gpu(oclMat &map, oclMat &st1, oclMat &st2, voi
|
||||
void canny::getEdges_gpu(oclMat &map, oclMat &dst, int rows, int cols)
|
||||
{
|
||||
Context *clCxt = map.clCxt;
|
||||
std::string kernelName = "getEdges";
|
||||
cv::String kernelName = "getEdges";
|
||||
std::vector< std::pair<size_t, const void *> > args;
|
||||
|
||||
args.push_back( std::make_pair( sizeof(cl_mem), (void *)&map.data));
|
||||
|
@@ -65,7 +65,7 @@ void cv::ocl::columnSum(const oclMat &src, oclMat &dst)
|
||||
|
||||
Context *clCxt = src.clCxt;
|
||||
|
||||
const std::string kernelName = "columnSum";
|
||||
const cv::String kernelName = "columnSum";
|
||||
|
||||
std::vector< std::pair<size_t, const void *> > args;
|
||||
|
||||
|
@@ -235,7 +235,7 @@ static void GPUErode(const oclMat &src, oclMat &dst, oclMat &mat_kernel,
|
||||
int srcOffset_x = srcOffset % srcStep;
|
||||
int srcOffset_y = srcOffset / srcStep;
|
||||
Context *clCxt = src.clCxt;
|
||||
std::string kernelName;
|
||||
cv::String kernelName;
|
||||
size_t localThreads[3] = {16, 16, 1};
|
||||
size_t globalThreads[3] = {(src.cols + localThreads[0] - 1) / localThreads[0] *localThreads[0], (src.rows + localThreads[1] - 1) / localThreads[1] *localThreads[1], 1};
|
||||
|
||||
@@ -314,7 +314,7 @@ static void GPUDilate(const oclMat &src, oclMat &dst, oclMat &mat_kernel,
|
||||
int srcOffset_x = srcOffset % srcStep;
|
||||
int srcOffset_y = srcOffset / srcStep;
|
||||
Context *clCxt = src.clCxt;
|
||||
std::string kernelName;
|
||||
cv::String kernelName;
|
||||
size_t localThreads[3] = {16, 16, 1};
|
||||
size_t globalThreads[3] = {(src.cols + localThreads[0] - 1) / localThreads[0] *localThreads[0],
|
||||
(src.rows + localThreads[1] - 1) / localThreads[1] *localThreads[1], 1};
|
||||
@@ -606,7 +606,7 @@ static void GPUFilter2D(const oclMat &src, oclMat &dst, oclMat &mat_kernel,
|
||||
int cn = src.oclchannels();
|
||||
int depth = src.depth();
|
||||
|
||||
std::string kernelName = "filter2D";
|
||||
cv::String kernelName = "filter2D";
|
||||
|
||||
size_t src_offset_x = (src.offset % src.step) / src.elemSize();
|
||||
size_t src_offset_y = src.offset / src.step;
|
||||
@@ -762,7 +762,7 @@ static void GPUFilterBox_8u_C1R(const oclMat &src, oclMat &dst,
|
||||
(src.rows == dst.rows));
|
||||
Context *clCxt = src.clCxt;
|
||||
|
||||
std::string kernelName = "boxFilter_C1_D0";
|
||||
cv::String kernelName = "boxFilter_C1_D0";
|
||||
|
||||
char btype[30];
|
||||
|
||||
@@ -824,7 +824,7 @@ static void GPUFilterBox_8u_C4R(const oclMat &src, oclMat &dst,
|
||||
(src.rows == dst.rows));
|
||||
Context *clCxt = src.clCxt;
|
||||
|
||||
std::string kernelName = "boxFilter_C4_D0";
|
||||
cv::String kernelName = "boxFilter_C4_D0";
|
||||
|
||||
char btype[30];
|
||||
|
||||
@@ -886,7 +886,7 @@ static void GPUFilterBox_32F_C1R(const oclMat &src, oclMat &dst,
|
||||
(src.rows == dst.rows));
|
||||
Context *clCxt = src.clCxt;
|
||||
|
||||
std::string kernelName = "boxFilter_C1_D5";
|
||||
cv::String kernelName = "boxFilter_C1_D5";
|
||||
|
||||
char btype[30];
|
||||
|
||||
@@ -949,7 +949,7 @@ static void GPUFilterBox_32F_C4R(const oclMat &src, oclMat &dst,
|
||||
(src.rows == dst.rows));
|
||||
Context *clCxt = src.clCxt;
|
||||
|
||||
std::string kernelName = "boxFilter_C4_D5";
|
||||
cv::String kernelName = "boxFilter_C4_D5";
|
||||
|
||||
char btype[30];
|
||||
|
||||
@@ -1095,7 +1095,7 @@ void linearRowFilter_gpu(const oclMat &src, const oclMat &dst, oclMat mat_kernel
|
||||
int channels = src.oclchannels();
|
||||
|
||||
size_t localThreads[3] = {16, 16, 1};
|
||||
std::string kernelName = "row_filter";
|
||||
cv::String kernelName = "row_filter";
|
||||
|
||||
char btype[30];
|
||||
|
||||
@@ -1227,7 +1227,7 @@ void linearColumnFilter_gpu(const oclMat &src, const oclMat &dst, oclMat mat_ker
|
||||
int channels = src.oclchannels();
|
||||
|
||||
size_t localThreads[3] = {16, 16, 1};
|
||||
std::string kernelName = "col_filter";
|
||||
cv::String kernelName = "col_filter";
|
||||
|
||||
char btype[30];
|
||||
|
||||
|
@@ -1575,7 +1575,7 @@ void cv::ocl::device::hog::compute_hists(int nbins, int block_stride_x, int bloc
|
||||
const cv::ocl::oclMat &qangle, float sigma, cv::ocl::oclMat &block_hists)
|
||||
{
|
||||
Context *clCxt = Context::getContext();
|
||||
std::string kernelName = "compute_hists_kernel";
|
||||
cv::String kernelName = "compute_hists_kernel";
|
||||
std::vector< std::pair<size_t, const void *> > args;
|
||||
|
||||
int img_block_width = (width - CELLS_PER_BLOCK_X * CELL_WIDTH + block_stride_x) / block_stride_x;
|
||||
@@ -1615,7 +1615,7 @@ void cv::ocl::device::hog::normalize_hists(int nbins, int block_stride_x, int bl
|
||||
int height, int width, cv::ocl::oclMat &block_hists, float threshold)
|
||||
{
|
||||
Context *clCxt = Context::getContext();
|
||||
std::string kernelName = "normalize_hists_kernel";
|
||||
cv::String kernelName = "normalize_hists_kernel";
|
||||
std::vector< std::pair<size_t, const void *> > args;
|
||||
|
||||
int block_hist_size = nbins * CELLS_PER_BLOCK_X * CELLS_PER_BLOCK_Y;
|
||||
@@ -1645,7 +1645,7 @@ void cv::ocl::device::hog::classify_hists(int win_height, int win_width, int blo
|
||||
float threshold, cv::ocl::oclMat &labels)
|
||||
{
|
||||
Context *clCxt = Context::getContext();
|
||||
std::string kernelName = "classify_hists_kernel";
|
||||
cv::String kernelName = "classify_hists_kernel";
|
||||
std::vector< std::pair<size_t, const void *> > args;
|
||||
|
||||
int win_block_stride_x = win_stride_x / block_stride_x;
|
||||
@@ -1678,7 +1678,7 @@ void cv::ocl::device::hog::extract_descrs_by_rows(int win_height, int win_width,
|
||||
const cv::ocl::oclMat &block_hists, cv::ocl::oclMat &descriptors)
|
||||
{
|
||||
Context *clCxt = Context::getContext();
|
||||
std::string kernelName = "extract_descrs_by_rows_kernel";
|
||||
cv::String kernelName = "extract_descrs_by_rows_kernel";
|
||||
std::vector< std::pair<size_t, const void *> > args;
|
||||
|
||||
int win_block_stride_x = win_stride_x / block_stride_x;
|
||||
@@ -1709,7 +1709,7 @@ void cv::ocl::device::hog::extract_descrs_by_cols(int win_height, int win_width,
|
||||
const cv::ocl::oclMat &block_hists, cv::ocl::oclMat &descriptors)
|
||||
{
|
||||
Context *clCxt = Context::getContext();
|
||||
std::string kernelName = "extract_descrs_by_cols_kernel";
|
||||
cv::String kernelName = "extract_descrs_by_cols_kernel";
|
||||
std::vector< std::pair<size_t, const void *> > args;
|
||||
|
||||
int win_block_stride_x = win_stride_x / block_stride_x;
|
||||
@@ -1745,7 +1745,7 @@ void cv::ocl::device::hog::compute_gradients_8UC1(int height, int width, const c
|
||||
float angle_scale, cv::ocl::oclMat &grad, cv::ocl::oclMat &qangle, bool correct_gamma)
|
||||
{
|
||||
Context *clCxt = Context::getContext();
|
||||
std::string kernelName = "compute_gradients_8UC1_kernel";
|
||||
cv::String kernelName = "compute_gradients_8UC1_kernel";
|
||||
std::vector< std::pair<size_t, const void *> > args;
|
||||
|
||||
size_t localThreads[3] = { NTHREADS, 1, 1 };
|
||||
@@ -1774,7 +1774,7 @@ void cv::ocl::device::hog::compute_gradients_8UC4(int height, int width, const c
|
||||
float angle_scale, cv::ocl::oclMat &grad, cv::ocl::oclMat &qangle, bool correct_gamma)
|
||||
{
|
||||
Context *clCxt = Context::getContext();
|
||||
std::string kernelName = "compute_gradients_8UC4_kernel";
|
||||
cv::String kernelName = "compute_gradients_8UC4_kernel";
|
||||
std::vector< std::pair<size_t, const void *> > args;
|
||||
|
||||
size_t localThreads[3] = { NTHREADS, 1, 1 };
|
||||
@@ -1805,7 +1805,7 @@ void cv::ocl::device::hog::resize( const oclMat &src, oclMat &dst, const Size sz
|
||||
CV_Assert( (src.channels() == dst.channels()) );
|
||||
Context *clCxt = Context::getContext();
|
||||
|
||||
std::string kernelName = (src.type() == CV_8UC1) ? "resize_8UC1_kernel" : "resize_8UC4_kernel";
|
||||
cv::String kernelName = (src.type() == CV_8UC1) ? "resize_8UC1_kernel" : "resize_8UC4_kernel";
|
||||
size_t blkSizeX = 16, blkSizeY = 16;
|
||||
size_t glbSizeX = sz.width % blkSizeX == 0 ? sz.width : (sz.width / blkSizeX + 1) * blkSizeX;
|
||||
size_t glbSizeY = sz.height % blkSizeY == 0 ? sz.height : (sz.height / blkSizeY + 1) * blkSizeY;
|
||||
|
@@ -123,7 +123,7 @@ namespace cv
|
||||
|
||||
uchar thresh_uchar = cvFloor(thresh);
|
||||
uchar max_val = cvRound(maxVal);
|
||||
std::string kernelName = "threshold";
|
||||
cv::String kernelName = "threshold";
|
||||
|
||||
size_t cols = (dst.cols + (dst.offset % 16) + 15) / 16;
|
||||
size_t bSizeX = 16, bSizeY = 16;
|
||||
@@ -159,7 +159,7 @@ namespace cv
|
||||
int src_offset = (src.offset >> 2);
|
||||
int src_step = (src.step >> 2);
|
||||
|
||||
std::string kernelName = "threshold";
|
||||
cv::String kernelName = "threshold";
|
||||
|
||||
size_t cols = (dst.cols + (dst_offset & 3) + 3) / 4;
|
||||
//size_t cols = dst.cols;
|
||||
@@ -216,7 +216,7 @@ namespace cv
|
||||
dst.create(map1.size(), src.type());
|
||||
|
||||
|
||||
std::string kernelName;
|
||||
cv::String kernelName;
|
||||
|
||||
if( map1.type() == CV_32FC2 && !map2.data )
|
||||
{
|
||||
@@ -347,7 +347,7 @@ namespace cv
|
||||
int dstStep_in_pixel = dst.step1() / dst.oclchannels();
|
||||
int dstoffset_in_pixel = dst.offset / dst.elemSize();
|
||||
//printf("%d %d\n",src.step1() , dst.elemSize());
|
||||
std::string kernelName;
|
||||
cv::String kernelName;
|
||||
if(interpolation == INTER_LINEAR)
|
||||
kernelName = "resizeLN";
|
||||
else if(interpolation == INTER_NEAREST)
|
||||
@@ -471,7 +471,7 @@ namespace cv
|
||||
int dstOffset = dst.offset / dst.oclchannels() / dst.elemSize1();
|
||||
|
||||
Context *clCxt = src.clCxt;
|
||||
std::string kernelName = "medianFilter";
|
||||
cv::String kernelName = "medianFilter";
|
||||
|
||||
|
||||
std::vector< std::pair<size_t, const void *> > args;
|
||||
@@ -489,18 +489,18 @@ namespace cv
|
||||
|
||||
if(m == 3)
|
||||
{
|
||||
std::string kernelName = "medianFilter3";
|
||||
cv::String kernelName = "medianFilter3";
|
||||
openCLExecuteKernel(clCxt, &imgproc_median, kernelName, globalThreads, localThreads, args, src.oclchannels(), src.depth());
|
||||
}
|
||||
else if(m == 5)
|
||||
{
|
||||
std::string kernelName = "medianFilter5";
|
||||
cv::String kernelName = "medianFilter5";
|
||||
openCLExecuteKernel(clCxt, &imgproc_median, kernelName, globalThreads, localThreads, args, src.oclchannels(), src.depth());
|
||||
}
|
||||
else
|
||||
{
|
||||
CV_Error(CV_StsUnsupportedFormat, "Non-supported filter length");
|
||||
//std::string kernelName = "medianFilter";
|
||||
//cv::String kernelName = "medianFilter";
|
||||
//args.push_back( std::make_pair( sizeof(cl_int),(void*)&m));
|
||||
|
||||
//openCLExecuteKernel(clCxt,&imgproc_median,kernelName,globalThreads,localThreads,args,src.oclchannels(),-1);
|
||||
@@ -549,7 +549,7 @@ namespace cv
|
||||
{
|
||||
CV_Error(CV_StsBadArg, "unsupported border type");
|
||||
}
|
||||
std::string kernelName = "copymakeborder";
|
||||
cv::String kernelName = "copymakeborder";
|
||||
size_t localThreads[3] = {16, 16, 1};
|
||||
size_t globalThreads[3] = {(dst.cols + localThreads[0] - 1) / localThreads[0] *localThreads[0],
|
||||
(dst.rows + localThreads[1] - 1) / localThreads[1] *localThreads[1], 1
|
||||
@@ -819,8 +819,8 @@ namespace cv
|
||||
cl_mem coeffs_cm;
|
||||
|
||||
Context *clCxt = src.clCxt;
|
||||
std::string s[3] = {"NN", "Linear", "Cubic"};
|
||||
std::string kernelName = "warpAffine" + s[interpolation];
|
||||
cv::String s[3] = {"NN", "Linear", "Cubic"};
|
||||
cv::String kernelName = "warpAffine" + s[interpolation];
|
||||
|
||||
|
||||
if(src.clCxt->supportsFeature(Context::CL_DOUBLE))
|
||||
@@ -890,8 +890,8 @@ namespace cv
|
||||
cl_mem coeffs_cm;
|
||||
|
||||
Context *clCxt = src.clCxt;
|
||||
std::string s[3] = {"NN", "Linear", "Cubic"};
|
||||
std::string kernelName = "warpPerspective" + s[interpolation];
|
||||
cv::String s[3] = {"NN", "Linear", "Cubic"};
|
||||
cv::String kernelName = "warpPerspective" + s[interpolation];
|
||||
|
||||
if(src.clCxt->supportsFeature(Context::CL_DOUBLE))
|
||||
{
|
||||
@@ -1133,7 +1133,7 @@ namespace cv
|
||||
CV_Assert(Dx.offset == 0 && Dy.offset == 0);
|
||||
}
|
||||
|
||||
static void corner_ocl(const char *src_str, std::string kernelName, int block_size, float k, oclMat &Dx, oclMat &Dy,
|
||||
static void corner_ocl(const char *src_str, cv::String kernelName, int block_size, float k, oclMat &Dx, oclMat &Dy,
|
||||
oclMat &dst, int border_type)
|
||||
{
|
||||
char borderType[30];
|
||||
@@ -1364,7 +1364,7 @@ namespace cv
|
||||
Context *clCxt = mat_src.clCxt;
|
||||
int depth = mat_src.depth();
|
||||
|
||||
std::string kernelName = "calc_sub_hist";
|
||||
cv::String kernelName = "calc_sub_hist";
|
||||
|
||||
size_t localThreads[3] = { HISTOGRAM256_BIN_COUNT, 1, 1 };
|
||||
size_t globalThreads[3] = { PARTIAL_HISTOGRAM256_COUNT *localThreads[0], 1, 1};
|
||||
@@ -1441,7 +1441,7 @@ namespace cv
|
||||
using namespace histograms;
|
||||
|
||||
Context *clCxt = sub_hist.clCxt;
|
||||
std::string kernelName = "merge_hist";
|
||||
cv::String kernelName = "merge_hist";
|
||||
|
||||
size_t localThreads[3] = { 256, 1, 1 };
|
||||
size_t globalThreads[3] = { HISTOGRAM256_BIN_COUNT *localThreads[0], 1, 1};
|
||||
@@ -1474,7 +1474,7 @@ namespace cv
|
||||
calcHist(mat_src, mat_hist);
|
||||
|
||||
Context *clCxt = mat_src.clCxt;
|
||||
std::string kernelName = "calLUT";
|
||||
cv::String kernelName = "calLUT";
|
||||
size_t localThreads[3] = { 256, 1, 1};
|
||||
size_t globalThreads[3] = { 256, 1, 1};
|
||||
oclMat lut(1, 256, CV_8UC1);
|
||||
@@ -1544,7 +1544,7 @@ namespace cv
|
||||
oclMat oclspace_weight(1, d * d, CV_32FC1, space_weight);
|
||||
oclMat oclspace_ofs(1, d * d, CV_32SC1, space_ofs);
|
||||
|
||||
std::string kernelName = "bilateral";
|
||||
cv::String kernelName = "bilateral";
|
||||
size_t localThreads[3] = { 16, 16, 1 };
|
||||
size_t globalThreads[3] = { (dst.cols + localThreads[0] - 1) / localThreads[0] *localThreads[0],
|
||||
(dst.rows + localThreads[1] - 1) / localThreads[1] *localThreads[1],
|
||||
@@ -1590,7 +1590,7 @@ inline int divUp(int total, int grain)
|
||||
{
|
||||
return (total + grain - 1) / grain;
|
||||
}
|
||||
static void convolve_run(const oclMat &src, const oclMat &temp1, oclMat &dst, std::string kernelName, const char **kernelString)
|
||||
static void convolve_run(const oclMat &src, const oclMat &temp1, oclMat &dst, cv::String kernelName, const char **kernelString)
|
||||
{
|
||||
CV_Assert(src.depth() == CV_32FC1);
|
||||
CV_Assert(temp1.depth() == CV_32F);
|
||||
@@ -1636,7 +1636,7 @@ void cv::ocl::convolve(const oclMat &x, const oclMat &t, oclMat &y)
|
||||
CV_Assert(t.depth() == CV_32F);
|
||||
CV_Assert(x.type() == y.type() && x.size() == y.size());
|
||||
y.create(x.size(), x.type());
|
||||
std::string kernelName = "convolve";
|
||||
cv::String kernelName = "convolve";
|
||||
|
||||
convolve_run(x, t, y, kernelName, &imgproc_convolve);
|
||||
}
|
||||
|
@@ -92,9 +92,9 @@ namespace cv
|
||||
releaseProgram();
|
||||
}
|
||||
|
||||
cl_program ProgramCache::progLookup(std::string srcsign)
|
||||
cl_program ProgramCache::progLookup(cv::String srcsign)
|
||||
{
|
||||
std::map<std::string, cl_program>::iterator iter;
|
||||
std::map<cv::String, cl_program>::iterator iter;
|
||||
iter = codeCache.find(srcsign);
|
||||
if(iter != codeCache.end())
|
||||
return iter->second;
|
||||
@@ -102,17 +102,17 @@ namespace cv
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void ProgramCache::addProgram(std::string srcsign , cl_program program)
|
||||
void ProgramCache::addProgram(cv::String srcsign , cl_program program)
|
||||
{
|
||||
if(!progLookup(srcsign))
|
||||
{
|
||||
codeCache.insert(std::map<std::string, cl_program>::value_type(srcsign, program));
|
||||
codeCache.insert(std::map<cv::String, cl_program>::value_type(srcsign, program));
|
||||
}
|
||||
}
|
||||
|
||||
void ProgramCache::releaseProgram()
|
||||
{
|
||||
std::map<std::string, cl_program>::iterator iter;
|
||||
std::map<cv::String, cl_program>::iterator iter;
|
||||
for(iter = codeCache.begin(); iter != codeCache.end(); iter++)
|
||||
{
|
||||
openCLSafeCall(clReleaseProgram(iter->second));
|
||||
@@ -126,7 +126,7 @@ namespace cv
|
||||
{
|
||||
cl_platform_id oclplatform;
|
||||
std::vector<cl_device_id> devices;
|
||||
std::vector<std::string> devName;
|
||||
std::vector<cv::String> devName;
|
||||
|
||||
cl_context oclcontext;
|
||||
cl_command_queue clCmdQueue;
|
||||
@@ -138,7 +138,7 @@ namespace cv
|
||||
char extra_options[512];
|
||||
int double_support;
|
||||
int unified_memory; //1 means integrated GPU, otherwise this value is 0
|
||||
std::string binpath;
|
||||
cv::String binpath;
|
||||
int refcounter;
|
||||
|
||||
Impl()
|
||||
@@ -236,9 +236,9 @@ namespace cv
|
||||
size_t extends_size;
|
||||
openCLSafeCall(clGetDeviceInfo(devices[devnum], CL_DEVICE_EXTENSIONS, EXT_LEN, (void *)extends_set, &extends_size));
|
||||
extends_set[EXT_LEN - 1] = 0;
|
||||
size_t fp64_khr = std::string(extends_set).find("cl_khr_fp64");
|
||||
size_t fp64_khr = cv::String(extends_set).find("cl_khr_fp64");
|
||||
|
||||
if(fp64_khr != std::string::npos)
|
||||
if(fp64_khr != cv::String::npos)
|
||||
{
|
||||
sprintf(extra_options, "-D DOUBLE_SUPPORT");
|
||||
double_support = 1;
|
||||
@@ -433,7 +433,7 @@ namespace cv
|
||||
{
|
||||
openCLSafeCall(clReleaseMemObject((cl_mem)devPtr));
|
||||
}
|
||||
cl_kernel openCLGetKernelFromSource(const Context *clCxt, const char **source, std::string kernelName)
|
||||
cl_kernel openCLGetKernelFromSource(const Context *clCxt, const char **source, cv::String kernelName)
|
||||
{
|
||||
return openCLGetKernelFromSource(clCxt, source, kernelName, NULL);
|
||||
}
|
||||
@@ -473,15 +473,15 @@ namespace cv
|
||||
return 1;
|
||||
}
|
||||
|
||||
cl_kernel openCLGetKernelFromSource(const Context *clCxt, const char **source, std::string kernelName,
|
||||
cl_kernel openCLGetKernelFromSource(const Context *clCxt, const char **source, cv::String kernelName,
|
||||
const char *build_options)
|
||||
{
|
||||
cl_kernel kernel;
|
||||
cl_program program ;
|
||||
cl_int status = 0;
|
||||
std::stringstream src_sign;
|
||||
std::string srcsign;
|
||||
std::string filename;
|
||||
cv::String srcsign;
|
||||
cv::String filename;
|
||||
CV_Assert(programCache != NULL);
|
||||
|
||||
if(NULL != build_options)
|
||||
@@ -601,7 +601,7 @@ namespace cv
|
||||
static double total_execute_time = 0;
|
||||
static double total_kernel_time = 0;
|
||||
#endif
|
||||
void openCLExecuteKernel_(Context *clCxt , const char **source, std::string kernelName, size_t globalThreads[3],
|
||||
void openCLExecuteKernel_(Context *clCxt , const char **source, cv::String kernelName, size_t globalThreads[3],
|
||||
size_t localThreads[3], std::vector< std::pair<size_t, const void *> > &args, int channels,
|
||||
int depth, const char *build_options)
|
||||
{
|
||||
@@ -668,14 +668,14 @@ namespace cv
|
||||
openCLSafeCall(clReleaseKernel(kernel));
|
||||
}
|
||||
|
||||
void openCLExecuteKernel(Context *clCxt , const char **source, std::string kernelName,
|
||||
void openCLExecuteKernel(Context *clCxt , const char **source, cv::String kernelName,
|
||||
size_t globalThreads[3], size_t localThreads[3],
|
||||
std::vector< std::pair<size_t, const void *> > &args, int channels, int depth)
|
||||
{
|
||||
openCLExecuteKernel(clCxt, source, kernelName, globalThreads, localThreads, args,
|
||||
channels, depth, NULL);
|
||||
}
|
||||
void openCLExecuteKernel(Context *clCxt , const char **source, std::string kernelName,
|
||||
void openCLExecuteKernel(Context *clCxt , const char **source, cv::String kernelName,
|
||||
size_t globalThreads[3], size_t localThreads[3],
|
||||
std::vector< std::pair<size_t, const void *> > &args, int channels, int depth, const char *build_options)
|
||||
|
||||
@@ -684,7 +684,7 @@ namespace cv
|
||||
openCLExecuteKernel_(clCxt, source, kernelName, globalThreads, localThreads, args, channels, depth,
|
||||
build_options);
|
||||
#else
|
||||
std::string data_type[] = { "uchar", "char", "ushort", "short", "int", "float", "double"};
|
||||
cv::String data_type[] = { "uchar", "char", "ushort", "short", "int", "float", "double"};
|
||||
std::cout << std::endl;
|
||||
std::cout << "Function Name: " << kernelName;
|
||||
if(depth >= 0)
|
||||
@@ -709,7 +709,7 @@ namespace cv
|
||||
#endif
|
||||
}
|
||||
|
||||
double openCLExecuteKernelInterop(Context *clCxt , const char **source, std::string kernelName,
|
||||
double openCLExecuteKernelInterop(Context *clCxt , const char **source, cv::String kernelName,
|
||||
size_t globalThreads[3], size_t localThreads[3],
|
||||
std::vector< std::pair<size_t, const void *> > &args, int channels, int depth, const char *build_options,
|
||||
bool finish, bool measureKernelTime, bool cleanUp)
|
||||
@@ -785,7 +785,7 @@ namespace cv
|
||||
}
|
||||
|
||||
// Converts the contents of a file into a string
|
||||
static int convertToString(const char *filename, std::string& s)
|
||||
static int convertToString(const char *filename, cv::String& s)
|
||||
{
|
||||
size_t size;
|
||||
char* str;
|
||||
@@ -817,16 +817,16 @@ namespace cv
|
||||
return -1;
|
||||
}
|
||||
|
||||
double openCLExecuteKernelInterop(Context *clCxt , const char **fileName, const int numFiles, std::string kernelName,
|
||||
double openCLExecuteKernelInterop(Context *clCxt , const char **fileName, const int numFiles, cv::String kernelName,
|
||||
size_t globalThreads[3], size_t localThreads[3],
|
||||
std::vector< std::pair<size_t, const void *> > &args, int channels, int depth, const char *build_options,
|
||||
bool finish, bool measureKernelTime, bool cleanUp)
|
||||
|
||||
{
|
||||
std::vector<std::string> fsource;
|
||||
std::vector<cv::String> fsource;
|
||||
for (int i = 0 ; i < numFiles ; i++)
|
||||
{
|
||||
std::string str;
|
||||
cv::String str;
|
||||
if (convertToString(fileName[i], str) >= 0)
|
||||
fsource.push_back(str);
|
||||
}
|
||||
|
@@ -131,7 +131,7 @@ void cv::ocl::interpolateFrames(const oclMat &frame0, const oclMat &frame1,
|
||||
void interpolate::memsetKernel(float val, oclMat &img, int height, int offset)
|
||||
{
|
||||
Context *clCxt = Context::getContext();
|
||||
std::string kernelName = "memsetKernel";
|
||||
cv::String kernelName = "memsetKernel";
|
||||
std::vector< std::pair<size_t, const void *> > args;
|
||||
int step = img.step / sizeof(float);
|
||||
offset = step * height * offset;
|
||||
@@ -150,7 +150,7 @@ void interpolate::memsetKernel(float val, oclMat &img, int height, int offset)
|
||||
void interpolate::normalizeKernel(oclMat &buffer, int height, int factor_offset, int dst_offset)
|
||||
{
|
||||
Context *clCxt = Context::getContext();
|
||||
std::string kernelName = "normalizeKernel";
|
||||
cv::String kernelName = "normalizeKernel";
|
||||
std::vector< std::pair<size_t, const void *> > args;
|
||||
int step = buffer.step / sizeof(float);
|
||||
factor_offset = step * height * factor_offset;
|
||||
@@ -172,7 +172,7 @@ void interpolate::forwardWarpKernel(const oclMat &src, oclMat &buffer, const ocl
|
||||
int b_offset, int d_offset)
|
||||
{
|
||||
Context *clCxt = Context::getContext();
|
||||
std::string kernelName = "forwardWarpKernel";
|
||||
cv::String kernelName = "forwardWarpKernel";
|
||||
std::vector< std::pair<size_t, const void *> > args;
|
||||
int f_step = u.step / sizeof(float); // flow step
|
||||
int b_step = buffer.step / sizeof(float);
|
||||
@@ -210,7 +210,7 @@ void interpolate::blendFrames(const oclMat &frame0, const oclMat &/*frame1*/, co
|
||||
int step = buffer.step / sizeof(float);
|
||||
|
||||
Context *clCxt = Context::getContext();
|
||||
std::string kernelName = "blendFramesKernel";
|
||||
cv::String kernelName = "blendFramesKernel";
|
||||
std::vector< std::pair<size_t, const void *> > args;
|
||||
|
||||
args.push_back( std::make_pair( sizeof(cl_mem), (void *)&tex_src0));
|
||||
|
@@ -139,7 +139,7 @@ namespace cv
|
||||
unsigned long long templ_sqsum = (unsigned long long)sqrSum(templ.reshape(1))[0];
|
||||
|
||||
Context *clCxt = image.clCxt;
|
||||
std::string kernelName = "matchTemplate_Prepared_SQDIFF_NORMED";
|
||||
cv::String kernelName = "matchTemplate_Prepared_SQDIFF_NORMED";
|
||||
std::vector< std::pair<size_t, const void *> > args;
|
||||
|
||||
args.push_back( std::make_pair( sizeof(cl_mem), (void *)&buf.image_sums[0].data));
|
||||
@@ -169,7 +169,7 @@ namespace cv
|
||||
CV_Assert(result.rows == image.rows - templ.rows + 1 && result.cols == image.cols - templ.cols + 1);
|
||||
|
||||
Context *clCxt = image.clCxt;
|
||||
std::string kernelName = "matchTemplate_Naive_SQDIFF";
|
||||
cv::String kernelName = "matchTemplate_Naive_SQDIFF";
|
||||
|
||||
std::vector< std::pair<size_t, const void *> > args;
|
||||
|
||||
@@ -232,7 +232,7 @@ namespace cv
|
||||
unsigned long long templ_sqsum = (unsigned long long)sqrSum(templ.reshape(1))[0];
|
||||
|
||||
Context *clCxt = image.clCxt;
|
||||
std::string kernelName = "normalizeKernel";
|
||||
cv::String kernelName = "normalizeKernel";
|
||||
std::vector< std::pair<size_t, const void *> > args;
|
||||
|
||||
args.push_back( std::make_pair( sizeof(cl_mem), (void *)&buf.image_sqsums[0].data));
|
||||
@@ -262,7 +262,7 @@ namespace cv
|
||||
CV_Assert(result.rows == image.rows - templ.rows + 1 && result.cols == image.cols - templ.cols + 1);
|
||||
|
||||
Context *clCxt = image.clCxt;
|
||||
std::string kernelName = "matchTemplate_Naive_CCORR";
|
||||
cv::String kernelName = "matchTemplate_Naive_CCORR";
|
||||
|
||||
std::vector< std::pair<size_t, const void *> > args;
|
||||
|
||||
@@ -296,7 +296,7 @@ namespace cv
|
||||
matchTemplate_CCORR(image, templ, result, buf);
|
||||
|
||||
Context *clCxt = image.clCxt;
|
||||
std::string kernelName;
|
||||
cv::String kernelName;
|
||||
|
||||
kernelName = "matchTemplate_Prepared_CCOFF";
|
||||
size_t globalThreads[3] = {result.cols, result.rows, 1};
|
||||
@@ -369,7 +369,7 @@ namespace cv
|
||||
float scale = 1.f / templ.size().area();
|
||||
|
||||
Context *clCxt = image.clCxt;
|
||||
std::string kernelName;
|
||||
cv::String kernelName;
|
||||
|
||||
kernelName = "matchTemplate_Prepared_CCOFF_NORMED";
|
||||
size_t globalThreads[3] = {result.cols, result.rows, 1};
|
||||
|
@@ -80,7 +80,7 @@ static void convert_C3C4(const cl_mem &src, oclMat &dst)
|
||||
int dstStep_in_pixel = dst.step1() / dst.oclchannels();
|
||||
int pixel_end = dst.wholecols * dst.wholerows - 1;
|
||||
Context *clCxt = dst.clCxt;
|
||||
std::string kernelName = "convertC3C4";
|
||||
cv::String kernelName = "convertC3C4";
|
||||
char compile_option[32];
|
||||
switch(dst.depth())
|
||||
{
|
||||
@@ -128,7 +128,7 @@ static void convert_C4C3(const oclMat &src, cl_mem &dst)
|
||||
int srcStep_in_pixel = src.step1() / src.oclchannels();
|
||||
int pixel_end = src.wholecols * src.wholerows - 1;
|
||||
Context *clCxt = src.clCxt;
|
||||
std::string kernelName = "convertC4C3";
|
||||
cv::String kernelName = "convertC4C3";
|
||||
char compile_option[32];
|
||||
switch(src.depth())
|
||||
{
|
||||
@@ -285,7 +285,7 @@ inline int divUp(int total, int grain)
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
////////////////////////////////// CopyTo /////////////////////////////////
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
static void copy_to_with_mask(const oclMat &src, oclMat &dst, const oclMat &mask, std::string kernelName)
|
||||
static void copy_to_with_mask(const oclMat &src, oclMat &dst, const oclMat &mask, cv::String kernelName)
|
||||
{
|
||||
CV_DbgAssert( dst.rows == mask.rows && dst.cols == mask.cols &&
|
||||
src.rows == dst.rows && src.cols == dst.cols
|
||||
@@ -293,7 +293,7 @@ static void copy_to_with_mask(const oclMat &src, oclMat &dst, const oclMat &mask
|
||||
|
||||
std::vector<std::pair<size_t , const void *> > args;
|
||||
|
||||
std::string string_types[4][7] = {{"uchar", "char", "ushort", "short", "int", "float", "double"},
|
||||
cv::String string_types[4][7] = {{"uchar", "char", "ushort", "short", "int", "float", "double"},
|
||||
{"uchar2", "char2", "ushort2", "short2", "int2", "float2", "double2"},
|
||||
{"uchar3", "char3", "ushort3", "short3", "int3", "float3", "double3"},
|
||||
{"uchar4", "char4", "ushort4", "short4", "int4", "float4", "double4"}
|
||||
@@ -352,8 +352,8 @@ void cv::ocl::oclMat::copyTo( oclMat &mat, const oclMat &mask) const
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
static void convert_run(const oclMat &src, oclMat &dst, double alpha, double beta)
|
||||
{
|
||||
std::string kernelName = "convert_to_S";
|
||||
std::stringstream idxStr;
|
||||
cv::String kernelName = "convert_to_S";
|
||||
cv::Stringstream idxStr;
|
||||
idxStr << src.depth();
|
||||
kernelName += idxStr.str();
|
||||
float alpha_f = alpha, beta_f = beta;
|
||||
@@ -421,7 +421,7 @@ oclMat &cv::ocl::oclMat::operator = (const Scalar &s)
|
||||
setTo(s);
|
||||
return *this;
|
||||
}
|
||||
static void set_to_withoutmask_run(const oclMat &dst, const Scalar &scalar, std::string kernelName)
|
||||
static void set_to_withoutmask_run(const oclMat &dst, const Scalar &scalar, cv::String kernelName)
|
||||
{
|
||||
std::vector<std::pair<size_t , const void *> > args;
|
||||
|
||||
@@ -617,7 +617,7 @@ static void set_to_withoutmask_run(const oclMat &dst, const Scalar &scalar, std:
|
||||
#endif
|
||||
}
|
||||
|
||||
static void set_to_withmask_run(const oclMat &dst, const Scalar &scalar, const oclMat &mask, std::string kernelName)
|
||||
static void set_to_withmask_run(const oclMat &dst, const Scalar &scalar, const oclMat &mask, cv::String kernelName)
|
||||
{
|
||||
CV_DbgAssert( dst.rows == mask.rows && dst.cols == mask.cols);
|
||||
std::vector<std::pair<size_t , const void *> > args;
|
||||
|
@@ -60,14 +60,14 @@ namespace cv
|
||||
}
|
||||
|
||||
// provide additional methods for the user to interact with the command queue after a task is fired
|
||||
static void openCLExecuteKernel_2(Context *clCxt , const char **source, std::string kernelName, size_t globalThreads[3],
|
||||
static void openCLExecuteKernel_2(Context *clCxt , const char **source, cv::String kernelName, size_t globalThreads[3],
|
||||
size_t localThreads[3], std::vector< std::pair<size_t, const void *> > &args, int channels,
|
||||
int depth, char *build_options, FLUSH_MODE finish_mode)
|
||||
{
|
||||
//construct kernel name
|
||||
//The rule is functionName_Cn_Dn, C represent Channels, D Represent DataType Depth, n represent an integer number
|
||||
//for exmaple split_C2_D2, represent the split kernel with channels =2 and dataType Depth = 2(Data type is char)
|
||||
std::stringstream idxStr;
|
||||
cv::Stringstream idxStr;
|
||||
if(channels != -1)
|
||||
idxStr << "_C" << channels;
|
||||
if(depth != -1)
|
||||
@@ -106,14 +106,14 @@ namespace cv
|
||||
openCLSafeCall(clReleaseKernel(kernel));
|
||||
}
|
||||
|
||||
void openCLExecuteKernel2(Context *clCxt , const char **source, std::string kernelName,
|
||||
void openCLExecuteKernel2(Context *clCxt , const char **source, cv::String kernelName,
|
||||
size_t globalThreads[3], size_t localThreads[3],
|
||||
std::vector< std::pair<size_t, const void *> > &args, int channels, int depth, FLUSH_MODE finish_mode)
|
||||
{
|
||||
openCLExecuteKernel2(clCxt, source, kernelName, globalThreads, localThreads, args,
|
||||
channels, depth, NULL, finish_mode);
|
||||
}
|
||||
void openCLExecuteKernel2(Context *clCxt , const char **source, std::string kernelName,
|
||||
void openCLExecuteKernel2(Context *clCxt , const char **source, cv::String kernelName,
|
||||
size_t globalThreads[3], size_t localThreads[3],
|
||||
std::vector< std::pair<size_t, const void *> > &args, int channels, int depth, char *build_options, FLUSH_MODE finish_mode)
|
||||
|
||||
|
@@ -72,7 +72,7 @@ static void pyrdown_run(const oclMat &src, const oclMat &dst)
|
||||
//int channels = dst.channels();
|
||||
//int depth = dst.depth();
|
||||
|
||||
std::string kernelName = "pyrDown";
|
||||
cv::String kernelName = "pyrDown";
|
||||
|
||||
//int vector_lengths[4][7] = {{4, 0, 4, 4, 1, 1, 1},
|
||||
// {4, 0, 4, 4, 1, 1, 1},
|
||||
|
@@ -114,8 +114,8 @@ inline int divUp(int total, int grain)
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
static void convert_run_cus(const oclMat &src, oclMat &dst, double alpha, double beta)
|
||||
{
|
||||
std::string kernelName = "convert_to_S";
|
||||
std::stringstream idxStr;
|
||||
cv::String kernelName = "convert_to_S";
|
||||
cv::Stringstream idxStr;
|
||||
idxStr << src.depth();
|
||||
kernelName += idxStr.str();
|
||||
float alpha_f = (float)alpha, beta_f = (float)beta;
|
||||
@@ -183,7 +183,7 @@ void convertTo( const oclMat &src, oclMat &dst, int rtype, double alpha, double
|
||||
// setTo(s);
|
||||
// return *this;
|
||||
//}
|
||||
static void set_to_withoutmask_run_cus(const oclMat &dst, const Scalar &scalar, std::string kernelName)
|
||||
static void set_to_withoutmask_run_cus(const oclMat &dst, const Scalar &scalar, cv::String kernelName)
|
||||
{
|
||||
std::vector<std::pair<size_t , const void *> > args;
|
||||
|
||||
@@ -399,7 +399,7 @@ static oclMat &setTo(oclMat &src, const Scalar &scalar)
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
////////////////////////////////// CopyTo /////////////////////////////////
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// static void copy_to_with_mask_cus(const oclMat &src, oclMat &dst, const oclMat &mask, std::string kernelName)
|
||||
// static void copy_to_with_mask_cus(const oclMat &src, oclMat &dst, const oclMat &mask, cv::String kernelName)
|
||||
// {
|
||||
// CV_DbgAssert( dst.rows == mask.rows && dst.cols == mask.cols &&
|
||||
// src.rows == dst.rows && src.cols == dst.cols
|
||||
@@ -407,7 +407,7 @@ static oclMat &setTo(oclMat &src, const Scalar &scalar)
|
||||
|
||||
// std::vector<std::pair<size_t , const void *> > args;
|
||||
|
||||
// std::string string_types[4][7] = {{"uchar", "char", "ushort", "short", "int", "float", "double"},
|
||||
// cv::String string_types[4][7] = {{"uchar", "char", "ushort", "short", "int", "float", "double"},
|
||||
// {"uchar2", "char2", "ushort2", "short2", "int2", "float2", "double2"},
|
||||
// {"uchar3", "char3", "ushort3", "short3", "int3", "float3", "double3"},
|
||||
// {"uchar4", "char4", "ushort4", "short4", "int4", "float4", "double4"}
|
||||
@@ -461,7 +461,7 @@ static void copyTo(const oclMat &src, oclMat &m )
|
||||
// }
|
||||
// }
|
||||
|
||||
static void arithmetic_run(const oclMat &src1, oclMat &dst, std::string kernelName, const char **kernelString, void *_scalar)
|
||||
static void arithmetic_run(const oclMat &src1, oclMat &dst, cv::String kernelName, const char **kernelString, void *_scalar)
|
||||
{
|
||||
if(!src1.clCxt->supportsFeature(Context::CL_DOUBLE) && src1.type() == CV_64F)
|
||||
{
|
||||
@@ -539,7 +539,7 @@ static void pyrdown_run_cus(const oclMat &src, const oclMat &dst)
|
||||
|
||||
Context *clCxt = src.clCxt;
|
||||
|
||||
std::string kernelName = "pyrDown";
|
||||
cv::String kernelName = "pyrDown";
|
||||
|
||||
size_t localThreads[3] = { 256, 1, 1 };
|
||||
size_t globalThreads[3] = { src.cols, dst.rows, 1};
|
||||
@@ -571,7 +571,7 @@ static void lkSparse_run(oclMat &I, oclMat &J,
|
||||
{
|
||||
Context *clCxt = I.clCxt;
|
||||
int elemCntPerRow = I.step / I.elemSize();
|
||||
std::string kernelName = "lkSparse";
|
||||
cv::String kernelName = "lkSparse";
|
||||
bool isImageSupported = support_image2d();
|
||||
size_t localThreads[3] = { 8, isImageSupported ? 8 : 32, 1 };
|
||||
size_t globalThreads[3] = { 8 * ptcount, isImageSupported ? 8 : 32, 1};
|
||||
@@ -724,7 +724,7 @@ static void lkDense_run(oclMat &I, oclMat &J, oclMat &u, oclMat &v,
|
||||
bool isImageSupported = support_image2d();
|
||||
int elemCntPerRow = I.step / I.elemSize();
|
||||
|
||||
std::string kernelName = "lkDense";
|
||||
cv::String kernelName = "lkDense";
|
||||
|
||||
size_t localThreads[3] = { 16, 16, 1 };
|
||||
size_t globalThreads[3] = { I.cols, I.rows, 1};
|
||||
|
@@ -64,7 +64,7 @@ namespace cv
|
||||
|
||||
Context *clCxt = src.clCxt;
|
||||
|
||||
const std::string kernelName = "pyrUp";
|
||||
const cv::String kernelName = "pyrUp";
|
||||
|
||||
std::vector< std::pair<size_t, const void *> > args;
|
||||
args.push_back( std::make_pair( sizeof(cl_mem), (void *)&src.data));
|
||||
|
@@ -84,7 +84,7 @@ namespace cv
|
||||
// int channels = mat_dst.oclchannels();
|
||||
// int depth = mat_dst.depth();
|
||||
|
||||
// std::string kernelName = "merge_vector";
|
||||
// cv::String kernelName = "merge_vector";
|
||||
|
||||
// int indexes[4][7] = {{0, 0, 0, 0, 0, 0, 0},
|
||||
// {4, 4, 2, 2, 1, 1, 1},
|
||||
@@ -135,7 +135,7 @@ namespace cv
|
||||
int channels = mat_dst.oclchannels();
|
||||
int depth = mat_dst.depth();
|
||||
|
||||
std::string kernelName = "merge_vector";
|
||||
cv::String kernelName = "merge_vector";
|
||||
|
||||
int vector_lengths[4][7] = {{0, 0, 0, 0, 0, 0, 0},
|
||||
{2, 2, 1, 1, 1, 1, 1},
|
||||
@@ -233,7 +233,7 @@ namespace cv
|
||||
// int channels = mat_src.oclchannels();
|
||||
// int depth = mat_src.depth();
|
||||
|
||||
// std::string kernelName = "split_vector";
|
||||
// cv::String kernelName = "split_vector";
|
||||
|
||||
// int indexes[4][7] = {{0, 0, 0, 0, 0, 0, 0},
|
||||
// {8, 8, 8, 8, 4, 4, 2},
|
||||
@@ -284,7 +284,7 @@ namespace cv
|
||||
int channels = mat_src.oclchannels();
|
||||
int depth = mat_src.depth();
|
||||
|
||||
std::string kernelName = "split_vector";
|
||||
cv::String kernelName = "split_vector";
|
||||
|
||||
int vector_lengths[4][7] = {{0, 0, 0, 0, 0, 0, 0},
|
||||
{4, 4, 2, 2, 1, 1, 1},
|
||||
|
@@ -74,7 +74,7 @@ static void prefilter_xsobel(const oclMat &input, oclMat &output, int prefilterC
|
||||
{
|
||||
Context *clCxt = input.clCxt;
|
||||
|
||||
std::string kernelName = "prefilter_xsobel";
|
||||
cv::String kernelName = "prefilter_xsobel";
|
||||
cl_kernel kernel = openCLGetKernelFromSource(clCxt, &stereobm, kernelName);
|
||||
|
||||
size_t blockSize = 1;
|
||||
@@ -118,7 +118,7 @@ static void stereo_bm(const oclMat &left, const oclMat &right, oclMat &disp,
|
||||
|
||||
Context *clCxt = left.clCxt;
|
||||
|
||||
std::string kernelName = "stereoKernel";
|
||||
cv::String kernelName = "stereoKernel";
|
||||
cl_kernel kernel = openCLGetKernelFromSource(clCxt, &stereobm, kernelName);
|
||||
|
||||
disp.setTo(Scalar_<unsigned char>::all(0));
|
||||
@@ -163,7 +163,7 @@ static void postfilter_textureness(oclMat &left, int winSize,
|
||||
{
|
||||
Context *clCxt = left.clCxt;
|
||||
|
||||
std::string kernelName = "textureness_kernel";
|
||||
cv::String kernelName = "textureness_kernel";
|
||||
cl_kernel kernel = openCLGetKernelFromSource(clCxt, &stereobm, kernelName);
|
||||
|
||||
size_t blockSize = 1;
|
||||
|
Reference in New Issue
Block a user