From 91a1a71de2fa2ee320d423250f6a41b98e8d6d79 Mon Sep 17 00:00:00 2001 From: Anatoly Baksheev Date: Mon, 8 Oct 2012 22:20:53 +0400 Subject: [PATCH] fixed compilation under Ubuntu without CUDA --- modules/gpu/src/cuda/internal_shared.hpp | 6 +----- modules/gpu/src/denoising.cpp | 3 +-- modules/gpu/src/precomp.cpp | 9 +++++---- modules/gpu/src/precomp.hpp | 11 ++++++++++- 4 files changed, 17 insertions(+), 12 deletions(-) diff --git a/modules/gpu/src/cuda/internal_shared.hpp b/modules/gpu/src/cuda/internal_shared.hpp index 193fcb3..3351043 100644 --- a/modules/gpu/src/cuda/internal_shared.hpp +++ b/modules/gpu/src/cuda/internal_shared.hpp @@ -60,11 +60,7 @@ namespace cv { namespace gpu BORDER_REFLECT_GPU, BORDER_WRAP_GPU }; - - // Converts CPU border extrapolation mode into GPU internal analogue. - // Returns true if the GPU analogue exists, false otherwise. - bool tryConvertToGpuBorderType(int cpuBorderType, int& gpuBorderType); - + class NppStreamHandler { public: diff --git a/modules/gpu/src/denoising.cpp b/modules/gpu/src/denoising.cpp index 6c7a669..0e28cd4 100644 --- a/modules/gpu/src/denoising.cpp +++ b/modules/gpu/src/denoising.cpp @@ -49,10 +49,9 @@ using namespace cv::gpu; void cv::gpu::bilateralFilter(const GpuMat&, GpuMat&, int, float, float, int, Stream&) { throw_nogpu(); } void cv::gpu::nonLocalMeans(const GpuMat&, GpuMat&, float, int, int, int, Stream&) { throw_nogpu(); } -void cv::gpu::fastNlMeansDenoising( const GpuMat&, GpuMat&, float, int, int, Stream&) { throw_nogpu(); } void cv::gpu::FastNonLocalMeansDenoising::simpleMethod(const GpuMat&, GpuMat&, float, int, int, Stream&) { throw_nogpu(); } -void cv::gpu::FastNonLocalMeansDenoising::labMethod( const GpuMat&, GpuMat, float, float, int, int, Stream&) { throw_nogpu(); } +void cv::gpu::FastNonLocalMeansDenoising::labMethod( const GpuMat&, GpuMat&, float, float, int, int, Stream&) { throw_nogpu(); } #else diff --git a/modules/gpu/src/precomp.cpp b/modules/gpu/src/precomp.cpp index fb2823b..1f16f33 100644 --- a/modules/gpu/src/precomp.cpp +++ b/modules/gpu/src/precomp.cpp @@ -41,10 +41,12 @@ #include "precomp.hpp" - - bool cv::gpu::tryConvertToGpuBorderType(int cpuBorderType, int& gpuBorderType) { +#if !defined (HAVE_CUDA) + (void)cpuBorderType; + (void)gpuBorderType; +#else switch (cpuBorderType) { case cv::BORDER_REFLECT101: @@ -65,10 +67,9 @@ bool cv::gpu::tryConvertToGpuBorderType(int cpuBorderType, int& gpuBorderType) default: return false; }; +#endif return false; } - - /* End of file. */ diff --git a/modules/gpu/src/precomp.hpp b/modules/gpu/src/precomp.hpp index 1cf467c..da5036f 100644 --- a/modules/gpu/src/precomp.hpp +++ b/modules/gpu/src/precomp.hpp @@ -123,9 +123,18 @@ static inline void throw_nogpu() { CV_Error(CV_StsNotImplemented, "The called functionality is disabled for current build or platform"); } #else /* defined(HAVE_CUDA) */ - + static inline void throw_nogpu() { CV_Error(CV_GpuNotSupported, "The library is compiled without GPU support"); } #endif /* defined(HAVE_CUDA) */ + +namespace cv { namespace gpu +{ + // Converts CPU border extrapolation mode into GPU internal analogue. + // Returns true if the GPU analogue exists, false otherwise. + bool tryConvertToGpuBorderType(int cpuBorderType, int& gpuBorderType); + +}} + #endif /* __OPENCV_PRECOMP_H__ */ -- 2.7.4