From 4dbd0f0e8fa30fd6d2a6e939d2830833caad6819 Mon Sep 17 00:00:00 2001 From: Vladislav Vinogradov Date: Tue, 26 Mar 2013 12:33:13 +0400 Subject: [PATCH] fixed compilation issues with gpu modules: * disabled warnings from thrust * fixed warnings from ts_gtest.h * possibly fixed superres compilation in Debug mode on Windows --- modules/gpu/CMakeLists.txt | 2 +- modules/gpu/perf/perf_precomp.hpp | 1 - modules/gpu/perf4au/main.cpp | 8 +++++--- modules/nonfree/perf/perf_gpu.cpp | 5 +++-- modules/nonfree/perf/perf_precomp.hpp | 7 ++++--- modules/superres/perf/perf_precomp.hpp | 5 +++-- 6 files changed, 16 insertions(+), 12 deletions(-) diff --git a/modules/gpu/CMakeLists.txt b/modules/gpu/CMakeLists.txt index 05b65f2413..8fba2ef4ec 100644 --- a/modules/gpu/CMakeLists.txt +++ b/modules/gpu/CMakeLists.txt @@ -28,7 +28,7 @@ if(HAVE_CUDA) source_group("Src\\NVidia" FILES ${ncv_files}) ocv_include_directories("src/nvidia" "src/nvidia/core" "src/nvidia/NPP_staging" ${CUDA_INCLUDE_DIRS}) - ocv_warnings_disable(CMAKE_CXX_FLAGS -Wundef -Wmissing-declarations /wd4211 /wd4201 /wd4100 /wd4505 /wd4408) + ocv_warnings_disable(CMAKE_CXX_FLAGS -Wundef -Wmissing-declarations -Wshadow -Wunused-parameter /wd4211 /wd4201 /wd4100 /wd4505 /wd4408) string(REPLACE "-Wsign-promo" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") #set (CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-Xcompiler;/EHsc-;") diff --git a/modules/gpu/perf/perf_precomp.hpp b/modules/gpu/perf/perf_precomp.hpp index 5e31c4cdef..c9cf886bc4 100644 --- a/modules/gpu/perf/perf_precomp.hpp +++ b/modules/gpu/perf/perf_precomp.hpp @@ -61,7 +61,6 @@ #endif #include "opencv2/ts/ts.hpp" -#include "opencv2/ts/ts_perf.hpp" #include "opencv2/ts/gpu_perf.hpp" #include "opencv2/core/core.hpp" diff --git a/modules/gpu/perf4au/main.cpp b/modules/gpu/perf4au/main.cpp index 68c00dbafe..f6a65ad636 100644 --- a/modules/gpu/perf4au/main.cpp +++ b/modules/gpu/perf4au/main.cpp @@ -41,17 +41,19 @@ //M*/ #include + #ifdef HAVE_CVCONFIG_H #include "cvconfig.h" #endif + +#include "opencv2/ts/ts.hpp" +#include "opencv2/ts/gpu_perf.hpp" + #include "opencv2/core/core.hpp" #include "opencv2/gpu/gpu.hpp" #include "opencv2/highgui/highgui.hpp" #include "opencv2/video/video.hpp" #include "opencv2/legacy/legacy.hpp" -#include "opencv2/ts/ts.hpp" -#include "opencv2/ts/ts_perf.hpp" -#include "opencv2/ts/gpu_perf.hpp" int main(int argc, char* argv[]) { diff --git a/modules/nonfree/perf/perf_gpu.cpp b/modules/nonfree/perf/perf_gpu.cpp index af95dbb7d0..aa8516b1c4 100644 --- a/modules/nonfree/perf/perf_gpu.cpp +++ b/modules/nonfree/perf/perf_gpu.cpp @@ -41,6 +41,9 @@ //M*/ #include "perf_precomp.hpp" + +#if defined(HAVE_OPENCV_GPU) && defined(HAVE_CUDA) + #include "opencv2/ts/gpu_perf.hpp" using namespace std; @@ -59,8 +62,6 @@ using namespace perf; # define BUILD_WITH_VIDEO_INPUT_SUPPORT 0 #endif -#if defined(HAVE_OPENCV_GPU) && defined(HAVE_CUDA) - ////////////////////////////////////////////////////////////////////// // SURF diff --git a/modules/nonfree/perf/perf_precomp.hpp b/modules/nonfree/perf/perf_precomp.hpp index 50a7f98f53..addba7b000 100644 --- a/modules/nonfree/perf/perf_precomp.hpp +++ b/modules/nonfree/perf/perf_precomp.hpp @@ -10,16 +10,17 @@ #define __OPENCV_PERF_PRECOMP_HPP__ #include "opencv2/ts/ts.hpp" + #include "opencv2/nonfree/nonfree.hpp" #include "opencv2/highgui/highgui.hpp" - #include "opencv2/opencv_modules.hpp" + #ifdef HAVE_OPENCV_OCL # include "opencv2/nonfree/ocl.hpp" #endif -#if defined(HAVE_OPENCV_GPU) && defined(HAVE_CUDA) - #include "opencv2/nonfree/gpu.hpp" +#ifdef HAVE_OPENCV_GPU +# include "opencv2/nonfree/gpu.hpp" #endif #ifdef GTEST_CREATE_SHARED_LIBRARY diff --git a/modules/superres/perf/perf_precomp.hpp b/modules/superres/perf/perf_precomp.hpp index 85b6c11f7e..f05203718c 100644 --- a/modules/superres/perf/perf_precomp.hpp +++ b/modules/superres/perf/perf_precomp.hpp @@ -55,10 +55,11 @@ #include "cvconfig.h" #endif +#include "opencv2/ts/ts.hpp" +#include "opencv2/ts/gpu_perf.hpp" + #include "opencv2/core/core.hpp" #include "opencv2/core/gpumat.hpp" -#include "opencv2/ts/ts_perf.hpp" -#include "opencv2/ts/gpu_perf.hpp" #include "opencv2/superres/superres.hpp" #include "opencv2/superres/optical_flow.hpp"