1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 23:33:05 +04:00

Merge pull request #5340 from alalek:ocl_off

This commit is contained in:
Vadim Pisarevsky
2015-11-10 16:53:36 +00:00
16 changed files with 127 additions and 18 deletions
+9 -3
View File
@@ -1364,10 +1364,16 @@ void pow( InputArray _src, double power, OutputArray _dst )
{
int type = _src.type(), depth = CV_MAT_DEPTH(type),
cn = CV_MAT_CN(type), ipower = cvRound(power);
bool is_ipower = fabs(ipower - power) < DBL_EPSILON,
useOpenCL = _dst.isUMat() && _src.dims() <= 2;
bool is_ipower = fabs(ipower - power) < DBL_EPSILON;
#ifdef HAVE_OPENCL
bool useOpenCL = _dst.isUMat() && _src.dims() <= 2;
#endif
if( is_ipower && !(ocl::Device::getDefault().isIntel() && useOpenCL && depth != CV_64F))
if( is_ipower
#ifdef HAVE_OPENCL
&& !(useOpenCL && ocl::Device::getDefault().isIntel() && depth != CV_64F)
#endif
)
{
switch( ipower )
{
+9 -1
View File
@@ -54,7 +54,9 @@
#include "opencv2/core/private.hpp"
#include "opencv2/core/private.cuda.hpp"
#ifdef HAVE_OPENCL
#include "opencv2/core/ocl.hpp"
#endif
#include "opencv2/hal.hpp"
@@ -262,7 +264,11 @@ struct ImplCollector
struct CoreTLSData
{
CoreTLSData() : device(0), useOpenCL(-1), useIPP(-1)
CoreTLSData() :
//#ifdef HAVE_OPENCL
device(0), useOpenCL(-1),
//#endif
useIPP(-1)
{
#ifdef HAVE_TEGRA_OPTIMIZATION
useTegra = -1;
@@ -270,9 +276,11 @@ struct CoreTLSData
}
RNG rng;
//#ifdef HAVE_OPENCL
int device;
ocl::Queue oclQueue;
int useOpenCL; // 1 - use, 0 - do not use, -1 - auto/not initialized
//#endif
int useIPP; // 1 - use, 0 - do not use, -1 - auto/not initialized
#ifdef HAVE_TEGRA_OPTIMIZATION
int useTegra; // 1 - use, 0 - do not use, -1 - auto/not initialized
+2
View File
@@ -391,7 +391,9 @@ void setUseOptimized( bool flag )
USE_SSE2 = currentFeatures->have[CV_CPU_SSE2];
ipp::setUseIPP(flag);
#ifdef HAVE_OPENCL
ocl::setUseOpenCL(flag);
#endif
#ifdef HAVE_TEGRA_OPTIMIZATION
::tegra::setUseTegra(flag);
#endif