diff --git a/modules/ocl/src/arithm.cpp b/modules/ocl/src/arithm.cpp index c4eb0041d9..a7e4fd90b6 100644 --- a/modules/ocl/src/arithm.cpp +++ b/modules/ocl/src/arithm.cpp @@ -57,180 +57,6 @@ using namespace cv; using namespace cv::ocl; using namespace std; -#if !defined (HAVE_OPENCL) - -/* arithmetics */ -void cv::ocl::add(const oclMat &, const oclMat &, oclMat &) -{ - throw_nogpu(); -} -void cv::ocl::add(const oclMat &, const oclMat &, oclMat &, const oclMat &) -{ - throw_nogpu(); -} -void cv::ocl::add(const oclMat &, const Scalar &, oclMat &, const oclMat &) -{ - throw_nogpu(); -} -void cv::ocl::subtract(const oclMat &, const oclMat &, oclMat &) -{ - throw_nogpu(); -} -void cv::ocl::subtract(const oclMat &, const oclMat &, oclMat &, const oclMat &) -{ - throw_nogpu(); -} -void cv::ocl::subtract(const oclMat &, const Scalar &, oclMat &, const oclMat & ) -{ - throw_nogpu(); -} -void cv::ocl::subtract(const Scalar &, const oclMat &, oclMat &, const oclMat & ) -{ - throw_nogpu(); -} -void cv::ocl::multiply(const oclMat &, const oclMat &, oclMat &, double) -{ - throw_nogpu(); -} -void cv::ocl::divide(const oclMat &, const oclMat &, oclMat &, double) -{ - throw_nogpu(); -} -void cv::ocl::divide(double, const oclMat &, oclMat &) -{ - throw_nogpu(); -} -void cv::ocl::absdiff(const oclMat &, const oclMat &, oclMat &) -{ - throw_nogpu(); -} -void cv::ocl::absdiff(const oclMat &, const Scalar &, oclMat &) -{ - throw_nogpu(); -} -void cv::ocl::compare(const oclMat &, const oclMat &, oclMat & , int) -{ - throw_nogpu(); -} -void cv::ocl::meanStdDev(const oclMat &, Scalar &, Scalar &) -{ - throw_nogpu(); -} -double cv::ocl::norm(const oclMat &, int) -{ - throw_nogpu(); - return 0.0; -} -double cv::ocl::norm(const oclMat &, const oclMat &, int) -{ - throw_nogpu(); - return 0.0; -} -void cv::ocl::flip(const oclMat &, oclMat &, int) -{ - throw_nogpu(); -} -Scalar cv::ocl::sum(const oclMat &) -{ - throw_nogpu(); - return Scalar(); -} -void cv::ocl::minMax(const oclMat &, double *, double *, const oclMat &) -{ - throw_nogpu(); -} -void cv::ocl::minMaxLoc(const oclMat &, double *, double *, Point *, Point *, const oclMat &) -{ - throw_nogpu(); -} -void cv::ocl::LUT(const oclMat &, const Mat &, oclMat &) -{ - throw_nogpu(); -} -void cv::ocl::exp(const oclMat &, oclMat &) -{ - throw_nogpu(); -} -void cv::ocl::log(const oclMat &, oclMat &) -{ - throw_nogpu(); -} -void cv::ocl::magnitude(const oclMat &, oclMat &) -{ - throw_nogpu(); -} -void cv::ocl::phase(const oclMat &, const oclMat &, oclMat &, bool) -{ - throw_nogpu(); -} -void cv::ocl::cartToPolar(const oclMat &, const oclMat &, oclMat &, oclMat &, bool) -{ - throw_nogpu(); -} -void cv::ocl::polarToCart(const oclMat &, const oclMat &, oclMat &, oclMat &, bool) -{ - throw_nogpu(); -} -void cv::ocl::transpose(const oclMat &, oclMat &) -{ - throw_nogpu(); -} -void cv::ocl::pow(const oclMat &, double, oclMat &) -{ - throw_nogpu(); -} -void cv::ocl::addWeighted(const oclMat &src1, double alpha, const oclMat &src2, double beta, double gama, oclMat &dst) -{ - throw_nogpu(); -} -void cv::ocl::magnitudeSqr(const oclMat &src1, const oclMat &src2, oclMat &dst) -{ - throw_nogpu(); -} - -/* bit wise operations */ -void cv::ocl::bitwise_not(const oclMat &, oclMat &) -{ - throw_nogpu(); -} -void cv::ocl::bitwise_or(const oclMat &, const oclMat &, oclMat &, const oclMat &) -{ - throw_nogpu(); -} -void cv::ocl::bitwise_and(const oclMat &, const oclMat &, oclMat &, const oclMat &) -{ - throw_nogpu(); -} -void cv::ocl::bitwise_and(const oclMat &, const Scalar &, oclMat &, const oclMat &) -{ - throw_nogpu(); -} -void cv::ocl::bitwise_xor(const oclMat &, const oclMat &, oclMat &, const oclMat &) -{ - throw_nogpu(); -} -cv::ocl::oclMat cv::ocl::operator ~ (const oclMat &) -{ - throw_nogpu(); - return oclMat(); -} -cv::ocl::oclMat cv::ocl::operator | (const oclMat &, const oclMat &) -{ - throw_nogpu(); - return oclMat(); -} -cv::ocl::oclMat cv::ocl::operator & (const oclMat &, const oclMat &) -{ - throw_nogpu(); - return oclMat(); -} -cv::ocl::oclMat cv::ocl::operator ^ (const oclMat &, const oclMat &) -{ - throw_nogpu(); - return oclMat(); -} - -#else /* !defined (HAVE_OPENCL) */ namespace cv { namespace ocl @@ -2477,5 +2303,3 @@ void cv::ocl::pow(const oclMat &x, double p, oclMat &y) arithmetic_pow_run(x, p, y, kernelName, &arithm_pow); } - -#endif /* !defined (HAVE_OPENCL) */ diff --git a/modules/ocl/src/binarycaching.hpp b/modules/ocl/src/binarycaching.hpp index 479487843f..0ec565f88b 100644 --- a/modules/ocl/src/binarycaching.hpp +++ b/modules/ocl/src/binarycaching.hpp @@ -50,17 +50,6 @@ using namespace std; using std::cout; using std::endl; -#if !defined (HAVE_OPENCL) -namespace cv -{ - namespace ocl - { - //nothing - }//namespace ocl -}//namespace cv - -#else /* !defined (HAVE_OPENCL) */ - namespace cv { namespace ocl @@ -99,4 +88,3 @@ namespace cv }//namespace ocl }//namespace cv -#endif diff --git a/modules/ocl/src/blend.cpp b/modules/ocl/src/blend.cpp index 75463b807f..5eead4766b 100644 --- a/modules/ocl/src/blend.cpp +++ b/modules/ocl/src/blend.cpp @@ -50,13 +50,6 @@ using namespace cv; using namespace cv::ocl; using namespace std; -#if !defined (HAVE_OPENCL) -void cv::ocl::blendLinear(const oclMat &img1, const oclMat &img2, const oclMat &weights1, const oclMat &weights2, - oclMat &result) -{ - throw_nogpu(); -} -#else namespace cv { namespace ocl @@ -97,5 +90,4 @@ void cv::ocl::blendLinear(const oclMat &img1, const oclMat &img2, const oclMat & openCLExecuteKernel(ctx, &blend_linear, kernelName, globalSize, localSize, args, channels, depth); } -} -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/modules/ocl/src/brute_force_matcher.cpp b/modules/ocl/src/brute_force_matcher.cpp index 9fe14d214d..c81e342d35 100644 --- a/modules/ocl/src/brute_force_matcher.cpp +++ b/modules/ocl/src/brute_force_matcher.cpp @@ -51,136 +51,6 @@ using namespace cv; using namespace cv::ocl; using namespace std; -#if !defined (HAVE_OPENCL) -cv::ocl::BruteForceMatcher_OCL_base::BruteForceMatcher_OCL_base(DistType) -{ - throw_nogpu(); -} -void cv::ocl::BruteForceMatcher_OCL_base::add(const vector &) -{ - throw_nogpu(); -} -const vector &cv::ocl::BruteForceMatcher_OCL_base::getTrainDescriptors() const -{ - throw_nogpu(); - return trainDescCollection; -} -void cv::ocl::BruteForceMatcher_OCL_base::clear() -{ - throw_nogpu(); -} -bool cv::ocl::BruteForceMatcher_OCL_base::empty() const -{ - throw_nogpu(); - return true; -} -bool cv::ocl::BruteForceMatcher_OCL_base::isMaskSupported() const -{ - throw_nogpu(); - return true; -} -void cv::ocl::BruteForceMatcher_OCL_base::matchSingle(const oclMat &, const oclMat &, oclMat &, oclMat &, const oclMat &) -{ - throw_nogpu(); -} -void cv::ocl::BruteForceMatcher_OCL_base::matchDownload(const oclMat &, const oclMat &, vector &) -{ - throw_nogpu(); -} -void cv::ocl::BruteForceMatcher_OCL_base::matchConvert(const Mat &, const Mat &, vector &) -{ - throw_nogpu(); -} -void cv::ocl::BruteForceMatcher_OCL_base::match(const oclMat &, const oclMat &, vector &, const oclMat &) -{ - throw_nogpu(); -} -void cv::ocl::BruteForceMatcher_OCL_base::makeGpuCollection(oclMat &, oclMat &, const vector &) -{ - throw_nogpu(); -} -void cv::ocl::BruteForceMatcher_OCL_base::matchCollection(const oclMat &, const oclMat &, oclMat &, oclMat &, oclMat &, const oclMat &) -{ - throw_nogpu(); -} -void cv::ocl::BruteForceMatcher_OCL_base::matchDownload(const oclMat &, const oclMat &, const oclMat &, vector &) -{ - throw_nogpu(); -} -void cv::ocl::BruteForceMatcher_OCL_base::matchConvert(const Mat &, const Mat &, const Mat &, vector &) -{ - throw_nogpu(); -} -void cv::ocl::BruteForceMatcher_OCL_base::match(const oclMat &, vector &, const vector &) -{ - throw_nogpu(); -} -void cv::ocl::BruteForceMatcher_OCL_base::knnMatchSingle(const oclMat &, const oclMat &, oclMat &, oclMat &, oclMat &, int, const oclMat &) -{ - throw_nogpu(); -} -void cv::ocl::BruteForceMatcher_OCL_base::knnMatchDownload(const oclMat &, const oclMat &, vector< vector > &, bool) -{ - throw_nogpu(); -} -void cv::ocl::BruteForceMatcher_OCL_base::knnMatchConvert(const Mat &, const Mat &, vector< vector > &, bool) -{ - throw_nogpu(); -} -void cv::ocl::BruteForceMatcher_OCL_base::knnMatch(const oclMat &, const oclMat &, vector< vector > &, int, const oclMat &, bool) -{ - throw_nogpu(); -} -void cv::ocl::BruteForceMatcher_OCL_base::knnMatch2Collection(const oclMat &, const oclMat &, oclMat &, oclMat &, oclMat &, const oclMat &) -{ - throw_nogpu(); -} -void cv::ocl::BruteForceMatcher_OCL_base::knnMatch2Download(const oclMat &, const oclMat &, const oclMat &, vector< vector > &, bool) -{ - throw_nogpu(); -} -void cv::ocl::BruteForceMatcher_OCL_base::knnMatch2Convert(const Mat &, const Mat &, const Mat &, vector< vector > &, bool) -{ - throw_nogpu(); -} -void cv::ocl::BruteForceMatcher_OCL_base::knnMatch(const oclMat &, vector< vector > &, int, const vector &, bool) -{ - throw_nogpu(); -} -void cv::ocl::BruteForceMatcher_OCL_base::radiusMatchSingle(const oclMat &, const oclMat &, oclMat &, oclMat &, oclMat &, float, const oclMat &) -{ - throw_nogpu(); -} -void cv::ocl::BruteForceMatcher_OCL_base::radiusMatchDownload(const oclMat &, const oclMat &, const oclMat &, vector< vector > &, bool) -{ - throw_nogpu(); -} -void cv::ocl::BruteForceMatcher_OCL_base::radiusMatchConvert(const Mat &, const Mat &, const Mat &, vector< vector > &, bool) -{ - throw_nogpu(); -} -void cv::ocl::BruteForceMatcher_OCL_base::radiusMatch(const oclMat &, const oclMat &, vector< vector > &, float, const oclMat &, bool) -{ - throw_nogpu(); -} -void cv::ocl::BruteForceMatcher_OCL_base::radiusMatchCollection(const oclMat &, oclMat &, oclMat &, oclMat &, oclMat &, float, const vector &) -{ - throw_nogpu(); -} -void cv::ocl::BruteForceMatcher_OCL_base::radiusMatchDownload(const oclMat &, const oclMat &, const oclMat &, const oclMat &, vector< vector > &, bool) -{ - throw_nogpu(); -} -void cv::ocl::BruteForceMatcher_OCL_base::radiusMatchConvert(const Mat &, const Mat &, const Mat &, const Mat &, vector< vector > &, bool) -{ - throw_nogpu(); -} -void cv::ocl::BruteForceMatcher_OCL_base::radiusMatch(const oclMat &, vector< vector > &, float, const vector &, bool) -{ - throw_nogpu(); -} -#else /* !defined (HAVE_OPENCL) */ - using namespace std; namespace cv { @@ -1826,8 +1696,4 @@ void cv::ocl::BruteForceMatcher_OCL_base::radiusMatch(const oclMat &query, vecto oclMat trainIdx, imgIdx, distance, nMatches; radiusMatchCollection(query, trainIdx, imgIdx, distance, nMatches, maxDistance, masks); radiusMatchDownload(trainIdx, imgIdx, distance, nMatches, matches, compactResult); -} - -#endif - - +} \ No newline at end of file diff --git a/modules/ocl/src/build_warps.cpp b/modules/ocl/src/build_warps.cpp index b41077ecd7..c4a092993a 100644 --- a/modules/ocl/src/build_warps.cpp +++ b/modules/ocl/src/build_warps.cpp @@ -49,21 +49,6 @@ using namespace cv; using namespace cv::ocl; using namespace std; -#if !defined (HAVE_OPENCL) -void cv::ocl::buildWarpPlaneMaps(Size, Rect, const Mat &, const Mat &, const Mat &, float, oclMat &, oclMat &, Stream &) -{ - throw_nogpu(); -} -void cv::ocl::buildWarpCylindricalMaps(Size, Rect, const Mat &, const Mat &, float, oclMat &, oclMat &, Stream &) -{ - throw_nogpu(); -} -void cv::ocl::buildWarpSphericalMaps(Size, Rect, const Mat &, const Mat &, float, oclMat &, oclMat &, Stream &) -{ - throw_nogpu(); -} -#else - namespace cv { namespace ocl @@ -275,6 +260,3 @@ void cv::ocl::buildWarpPerspectiveMaps(const Mat &M, bool inverse, Size dsize, o size_t localThreads[3] = {32, 8, 1}; openCLExecuteKernel(clCxt, &build_warps, kernelName, globalThreads, localThreads, args, -1, -1); } - - -#endif // HAVE_OPENCL diff --git a/modules/ocl/src/canny.cpp b/modules/ocl/src/canny.cpp index 2501089081..4b872a1bc4 100644 --- a/modules/ocl/src/canny.cpp +++ b/modules/ocl/src/canny.cpp @@ -51,25 +51,6 @@ using namespace cv; using namespace cv::ocl; using namespace std; -#if !defined (HAVE_OPENCL) -void cv::ocl::Canny(const oclMat &image, oclMat &edges, double low_thresh, double high_thresh, int apperture_size = 3, bool L2gradient = false) -{ - throw_nogpu(); -} -void cv::ocl::Canny(const oclMat &image, CannyBuf &buf, oclMat &edges, double low_thresh, double high_thresh, int apperture_size = 3, bool L2gradient = false) -{ - throw_nogpu(); -} -void cv::ocl::Canny(const oclMat &dx, const oclMat &dy, oclMat &edges, double low_thresh, double high_thresh, bool L2gradient = false) -{ - throw_nogpu(); -} -void cv::ocl::Canny(const oclMat &dx, const oclMat &dy, CannyBuf &buf, oclMat &edges, double low_thresh, double high_thresh, bool L2gradient = false) -{ - throw_nogpu(); -} -#else - namespace cv { namespace ocl @@ -426,5 +407,3 @@ void canny::getEdges_gpu(oclMat &map, oclMat &dst, int rows, int cols) openCLExecuteKernel2(clCxt, &imgproc_canny, kernelName, globalThreads, localThreads, args, -1, -1); } - -#endif // HAVE_OPENCL diff --git a/modules/ocl/src/color.cpp b/modules/ocl/src/color.cpp index ab613e051d..e14bd27569 100644 --- a/modules/ocl/src/color.cpp +++ b/modules/ocl/src/color.cpp @@ -49,18 +49,6 @@ using namespace cv; using namespace cv::ocl; -#if !defined (HAVE_OPENCL) - -void cv::ocl::cvtColor(const oclMat &, oclMat &, int, int) -{ - throw_nogpu(); -} -void cv::ocl::cvtColor(const oclMat &, oclMat &, int, int, const Stream &) -{ - throw_nogpu(); -} - -#else /* !defined (HAVE_OPENCL) */ #ifndef CV_DESCALE #define CV_DESCALE(x, n) (((x) + (1 << ((n)-1))) >> (n)) #endif @@ -289,5 +277,3 @@ void cv::ocl::cvtColor(const oclMat &src, oclMat &dst, int code, int dcn) { cvtColor_caller(src, dst, code, dcn); } - -#endif /* !defined (HAVE_OPENCL) */ diff --git a/modules/ocl/src/columnsum.cpp b/modules/ocl/src/columnsum.cpp index 06c871d502..037ff234e9 100644 --- a/modules/ocl/src/columnsum.cpp +++ b/modules/ocl/src/columnsum.cpp @@ -50,16 +50,6 @@ using namespace cv; using namespace cv::ocl; using namespace std; - -#if !defined(HAVE_OPENCL) - -void cv::ocl::columnSum(const oclMat &src, oclMat &dst) -{ - throw_nogpu(); -} - -#else /*!HAVE_OPENCL */ - namespace cv { namespace ocl @@ -92,5 +82,4 @@ void cv::ocl::columnSum(const oclMat &src, oclMat &dst) openCLExecuteKernel(clCxt, &imgproc_columnsum, kernelName, globalThreads, localThreads, args, src.channels(), src.depth()); -} -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/modules/ocl/src/error.cpp b/modules/ocl/src/error.cpp index 007c013cfb..e854e70cd0 100644 --- a/modules/ocl/src/error.cpp +++ b/modules/ocl/src/error.cpp @@ -46,12 +46,6 @@ using namespace cv; using namespace cv::ocl; -#if !defined (HAVE_OPENCL) - -// do nothing - -#else /* !defined (HAVE_OPENCL) */ - namespace cv { namespace ocl @@ -194,5 +188,3 @@ namespace cv } } } - -#endif diff --git a/modules/ocl/src/fft.cpp b/modules/ocl/src/fft.cpp index cbecaec796..300ae60a7f 100644 --- a/modules/ocl/src/fft.cpp +++ b/modules/ocl/src/fft.cpp @@ -49,12 +49,7 @@ using namespace cv; using namespace cv::ocl; using namespace std; -#if !defined HAVE_OPENCL -void cv::ocl::dft(const oclMat &, oclMat &, Size , int ) -{ - throw_nogpu(); -} -#elif !defined HAVE_CLAMDFFT +#if !defined HAVE_CLAMDFFT void cv::ocl::dft(const oclMat&, oclMat&, Size, int) { CV_Error(CV_StsNotImplemented, "OpenCL DFT is not implemented"); diff --git a/modules/ocl/src/filtering.cpp b/modules/ocl/src/filtering.cpp index b9ad3d995d..6697c953fd 100644 --- a/modules/ocl/src/filtering.cpp +++ b/modules/ocl/src/filtering.cpp @@ -54,121 +54,6 @@ using namespace std; using namespace cv; using namespace cv::ocl; -#if !defined (HAVE_OPENCL) - -Ptr cv::ocl::getBoxFilter_GPU(int, int, const Size &, Point, int) -{ - throw_nogpu(); - return Ptr(0); -} - -Ptr cv::ocl::createBoxFilter_GPU(int, int, const Size &, const Point &, int) -{ - throw_nogpu(); - return Ptr(0); -} - -Ptr cv::ocl::createFilter2D_GPU(const Ptr) -{ - throw_nogpu(); - return Ptr(0); -} - -Ptr cv::ocl::createSeparableLinearFilter_GPU(int, int, const Mat &, const Mat &, const Point &) -{ - throw_nogpu(); - return Ptr(0); -} - -Ptr cv::ocl::getLinearRowFilter_GPU(int, int, const Mat &, int) -{ - throw_nogpu(); - return Ptr(0); -} - -Ptr cv::ocl::getLinearColumnFilter_GPU(int, int, const Mat &, int) -{ - throw_nogpu(); - return Ptr(0); -} - -Ptr cv::ocl::createGaussianFilter_GPU(int, Size, double, double) -{ - throw_nogpu(); - return Ptr(0); -} - - -Ptr cv::ocl::getLinearFilter_GPU(int, int, const Mat &, const Size &, Point) -{ - throw_nogpu(); - return Ptr(0); -} - -Ptr cv::ocl::createLinearFilter_GPU(int, int, const Mat &, const Point &) -{ - throw_nogpu(); - return Ptr(0); -} - -Ptr cv::ocl::createDerivFilter_GPU(int srcType, int dstType, int dx, int dy, int ksize, int borderType) -{ - throw_nogpu(); - return Ptr(0); -} - -void cv::ocl::boxFilter(const oclMat &, oclMat &, int, Size, Point, int) -{ - throw_nogpu(); -} - -void cv::ocl::sepFilter2D(const oclMat &, oclMat &, int, const Mat &, const Mat &, Point) -{ - throw_nogpu(); -} - -void cv::ocl::Sobel(const oclMat &, oclMat &, int, int, int, int, double) -{ - throw_nogpu(); -} - -void cv::ocl::Scharr(const oclMat &, oclMat &, int, int, int, double) -{ - throw_nogpu(); -} - -void cv::ocl::GaussianBlur(const oclMat &, oclMat &, Size, double, double) -{ - throw_nogpu(); -} - -void cv::ocl::filter2D(const oclMat &, oclMat &, int, const Mat &, Point) -{ - throw_nogpu(); -} - -void cv::ocl::Laplacian(const oclMat &, oclMat &, int, int, double) -{ - throw_nogpu(); -} - -void cv::ocl::erode(const oclMat &, oclMat &, const Mat &, Point, int) -{ - throw_nogpu(); -} - -void cv::ocl::dilate(const oclMat &, oclMat &, const Mat &, Point, int) -{ - throw_nogpu(); -} - -void cv::ocl::morphologyEx(const oclMat &, oclMat &, int, const Mat &, Point, int) -{ - throw_nogpu(); -} - -#else /* !defined (HAVE_OPENCL) */ - //helper routines namespace cv { @@ -1705,5 +1590,3 @@ void cv::ocl::GaussianBlur(const oclMat &src, oclMat &dst, Size ksize, double si Ptr f = createGaussianFilter_GPU(src.type(), ksize, sigma1, sigma2, bordertype); f->apply(src, dst); } - -#endif /* !defined (HAVE_OPENCL) */ diff --git a/modules/ocl/src/gemm.cpp b/modules/ocl/src/gemm.cpp index 2f11e2b36a..be7e79cce3 100644 --- a/modules/ocl/src/gemm.cpp +++ b/modules/ocl/src/gemm.cpp @@ -46,24 +46,14 @@ #include #include "precomp.hpp" -#ifdef HAVE_CLAMDBLAS - -#include "clAmdBlas.h" - -#if !defined HAVE_OPENCL -void cv::ocl::gemm(const oclMat &src1, const oclMat &src2, double alpha, - const oclMat &src3, double beta, oclMat &dst, int flags) -{ - throw_nogpu(); -} -#elif !defined HAVE_CLAMDBLAS -void cv::ocl::gemm(const oclMat &src1, const oclMat &src2, double alpha, - const oclMat &src3, double beta, oclMat &dst, int flags) +#if !defined HAVE_CLAMDBLAS +void cv::ocl::gemm(const oclMat&, const oclMat&, double, + const oclMat&, double, oclMat&, int) { CV_Error(CV_StsNotImplemented, "OpenCL BLAS is not implemented"); } #else - +#include "clAmdBlas.h" using namespace cv; void cv::ocl::gemm(const oclMat &src1, const oclMat &src2, double alpha, @@ -168,4 +158,3 @@ void cv::ocl::gemm(const oclMat &src1, const oclMat &src2, double alpha, clAmdBlasTeardown(); } #endif -#endif diff --git a/modules/ocl/src/hog.cpp b/modules/ocl/src/hog.cpp index 7eca4fe0f6..59062ae499 100644 --- a/modules/ocl/src/hog.cpp +++ b/modules/ocl/src/hog.cpp @@ -49,69 +49,6 @@ using namespace cv; using namespace cv::ocl; using namespace std; -#if !defined (HAVE_OPENCL) - -cv::ocl::HOGDescriptor::HOGDescriptor(Size, Size, Size, Size, int, double, double, bool, int) -{ - throw_nogpu(); -} -size_t cv::ocl::HOGDescriptor::getDescriptorSize() const -{ - throw_nogpu(); - return 0; -} -size_t cv::ocl::HOGDescriptor::getBlockHistogramSize() const -{ - throw_nogpu(); - return 0; -} -double cv::ocl::HOGDescriptor::getWinSigma() const -{ - throw_nogpu(); - return 0; -} -bool cv::ocl::HOGDescriptor::checkDetectorSize() const -{ - throw_nogpu(); - return false; -} -void cv::ocl::HOGDescriptor::setSVMDetector(const vector &) -{ - throw_nogpu(); -} -void cv::ocl::HOGDescriptor::detect(const oclMat &, vector &, double, Size, Size) -{ - throw_nogpu(); -} -void cv::ocl::HOGDescriptor::detectMultiScale(const oclMat &, vector &, double, Size, Size, double, int) -{ - throw_nogpu(); -} -void cv::ocl::HOGDescriptor::computeBlockHistograms(const oclMat &) -{ - throw_nogpu(); -} -void cv::ocl::HOGDescriptor::getDescriptors(const oclMat &, Size, oclMat &, int) -{ - throw_nogpu(); -} -std::vector cv::ocl::HOGDescriptor::getDefaultPeopleDetector() -{ - throw_nogpu(); - return std::vector(); -} -std::vector cv::ocl::HOGDescriptor::getPeopleDetector48x96() -{ - throw_nogpu(); - return std::vector(); -} -std::vector cv::ocl::HOGDescriptor::getPeopleDetector64x128() -{ - throw_nogpu(); - return std::vector(); -} - -#else #define CELL_WIDTH 8 #define CELL_HEIGHT 8 @@ -1895,5 +1832,3 @@ void cv::ocl::device::hog::resize( const oclMat &src, oclMat &dst, const Size sz openCLExecuteKernel2(clCxt, &objdetect_hog, kernelName, globalThreads, localThreads, args, -1, -1); } - -#endif diff --git a/modules/ocl/src/imgproc.cpp b/modules/ocl/src/imgproc.cpp index f7d0c43948..8fbada1d33 100644 --- a/modules/ocl/src/imgproc.cpp +++ b/modules/ocl/src/imgproc.cpp @@ -59,62 +59,6 @@ using namespace cv; using namespace cv::ocl; using namespace std; -#if !defined (HAVE_OPENCL) - - -void cv::ocl::meanShiftFiltering(const oclMat &, oclMat &, int, int, TermCriteria) -{ - throw_nogpu(); -} -void cv::ocl::meanShiftProc(const oclMat &, oclMat &, oclMat &, int, int, TermCriteria) -{ - throw_nogpu(); -} -double cv::ocl::threshold(const oclMat &, oclMat &, double, int) -{ - throw_nogpu(); - return 0.0; -} -void cv::ocl::resize(const oclMat &, oclMat &, Size, double, double, int) -{ - throw_nogpu(); -} -void cv::ocl::remap(const oclMat &, oclMat &, oclMat &, oclMat &, int, int , const Scalar &) -{ - throw_nogpu(); -} - -void cv::ocl::copyMakeBorder(const oclMat &, oclMat &, int, int, int, int, const Scalar &) -{ - throw_nogpu(); -} -void cv::ocl::warpAffine(const oclMat &, oclMat &, const Mat &, Size, int) -{ - throw_nogpu(); -} -void cv::ocl::warpPerspective(const oclMat &, oclMat &, const Mat &, Size, int) -{ - throw_nogpu(); -} -void cv::ocl::integral(const oclMat &, oclMat &, oclMat &) -{ - throw_nogpu(); -} -void cv::ocl::calcHist(const oclMat &, oclMat &hist) -{ - throw_nogpu(); -} -void cv::ocl::bilateralFilter(const oclMat &, oclMat &, int, double, double, int) -{ - throw_nogpu(); -} -void cv::ocl::convolve(const oclMat &, const oclMat &, oclMat &) -{ - throw_nogpu(); -} - -#else /* !defined (HAVE_OPENCL) */ - namespace cv { namespace ocl @@ -1696,4 +1640,3 @@ void cv::ocl::convolve(const oclMat &x, const oclMat &t, oclMat &y) convolve_run(x, t, y, kernelName, &imgproc_convolve); } -#endif /* !defined (HAVE_OPENCL) */ diff --git a/modules/ocl/src/initialization.cpp b/modules/ocl/src/initialization.cpp index 8f8c19b945..c90b62b1a8 100644 --- a/modules/ocl/src/initialization.cpp +++ b/modules/ocl/src/initialization.cpp @@ -61,82 +61,6 @@ using std::endl; //#define AMD_DOUBLE_DIFFER -#if !defined (HAVE_OPENCL) - -namespace cv -{ - namespace ocl - { - - cl_device_id getDevice() - { - throw_nogpu(); - return 0; - } - - void getComputeCapability(cl_device_id, int &major, int &minor) - { - throw_nogpu(); - } - - void openCLMallocPitch(Context * /*clCxt*/, void ** /*dev_ptr*/, size_t * /*pitch*/, - size_t /*widthInBytes*/, size_t /*height*/) - { - throw_nogpu(); - } - - void openCLMemcpy2D(Context * /*clCxt*/, void * /*dst*/, size_t /*dpitch*/, - const void * /*src*/, size_t /*spitch*/, - size_t /*width*/, size_t /*height*/, enum openCLMemcpyKind /*kind*/) - { - throw_nogpu(); - } - - void openCLCopyBuffer2D(Context * /*clCxt*/, void * /*dst*/, size_t /*dpitch*/, - const void * /*src*/, size_t /*spitch*/, - size_t /*width*/, size_t /*height*/, enum openCLMemcpyKind /*kind*/) - { - throw_nogpu(); - } - - cl_mem openCLCreateBuffer(Context *, size_t, size_t) - { - throw_nogpu(); - } - - void openCLReadBuffer(Context *, cl_mem, void *, size_t) - { - throw_nogpu(); - } - - void openCLFree(void * /*devPtr*/) - { - throw_nogpu(); - } - - cl_kernel openCLGetKernelFromSource(const Context * /*clCxt*/, - const char ** /*fileName*/, string /*kernelName*/) - { - throw_nogpu(); - } - - void openCLVerifyKernel(const Context * /*clCxt*/, cl_kernel /*kernel*/, size_t * /*blockSize*/, - size_t * /*globalThreads*/, size_t * /*localThreads*/) - { - throw_nogpu(); - } - - cl_mem load_constant(cl_context context, cl_command_queue command_queue, const void *value, - const size_t size) - { - throw_nogpu(); - } - - }//namespace ocl -}//namespace cv - -#else /* !defined (HAVE_OPENCL) */ - namespace cv { namespace ocl @@ -1013,4 +937,3 @@ namespace cv }//namespace ocl }//namespace cv -#endif diff --git a/modules/ocl/src/interpolate_frames.cpp b/modules/ocl/src/interpolate_frames.cpp index d6b4020939..6b9f53b853 100644 --- a/modules/ocl/src/interpolate_frames.cpp +++ b/modules/ocl/src/interpolate_frames.cpp @@ -50,17 +50,6 @@ using namespace std; using namespace cv; using namespace cv::ocl; - -#if !defined (HAVE_OPENCL) -void cv::ocl::interpolateFrames(const oclMat &frame0, const oclMat &frame1, - const oclMat &fu, const oclMat &fv, - const oclMat &bu, const oclMat &bv, - float pos, oclMat &newFrame, oclMat &buf) -{ - throw_nogpu(); -} -#else - namespace cv { namespace ocl @@ -311,5 +300,4 @@ void interpolate::bindImgTex(const oclMat &img, cl_mem &texture) clEnqueueCopyBufferToImage(img.clCxt->impl->clCmdQueue, (cl_mem)img.data, texture, 0, origin, region, 0, NULL, 0); openCLSafeCall(err); } -#endif//(HAVE_OPENCL) diff --git a/modules/ocl/src/match_template.cpp b/modules/ocl/src/match_template.cpp index 8a27056469..ab867d4d31 100644 --- a/modules/ocl/src/match_template.cpp +++ b/modules/ocl/src/match_template.cpp @@ -51,12 +51,6 @@ using namespace cv; using namespace cv::ocl; using namespace std; -#if !defined (HAVE_OPENCL) -void cv::ocl::matchTemplate(const oclMat &, const oclMat &, oclMat &) -{ - throw_nogpu(); -} -#else //helper routines namespace cv { @@ -498,4 +492,3 @@ void cv::ocl::matchTemplate(const oclMat &image, const oclMat &templ, oclMat &re CV_Assert(caller); caller(image, templ, result, buf); } -#endif // diff --git a/modules/ocl/src/matrix_operations.cpp b/modules/ocl/src/matrix_operations.cpp index 7b90218d97..f0e65f9cc8 100644 --- a/modules/ocl/src/matrix_operations.cpp +++ b/modules/ocl/src/matrix_operations.cpp @@ -58,60 +58,6 @@ using namespace std; //////////////////////////////// oclMat //////////////////////////////// //////////////////////////////////////////////////////////////////////// -#if !defined (HAVE_OPENCL) - -namespace cv -{ - namespace ocl - { - void oclMat::upload(const Mat & /*m*/) - { - throw_nogpu(); - } - void oclMat::download(cv::Mat & /*m*/) const - { - throw_nogpu(); - } - void oclMat::copyTo( oclMat & /*m*/ ) const - { - throw_nogpu(); - } - void oclMat::copyTo( oclMat & /*m*/, const oclMat &/* mask */) const - { - throw_nogpu(); - } - void oclMat::convertTo( oclMat & /*m*/, int /*rtype*/, double /*alpha*/, double /*beta*/ ) const - { - throw_nogpu(); - } - oclMat &oclMat::operator = (const Scalar & /*s*/) - { - throw_nogpu(); - return *this; - } - oclMat &oclMat::setTo(const Scalar & /*s*/, const oclMat & /*mask*/) - { - throw_nogpu(); - return *this; - } - oclMat oclMat::reshape(int /*new_cn*/, int /*new_rows*/) const - { - throw_nogpu(); - return oclMat(); - } - void oclMat::create(int /*_rows*/, int /*_cols*/, int /*_type*/) - { - throw_nogpu(); - } - void oclMat::release() - { - throw_nogpu(); - } - } -} - -#else /* !defined (HAVE_OPENCL) */ - //helper routines namespace cv { @@ -1045,4 +991,3 @@ oclMat& cv::ocl::oclMat::operator/=( const oclMat& m ) divide(*this, m, *this); return *this; } -#endif /* !defined (HAVE_OPENCL) */ diff --git a/modules/ocl/src/mcwutil.hpp b/modules/ocl/src/mcwutil.hpp index 8db61f1633..d1986b93bd 100644 --- a/modules/ocl/src/mcwutil.hpp +++ b/modules/ocl/src/mcwutil.hpp @@ -47,9 +47,6 @@ #define _OPENCV_MCWUTIL_ #include "precomp.hpp" - -#if defined (HAVE_OPENCL) - using namespace std; namespace cv @@ -76,5 +73,5 @@ namespace cv }//namespace ocl }//namespace cv -#endif // HAVE_OPENCL + #endif //_OPENCV_MCWUTIL_ diff --git a/modules/ocl/src/mssegmentation.cpp b/modules/ocl/src/mssegmentation.cpp index 48bc96f41b..300265bc2e 100644 --- a/modules/ocl/src/mssegmentation.cpp +++ b/modules/ocl/src/mssegmentation.cpp @@ -44,23 +44,6 @@ #include "precomp.hpp" -#if !defined(HAVE_OPENCL) - -namespace cv -{ - namespace ocl - { - - void meanShiftSegmentation(const oclMat &, Mat &, int, int, int, TermCriteria) - { - throw_nogpu(); - } - - } -} - -#else - using namespace std; // Auxiliray stuff @@ -411,4 +394,3 @@ namespace cv } } -#endif // #if !defined (HAVE_OPENCL) diff --git a/modules/ocl/src/pyrlk.cpp b/modules/ocl/src/pyrlk.cpp index 87c536ec94..d4dbfd5061 100644 --- a/modules/ocl/src/pyrlk.cpp +++ b/modules/ocl/src/pyrlk.cpp @@ -52,13 +52,6 @@ using namespace std; using namespace cv; using namespace cv::ocl; -#if !defined (HAVE_OPENCL) - -void cv::ocl::PyrLKOpticalFlow::sparse(const oclMat &, const oclMat &, const oclMat &, oclMat &, oclMat &, oclMat &) { } -void cv::ocl::PyrLKOpticalFlow::dense(const oclMat &, const oclMat &, oclMat &, oclMat &, oclMat *) { } - -#else /* !defined (HAVE_OPENCL) */ - namespace cv { namespace ocl @@ -862,5 +855,3 @@ void cv::ocl::PyrLKOpticalFlow::dense(const oclMat &prevImg, const oclMat &nextI clFinish(prevImg.clCxt->impl->clCmdQueue); } - -#endif /* !defined (HAVE_CUDA) */ diff --git a/modules/ocl/src/pyrup.cpp b/modules/ocl/src/pyrup.cpp index ebd3535b66..fa7f73d4cb 100644 --- a/modules/ocl/src/pyrup.cpp +++ b/modules/ocl/src/pyrup.cpp @@ -54,13 +54,6 @@ using namespace cv; using namespace cv::ocl; using namespace std; -#ifndef HAVE_OPENCL -void cv::ocl::pyrUp(const oclMat &, GpuMat &, oclMat &) -{ - throw_nogpu(); -} -#else - namespace cv { namespace ocl @@ -93,5 +86,4 @@ namespace cv openCLExecuteKernel(clCxt, &pyr_up, kernelName, globalThreads, localThreads, args, src.oclchannels(), src.depth()); } } -}; -#endif // HAVE_OPENCL \ No newline at end of file +} \ No newline at end of file diff --git a/modules/ocl/src/split_merge.cpp b/modules/ocl/src/split_merge.cpp index b071ff8702..e7aad4382a 100644 --- a/modules/ocl/src/split_merge.cpp +++ b/modules/ocl/src/split_merge.cpp @@ -58,34 +58,6 @@ using std::endl; ///////////////// oclMat merge and split /////////////////////////////// //////////////////////////////////////////////////////////////////////// -#if !defined (HAVE_OPENCL) - -namespace cv -{ - namespace ocl - { - void cv::ocl::merge(const oclMat *src_mat, size_t count, oclMat &dst_mat) - { - throw_nogpu(); - } - void cv::ocl::merge(const vector &src_mat, oclMat &dst_mat) - { - throw_nogpu(); - } - - void cv::ocl::split(const oclMat &src, oclMat *dst) - { - throw_nogpu(); - } - void cv::ocl::split(const oclMat &src, vector &dst) - { - throw_nogpu(); - } - } -} - -#else /* !defined (HAVE_OPENCL) */ - namespace cv { namespace ocl @@ -417,4 +389,3 @@ void cv::ocl::split(const oclMat &src, vector &dst) if(src.oclchannels() > 0) split_merge::split(src, &dst[0]); } -#endif /* !defined (HAVE_OPENCL) */ diff --git a/modules/ocl/src/surf.cpp b/modules/ocl/src/surf.cpp index 71a7aacd33..65dc86d167 100644 --- a/modules/ocl/src/surf.cpp +++ b/modules/ocl/src/surf.cpp @@ -50,59 +50,6 @@ using namespace cv; using namespace cv::ocl; using namespace std; -#if !defined (HAVE_OPENCL) - -cv::ocl::SURF_OCL::SURF_OCL() -{ - throw_nogpu(); -} -cv::ocl::SURF_OCL::SURF_OCL(double, int, int, bool, float, bool) -{ - throw_nogpu(); -} -int cv::ocl::SURF_OCL::descriptorSize() const -{ - throw_nogpu(); - return 0; -} -void cv::ocl::SURF_OCL::uploadKeypoints(const vector &, oclMat &) -{ - throw_nogpu(); -} -void cv::ocl::SURF_OCL::downloadKeypoints(const oclMat &, vector &) -{ - throw_nogpu(); -} -void cv::ocl::SURF_OCL::downloadDescriptors(const oclMat &, vector &) -{ - throw_nogpu(); -} -void cv::ocl::SURF_OCL::operator()(const oclMat &, const oclMat &, oclMat &) -{ - throw_nogpu(); -} -void cv::ocl::SURF_OCL::operator()(const oclMat &, const oclMat &, oclMat &, oclMat &, bool) -{ - throw_nogpu(); -} -void cv::ocl::SURF_OCL::operator()(const oclMat &, const oclMat &, vector &) -{ - throw_nogpu(); -} -void cv::ocl::SURF_OCL::operator()(const oclMat &, const oclMat &, vector &, oclMat &, bool) -{ - throw_nogpu(); -} -void cv::ocl::SURF_OCL::operator()(const oclMat &, const oclMat &, vector &, vector &, bool) -{ - throw_nogpu(); -} -void cv::ocl::SURF_OCL::releaseMemory() -{ - throw_nogpu(); -} - -#else /* !defined (HAVE_OPENCL) */ namespace cv { namespace ocl @@ -755,5 +702,3 @@ void SURF_OCL_Invoker::compute_descriptors_gpu(const oclMat &descriptors, const } } -#endif // /* !defined (HAVE_OPENCL) */ -