From 6b345329019b8842a2d9960920f5bd1cbbe80376 Mon Sep 17 00:00:00 2001 From: Anatoly Baksheev Date: Tue, 15 Feb 2011 15:09:54 +0000 Subject: [PATCH] minor + warnings --- doc/gpu_initialization.tex | 2 +- modules/contrib/src/chamfermatching.cpp | 13 ++++++++++++- modules/gpu/include/opencv2/gpu/gpu.hpp | 2 +- modules/gpu/src/brute_force_matcher.cpp | 2 +- modules/gpu/src/matrix_reductions.cpp | 16 ++++++++-------- .../gpu/src/nvidia/core/NCVRuntimeTemplates.hpp | 4 ++++ modules/gpu/src/surf.cpp | 2 +- 7 files changed, 28 insertions(+), 13 deletions(-) diff --git a/doc/gpu_initialization.tex b/doc/gpu_initialization.tex index 3daafbc64..fc7ad86ca 100644 --- a/doc/gpu_initialization.tex +++ b/doc/gpu_initialization.tex @@ -31,7 +31,7 @@ enum FeatureSet FEATURE_SET_COMPUTE_10, FEATURE_SET_COMPUTE_11, FEATURE_SET_COMPUTE_12, FEATURE_SET_COMPUTE_13, FEATURE_SET_COMPUTE_20, FEATURE_SET_COMPUTE_21, - ATOMICS, NATIVE_DOUBLE + GLOBAL_ATOMICS, NATIVE_DOUBLE }; \end{lstlisting} diff --git a/modules/contrib/src/chamfermatching.cpp b/modules/contrib/src/chamfermatching.cpp index f98de6c9d..0f6f8cefc 100644 --- a/modules/contrib/src/chamfermatching.cpp +++ b/modules/contrib/src/chamfermatching.cpp @@ -111,6 +111,9 @@ private: int scales_; float min_scale_; float max_scale_; + + LocationImageRange(const LocationImageRange&); + LocationImageRange& operator=(const LocationImageRange&); public: LocationImageRange(const vector& locations, int scales = 5, float min_scale = 0.6, float max_scale = 1.6) : @@ -130,6 +133,8 @@ private: const vector& locations_; const vector& scales_; + LocationScaleImageRange(const LocationScaleImageRange&); + LocationScaleImageRange& operator=(const LocationScaleImageRange&); public: LocationScaleImageRange(const vector& locations, const vector& scales) : locations_(locations), scales_(scales) @@ -355,6 +360,9 @@ private: int scale_cnt_; bool has_next_; + + LocationImageIterator(const LocationImageIterator&); + LocationImageIterator& operator=(const LocationImageIterator&); public: LocationImageIterator(const vector& locations, int scales, float min_scale, float max_scale); @@ -374,6 +382,9 @@ private: size_t iter_; bool has_next_; + + LocationScaleImageIterator(const LocationScaleImageIterator&); + LocationScaleImageIterator& operator=(const LocationScaleImageIterator&); public: LocationScaleImageIterator(const vector& locations, const vector& scales) : @@ -714,7 +725,7 @@ float ChamferMatcher::Matching::getAngle(coordinate_t a, coordinate_t b, int& dx float angle = atan2((float)dy,(float)dx); if (angle<0) { - angle+=CV_PI; + angle+=(float)CV_PI; } return angle; diff --git a/modules/gpu/include/opencv2/gpu/gpu.hpp b/modules/gpu/include/opencv2/gpu/gpu.hpp index a40188527..0a4c3487b 100644 --- a/modules/gpu/include/opencv2/gpu/gpu.hpp +++ b/modules/gpu/include/opencv2/gpu/gpu.hpp @@ -72,7 +72,7 @@ namespace cv FEATURE_SET_COMPUTE_13 = 13, FEATURE_SET_COMPUTE_20 = 20, FEATURE_SET_COMPUTE_21 = 21, - ATOMICS = FEATURE_SET_COMPUTE_11, + GLOBAL_ATOMICS = FEATURE_SET_COMPUTE_11, NATIVE_DOUBLE = FEATURE_SET_COMPUTE_13 }; diff --git a/modules/gpu/src/brute_force_matcher.cpp b/modules/gpu/src/brute_force_matcher.cpp index ebf831f20..f63c42781 100644 --- a/modules/gpu/src/brute_force_matcher.cpp +++ b/modules/gpu/src/brute_force_matcher.cpp @@ -542,7 +542,7 @@ void cv::gpu::BruteForceMatcher_GPU_base::radiusMatch(const GpuMat& queryDescs, } }; - CV_Assert(DeviceInfo().supports(ATOMICS)); + CV_Assert(DeviceInfo().supports(GLOBAL_ATOMICS)); const int nQuery = queryDescs.rows; const int nTrain = trainDescs.rows; diff --git a/modules/gpu/src/matrix_reductions.cpp b/modules/gpu/src/matrix_reductions.cpp index 1a717a91c..1cc8831a5 100644 --- a/modules/gpu/src/matrix_reductions.cpp +++ b/modules/gpu/src/matrix_reductions.cpp @@ -201,7 +201,7 @@ Scalar cv::gpu::sum(const GpuMat& src, GpuMat& buf) ensureSizeIsEnough(buf_size, CV_8U, buf); Caller* callers = multipass_callers; - if (TargetArchs::builtWith(ATOMICS) && DeviceInfo().supports(ATOMICS)) + if (TargetArchs::builtWith(GLOBAL_ATOMICS) && DeviceInfo().supports(GLOBAL_ATOMICS)) callers = singlepass_callers; Caller caller = callers[src.depth()]; @@ -242,7 +242,7 @@ Scalar cv::gpu::absSum(const GpuMat& src, GpuMat& buf) ensureSizeIsEnough(buf_size, CV_8U, buf); Caller* callers = multipass_callers; - if (TargetArchs::builtWith(ATOMICS) && DeviceInfo().supports(ATOMICS)) + if (TargetArchs::builtWith(GLOBAL_ATOMICS) && DeviceInfo().supports(GLOBAL_ATOMICS)) callers = singlepass_callers; Caller caller = callers[src.depth()]; @@ -278,7 +278,7 @@ Scalar cv::gpu::sqrSum(const GpuMat& src, GpuMat& buf) sqrSumCaller, sqrSumCaller, 0 }; Caller* callers = multipass_callers; - if (TargetArchs::builtWith(ATOMICS) && DeviceInfo().supports(ATOMICS)) + if (TargetArchs::builtWith(GLOBAL_ATOMICS) && DeviceInfo().supports(GLOBAL_ATOMICS)) callers = singlepass_callers; Size buf_size; @@ -371,7 +371,7 @@ void cv::gpu::minMax(const GpuMat& src, double* minVal, double* maxVal, const Gp if (mask.empty()) { Caller* callers = multipass_callers; - if (TargetArchs::builtWith(ATOMICS) && DeviceInfo().supports(ATOMICS)) + if (TargetArchs::builtWith(GLOBAL_ATOMICS) && DeviceInfo().supports(GLOBAL_ATOMICS)) callers = singlepass_callers; Caller caller = callers[src.type()]; @@ -381,7 +381,7 @@ void cv::gpu::minMax(const GpuMat& src, double* minVal, double* maxVal, const Gp else { MaskedCaller* callers = masked_multipass_callers; - if (TargetArchs::builtWith(ATOMICS) && DeviceInfo().supports(ATOMICS)) + if (TargetArchs::builtWith(GLOBAL_ATOMICS) && DeviceInfo().supports(GLOBAL_ATOMICS)) callers = masked_singlepass_callers; MaskedCaller caller = callers[src.type()]; @@ -474,7 +474,7 @@ void cv::gpu::minMaxLoc(const GpuMat& src, double* minVal, double* maxVal, Point if (mask.empty()) { Caller* callers = multipass_callers; - if (TargetArchs::builtWith(ATOMICS) && DeviceInfo().supports(ATOMICS)) + if (TargetArchs::builtWith(GLOBAL_ATOMICS) && DeviceInfo().supports(GLOBAL_ATOMICS)) callers = singlepass_callers; Caller caller = callers[src.type()]; @@ -484,7 +484,7 @@ void cv::gpu::minMaxLoc(const GpuMat& src, double* minVal, double* maxVal, Point else { MaskedCaller* callers = masked_multipass_callers; - if (TargetArchs::builtWith(ATOMICS) && DeviceInfo().supports(ATOMICS)) + if (TargetArchs::builtWith(GLOBAL_ATOMICS) && DeviceInfo().supports(GLOBAL_ATOMICS)) callers = masked_singlepass_callers; MaskedCaller caller = callers[src.type()]; @@ -546,7 +546,7 @@ int cv::gpu::countNonZero(const GpuMat& src, GpuMat& buf) ensureSizeIsEnough(buf_size, CV_8U, buf); Caller* callers = multipass_callers; - if (TargetArchs::builtWith(ATOMICS) && DeviceInfo().supports(ATOMICS)) + if (TargetArchs::builtWith(GLOBAL_ATOMICS) && DeviceInfo().supports(GLOBAL_ATOMICS)) callers = singlepass_callers; Caller caller = callers[src.type()]; diff --git a/modules/gpu/src/nvidia/core/NCVRuntimeTemplates.hpp b/modules/gpu/src/nvidia/core/NCVRuntimeTemplates.hpp index 30f3e816a..08ec9e35d 100644 --- a/modules/gpu/src/nvidia/core/NCVRuntimeTemplates.hpp +++ b/modules/gpu/src/nvidia/core/NCVRuntimeTemplates.hpp @@ -41,6 +41,10 @@ #ifndef _ncvruntimetemplates_hpp_ #define _ncvruntimetemplates_hpp_ +#if _MSC_VER >= 1200 +#pragma warning( disable: 4800 ) +#endif + #include #include diff --git a/modules/gpu/src/surf.cpp b/modules/gpu/src/surf.cpp index 9680260e1..913a385c8 100644 --- a/modules/gpu/src/surf.cpp +++ b/modules/gpu/src/surf.cpp @@ -108,7 +108,7 @@ namespace CV_Assert(!img.empty() && img.type() == CV_8UC1); CV_Assert(mask.empty() || (mask.size() == img.size() && mask.type() == CV_8UC1)); CV_Assert(nOctaves > 0 && nIntervals > 2 && nIntervals < 22); - CV_Assert(DeviceInfo().supports(ATOMICS)); + CV_Assert(DeviceInfo().supports(GLOBAL_ATOMICS)); max_features = static_cast(img.size().area() * featuresRatio); max_candidates = static_cast(1.5 * max_features);