mirror of
https://github.com/opencv/opencv.git
synced 2026-07-30 07:43:03 +04:00
minor ocl.cpp refactoring
fix for cv::LUT and cv::transpose
This commit is contained in:
@@ -90,7 +90,8 @@ public:
|
||||
String vendor() const;
|
||||
String OpenCL_C_Version() const;
|
||||
String OpenCLVersion() const;
|
||||
String deviceVersion() const;
|
||||
int deviceVersionMajor() const;
|
||||
int deviceVersionMinor() const;
|
||||
String driverVersion() const;
|
||||
void* ptr() const;
|
||||
|
||||
@@ -224,16 +225,12 @@ public:
|
||||
static Context2& getDefault(bool initialize = true);
|
||||
void* ptr() const;
|
||||
|
||||
struct Impl;
|
||||
inline struct Impl* _getImpl() const { return p; }
|
||||
friend void initializeContextFromHandle(Context2& ctx, void* platform, void* context, void* device);
|
||||
protected:
|
||||
struct Impl;
|
||||
Impl* p;
|
||||
};
|
||||
|
||||
|
||||
// TODO Move to internal header
|
||||
void initializeContextFromHandle(Context2& ctx, void* platform, void* context, void* device);
|
||||
|
||||
class CV_EXPORTS Platform
|
||||
{
|
||||
public:
|
||||
@@ -245,12 +242,14 @@ public:
|
||||
void* ptr() const;
|
||||
static Platform& getDefault();
|
||||
|
||||
struct Impl;
|
||||
inline struct Impl* _getImpl() const { return p; }
|
||||
friend void initializeContextFromHandle(Context2& ctx, void* platform, void* context, void* device);
|
||||
protected:
|
||||
struct Impl;
|
||||
Impl* p;
|
||||
};
|
||||
|
||||
// TODO Move to internal header
|
||||
void initializeContextFromHandle(Context2& ctx, void* platform, void* context, void* device);
|
||||
|
||||
class CV_EXPORTS Queue
|
||||
{
|
||||
@@ -585,9 +584,12 @@ class CV_EXPORTS Image2D
|
||||
{
|
||||
public:
|
||||
Image2D();
|
||||
Image2D(const UMat &src);
|
||||
explicit Image2D(const UMat &src);
|
||||
Image2D(const Image2D & i);
|
||||
~Image2D();
|
||||
|
||||
Image2D & operator = (const Image2D & i);
|
||||
|
||||
void* ptr() const;
|
||||
protected:
|
||||
struct Impl;
|
||||
|
||||
@@ -1505,6 +1505,9 @@ static bool ocl_LUT(InputArray _src, InputArray _lut, OutputArray _dst)
|
||||
format("-D dcn=%d -D lcn=%d -D srcT=%s -D dstT=%s%s", dcn, lcn,
|
||||
ocl::typeToStr(src.depth()), ocl::typeToStr(ddepth),
|
||||
doubleSupport ? " -D DOUBLE_SUPPORT" : ""));
|
||||
if (k.empty())
|
||||
return false;
|
||||
|
||||
k.args(ocl::KernelArg::ReadOnlyNoSize(src), ocl::KernelArg::ReadOnlyNoSize(lut),
|
||||
ocl::KernelArg::WriteOnly(dst));
|
||||
|
||||
|
||||
@@ -2909,6 +2909,9 @@ static bool ocl_transpose( InputArray _src, OutputArray _dst )
|
||||
ocl::Kernel k(kernelName.c_str(), ocl::core::transpose_oclsrc,
|
||||
format("-D T=%s -D TILE_DIM=%d -D BLOCK_ROWS=%d",
|
||||
ocl::memopTypeToStr(type), TILE_DIM, BLOCK_ROWS));
|
||||
if (k.empty())
|
||||
return false;
|
||||
|
||||
if (inplace)
|
||||
k.args(ocl::KernelArg::ReadWriteNoSize(dst), dst.rows);
|
||||
else
|
||||
|
||||
+253
-225
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user