Fixed problem with compilation without HAVE_OPENCL

When compiling without OpenCL, some classes from its namespace are still used in code.
This commit is contained in:
DeanF 2014-04-01 21:20:13 +03:00
parent 6ef94b52ad
commit bdc91c66c9

View File

@ -88,8 +88,10 @@ void UMatData::unlock()
MatAllocator* UMat::getStdAllocator()
{
#ifdef HAVE_OPENCL
if( ocl::haveOpenCL() && ocl::useOpenCL() )
return ocl::getOpenCLAllocator();
#endif
return Mat::getStdAllocator();
}
@ -665,6 +667,8 @@ void UMat::copyTo(OutputArray _dst, InputArray _mask) const
copyTo(_dst);
return;
}
#ifdef HAVE_OPENCL
int cn = channels(), mtype = _mask.type(), mdepth = CV_MAT_DEPTH(mtype), mcn = CV_MAT_CN(mtype);
CV_Assert( mdepth == CV_8U && (mcn == 1 || mcn == cn) );
@ -692,6 +696,7 @@ void UMat::copyTo(OutputArray _dst, InputArray _mask) const
return;
}
}
#endif
Mat src = getMat(ACCESS_READ);
src.copyTo(_dst, _mask);
@ -713,7 +718,9 @@ void UMat::convertTo(OutputArray _dst, int _type, double alpha, double beta) con
copyTo(_dst);
return;
}
#ifdef HAVE_OPENCL
bool doubleSupport = ocl::Device::getDefault().doubleFPConfig() > 0;
bool needDouble = sdepth == CV_64F || ddepth == CV_64F;
if( dims <= 2 && cn && _dst.isUMat() && ocl::useOpenCL() &&
@ -748,6 +755,7 @@ void UMat::convertTo(OutputArray _dst, int _type, double alpha, double beta) con
return;
}
}
#endif
Mat m = getMat(ACCESS_READ);
m.convertTo(_dst, _type, alpha, beta);
@ -756,7 +764,10 @@ void UMat::convertTo(OutputArray _dst, int _type, double alpha, double beta) con
UMat& UMat::setTo(InputArray _value, InputArray _mask)
{
bool haveMask = !_mask.empty();
#ifdef HAVE_OPENCL
int tp = type(), cn = CV_MAT_CN(tp);
if( dims <= 2 && cn <= 4 && CV_MAT_DEPTH(tp) < CV_64F && ocl::useOpenCL() )
{
Mat value = _value.getMat();
@ -795,6 +806,8 @@ UMat& UMat::setTo(InputArray _value, InputArray _mask)
return *this;
}
}
#endif
Mat m = getMat(haveMask ? ACCESS_RW : ACCESS_WRITE);
m.setTo(_value, _mask);
return *this;