From 55b1d7c097c516a29a51019b27249f5927d672a5 Mon Sep 17 00:00:00 2001 From: Anatoly Baksheev Date: Mon, 1 Oct 2012 22:37:20 +0400 Subject: [PATCH] added CUDA_DISABLER preprocessor commands --- modules/core/src/cuda/matrix_operations.cu | 4 +++ modules/core/src/gpumat.cpp | 16 +++++----- modules/core/src/opengl_interop.cpp | 16 +++++----- modules/gpu/perf/main.cpp | 4 +-- modules/gpu/src/arithm.cpp | 2 +- modules/gpu/src/bgfg_gmg.cpp | 2 +- modules/gpu/src/bgfg_mog.cpp | 2 +- modules/gpu/src/bgfg_vibe.cpp | 2 +- modules/gpu/src/bilateral_filter.cpp | 2 +- modules/gpu/src/blend.cpp | 2 +- modules/gpu/src/brute_force_matcher.cpp | 2 +- modules/gpu/src/calib3d.cpp | 2 +- modules/gpu/src/cascadeclassifier.cpp | 2 +- modules/gpu/src/color.cpp | 2 +- modules/gpu/src/cuda/NV12ToARGB.cu | 4 +++ modules/gpu/src/cuda/bf_knnmatch.cu | 5 ++++ modules/gpu/src/cuda/bf_match.cu | 5 ++++ modules/gpu/src/cuda/bf_radius_match.cu | 5 ++++ modules/gpu/src/cuda/bgfg_gmg.cu | 5 ++++ modules/gpu/src/cuda/bgfg_mog.cu | 5 ++++ modules/gpu/src/cuda/bgfg_vibe.cu | 5 ++++ modules/gpu/src/cuda/bilateral_filter.cu | 5 ++++ modules/gpu/src/cuda/blend.cu | 5 ++++ modules/gpu/src/cuda/calib3d.cu | 5 ++++ modules/gpu/src/cuda/canny.cu | 5 ++++ modules/gpu/src/cuda/ccomponetns.cu | 6 +++- modules/gpu/src/cuda/color.cu | 4 +++ modules/gpu/src/cuda/column_filter.cu | 5 ++++ modules/gpu/src/cuda/copy_make_border.cu | 4 +++ modules/gpu/src/cuda/debayer.cu | 4 +++ modules/gpu/src/cuda/disp_bilateral_filter.cu | 4 +++ modules/gpu/src/cuda/element_operations.cu | 4 +++ modules/gpu/src/cuda/fast.cu | 5 ++++ modules/gpu/src/cuda/fgd_bgfg.cu | 4 +++ modules/gpu/src/cuda/gftt.cu | 5 ++++ modules/gpu/src/cuda/global_motion.cu | 5 ++++ modules/gpu/src/cuda/hist.cu | 5 ++++ modules/gpu/src/cuda/hog.cu | 5 ++++ modules/gpu/src/cuda/hough.cu | 5 ++++ modules/gpu/src/cuda/imgproc.cu | 5 ++++ modules/gpu/src/cuda/integral_image.cu | 4 +++ modules/gpu/src/cuda/lbp.cu | 6 +++- modules/gpu/src/cuda/match_template.cu | 5 ++++ modules/gpu/src/cuda/mathfunc.cu | 4 +++ modules/gpu/src/cuda/matrix_reductions.cu | 4 +++ modules/gpu/src/cuda/nlm.cu | 4 +++ modules/gpu/src/cuda/optical_flow.cu | 4 +++ modules/gpu/src/cuda/optical_flow_farneback.cu | 4 +++ modules/gpu/src/cuda/orb.cu | 6 +++- modules/gpu/src/cuda/pyr_down.cu | 5 ++++ modules/gpu/src/cuda/pyr_up.cu | 4 +++ modules/gpu/src/cuda/pyrlk.cu | 4 +++ modules/gpu/src/cuda/remap.cu | 5 ++++ modules/gpu/src/cuda/resize.cu | 5 ++++ modules/gpu/src/cuda/rgb_to_yv12.cu | 4 +++ modules/gpu/src/cuda/row_filter.cu | 5 ++++ modules/gpu/src/cuda/split_merge.cu | 5 ++++ modules/gpu/src/cuda/stereobm.cu | 5 ++++ modules/gpu/src/cuda/stereobp.cu | 4 +++ modules/gpu/src/cuda/stereocsbp.cu | 4 +++ modules/gpu/src/cuda/surf.cu | 5 ++++ modules/gpu/src/cuda/warp.cu | 5 ++++ modules/gpu/src/cudastream.cpp | 34 ++++++++++++---------- modules/gpu/src/denoising.cpp | 2 +- modules/gpu/src/element_operations.cpp | 2 +- modules/gpu/src/fast.cpp | 2 +- modules/gpu/src/fgd_bgfg.cpp | 2 +- modules/gpu/src/filtering.cpp | 2 +- modules/gpu/src/gftt.cpp | 2 +- modules/gpu/src/global_motion.cpp | 2 +- modules/gpu/src/graphcuts.cpp | 2 +- modules/gpu/src/hog.cpp | 2 +- modules/gpu/src/hough.cpp | 2 +- modules/gpu/src/imgproc.cpp | 2 +- modules/gpu/src/match_template.cpp | 2 +- modules/gpu/src/matrix_operations.cpp | 2 +- modules/gpu/src/matrix_reductions.cpp | 2 +- modules/gpu/src/mssegmentation.cpp | 4 +-- modules/gpu/src/nvidia/NCVBroxOpticalFlow.cu | 4 +++ modules/gpu/src/nvidia/NCVHaarObjectDetection.cu | 4 +++ modules/gpu/src/nvidia/NPP_staging/NPP_staging.cu | 3 ++ modules/gpu/src/nvidia/core/NCV.cu | 4 +++ modules/gpu/src/nvidia/core/NCVPyramid.cu | 3 ++ modules/gpu/src/optical_flow.cpp | 2 +- modules/gpu/src/optical_flow_farneback.cpp | 2 +- modules/gpu/src/orb.cpp | 2 +- modules/gpu/src/pyramids.cpp | 2 +- modules/gpu/src/pyrlk.cpp | 2 +- modules/gpu/src/remap.cpp | 2 +- modules/gpu/src/resize.cpp | 2 +- modules/gpu/src/split_merge.cpp | 2 +- modules/gpu/src/stereobm.cpp | 2 +- modules/gpu/src/stereobp.cpp | 2 +- modules/gpu/src/stereocsbp.cpp | 2 +- modules/gpu/src/surf.cpp | 2 +- modules/gpu/src/video_reader.cpp | 2 +- modules/gpu/src/video_writer.cpp | 2 +- modules/gpu/src/warp.cpp | 2 +- modules/gpu/test/main.cpp | 2 +- modules/gpu/test/nvidia/TestCompact.cpp | 4 +++ modules/gpu/test/nvidia/TestDrawRects.cpp | 4 +++ .../gpu/test/nvidia/TestHaarCascadeApplication.cpp | 4 +++ modules/gpu/test/nvidia/TestHaarCascadeLoader.cpp | 4 +++ modules/gpu/test/nvidia/TestHypothesesFilter.cpp | 4 +++ modules/gpu/test/nvidia/TestHypothesesGrow.cpp | 4 +++ modules/gpu/test/nvidia/TestIntegralImage.cpp | 4 +++ .../gpu/test/nvidia/TestIntegralImageSquared.cpp | 4 +++ modules/gpu/test/nvidia/TestRectStdDev.cpp | 4 +++ modules/gpu/test/nvidia/TestResize.cpp | 4 +++ modules/gpu/test/nvidia/TestTranspose.cpp | 4 +++ modules/gpu/test/nvidia/main_nvidia.cpp | 4 +++ modules/gpu/test/test_nvidia.cpp | 8 +++-- 112 files changed, 376 insertions(+), 81 deletions(-) diff --git a/modules/core/src/cuda/matrix_operations.cu b/modules/core/src/cuda/matrix_operations.cu index f475136..c3da05e 100644 --- a/modules/core/src/cuda/matrix_operations.cu +++ b/modules/core/src/cuda/matrix_operations.cu @@ -40,6 +40,8 @@ // //M*/ +#if !defined CUDA_DISABLER + #include "opencv2/gpu/device/saturate_cast.hpp" #include "opencv2/gpu/device/transform.hpp" #include "opencv2/gpu/device/functional.hpp" @@ -340,3 +342,5 @@ namespace cv { namespace gpu { namespace device # pragma clang diagnostic pop #endif }}} // namespace cv { namespace gpu { namespace device + +#endif /* CUDA_DISABLER */ \ No newline at end of file diff --git a/modules/core/src/gpumat.cpp b/modules/core/src/gpumat.cpp index 07d7363..90162e7 100644 --- a/modules/core/src/gpumat.cpp +++ b/modules/core/src/gpumat.cpp @@ -94,7 +94,7 @@ namespace bool cv::gpu::TargetArchs::builtWith(cv::gpu::FeatureSet feature_set) { -#ifdef HAVE_CUDA +#if defined HAVE_CUDA && !defined(CUDA_DISABLER) return ::compareToSet(CUDA_ARCH_FEATURES, feature_set, std::greater_equal()); #else (void)feature_set; @@ -109,7 +109,7 @@ bool cv::gpu::TargetArchs::has(int major, int minor) bool cv::gpu::TargetArchs::hasPtx(int major, int minor) { -#ifdef HAVE_CUDA +#if defined HAVE_CUDA && !defined(CUDA_DISABLER) return ::compareToSet(CUDA_ARCH_PTX, major * 10 + minor, std::equal_to()); #else (void)major; @@ -120,7 +120,7 @@ bool cv::gpu::TargetArchs::hasPtx(int major, int minor) bool cv::gpu::TargetArchs::hasBin(int major, int minor) { -#if defined (HAVE_CUDA) +#if defined (HAVE_CUDA) && !defined(CUDA_DISABLER) return ::compareToSet(CUDA_ARCH_BIN, major * 10 + minor, std::equal_to()); #else (void)major; @@ -131,7 +131,7 @@ bool cv::gpu::TargetArchs::hasBin(int major, int minor) bool cv::gpu::TargetArchs::hasEqualOrLessPtx(int major, int minor) { -#ifdef HAVE_CUDA +#if defined HAVE_CUDA && !defined(CUDA_DISABLER) return ::compareToSet(CUDA_ARCH_PTX, major * 10 + minor, std::less_equal()); #else @@ -149,7 +149,7 @@ bool cv::gpu::TargetArchs::hasEqualOrGreater(int major, int minor) bool cv::gpu::TargetArchs::hasEqualOrGreaterPtx(int major, int minor) { -#ifdef HAVE_CUDA +#if defined HAVE_CUDA && !defined(CUDA_DISABLER) return ::compareToSet(CUDA_ARCH_PTX, major * 10 + minor, std::greater_equal()); #else @@ -161,7 +161,7 @@ bool cv::gpu::TargetArchs::hasEqualOrGreaterPtx(int major, int minor) bool cv::gpu::TargetArchs::hasEqualOrGreaterBin(int major, int minor) { -#ifdef HAVE_CUDA +#if defined HAVE_CUDA && !defined(CUDA_DISABLER) return ::compareToSet(CUDA_ARCH_BIN, major * 10 + minor, std::greater_equal()); #else @@ -171,7 +171,7 @@ bool cv::gpu::TargetArchs::hasEqualOrGreaterBin(int major, int minor) #endif } -#ifndef HAVE_CUDA +#if !defined HAVE_CUDA || defined(CUDA_DISABLER) #define throw_nogpu CV_Error(CV_GpuNotSupported, "The library is compiled without CUDA support") @@ -728,7 +728,7 @@ namespace }; } -#ifndef HAVE_CUDA +#if !defined HAVE_CUDA || defined(CUDA_DISABLER) namespace { diff --git a/modules/core/src/opengl_interop.cpp b/modules/core/src/opengl_interop.cpp index 5895363..a549366 100644 --- a/modules/core/src/opengl_interop.cpp +++ b/modules/core/src/opengl_interop.cpp @@ -70,7 +70,7 @@ using namespace cv::gpu; #else #define throw_nogl CV_Error(CV_OpenGlNotSupported, "OpenGL context doesn't exist") - #ifndef HAVE_CUDA + #if !defined HAVE_CUDA || defined(CUDA_DISABLER) #define throw_nocuda CV_Error(CV_GpuNotSupported, "The library is compiled without CUDA support") #else #if defined(__GNUC__) @@ -162,7 +162,7 @@ void icvSetOpenGlFuncTab(const CvOpenGlFuncTab* tab) void cv::gpu::setGlDevice(int device) { -#ifndef HAVE_CUDA +#if !defined HAVE_CUDA || defined(CUDA_DISABLER) (void)device; throw_nocuda; #else @@ -538,7 +538,7 @@ cv::GlBuffer::GlBuffer(InputArray mat_, Usage _usage) : rows_(0), cols_(0), type if (kind == _InputArray::GPU_MAT) { - #ifndef HAVE_CUDA + #if !defined HAVE_CUDA || defined(CUDA_DISABLER) throw_nocuda; #else GpuMat d_mat = mat_.getGpuMat(); @@ -609,7 +609,7 @@ void cv::GlBuffer::copyFrom(InputArray mat_) } case _InputArray::GPU_MAT: { - #ifndef HAVE_CUDA + #if !defined HAVE_CUDA || defined(CUDA_DISABLER) throw_nocuda; #else GpuMat d_mat = mat_.getGpuMat(); @@ -670,7 +670,7 @@ GpuMat cv::GlBuffer::mapDevice() throw_nogl; return GpuMat(); #else - #ifndef HAVE_CUDA + #if !defined HAVE_CUDA || defined(CUDA_DISABLER) throw_nocuda; return GpuMat(); #else @@ -684,7 +684,7 @@ void cv::GlBuffer::unmapDevice() #ifndef HAVE_OPENGL throw_nogl; #else - #ifndef HAVE_CUDA + #if !defined HAVE_CUDA || defined(CUDA_DISABLER) throw_nocuda; #else impl_->unmapDevice(); @@ -976,7 +976,7 @@ cv::GlTexture::GlTexture(InputArray mat_, bool bgra) : rows_(0), cols_(0), type_ } case _InputArray::GPU_MAT: { - #ifndef HAVE_CUDA + #if !defined HAVE_CUDA || defined(CUDA_DISABLER) throw_nocuda; #else GpuMat d_mat = mat_.getGpuMat(); @@ -1056,7 +1056,7 @@ void cv::GlTexture::copyFrom(InputArray mat_, bool bgra) } case _InputArray::GPU_MAT: { - #ifndef HAVE_CUDA + #if !defined HAVE_CUDA || defined(CUDA_DISABLER) throw_nocuda; #else GpuMat d_mat = mat_.getGpuMat(); diff --git a/modules/gpu/perf/main.cpp b/modules/gpu/perf/main.cpp index 8d34041..8af255b 100644 --- a/modules/gpu/perf/main.cpp +++ b/modules/gpu/perf/main.cpp @@ -31,7 +31,7 @@ void printOsInfo() void printCudaInfo() { -#ifndef HAVE_CUDA +#if !defined HAVE_CUDA || defined(CUDA_DISABLER) cout << "OpenCV was built without CUDA support \n" << endl; #else int driver; @@ -99,7 +99,7 @@ int main(int argc, char** argv) int device = cmd.get("device"); bool cpu = cmd.has("cpu"); -#ifndef HAVE_CUDA +#if !defined HAVE_CUDA || defined(CUDA_DISABLER) cpu = true; #endif diff --git a/modules/gpu/src/arithm.cpp b/modules/gpu/src/arithm.cpp index 67f3936..b5d0735 100644 --- a/modules/gpu/src/arithm.cpp +++ b/modules/gpu/src/arithm.cpp @@ -46,7 +46,7 @@ using namespace cv; using namespace cv::gpu; using namespace std; -#if !defined (HAVE_CUDA) +#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER) void cv::gpu::gemm(const GpuMat&, const GpuMat&, double, const GpuMat&, double, GpuMat&, int, Stream&) { throw_nogpu(); } void cv::gpu::transpose(const GpuMat&, GpuMat&, Stream&) { throw_nogpu(); } diff --git a/modules/gpu/src/bgfg_gmg.cpp b/modules/gpu/src/bgfg_gmg.cpp index f4133f4..46f3ba2 100644 --- a/modules/gpu/src/bgfg_gmg.cpp +++ b/modules/gpu/src/bgfg_gmg.cpp @@ -42,7 +42,7 @@ #include "precomp.hpp" -#ifndef HAVE_CUDA +#if !defined HAVE_CUDA || defined(CUDA_DISABLER) cv::gpu::GMG_GPU::GMG_GPU() { throw_nogpu(); } void cv::gpu::GMG_GPU::initialize(cv::Size, float, float) { throw_nogpu(); } diff --git a/modules/gpu/src/bgfg_mog.cpp b/modules/gpu/src/bgfg_mog.cpp index 67cac76..05b4ffb 100644 --- a/modules/gpu/src/bgfg_mog.cpp +++ b/modules/gpu/src/bgfg_mog.cpp @@ -42,7 +42,7 @@ #include "precomp.hpp" -#ifndef HAVE_CUDA +#if !defined HAVE_CUDA || defined(CUDA_DISABLER) cv::gpu::MOG_GPU::MOG_GPU(int) { throw_nogpu(); } void cv::gpu::MOG_GPU::initialize(cv::Size, int) { throw_nogpu(); } diff --git a/modules/gpu/src/bgfg_vibe.cpp b/modules/gpu/src/bgfg_vibe.cpp index cf6d3c5..ff7e580 100644 --- a/modules/gpu/src/bgfg_vibe.cpp +++ b/modules/gpu/src/bgfg_vibe.cpp @@ -42,7 +42,7 @@ #include "precomp.hpp" -#ifndef HAVE_CUDA +#if !defined HAVE_CUDA || defined(CUDA_DISABLER) cv::gpu::VIBE_GPU::VIBE_GPU(unsigned long) { throw_nogpu(); } void cv::gpu::VIBE_GPU::initialize(const GpuMat&, Stream&) { throw_nogpu(); } diff --git a/modules/gpu/src/bilateral_filter.cpp b/modules/gpu/src/bilateral_filter.cpp index facd1ee..b4920a0 100644 --- a/modules/gpu/src/bilateral_filter.cpp +++ b/modules/gpu/src/bilateral_filter.cpp @@ -46,7 +46,7 @@ using namespace cv; using namespace cv::gpu; using namespace std; -#if !defined (HAVE_CUDA) +#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER) cv::gpu::DisparityBilateralFilter::DisparityBilateralFilter(int, int, int) { throw_nogpu(); } cv::gpu::DisparityBilateralFilter::DisparityBilateralFilter(int, int, int, float, float, float) { throw_nogpu(); } diff --git a/modules/gpu/src/blend.cpp b/modules/gpu/src/blend.cpp index 7c2a86e..4023a08 100644 --- a/modules/gpu/src/blend.cpp +++ b/modules/gpu/src/blend.cpp @@ -46,7 +46,7 @@ using namespace std; using namespace cv; using namespace cv::gpu; -#if !defined (HAVE_CUDA) +#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER) void cv::gpu::blendLinear(const GpuMat&, const GpuMat&, const GpuMat&, const GpuMat&, GpuMat&, Stream&) { throw_nogpu(); } diff --git a/modules/gpu/src/brute_force_matcher.cpp b/modules/gpu/src/brute_force_matcher.cpp index 5e0ef21..9b8a9c9 100644 --- a/modules/gpu/src/brute_force_matcher.cpp +++ b/modules/gpu/src/brute_force_matcher.cpp @@ -46,7 +46,7 @@ using namespace cv; using namespace cv::gpu; using namespace std; -#if !defined (HAVE_CUDA) +#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER) cv::gpu::BFMatcher_GPU::BFMatcher_GPU(int) { throw_nogpu(); } void cv::gpu::BFMatcher_GPU::add(const vector&) { throw_nogpu(); } diff --git a/modules/gpu/src/calib3d.cpp b/modules/gpu/src/calib3d.cpp index efbd76e..7e1de91 100644 --- a/modules/gpu/src/calib3d.cpp +++ b/modules/gpu/src/calib3d.cpp @@ -46,7 +46,7 @@ using namespace cv; using namespace cv::gpu; using namespace std; -#if !defined(HAVE_CUDA) +#if !defined HAVE_CUDA || defined(CUDA_DISABLER) void cv::gpu::transformPoints(const GpuMat&, const Mat&, const Mat&, GpuMat&, Stream&) { throw_nogpu(); } diff --git a/modules/gpu/src/cascadeclassifier.cpp b/modules/gpu/src/cascadeclassifier.cpp index d6fb10c..676bca5 100644 --- a/modules/gpu/src/cascadeclassifier.cpp +++ b/modules/gpu/src/cascadeclassifier.cpp @@ -48,7 +48,7 @@ using namespace cv; using namespace cv::gpu; using namespace std; -#if !defined (HAVE_CUDA) +#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER) cv::gpu::CascadeClassifier_GPU::CascadeClassifier_GPU() { throw_nogpu(); } cv::gpu::CascadeClassifier_GPU::CascadeClassifier_GPU(const string&) { throw_nogpu(); } diff --git a/modules/gpu/src/color.cpp b/modules/gpu/src/color.cpp index b8c5942..8115ac0 100644 --- a/modules/gpu/src/color.cpp +++ b/modules/gpu/src/color.cpp @@ -45,7 +45,7 @@ using namespace cv; using namespace cv::gpu; -#if !defined (HAVE_CUDA) +#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER) void cv::gpu::cvtColor(const GpuMat&, GpuMat&, int, int, Stream&) { throw_nogpu(); } void cv::gpu::swapChannels(GpuMat&, const int[], Stream&) { throw_nogpu(); } diff --git a/modules/gpu/src/cuda/NV12ToARGB.cu b/modules/gpu/src/cuda/NV12ToARGB.cu index 32d5749..a860c85 100644 --- a/modules/gpu/src/cuda/NV12ToARGB.cu +++ b/modules/gpu/src/cuda/NV12ToARGB.cu @@ -58,6 +58,8 @@ source and converts to output in ARGB format */ +#if !defined CUDA_DISABLER + #include "opencv2/gpu/device/common.hpp" namespace cv { namespace gpu { namespace device { @@ -206,3 +208,5 @@ namespace cv { namespace gpu { namespace device { } } }}} + +#endif /* CUDA_DISABLER */ \ No newline at end of file diff --git a/modules/gpu/src/cuda/bf_knnmatch.cu b/modules/gpu/src/cuda/bf_knnmatch.cu index b545cb5..fac2f20 100644 --- a/modules/gpu/src/cuda/bf_knnmatch.cu +++ b/modules/gpu/src/cuda/bf_knnmatch.cu @@ -40,6 +40,8 @@ // //M*/ +#if !defined CUDA_DISABLER + #include "internal_shared.hpp" #include "opencv2/gpu/device/limits.hpp" #include "opencv2/gpu/device/vec_distance.hpp" @@ -1160,3 +1162,6 @@ namespace cv { namespace gpu { namespace device template void match2Hamming_gpu(const PtrStepSzb& query, const PtrStepSzb& trains, const PtrStepSz& masks, const PtrStepSzb& trainIdx, const PtrStepSzb& imgIdx, const PtrStepSzb& distance, int cc, cudaStream_t stream); } // namespace bf_knnmatch }}} // namespace cv { namespace gpu { namespace device { + + +#endif /* CUDA_DISABLER */ \ No newline at end of file diff --git a/modules/gpu/src/cuda/bf_match.cu b/modules/gpu/src/cuda/bf_match.cu index d8489d9..c50a076 100644 --- a/modules/gpu/src/cuda/bf_match.cu +++ b/modules/gpu/src/cuda/bf_match.cu @@ -40,6 +40,8 @@ // //M*/ +#if !defined CUDA_DISABLER + #include "internal_shared.hpp" #include "opencv2/gpu/device/limits.hpp" #include "opencv2/gpu/device/vec_distance.hpp" @@ -778,3 +780,6 @@ namespace cv { namespace gpu { namespace device template void matchHamming_gpu(const PtrStepSzb& query, const PtrStepSzb& trains, const PtrStepSz& masks, const PtrStepSzi& trainIdx, const PtrStepSzi& imgIdx, const PtrStepSzf& distance, int cc, cudaStream_t stream); } // namespace bf_match }}} // namespace cv { namespace gpu { namespace device { + + +#endif /* CUDA_DISABLER */ \ No newline at end of file diff --git a/modules/gpu/src/cuda/bf_radius_match.cu b/modules/gpu/src/cuda/bf_radius_match.cu index 63dcd01..1954bf9 100644 --- a/modules/gpu/src/cuda/bf_radius_match.cu +++ b/modules/gpu/src/cuda/bf_radius_match.cu @@ -40,6 +40,8 @@ // //M*/ +#if !defined CUDA_DISABLER + #include "internal_shared.hpp" #include "opencv2/gpu/device/limits.hpp" #include "opencv2/gpu/device/vec_distance.hpp" @@ -465,3 +467,6 @@ namespace cv { namespace gpu { namespace device template void matchHamming_gpu(const PtrStepSzb& query, const PtrStepSzb* trains, int n, float maxDistance, const PtrStepSzb* masks, const PtrStepSzi& trainIdx, const PtrStepSzi& imgIdx, const PtrStepSzf& distance, const PtrStepSz& nMatches, int cc, cudaStream_t stream); } // namespace bf_radius_match }}} // namespace cv { namespace gpu { namespace device + + +#endif /* CUDA_DISABLER */ \ No newline at end of file diff --git a/modules/gpu/src/cuda/bgfg_gmg.cu b/modules/gpu/src/cuda/bgfg_gmg.cu index 7fee2d8..8e2fd3b 100644 --- a/modules/gpu/src/cuda/bgfg_gmg.cu +++ b/modules/gpu/src/cuda/bgfg_gmg.cu @@ -40,6 +40,8 @@ // //M*/ +#if !defined CUDA_DISABLER + #include "opencv2/gpu/device/common.hpp" #include "opencv2/gpu/device/vec_traits.hpp" #include "opencv2/gpu/device/limits.hpp" @@ -251,3 +253,6 @@ namespace cv { namespace gpu { namespace device { template void update_gpu(PtrStepSzb frame, PtrStepb fgmask, PtrStepSzi colors, PtrStepf weights, PtrStepi nfeatures, int frameNum, float learningRate, bool updateBackgroundModel, cudaStream_t stream); } }}} + + +#endif /* CUDA_DISABLER */ \ No newline at end of file diff --git a/modules/gpu/src/cuda/bgfg_mog.cu b/modules/gpu/src/cuda/bgfg_mog.cu index dcfd502..4f78dbd 100644 --- a/modules/gpu/src/cuda/bgfg_mog.cu +++ b/modules/gpu/src/cuda/bgfg_mog.cu @@ -40,6 +40,8 @@ // //M*/ +#if !defined CUDA_DISABLER + #include "opencv2/gpu/device/common.hpp" #include "opencv2/gpu/device/vec_traits.hpp" #include "opencv2/gpu/device/vec_math.hpp" @@ -757,3 +759,6 @@ namespace cv { namespace gpu { namespace device } } }}} + + +#endif /* CUDA_DISABLER */ \ No newline at end of file diff --git a/modules/gpu/src/cuda/bgfg_vibe.cu b/modules/gpu/src/cuda/bgfg_vibe.cu index 2b3b707..72ea7f0 100644 --- a/modules/gpu/src/cuda/bgfg_vibe.cu +++ b/modules/gpu/src/cuda/bgfg_vibe.cu @@ -40,6 +40,8 @@ // //M*/ +#if !defined CUDA_DISABLER + #include "opencv2/gpu/device/common.hpp" namespace cv { namespace gpu { namespace device @@ -251,3 +253,6 @@ namespace cv { namespace gpu { namespace device } } }}} + + +#endif /* CUDA_DISABLER */ \ No newline at end of file diff --git a/modules/gpu/src/cuda/bilateral_filter.cu b/modules/gpu/src/cuda/bilateral_filter.cu index 9e9135e..15f7b19 100644 --- a/modules/gpu/src/cuda/bilateral_filter.cu +++ b/modules/gpu/src/cuda/bilateral_filter.cu @@ -41,6 +41,8 @@ // //M*/ +#if !defined CUDA_DISABLER + #include "internal_shared.hpp" #include "opencv2/gpu/device/vec_traits.hpp" @@ -194,3 +196,6 @@ OCV_INSTANTIATE_BILATERAL_FILTER(float) //OCV_INSTANTIATE_BILATERAL_FILTER(float2) OCV_INSTANTIATE_BILATERAL_FILTER(float3) OCV_INSTANTIATE_BILATERAL_FILTER(float4) + + +#endif /* CUDA_DISABLER */ \ No newline at end of file diff --git a/modules/gpu/src/cuda/blend.cu b/modules/gpu/src/cuda/blend.cu index e716edc..841258f 100644 --- a/modules/gpu/src/cuda/blend.cu +++ b/modules/gpu/src/cuda/blend.cu @@ -40,6 +40,8 @@ // //M*/ +#if !defined CUDA_DISABLER + #include "internal_shared.hpp" namespace cv { namespace gpu { namespace device @@ -114,3 +116,6 @@ namespace cv { namespace gpu { namespace device } } // namespace blend }}} // namespace cv { namespace gpu { namespace device + + +#endif /* CUDA_DISABLER */ \ No newline at end of file diff --git a/modules/gpu/src/cuda/calib3d.cu b/modules/gpu/src/cuda/calib3d.cu index 5def4ad..40c8475 100644 --- a/modules/gpu/src/cuda/calib3d.cu +++ b/modules/gpu/src/cuda/calib3d.cu @@ -40,6 +40,8 @@ // //M*/ +#if !defined CUDA_DISABLER + #include "internal_shared.hpp" #include "opencv2/gpu/device/transform.hpp" #include "opencv2/gpu/device/functional.hpp" @@ -189,3 +191,6 @@ namespace cv { namespace gpu { namespace device } } // namespace solvepnp_ransac }}} // namespace cv { namespace gpu { namespace device + + +#endif /* CUDA_DISABLER */ \ No newline at end of file diff --git a/modules/gpu/src/cuda/canny.cu b/modules/gpu/src/cuda/canny.cu index 95028c2..6667772 100644 --- a/modules/gpu/src/cuda/canny.cu +++ b/modules/gpu/src/cuda/canny.cu @@ -40,6 +40,8 @@ // //M*/ +#if !defined CUDA_DISABLER + #include #include #include "internal_shared.hpp" @@ -494,3 +496,6 @@ namespace cv { namespace gpu { namespace device } } // namespace canny }}} // namespace cv { namespace gpu { namespace device + + +#endif /* CUDA_DISABLER */ \ No newline at end of file diff --git a/modules/gpu/src/cuda/ccomponetns.cu b/modules/gpu/src/cuda/ccomponetns.cu index e92615e..62e8137 100644 --- a/modules/gpu/src/cuda/ccomponetns.cu +++ b/modules/gpu/src/cuda/ccomponetns.cu @@ -39,6 +39,8 @@ // the use of this software, even if advised of the possibility of such damage. //M*/ +#if !defined CUDA_DISABLER + #include #include #include @@ -525,4 +527,6 @@ namespace cv { namespace gpu { namespace device cudaSafeCall( cudaDeviceSynchronize() ); } } -} } } \ No newline at end of file +} } } + +#endif /* CUDA_DISABLER */ \ No newline at end of file diff --git a/modules/gpu/src/cuda/color.cu b/modules/gpu/src/cuda/color.cu index 54925ab..7d2befe 100644 --- a/modules/gpu/src/cuda/color.cu +++ b/modules/gpu/src/cuda/color.cu @@ -40,6 +40,8 @@ // //M*/ +#if !defined CUDA_DISABLER + #include #include #include @@ -378,3 +380,5 @@ namespace cv { namespace gpu { namespace device #undef OPENCV_GPU_IMPLEMENT_CVTCOLOR_ALL #undef OPENCV_GPU_IMPLEMENT_CVTCOLOR_8U32F }}} // namespace cv { namespace gpu { namespace device + +#endif /* CUDA_DISABLER */ \ No newline at end of file diff --git a/modules/gpu/src/cuda/column_filter.cu b/modules/gpu/src/cuda/column_filter.cu index f283bf6..7f5d247 100644 --- a/modules/gpu/src/cuda/column_filter.cu +++ b/modules/gpu/src/cuda/column_filter.cu @@ -41,6 +41,8 @@ // //M*/ +#if !defined CUDA_DISABLER + #include "internal_shared.hpp" #include "opencv2/gpu/device/saturate_cast.hpp" #include "opencv2/gpu/device/vec_math.hpp" @@ -378,3 +380,6 @@ namespace cv { namespace gpu { namespace device template void linearColumnFilter_gpu(PtrStepSzb src, PtrStepSzb dst, const float kernel[], int ksize, int anchor, int brd_type, int cc, cudaStream_t stream); } // namespace column_filter }}} // namespace cv { namespace gpu { namespace device + + +#endif /* CUDA_DISABLER */ \ No newline at end of file diff --git a/modules/gpu/src/cuda/copy_make_border.cu b/modules/gpu/src/cuda/copy_make_border.cu index 71859f2..74120ba 100644 --- a/modules/gpu/src/cuda/copy_make_border.cu +++ b/modules/gpu/src/cuda/copy_make_border.cu @@ -40,6 +40,8 @@ // //M*/ +#if !defined CUDA_DISABLER + #include "internal_shared.hpp" #include "opencv2/gpu/device/border_interpolate.hpp" @@ -125,3 +127,5 @@ namespace cv { namespace gpu { namespace device template void copyMakeBorder_gpu(const PtrStepSzb& src, const PtrStepSzb& dst, int top, int left, int borderMode, const float* borderValue, cudaStream_t stream); } // namespace imgproc }}} // namespace cv { namespace gpu { namespace device + +#endif /* CUDA_DISABLER */ \ No newline at end of file diff --git a/modules/gpu/src/cuda/debayer.cu b/modules/gpu/src/cuda/debayer.cu index 29e4b4b..57322ed 100644 --- a/modules/gpu/src/cuda/debayer.cu +++ b/modules/gpu/src/cuda/debayer.cu @@ -40,6 +40,8 @@ // //M*/ +#if !defined CUDA_DISABLER + #include #include #include @@ -325,3 +327,5 @@ namespace cv { namespace gpu { template void Bayer2BGR_16u_gpu<4>(PtrStepSzb src, PtrStepSzb dst, bool blue_last, bool start_with_green, cudaStream_t stream); } }} + +#endif /* CUDA_DISABLER */ \ No newline at end of file diff --git a/modules/gpu/src/cuda/disp_bilateral_filter.cu b/modules/gpu/src/cuda/disp_bilateral_filter.cu index e91cf9c..56b39ea 100644 --- a/modules/gpu/src/cuda/disp_bilateral_filter.cu +++ b/modules/gpu/src/cuda/disp_bilateral_filter.cu @@ -40,6 +40,8 @@ // //M*/ +#if !defined CUDA_DISABLER + #include "internal_shared.hpp" #include "opencv2/gpu/device/limits.hpp" @@ -217,3 +219,5 @@ namespace cv { namespace gpu { namespace device template void disp_bilateral_filter(PtrStepSz disp, PtrStepSzb img, int channels, int iters, cudaStream_t stream); } // namespace bilateral_filter }}} // namespace cv { namespace gpu { namespace device + +#endif /* CUDA_DISABLER */ \ No newline at end of file diff --git a/modules/gpu/src/cuda/element_operations.cu b/modules/gpu/src/cuda/element_operations.cu index 19c328c..deaa94a 100644 --- a/modules/gpu/src/cuda/element_operations.cu +++ b/modules/gpu/src/cuda/element_operations.cu @@ -40,6 +40,8 @@ // //M*/ +#if !defined CUDA_DISABLER + #include "internal_shared.hpp" #include "opencv2/gpu/device/functional.hpp" #include "opencv2/gpu/device/vec_math.hpp" @@ -2367,3 +2369,5 @@ namespace cv { namespace gpu { namespace device template void addWeighted_gpu(const PtrStepSzb& src1, double alpha, const PtrStepSzb& src2, double beta, double gamma, const PtrStepSzb& dst, cudaStream_t stream); template void addWeighted_gpu(const PtrStepSzb& src1, double alpha, const PtrStepSzb& src2, double beta, double gamma, const PtrStepSzb& dst, cudaStream_t stream); }}} // namespace cv { namespace gpu { namespace device + +#endif /* CUDA_DISABLER */ \ No newline at end of file diff --git a/modules/gpu/src/cuda/fast.cu b/modules/gpu/src/cuda/fast.cu index 75237ee..0661888 100644 --- a/modules/gpu/src/cuda/fast.cu +++ b/modules/gpu/src/cuda/fast.cu @@ -45,6 +45,8 @@ // //M*/ +#if !defined CUDA_DISABLER + #include "opencv2/gpu/device/common.hpp" #include "opencv2/gpu/device/utility.hpp" @@ -383,3 +385,6 @@ namespace cv { namespace gpu { namespace device } } // namespace fast }}} + + +#endif /* CUDA_DISABLER */ \ No newline at end of file diff --git a/modules/gpu/src/cuda/fgd_bgfg.cu b/modules/gpu/src/cuda/fgd_bgfg.cu index b19fff4..6040d02 100644 --- a/modules/gpu/src/cuda/fgd_bgfg.cu +++ b/modules/gpu/src/cuda/fgd_bgfg.cu @@ -40,6 +40,8 @@ // //M*/ +#if !defined CUDA_DISABLER + #include "opencv2/gpu/device/common.hpp" #include "opencv2/gpu/device/vec_math.hpp" #include "opencv2/gpu/device/limits.hpp" @@ -842,3 +844,5 @@ namespace bgfg template void updateBackgroundModel_gpu(PtrStepSzb prevFrame, PtrStepSzb curFrame, PtrStepSzb Ftd, PtrStepSzb Fbd, PtrStepSzb foreground, PtrStepSzb background, int deltaC, int deltaCC, float alpha1, float alpha2, float alpha3, int N1c, int N1cc, int N2c, int N2cc, float T, cudaStream_t stream); template void updateBackgroundModel_gpu(PtrStepSzb prevFrame, PtrStepSzb curFrame, PtrStepSzb Ftd, PtrStepSzb Fbd, PtrStepSzb foreground, PtrStepSzb background, int deltaC, int deltaCC, float alpha1, float alpha2, float alpha3, int N1c, int N1cc, int N2c, int N2cc, float T, cudaStream_t stream); } + +#endif /* CUDA_DISABLER */ \ No newline at end of file diff --git a/modules/gpu/src/cuda/gftt.cu b/modules/gpu/src/cuda/gftt.cu index 03e1fa2..356d34c 100644 --- a/modules/gpu/src/cuda/gftt.cu +++ b/modules/gpu/src/cuda/gftt.cu @@ -45,6 +45,8 @@ // //M*/ +#if !defined CUDA_DISABLER + #include #include "opencv2/gpu/device/common.hpp" @@ -144,3 +146,6 @@ namespace cv { namespace gpu { namespace device } } // namespace optical_flow }}} + + +#endif /* CUDA_DISABLER */ \ No newline at end of file diff --git a/modules/gpu/src/cuda/global_motion.cu b/modules/gpu/src/cuda/global_motion.cu index 8a15071..c48274a 100644 --- a/modules/gpu/src/cuda/global_motion.cu +++ b/modules/gpu/src/cuda/global_motion.cu @@ -41,6 +41,8 @@ // //M*/ +#if !defined CUDA_DISABLER + #include "thrust/device_ptr.h" #include "thrust/remove.h" #include "thrust/functional.h" @@ -113,3 +115,6 @@ void calcWobbleSuppressionMaps( } }}}} + + +#endif /* CUDA_DISABLER */ \ No newline at end of file diff --git a/modules/gpu/src/cuda/hist.cu b/modules/gpu/src/cuda/hist.cu index a337d20..363050a 100644 --- a/modules/gpu/src/cuda/hist.cu +++ b/modules/gpu/src/cuda/hist.cu @@ -41,6 +41,8 @@ // //M*/ +#if !defined CUDA_DISABLER + #include "internal_shared.hpp" #include "opencv2/gpu/device/utility.hpp" #include "opencv2/gpu/device/saturate_cast.hpp" @@ -217,3 +219,6 @@ namespace cv { namespace gpu { namespace device } } // namespace hist }}} // namespace cv { namespace gpu { namespace device + + +#endif /* CUDA_DISABLER */ \ No newline at end of file diff --git a/modules/gpu/src/cuda/hog.cu b/modules/gpu/src/cuda/hog.cu index 3a3abd4..801e9cd 100644 --- a/modules/gpu/src/cuda/hog.cu +++ b/modules/gpu/src/cuda/hog.cu @@ -40,6 +40,8 @@ // //M*/ +#if !defined CUDA_DISABLER + #include "internal_shared.hpp" namespace cv { namespace gpu { namespace device @@ -864,3 +866,6 @@ namespace cv { namespace gpu { namespace device void resize_8UC4(const PtrStepSzb& src, PtrStepSzb dst) { resize_for_hog(src, dst, resize8UC4_tex); } } // namespace hog }}} // namespace cv { namespace gpu { namespace device + + +#endif /* CUDA_DISABLER */ \ No newline at end of file diff --git a/modules/gpu/src/cuda/hough.cu b/modules/gpu/src/cuda/hough.cu index 712b91a..ac65b36 100644 --- a/modules/gpu/src/cuda/hough.cu +++ b/modules/gpu/src/cuda/hough.cu @@ -40,6 +40,8 @@ // //M*/ +#if !defined CUDA_DISABLER + #include #include "opencv2/gpu/device/common.hpp" #include "opencv2/gpu/device/emulation.hpp" @@ -1505,3 +1507,6 @@ namespace cv { namespace gpu { namespace device } } }}} + + +#endif /* CUDA_DISABLER */ \ No newline at end of file diff --git a/modules/gpu/src/cuda/imgproc.cu b/modules/gpu/src/cuda/imgproc.cu index 494da8d..9a75c52 100644 --- a/modules/gpu/src/cuda/imgproc.cu +++ b/modules/gpu/src/cuda/imgproc.cu @@ -40,6 +40,8 @@ // //M*/ +#if !defined CUDA_DISABLER + #include "internal_shared.hpp" #include "opencv2/gpu/device/vec_traits.hpp" #include "opencv2/gpu/device/vec_math.hpp" @@ -997,3 +999,6 @@ namespace cv { namespace gpu { namespace device template void filter2D_gpu(PtrStepSzb srcWhole, int ofsX, int ofsY, PtrStepSzb dst, int kWidth, int kHeight, int anchorX, int anchorY, const float* kernel, int borderMode, const float* borderValue, cudaStream_t stream); } // namespace imgproc }}} // namespace cv { namespace gpu { namespace device { + + +#endif /* CUDA_DISABLER */ \ No newline at end of file diff --git a/modules/gpu/src/cuda/integral_image.cu b/modules/gpu/src/cuda/integral_image.cu index 0405f66..558f908 100644 --- a/modules/gpu/src/cuda/integral_image.cu +++ b/modules/gpu/src/cuda/integral_image.cu @@ -40,6 +40,8 @@ // //M*/ +#if !defined CUDA_DISABLER + #include "opencv2/gpu/device/common.hpp" namespace cv { namespace gpu { namespace device @@ -383,3 +385,5 @@ namespace cv { namespace gpu { namespace device } } }}} + +#endif /* CUDA_DISABLER */ \ No newline at end of file diff --git a/modules/gpu/src/cuda/lbp.cu b/modules/gpu/src/cuda/lbp.cu index d280344..ce5e9ae 100644 --- a/modules/gpu/src/cuda/lbp.cu +++ b/modules/gpu/src/cuda/lbp.cu @@ -40,6 +40,8 @@ // //M*/ +#if !defined CUDA_DISABLER + #include #include #include @@ -295,4 +297,6 @@ namespace cv { namespace gpu { namespace device lbp_cascade<<>>(cascade, frameW, frameH, windowW, windowH, initialScale, factor, workAmount, integral.ptr(), integral.step / sizeof(int), objects, classified); } } -}}} \ No newline at end of file +}}} + +#endif /* CUDA_DISABLER */ \ No newline at end of file diff --git a/modules/gpu/src/cuda/match_template.cu b/modules/gpu/src/cuda/match_template.cu index 6fd6359..1b81e87 100644 --- a/modules/gpu/src/cuda/match_template.cu +++ b/modules/gpu/src/cuda/match_template.cu @@ -40,6 +40,8 @@ // //M*/ +#if !defined CUDA_DISABLER + #include "internal_shared.hpp" #include "opencv2/gpu/device/vec_math.hpp" @@ -909,3 +911,6 @@ namespace cv { namespace gpu { namespace device } } //namespace match_template }}} // namespace cv { namespace gpu { namespace device + + +#endif /* CUDA_DISABLER */ \ No newline at end of file diff --git a/modules/gpu/src/cuda/mathfunc.cu b/modules/gpu/src/cuda/mathfunc.cu index b6969fc..aa502d1 100644 --- a/modules/gpu/src/cuda/mathfunc.cu +++ b/modules/gpu/src/cuda/mathfunc.cu @@ -40,6 +40,8 @@ // //M*/ +#if !defined CUDA_DISABLER + #include "internal_shared.hpp" namespace cv { namespace gpu { namespace device @@ -211,3 +213,5 @@ namespace cv { namespace gpu { namespace device } } // namespace mathfunc }}} // namespace cv { namespace gpu { namespace device + +#endif /* CUDA_DISABLER */ \ No newline at end of file diff --git a/modules/gpu/src/cuda/matrix_reductions.cu b/modules/gpu/src/cuda/matrix_reductions.cu index 26eca02..b7da215 100644 --- a/modules/gpu/src/cuda/matrix_reductions.cu +++ b/modules/gpu/src/cuda/matrix_reductions.cu @@ -40,6 +40,8 @@ // //M*/ +#if !defined CUDA_DISABLER + #include "internal_shared.hpp" #include "opencv2/gpu/device/limits.hpp" #include "opencv2/gpu/device/saturate_cast.hpp" @@ -2097,3 +2099,5 @@ namespace cv { namespace gpu { namespace device template void reduceCols_gpu(const PtrStepSzb& src, int cn, const PtrStepSzb& dst, int reduceOp, cudaStream_t stream); } // namespace mattrix_reductions }}} // namespace cv { namespace gpu { namespace device + +#endif /* CUDA_DISABLER */ \ No newline at end of file diff --git a/modules/gpu/src/cuda/nlm.cu b/modules/gpu/src/cuda/nlm.cu index a175d5f..b65962d 100644 --- a/modules/gpu/src/cuda/nlm.cu +++ b/modules/gpu/src/cuda/nlm.cu @@ -41,6 +41,8 @@ // //M*/ +#if !defined CUDA_DISABLER + #include "internal_shared.hpp" #include "opencv2/gpu/device/vec_traits.hpp" @@ -168,3 +170,5 @@ namespace cv { namespace gpu { namespace device template void nlm_bruteforce_gpu(const PtrStepSzb&, PtrStepSzb, int, int, float, int, cudaStream_t); } }}} + +#endif /* CUDA_DISABLER */ \ No newline at end of file diff --git a/modules/gpu/src/cuda/optical_flow.cu b/modules/gpu/src/cuda/optical_flow.cu index c0961c3..db529c4 100644 --- a/modules/gpu/src/cuda/optical_flow.cu +++ b/modules/gpu/src/cuda/optical_flow.cu @@ -40,6 +40,8 @@ // //M*/ +#if !defined CUDA_DISABLER + #include "opencv2/gpu/device/common.hpp" namespace cv { namespace gpu { namespace device @@ -214,3 +216,5 @@ namespace cv { namespace gpu { namespace device } } }}} + +#endif /* CUDA_DISABLER */ \ No newline at end of file diff --git a/modules/gpu/src/cuda/optical_flow_farneback.cu b/modules/gpu/src/cuda/optical_flow_farneback.cu index f83e440..8231775 100644 --- a/modules/gpu/src/cuda/optical_flow_farneback.cu +++ b/modules/gpu/src/cuda/optical_flow_farneback.cu @@ -40,6 +40,8 @@ // //M*/ +#if !defined CUDA_DISABLER + #include #include "internal_shared.hpp" #include "opencv2/gpu/device/common.hpp" @@ -645,3 +647,5 @@ namespace cv { namespace gpu { namespace device { namespace optflow_farneback }}}} // namespace cv { namespace gpu { namespace device { namespace optflow_farneback + +#endif /* CUDA_DISABLER */ \ No newline at end of file diff --git a/modules/gpu/src/cuda/orb.cu b/modules/gpu/src/cuda/orb.cu index 0d5ce37..d136472 100644 --- a/modules/gpu/src/cuda/orb.cu +++ b/modules/gpu/src/cuda/orb.cu @@ -45,6 +45,8 @@ // //M*/ +#if !defined CUDA_DISABLER + #include #include "opencv2/gpu/device/common.hpp" @@ -415,4 +417,6 @@ namespace cv { namespace gpu { namespace device cudaSafeCall( cudaDeviceSynchronize() ); } } -}}} \ No newline at end of file +}}} + +#endif /* CUDA_DISABLER */ \ No newline at end of file diff --git a/modules/gpu/src/cuda/pyr_down.cu b/modules/gpu/src/cuda/pyr_down.cu index ca9a598..db5f9d2 100644 --- a/modules/gpu/src/cuda/pyr_down.cu +++ b/modules/gpu/src/cuda/pyr_down.cu @@ -40,6 +40,8 @@ // //M*/ +#if !defined CUDA_DISABLER + #include "opencv2/gpu/device/common.hpp" #include "opencv2/gpu/device/border_interpolate.hpp" #include "opencv2/gpu/device/vec_traits.hpp" @@ -221,3 +223,6 @@ namespace cv { namespace gpu { namespace device template void pyrDown_gpu(PtrStepSzb src, PtrStepSzb dst, cudaStream_t stream); } // namespace imgproc }}} // namespace cv { namespace gpu { namespace device + + +#endif /* CUDA_DISABLER */ \ No newline at end of file diff --git a/modules/gpu/src/cuda/pyr_up.cu b/modules/gpu/src/cuda/pyr_up.cu index 996663e..89775a0 100644 --- a/modules/gpu/src/cuda/pyr_up.cu +++ b/modules/gpu/src/cuda/pyr_up.cu @@ -40,6 +40,8 @@ // //M*/ +#if !defined CUDA_DISABLER + #include "internal_shared.hpp" #include "opencv2/gpu/device/border_interpolate.hpp" #include "opencv2/gpu/device/vec_traits.hpp" @@ -190,3 +192,5 @@ namespace cv { namespace gpu { namespace device template void pyrUp_gpu(PtrStepSzb src, PtrStepSzb dst, cudaStream_t stream); } // namespace imgproc }}} // namespace cv { namespace gpu { namespace device + +#endif /* CUDA_DISABLER */ \ No newline at end of file diff --git a/modules/gpu/src/cuda/pyrlk.cu b/modules/gpu/src/cuda/pyrlk.cu index ef3f424..c348591 100644 --- a/modules/gpu/src/cuda/pyrlk.cu +++ b/modules/gpu/src/cuda/pyrlk.cu @@ -45,6 +45,8 @@ // //M*/ +#if !defined CUDA_DISABLER + #include "opencv2/gpu/device/common.hpp" #include "opencv2/gpu/device/utility.hpp" #include "opencv2/gpu/device/functional.hpp" @@ -678,3 +680,5 @@ namespace cv { namespace gpu { namespace device } } }}} + +#endif /* CUDA_DISABLER */ \ No newline at end of file diff --git a/modules/gpu/src/cuda/remap.cu b/modules/gpu/src/cuda/remap.cu index 896e48b..8f7ce5b 100644 --- a/modules/gpu/src/cuda/remap.cu +++ b/modules/gpu/src/cuda/remap.cu @@ -40,6 +40,8 @@ // //M*/ +#if !defined CUDA_DISABLER + #include "internal_shared.hpp" #include "opencv2/gpu/device/border_interpolate.hpp" #include "opencv2/gpu/device/vec_traits.hpp" @@ -267,3 +269,6 @@ namespace cv { namespace gpu { namespace device template void remap_gpu(PtrStepSzb src, PtrStepSzb srcWhole, int xoff, int yoff, PtrStepSzf xmap, PtrStepSzf ymap, PtrStepSzb dst, int interpolation, int borderMode, const float* borderValue, cudaStream_t stream, int cc); } // namespace imgproc }}} // namespace cv { namespace gpu { namespace device + + +#endif /* CUDA_DISABLER */ \ No newline at end of file diff --git a/modules/gpu/src/cuda/resize.cu b/modules/gpu/src/cuda/resize.cu index e5faeb8..59424f5 100644 --- a/modules/gpu/src/cuda/resize.cu +++ b/modules/gpu/src/cuda/resize.cu @@ -40,6 +40,8 @@ // //M*/ +#if !defined CUDA_DISABLER + #include "internal_shared.hpp" #include "opencv2/gpu/device/border_interpolate.hpp" #include "opencv2/gpu/device/vec_traits.hpp" @@ -295,3 +297,6 @@ namespace cv { namespace gpu { namespace device } // namespace imgproc }}} // namespace cv { namespace gpu { namespace device + + +#endif /* CUDA_DISABLER */ \ No newline at end of file diff --git a/modules/gpu/src/cuda/rgb_to_yv12.cu b/modules/gpu/src/cuda/rgb_to_yv12.cu index 3ef0a3e..29ee794 100644 --- a/modules/gpu/src/cuda/rgb_to_yv12.cu +++ b/modules/gpu/src/cuda/rgb_to_yv12.cu @@ -40,6 +40,8 @@ // //M*/ +#if !defined CUDA_DISABLER + #include "opencv2/gpu/device/common.hpp" #include "opencv2/gpu/device/vec_traits.hpp" @@ -169,3 +171,5 @@ namespace cv { namespace gpu { namespace device } } }}} + +#endif /* CUDA_DISABLER */ \ No newline at end of file diff --git a/modules/gpu/src/cuda/row_filter.cu b/modules/gpu/src/cuda/row_filter.cu index 5b3d044..7076f38 100644 --- a/modules/gpu/src/cuda/row_filter.cu +++ b/modules/gpu/src/cuda/row_filter.cu @@ -41,6 +41,8 @@ // //M*/ +#if !defined CUDA_DISABLER + #include "internal_shared.hpp" #include "opencv2/gpu/device/saturate_cast.hpp" #include "opencv2/gpu/device/vec_math.hpp" @@ -377,3 +379,6 @@ namespace cv { namespace gpu { namespace device template void linearRowFilter_gpu(PtrStepSzb src, PtrStepSzb dst, const float kernel[], int ksize, int anchor, int brd_type, int cc, cudaStream_t stream); } // namespace row_filter }}} // namespace cv { namespace gpu { namespace device + + +#endif /* CUDA_DISABLER */ \ No newline at end of file diff --git a/modules/gpu/src/cuda/split_merge.cu b/modules/gpu/src/cuda/split_merge.cu index edf19c9..7613e93 100644 --- a/modules/gpu/src/cuda/split_merge.cu +++ b/modules/gpu/src/cuda/split_merge.cu @@ -40,6 +40,8 @@ // //M*/ +#if !defined CUDA_DISABLER + #include "internal_shared.hpp" namespace cv { namespace gpu { namespace device @@ -504,3 +506,6 @@ namespace cv { namespace gpu { namespace device } } // namespace split_merge }}} // namespace cv { namespace gpu { namespace device + + +#endif /* CUDA_DISABLER */ \ No newline at end of file diff --git a/modules/gpu/src/cuda/stereobm.cu b/modules/gpu/src/cuda/stereobm.cu index 3f36d0f..b252a5e 100644 --- a/modules/gpu/src/cuda/stereobm.cu +++ b/modules/gpu/src/cuda/stereobm.cu @@ -40,6 +40,8 @@ // //M*/ +#if !defined CUDA_DISABLER + #include "internal_shared.hpp" namespace cv { namespace gpu { namespace device @@ -533,3 +535,6 @@ namespace cv { namespace gpu { namespace device } } // namespace stereobm }}} // namespace cv { namespace gpu { namespace device + + +#endif /* CUDA_DISABLER */ \ No newline at end of file diff --git a/modules/gpu/src/cuda/stereobp.cu b/modules/gpu/src/cuda/stereobp.cu index cf9a743..62d4e9a 100644 --- a/modules/gpu/src/cuda/stereobp.cu +++ b/modules/gpu/src/cuda/stereobp.cu @@ -40,6 +40,8 @@ // //M*/ +#if !defined CUDA_DISABLER + #include "internal_shared.hpp" #include "opencv2/gpu/device/saturate_cast.hpp" #include "opencv2/gpu/device/limits.hpp" @@ -532,3 +534,5 @@ namespace cv { namespace gpu { namespace device template void output_gpu(const PtrStepSzb& u, const PtrStepSzb& d, const PtrStepSzb& l, const PtrStepSzb& r, const PtrStepSzb& data, const PtrStepSz& disp, cudaStream_t stream); } // namespace stereobp }}} // namespace cv { namespace gpu { namespace device + +#endif /* CUDA_DISABLER */ \ No newline at end of file diff --git a/modules/gpu/src/cuda/stereocsbp.cu b/modules/gpu/src/cuda/stereocsbp.cu index 6001d90..4c7a2da 100644 --- a/modules/gpu/src/cuda/stereocsbp.cu +++ b/modules/gpu/src/cuda/stereocsbp.cu @@ -40,6 +40,8 @@ // //M*/ +#if !defined CUDA_DISABLER + #include "internal_shared.hpp" #include "opencv2/gpu/device/saturate_cast.hpp" #include "opencv2/gpu/device/limits.hpp" @@ -886,3 +888,5 @@ namespace cv { namespace gpu { namespace device const PtrStepSz& disp, int nr_plane, cudaStream_t stream); } // namespace stereocsbp }}} // namespace cv { namespace gpu { namespace device { + +#endif /* CUDA_DISABLER */ \ No newline at end of file diff --git a/modules/gpu/src/cuda/surf.cu b/modules/gpu/src/cuda/surf.cu index 8132d7f..509132f 100644 --- a/modules/gpu/src/cuda/surf.cu +++ b/modules/gpu/src/cuda/surf.cu @@ -45,6 +45,8 @@ // //M*/ +#if !defined CUDA_DISABLER + #include "internal_shared.hpp" #include "opencv2/gpu/device/limits.hpp" #include "opencv2/gpu/device/saturate_cast.hpp" @@ -990,3 +992,6 @@ namespace cv { namespace gpu { namespace device } } // namespace surf }}} // namespace cv { namespace gpu { namespace device + + +#endif /* CUDA_DISABLER */ \ No newline at end of file diff --git a/modules/gpu/src/cuda/warp.cu b/modules/gpu/src/cuda/warp.cu index e3569e7..a62037c 100644 --- a/modules/gpu/src/cuda/warp.cu +++ b/modules/gpu/src/cuda/warp.cu @@ -40,6 +40,8 @@ // //M*/ +#if !defined CUDA_DISABLER + #include "internal_shared.hpp" #include "opencv2/gpu/device/border_interpolate.hpp" #include "opencv2/gpu/device/vec_traits.hpp" @@ -382,3 +384,6 @@ namespace cv { namespace gpu { namespace device template void warpPerspective_gpu(PtrStepSzb src, PtrStepSzb srcWhole, int xoff, int yoff, float coeffs[3 * 3], PtrStepSzb dst, int interpolation, int borderMode, const float* borderValue, cudaStream_t stream, int cc); } // namespace imgproc }}} // namespace cv { namespace gpu { namespace device + + +#endif /* CUDA_DISABLER */ \ No newline at end of file diff --git a/modules/gpu/src/cudastream.cpp b/modules/gpu/src/cudastream.cpp index 569b460..4b0a81a 100644 --- a/modules/gpu/src/cudastream.cpp +++ b/modules/gpu/src/cudastream.cpp @@ -45,8 +45,26 @@ using namespace cv; using namespace cv::gpu; +#if defined HAVE_CUDA + +struct Stream::Impl +{ + static cudaStream_t getStream(const Impl* impl) { return impl ? impl->stream : 0; } + cudaStream_t stream; + int ref_counter; +}; + +#include "opencv2/gpu/stream_accessor.hpp" + +CV_EXPORTS cudaStream_t cv::gpu::StreamAccessor::getStream(const Stream& stream) +{ + return Stream::Impl::getStream(stream.impl); +}; + +#endif /* !defined (HAVE_CUDA) */ -#if !defined (HAVE_CUDA) + +#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER) void cv::gpu::Stream::create() { throw_nogpu(); } void cv::gpu::Stream::release() { throw_nogpu(); } @@ -69,8 +87,6 @@ cv::gpu::Stream::operator bool() const { throw_nogpu(); return false; } #else /* !defined (HAVE_CUDA) */ -#include "opencv2/gpu/stream_accessor.hpp" - namespace cv { namespace gpu { void copyWithMask(const GpuMat& src, GpuMat& dst, const GpuMat& mask, cudaStream_t stream); @@ -79,13 +95,6 @@ namespace cv { namespace gpu void setTo(GpuMat& src, Scalar s, const GpuMat& mask, cudaStream_t stream); }} -struct Stream::Impl -{ - static cudaStream_t getStream(const Impl* impl) { return impl ? impl->stream : 0; } - cudaStream_t stream; - int ref_counter; -}; - namespace { template void devcopy(const S& src, D& dst, cudaStream_t s, cudaMemcpyKind k) @@ -96,11 +105,6 @@ namespace }; } -CV_EXPORTS cudaStream_t cv::gpu::StreamAccessor::getStream(const Stream& stream) -{ - return Stream::Impl::getStream(stream.impl); -}; - void cv::gpu::Stream::create() { if (impl) diff --git a/modules/gpu/src/denoising.cpp b/modules/gpu/src/denoising.cpp index 7a85de9..2d56020 100644 --- a/modules/gpu/src/denoising.cpp +++ b/modules/gpu/src/denoising.cpp @@ -45,7 +45,7 @@ using namespace cv; using namespace cv::gpu; -#if !defined (HAVE_CUDA) +#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER) 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(); } diff --git a/modules/gpu/src/element_operations.cpp b/modules/gpu/src/element_operations.cpp index eb1581f..4f282b5 100644 --- a/modules/gpu/src/element_operations.cpp +++ b/modules/gpu/src/element_operations.cpp @@ -45,7 +45,7 @@ using namespace cv; using namespace cv::gpu; -#if !defined (HAVE_CUDA) +#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER) void cv::gpu::add(const GpuMat&, const GpuMat&, GpuMat&, const GpuMat&, int, Stream&) { throw_nogpu(); } void cv::gpu::add(const GpuMat&, const Scalar&, GpuMat&, const GpuMat&, int, Stream&) { throw_nogpu(); } diff --git a/modules/gpu/src/fast.cpp b/modules/gpu/src/fast.cpp index 5b61e60..f8edd23 100644 --- a/modules/gpu/src/fast.cpp +++ b/modules/gpu/src/fast.cpp @@ -46,7 +46,7 @@ using namespace cv; using namespace cv::gpu; using namespace std; -#if !defined (HAVE_CUDA) +#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER) cv::gpu::FAST_GPU::FAST_GPU(int, bool, double) { throw_nogpu(); } void cv::gpu::FAST_GPU::operator ()(const GpuMat&, const GpuMat&, GpuMat&) { throw_nogpu(); } diff --git a/modules/gpu/src/fgd_bgfg.cpp b/modules/gpu/src/fgd_bgfg.cpp index f9ca5c2..6bd7cab 100644 --- a/modules/gpu/src/fgd_bgfg.cpp +++ b/modules/gpu/src/fgd_bgfg.cpp @@ -42,7 +42,7 @@ #include "precomp.hpp" -#ifndef HAVE_CUDA +#if !defined HAVE_CUDA || defined(CUDA_DISABLER) class cv::gpu::FGDStatModel::Impl { diff --git a/modules/gpu/src/filtering.cpp b/modules/gpu/src/filtering.cpp index d90a0d8..82ccd85 100644 --- a/modules/gpu/src/filtering.cpp +++ b/modules/gpu/src/filtering.cpp @@ -46,7 +46,7 @@ using namespace cv; using namespace cv::gpu; -#if !defined (HAVE_CUDA) +#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER) Ptr cv::gpu::createFilter2D_GPU(const Ptr&, int, int) { throw_nogpu(); return Ptr(0); } Ptr cv::gpu::createSeparableFilter_GPU(const Ptr&, const Ptr&, int, int, int) { throw_nogpu(); return Ptr(0); } diff --git a/modules/gpu/src/gftt.cpp b/modules/gpu/src/gftt.cpp index 69b262d..00c1195 100644 --- a/modules/gpu/src/gftt.cpp +++ b/modules/gpu/src/gftt.cpp @@ -46,7 +46,7 @@ using namespace std; using namespace cv; using namespace cv::gpu; -#if !defined (HAVE_CUDA) +#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER) void cv::gpu::GoodFeaturesToTrackDetector_GPU::operator ()(const GpuMat&, GpuMat&, const GpuMat&) { throw_nogpu(); } diff --git a/modules/gpu/src/global_motion.cpp b/modules/gpu/src/global_motion.cpp index b23c642..7531c93 100644 --- a/modules/gpu/src/global_motion.cpp +++ b/modules/gpu/src/global_motion.cpp @@ -46,7 +46,7 @@ using namespace std; using namespace cv; using namespace cv::gpu; -#ifndef HAVE_CUDA +#if !defined HAVE_CUDA || defined(CUDA_DISABLER) void cv::gpu::compactPoints(GpuMat&, GpuMat&, const GpuMat&) { throw_nogpu(); } void cv::gpu::calcWobbleSuppressionMaps( diff --git a/modules/gpu/src/graphcuts.cpp b/modules/gpu/src/graphcuts.cpp index d41b1c6..ab16070 100644 --- a/modules/gpu/src/graphcuts.cpp +++ b/modules/gpu/src/graphcuts.cpp @@ -42,7 +42,7 @@ #include "precomp.hpp" -#if !defined (HAVE_CUDA) +#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER) void cv::gpu::graphcut(GpuMat&, GpuMat&, GpuMat&, GpuMat&, GpuMat&, GpuMat&, GpuMat&, Stream&) { throw_nogpu(); } void cv::gpu::graphcut(GpuMat&, GpuMat&, GpuMat&, GpuMat&, GpuMat&, GpuMat&, GpuMat&, GpuMat&, GpuMat&, GpuMat&, GpuMat&, Stream&) { throw_nogpu(); } diff --git a/modules/gpu/src/hog.cpp b/modules/gpu/src/hog.cpp index aae1818..9de31cb 100644 --- a/modules/gpu/src/hog.cpp +++ b/modules/gpu/src/hog.cpp @@ -42,7 +42,7 @@ #include "precomp.hpp" -#if !defined (HAVE_CUDA) +#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER) cv::gpu::HOGDescriptor::HOGDescriptor(Size, Size, Size, Size, int, double, double, bool, int) { throw_nogpu(); } size_t cv::gpu::HOGDescriptor::getDescriptorSize() const { throw_nogpu(); return 0; } diff --git a/modules/gpu/src/hough.cpp b/modules/gpu/src/hough.cpp index 6d96d38..6e2170d 100644 --- a/modules/gpu/src/hough.cpp +++ b/modules/gpu/src/hough.cpp @@ -46,7 +46,7 @@ using namespace std; using namespace cv; using namespace cv::gpu; -#if !defined (HAVE_CUDA) +#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER) void cv::gpu::HoughLines(const GpuMat&, GpuMat&, float, float, int, bool, int) { throw_nogpu(); } void cv::gpu::HoughLines(const GpuMat&, GpuMat&, HoughLinesBuf&, float, float, int, bool, int) { throw_nogpu(); } diff --git a/modules/gpu/src/imgproc.cpp b/modules/gpu/src/imgproc.cpp index 6dd0c71..14158af 100644 --- a/modules/gpu/src/imgproc.cpp +++ b/modules/gpu/src/imgproc.cpp @@ -45,7 +45,7 @@ using namespace cv; using namespace cv::gpu; -#if !defined (HAVE_CUDA) +#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER) void cv::gpu::meanShiftFiltering(const GpuMat&, GpuMat&, int, int, TermCriteria, Stream&) { throw_nogpu(); } void cv::gpu::meanShiftProc(const GpuMat&, GpuMat&, GpuMat&, int, int, TermCriteria, Stream&) { throw_nogpu(); } diff --git a/modules/gpu/src/match_template.cpp b/modules/gpu/src/match_template.cpp index df042f1..3b05433 100644 --- a/modules/gpu/src/match_template.cpp +++ b/modules/gpu/src/match_template.cpp @@ -46,7 +46,7 @@ using namespace cv; using namespace cv::gpu; using namespace std; -#if !defined (HAVE_CUDA) +#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER) void cv::gpu::matchTemplate(const GpuMat&, const GpuMat&, GpuMat&, int, Stream&) { throw_nogpu(); } diff --git a/modules/gpu/src/matrix_operations.cpp b/modules/gpu/src/matrix_operations.cpp index 711ff11..62ee0c4 100644 --- a/modules/gpu/src/matrix_operations.cpp +++ b/modules/gpu/src/matrix_operations.cpp @@ -178,7 +178,7 @@ bool cv::gpu::CudaMem::empty() const return data == 0; } -#if !defined (HAVE_CUDA) +#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER) void cv::gpu::registerPageLocked(Mat&) { throw_nogpu(); } void cv::gpu::unregisterPageLocked(Mat&) { throw_nogpu(); } diff --git a/modules/gpu/src/matrix_reductions.cpp b/modules/gpu/src/matrix_reductions.cpp index 563d42d..7fd268c 100644 --- a/modules/gpu/src/matrix_reductions.cpp +++ b/modules/gpu/src/matrix_reductions.cpp @@ -45,7 +45,7 @@ using namespace cv; using namespace cv::gpu; -#if !defined (HAVE_CUDA) +#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER) void cv::gpu::meanStdDev(const GpuMat&, Scalar&, Scalar&) { throw_nogpu(); } void cv::gpu::meanStdDev(const GpuMat&, Scalar&, Scalar&, GpuMat&) { throw_nogpu(); } diff --git a/modules/gpu/src/mssegmentation.cpp b/modules/gpu/src/mssegmentation.cpp index 1b9e481..cf32c44 100644 --- a/modules/gpu/src/mssegmentation.cpp +++ b/modules/gpu/src/mssegmentation.cpp @@ -42,7 +42,7 @@ #include "precomp.hpp" -#if !defined(HAVE_CUDA) +#if !defined HAVE_CUDA || defined(CUDA_DISABLER) void cv::gpu::meanShiftSegmentation(const GpuMat&, Mat&, int, int, int, TermCriteria) { throw_nogpu(); } @@ -386,4 +386,4 @@ void cv::gpu::meanShiftSegmentation(const GpuMat& src, Mat& dst, int sp, int sr, } } -#endif // #if !defined (HAVE_CUDA) +#endif // #if !defined (HAVE_CUDA) || defined (CUDA_DISABLER) diff --git a/modules/gpu/src/nvidia/NCVBroxOpticalFlow.cu b/modules/gpu/src/nvidia/NCVBroxOpticalFlow.cu index e04ec84..0598f24 100644 --- a/modules/gpu/src/nvidia/NCVBroxOpticalFlow.cu +++ b/modules/gpu/src/nvidia/NCVBroxOpticalFlow.cu @@ -56,6 +56,8 @@ // //////////////////////////////////////////////////////////////////////////////// +#if !defined CUDA_DISABLER + #include #include #include @@ -1160,3 +1162,5 @@ NCVStatus NCVBroxOpticalFlow(const NCVBroxOpticalFlowDescriptor desc, return NCV_SUCCESS; } + +#endif /* CUDA_DISABLER */ \ No newline at end of file diff --git a/modules/gpu/src/nvidia/NCVHaarObjectDetection.cu b/modules/gpu/src/nvidia/NCVHaarObjectDetection.cu index 4449c42..05918ab 100644 --- a/modules/gpu/src/nvidia/NCVHaarObjectDetection.cu +++ b/modules/gpu/src/nvidia/NCVHaarObjectDetection.cu @@ -55,6 +55,8 @@ // //////////////////////////////////////////////////////////////////////////////// +#if !defined CUDA_DISABLER + #include #include @@ -2314,3 +2316,5 @@ NCVStatus ncvHaarStoreNVBIN_host(const std::string &filename, fclose(fp); return NCV_SUCCESS; } + +#endif /* CUDA_DISABLER */ \ No newline at end of file diff --git a/modules/gpu/src/nvidia/NPP_staging/NPP_staging.cu b/modules/gpu/src/nvidia/NPP_staging/NPP_staging.cu index 0e6aca0..6885e5b 100644 --- a/modules/gpu/src/nvidia/NPP_staging/NPP_staging.cu +++ b/modules/gpu/src/nvidia/NPP_staging/NPP_staging.cu @@ -39,6 +39,7 @@ // //M*/ +#if !defined CUDA_DISABLER #include #include @@ -2576,3 +2577,5 @@ NCVStatus nppiStResize_32f_C1R(const Ncv32f *pSrc, return status; } + +#endif /* CUDA_DISABLER */ \ No newline at end of file diff --git a/modules/gpu/src/nvidia/core/NCV.cu b/modules/gpu/src/nvidia/core/NCV.cu index 2831877..44c5d32 100644 --- a/modules/gpu/src/nvidia/core/NCV.cu +++ b/modules/gpu/src/nvidia/core/NCV.cu @@ -39,6 +39,8 @@ // //M*/ +#if !defined CUDA_DISABLER + #include #include @@ -905,3 +907,5 @@ NCVStatus ncvDrawRects_32u_device(Ncv32u *d_dst, { return drawRectsWrapperDevice(d_dst, dstStride, dstWidth, dstHeight, d_rects, numRects, color, cuStream); } + +#endif /* CUDA_DISABLER */ \ No newline at end of file diff --git a/modules/gpu/src/nvidia/core/NCVPyramid.cu b/modules/gpu/src/nvidia/core/NCVPyramid.cu index 84c9c12..cb80bcc 100644 --- a/modules/gpu/src/nvidia/core/NCVPyramid.cu +++ b/modules/gpu/src/nvidia/core/NCVPyramid.cu @@ -39,6 +39,7 @@ // //M*/ +#if !defined CUDA_DISABLER #include #include @@ -600,3 +601,5 @@ template class NCVImagePyramid; template class NCVImagePyramid; #endif //_WIN32 + +#endif /* CUDA_DISABLER */ \ No newline at end of file diff --git a/modules/gpu/src/optical_flow.cpp b/modules/gpu/src/optical_flow.cpp index 1e44ed7..5829d08 100644 --- a/modules/gpu/src/optical_flow.cpp +++ b/modules/gpu/src/optical_flow.cpp @@ -46,7 +46,7 @@ using namespace cv; using namespace cv::gpu; using namespace std; -#if !defined (HAVE_CUDA) +#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER) void cv::gpu::BroxOpticalFlow::operator ()(const GpuMat&, const GpuMat&, GpuMat&, GpuMat&, Stream&) { throw_nogpu(); } void cv::gpu::interpolateFrames(const GpuMat&, const GpuMat&, const GpuMat&, const GpuMat&, const GpuMat&, const GpuMat&, float, GpuMat&, GpuMat&, Stream&) { throw_nogpu(); } diff --git a/modules/gpu/src/optical_flow_farneback.cpp b/modules/gpu/src/optical_flow_farneback.cpp index 4775f66..4d771db 100644 --- a/modules/gpu/src/optical_flow_farneback.cpp +++ b/modules/gpu/src/optical_flow_farneback.cpp @@ -54,7 +54,7 @@ using namespace std; using namespace cv; using namespace cv::gpu; -#if !defined(HAVE_CUDA) +#if !defined HAVE_CUDA || defined(CUDA_DISABLER) void cv::gpu::FarnebackOpticalFlow::operator ()(const GpuMat&, const GpuMat&, GpuMat&, GpuMat&, Stream&) { throw_nogpu(); } diff --git a/modules/gpu/src/orb.cpp b/modules/gpu/src/orb.cpp index c1df4dd..299806c 100644 --- a/modules/gpu/src/orb.cpp +++ b/modules/gpu/src/orb.cpp @@ -46,7 +46,7 @@ using namespace std; using namespace cv; using namespace cv::gpu; -#if !defined (HAVE_CUDA) +#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER) cv::gpu::ORB_GPU::ORB_GPU(int, float, int, int, int, int, int, int) : fastDetector_(20) { throw_nogpu(); } void cv::gpu::ORB_GPU::operator()(const GpuMat&, const GpuMat&, std::vector&) { throw_nogpu(); } diff --git a/modules/gpu/src/pyramids.cpp b/modules/gpu/src/pyramids.cpp index 1c6dc7b..85fb990 100644 --- a/modules/gpu/src/pyramids.cpp +++ b/modules/gpu/src/pyramids.cpp @@ -42,7 +42,7 @@ #include "precomp.hpp" -#ifndef HAVE_CUDA +#if !defined HAVE_CUDA || defined(CUDA_DISABLER) void cv::gpu::pyrDown(const GpuMat&, GpuMat&, Stream&) { throw_nogpu(); } void cv::gpu::pyrUp(const GpuMat&, GpuMat&, Stream&) { throw_nogpu(); } diff --git a/modules/gpu/src/pyrlk.cpp b/modules/gpu/src/pyrlk.cpp index 4ad9960..dc874e6 100644 --- a/modules/gpu/src/pyrlk.cpp +++ b/modules/gpu/src/pyrlk.cpp @@ -46,7 +46,7 @@ using namespace std; using namespace cv; using namespace cv::gpu; -#if !defined (HAVE_CUDA) +#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER) cv::gpu::PyrLKOpticalFlow::PyrLKOpticalFlow() { throw_nogpu(); } void cv::gpu::PyrLKOpticalFlow::sparse(const GpuMat&, const GpuMat&, const GpuMat&, GpuMat&, GpuMat&, GpuMat*) { throw_nogpu(); } diff --git a/modules/gpu/src/remap.cpp b/modules/gpu/src/remap.cpp index d2bd3cc..8499eef 100644 --- a/modules/gpu/src/remap.cpp +++ b/modules/gpu/src/remap.cpp @@ -42,7 +42,7 @@ #include "precomp.hpp" -#ifndef HAVE_CUDA +#if !defined HAVE_CUDA || defined(CUDA_DISABLER) void cv::gpu::remap(const GpuMat&, GpuMat&, const GpuMat&, const GpuMat&, int, int, Scalar, Stream&){ throw_nogpu(); } diff --git a/modules/gpu/src/resize.cpp b/modules/gpu/src/resize.cpp index 67cf186..edf2fc8 100644 --- a/modules/gpu/src/resize.cpp +++ b/modules/gpu/src/resize.cpp @@ -42,7 +42,7 @@ #include "precomp.hpp" -#ifndef HAVE_CUDA +#if !defined HAVE_CUDA || defined(CUDA_DISABLER) void cv::gpu::resize(const GpuMat& src, GpuMat& dst, Size dsize, double fx, double fy, int interpolation, Stream& s) { diff --git a/modules/gpu/src/split_merge.cpp b/modules/gpu/src/split_merge.cpp index f983d9d..d185f78 100644 --- a/modules/gpu/src/split_merge.cpp +++ b/modules/gpu/src/split_merge.cpp @@ -46,7 +46,7 @@ using namespace cv; using namespace cv::gpu; using namespace std; -#if !defined (HAVE_CUDA) +#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER) void cv::gpu::merge(const GpuMat* /*src*/, size_t /*count*/, GpuMat& /*dst*/, Stream& /*stream*/) { throw_nogpu(); } void cv::gpu::merge(const vector& /*src*/, GpuMat& /*dst*/, Stream& /*stream*/) { throw_nogpu(); } diff --git a/modules/gpu/src/stereobm.cpp b/modules/gpu/src/stereobm.cpp index 30faf5c..9522872 100644 --- a/modules/gpu/src/stereobm.cpp +++ b/modules/gpu/src/stereobm.cpp @@ -45,7 +45,7 @@ using namespace cv; using namespace cv::gpu; -#if !defined (HAVE_CUDA) +#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER) cv::gpu::StereoBM_GPU::StereoBM_GPU() { throw_nogpu(); } cv::gpu::StereoBM_GPU::StereoBM_GPU(int, int, int) { throw_nogpu(); } diff --git a/modules/gpu/src/stereobp.cpp b/modules/gpu/src/stereobp.cpp index 4dbba12..06bfdd6 100644 --- a/modules/gpu/src/stereobp.cpp +++ b/modules/gpu/src/stereobp.cpp @@ -46,7 +46,7 @@ using namespace cv; using namespace cv::gpu; using namespace std; -#if !defined (HAVE_CUDA) +#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER) void cv::gpu::StereoBeliefPropagation::estimateRecommendedParams(int, int, int&, int&, int&) { throw_nogpu(); } diff --git a/modules/gpu/src/stereocsbp.cpp b/modules/gpu/src/stereocsbp.cpp index 1eda460..db15e39 100644 --- a/modules/gpu/src/stereocsbp.cpp +++ b/modules/gpu/src/stereocsbp.cpp @@ -46,7 +46,7 @@ using namespace cv; using namespace cv::gpu; using namespace std; -#if !defined (HAVE_CUDA) +#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER) void cv::gpu::StereoConstantSpaceBP::estimateRecommendedParams(int, int, int&, int&, int&, int&) { throw_nogpu(); } diff --git a/modules/gpu/src/surf.cpp b/modules/gpu/src/surf.cpp index 5df61d0..99c3370 100644 --- a/modules/gpu/src/surf.cpp +++ b/modules/gpu/src/surf.cpp @@ -46,7 +46,7 @@ using namespace cv; using namespace cv::gpu; using namespace std; -#if !defined (HAVE_CUDA) +#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER) cv::gpu::SURF_GPU::SURF_GPU() { throw_nogpu(); } cv::gpu::SURF_GPU::SURF_GPU(double, int, int, bool, float, bool) { throw_nogpu(); } diff --git a/modules/gpu/src/video_reader.cpp b/modules/gpu/src/video_reader.cpp index f9d75a3..07abebc 100644 --- a/modules/gpu/src/video_reader.cpp +++ b/modules/gpu/src/video_reader.cpp @@ -42,7 +42,7 @@ #include "precomp.hpp" -#if !defined(HAVE_CUDA) || defined(__APPLE__) +#if !defined HAVE_CUDA || defined(CUDA_DISABLER) || defined(__APPLE__) class cv::gpu::VideoReader_GPU::Impl { diff --git a/modules/gpu/src/video_writer.cpp b/modules/gpu/src/video_writer.cpp index 42d0e09..5410b72 100644 --- a/modules/gpu/src/video_writer.cpp +++ b/modules/gpu/src/video_writer.cpp @@ -42,7 +42,7 @@ #include "precomp.hpp" -#if !defined(HAVE_CUDA) || !defined(WIN32) +#if !defined HAVE_CUDA || defined(CUDA_DISABLER) || !defined(WIN32) class cv::gpu::VideoWriter_GPU::Impl { diff --git a/modules/gpu/src/warp.cpp b/modules/gpu/src/warp.cpp index 9de5651..57bc92d 100644 --- a/modules/gpu/src/warp.cpp +++ b/modules/gpu/src/warp.cpp @@ -42,7 +42,7 @@ #include "precomp.hpp" -#ifndef HAVE_CUDA +#if !defined HAVE_CUDA || defined(CUDA_DISABLER) void cv::gpu::warpAffine(const GpuMat&, GpuMat&, const Mat&, Size, int, int, Scalar, Stream&) { throw_nogpu(); } diff --git a/modules/gpu/test/main.cpp b/modules/gpu/test/main.cpp index 2e1edf0..665b3ab 100644 --- a/modules/gpu/test/main.cpp +++ b/modules/gpu/test/main.cpp @@ -74,7 +74,7 @@ void printOsInfo() void printCudaInfo() { -#ifndef HAVE_CUDA +#if !defined HAVE_CUDA || defined(CUDA_DISABLER) cout << "OpenCV was built without CUDA support \n" << endl; #else int driver; diff --git a/modules/gpu/test/nvidia/TestCompact.cpp b/modules/gpu/test/nvidia/TestCompact.cpp index 92ca735..ff54c47 100644 --- a/modules/gpu/test/nvidia/TestCompact.cpp +++ b/modules/gpu/test/nvidia/TestCompact.cpp @@ -9,6 +9,8 @@ * agreement from NVIDIA Corporation is strictly prohibited. */ +#if !defined CUDA_DISABLER + #include "TestCompact.h" @@ -127,3 +129,5 @@ bool TestCompact::deinit() { return true; } + +#endif /* CUDA_DISABLER */ \ No newline at end of file diff --git a/modules/gpu/test/nvidia/TestDrawRects.cpp b/modules/gpu/test/nvidia/TestDrawRects.cpp index b063293..90e1bd8 100644 --- a/modules/gpu/test/nvidia/TestDrawRects.cpp +++ b/modules/gpu/test/nvidia/TestDrawRects.cpp @@ -9,6 +9,8 @@ * agreement from NVIDIA Corporation is strictly prohibited. */ +#if !defined CUDA_DISABLER + #include "TestDrawRects.h" #include "NCVHaarObjectDetection.hpp" @@ -162,3 +164,5 @@ bool TestDrawRects::deinit() template class TestDrawRects; template class TestDrawRects; + +#endif /* CUDA_DISABLER */ \ No newline at end of file diff --git a/modules/gpu/test/nvidia/TestHaarCascadeApplication.cpp b/modules/gpu/test/nvidia/TestHaarCascadeApplication.cpp index fe4f5d6..644ca73 100644 --- a/modules/gpu/test/nvidia/TestHaarCascadeApplication.cpp +++ b/modules/gpu/test/nvidia/TestHaarCascadeApplication.cpp @@ -9,6 +9,8 @@ * agreement from NVIDIA Corporation is strictly prohibited. */ +#if !defined CUDA_DISABLER + #include #if defined(__GNUC__) && !defined(__APPLE__) @@ -299,3 +301,5 @@ bool TestHaarCascadeApplication::deinit() { return true; } + +#endif /* CUDA_DISABLER */ \ No newline at end of file diff --git a/modules/gpu/test/nvidia/TestHaarCascadeLoader.cpp b/modules/gpu/test/nvidia/TestHaarCascadeLoader.cpp index ad1c953..ddc8472 100644 --- a/modules/gpu/test/nvidia/TestHaarCascadeLoader.cpp +++ b/modules/gpu/test/nvidia/TestHaarCascadeLoader.cpp @@ -9,6 +9,8 @@ * agreement from NVIDIA Corporation is strictly prohibited. */ +#if !defined CUDA_DISABLER + #include "TestHaarCascadeLoader.h" #include "NCVHaarObjectDetection.hpp" @@ -121,3 +123,5 @@ bool TestHaarCascadeLoader::deinit() { return true; } + +#endif /* CUDA_DISABLER */ \ No newline at end of file diff --git a/modules/gpu/test/nvidia/TestHypothesesFilter.cpp b/modules/gpu/test/nvidia/TestHypothesesFilter.cpp index 48ed3a1..702050b 100644 --- a/modules/gpu/test/nvidia/TestHypothesesFilter.cpp +++ b/modules/gpu/test/nvidia/TestHypothesesFilter.cpp @@ -9,6 +9,8 @@ * agreement from NVIDIA Corporation is strictly prohibited. */ +#if !defined CUDA_DISABLER + #include "TestHypothesesFilter.h" #include "NCVHaarObjectDetection.hpp" @@ -174,3 +176,5 @@ bool TestHypothesesFilter::deinit() { return true; } + +#endif /* CUDA_DISABLER */ \ No newline at end of file diff --git a/modules/gpu/test/nvidia/TestHypothesesGrow.cpp b/modules/gpu/test/nvidia/TestHypothesesGrow.cpp index 2b0c34a..00234c5 100644 --- a/modules/gpu/test/nvidia/TestHypothesesGrow.cpp +++ b/modules/gpu/test/nvidia/TestHypothesesGrow.cpp @@ -9,6 +9,8 @@ * agreement from NVIDIA Corporation is strictly prohibited. */ +#if !defined CUDA_DISABLER + #include "TestHypothesesGrow.h" #include "NCVHaarObjectDetection.hpp" @@ -132,3 +134,5 @@ bool TestHypothesesGrow::deinit() { return true; } + +#endif /* CUDA_DISABLER */ \ No newline at end of file diff --git a/modules/gpu/test/nvidia/TestIntegralImage.cpp b/modules/gpu/test/nvidia/TestIntegralImage.cpp index bff2aa5..8d498cf 100644 --- a/modules/gpu/test/nvidia/TestIntegralImage.cpp +++ b/modules/gpu/test/nvidia/TestIntegralImage.cpp @@ -9,6 +9,8 @@ * agreement from NVIDIA Corporation is strictly prohibited. */ +#if !defined CUDA_DISABLER + #include #include "TestIntegralImage.h" @@ -183,3 +185,5 @@ bool TestIntegralImage::deinit() template class TestIntegralImage; template class TestIntegralImage; + +#endif /* CUDA_DISABLER */ \ No newline at end of file diff --git a/modules/gpu/test/nvidia/TestIntegralImageSquared.cpp b/modules/gpu/test/nvidia/TestIntegralImageSquared.cpp index 0277f5e..2a19854 100644 --- a/modules/gpu/test/nvidia/TestIntegralImageSquared.cpp +++ b/modules/gpu/test/nvidia/TestIntegralImageSquared.cpp @@ -9,6 +9,8 @@ * agreement from NVIDIA Corporation is strictly prohibited. */ +#if !defined CUDA_DISABLER + #include "TestIntegralImageSquared.h" @@ -115,3 +117,5 @@ bool TestIntegralImageSquared::deinit() { return true; } + +#endif /* CUDA_DISABLER */ \ No newline at end of file diff --git a/modules/gpu/test/nvidia/TestRectStdDev.cpp b/modules/gpu/test/nvidia/TestRectStdDev.cpp index 420979d..d8857f6 100644 --- a/modules/gpu/test/nvidia/TestRectStdDev.cpp +++ b/modules/gpu/test/nvidia/TestRectStdDev.cpp @@ -9,6 +9,8 @@ * agreement from NVIDIA Corporation is strictly prohibited. */ +#if !defined CUDA_DISABLER + #include #include "TestRectStdDev.h" @@ -178,3 +180,5 @@ bool TestRectStdDev::deinit() { return true; } + +#endif /* CUDA_DISABLER */ \ No newline at end of file diff --git a/modules/gpu/test/nvidia/TestResize.cpp b/modules/gpu/test/nvidia/TestResize.cpp index eb49ddd..7ccffac 100644 --- a/modules/gpu/test/nvidia/TestResize.cpp +++ b/modules/gpu/test/nvidia/TestResize.cpp @@ -9,6 +9,8 @@ * agreement from NVIDIA Corporation is strictly prohibited. */ +#if !defined CUDA_DISABLER + #include #include "TestResize.h" @@ -159,3 +161,5 @@ bool TestResize::deinit() template class TestResize; template class TestResize; + +#endif /* CUDA_DISABLER */ \ No newline at end of file diff --git a/modules/gpu/test/nvidia/TestTranspose.cpp b/modules/gpu/test/nvidia/TestTranspose.cpp index b4c65ea..82ca202 100644 --- a/modules/gpu/test/nvidia/TestTranspose.cpp +++ b/modules/gpu/test/nvidia/TestTranspose.cpp @@ -9,6 +9,8 @@ * agreement from NVIDIA Corporation is strictly prohibited. */ +#if !defined CUDA_DISABLER + #include #include "TestTranspose.h" @@ -146,3 +148,5 @@ bool TestTranspose::deinit() template class TestTranspose; template class TestTranspose; + +#endif /* CUDA_DISABLER */ \ No newline at end of file diff --git a/modules/gpu/test/nvidia/main_nvidia.cpp b/modules/gpu/test/nvidia/main_nvidia.cpp index 15759e1..d249064 100644 --- a/modules/gpu/test/nvidia/main_nvidia.cpp +++ b/modules/gpu/test/nvidia/main_nvidia.cpp @@ -2,6 +2,8 @@ # pragma warning (disable : 4408 4201 4100) #endif +#if !defined CUDA_DISABLER + #include #include "NCV.hpp" @@ -436,3 +438,5 @@ bool nvidia_NCV_Visualization(const std::string& test_data_path, OutputLevel out return testListerVisualize.invoke(); } + +#endif /* CUDA_DISABLER */ \ No newline at end of file diff --git a/modules/gpu/test/test_nvidia.cpp b/modules/gpu/test/test_nvidia.cpp index 9c49b09..4e6db58 100644 --- a/modules/gpu/test/test_nvidia.cpp +++ b/modules/gpu/test/test_nvidia.cpp @@ -41,13 +41,15 @@ #include "test_precomp.hpp" -#ifdef HAVE_CUDA +#if defined HAVE_CUDA + OutputLevel nvidiaTestOutputLevel = OutputLevelCompact; +#endif + +#if defined HAVE_CUDA && !defined(CUDA_DISABLER) using namespace cvtest; using namespace testing; -OutputLevel nvidiaTestOutputLevel = OutputLevelCompact; - struct NVidiaTest : TestWithParam { cv::gpu::DeviceInfo devInfo; -- 2.7.4