From 1e038e2837afe4d28965900023bf396ef4252bc4 Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Tue, 24 Dec 2013 12:23:50 +0400 Subject: [PATCH] CUDA warning fix/supporession for Android. --- modules/core/src/gpumat.cpp | 41 ++++++++++++++++++++++++++------------- modules/dynamicuda/CMakeLists.txt | 2 +- modules/dynamicuda/src/main.cpp | 20 +++++++++---------- 3 files changed, 38 insertions(+), 25 deletions(-) diff --git a/modules/core/src/gpumat.cpp b/modules/core/src/gpumat.cpp index cc97898..5dae469 100644 --- a/modules/core/src/gpumat.cpp +++ b/modules/core/src/gpumat.cpp @@ -45,29 +45,42 @@ #include #if defined(HAVE_CUDA) - #include - #include +# include +# include - #define CUDART_MINIMUM_REQUIRED_VERSION 4020 - #define NPP_MINIMUM_REQUIRED_VERSION 4200 +# define CUDART_MINIMUM_REQUIRED_VERSION 4020 +# define NPP_MINIMUM_REQUIRED_VERSION 4200 - #if (CUDART_VERSION < CUDART_MINIMUM_REQUIRED_VERSION) - #error "Insufficient Cuda Runtime library version, please update it." - #endif +# if (CUDART_VERSION < CUDART_MINIMUM_REQUIRED_VERSION) +# error "Insufficient Cuda Runtime library version, please update it." +# endif - #if (NPP_VERSION_MAJOR * 1000 + NPP_VERSION_MINOR * 100 + NPP_VERSION_BUILD < NPP_MINIMUM_REQUIRED_VERSION) - #error "Insufficient NPP version, please update it." - #endif +# if (NPP_VERSION_MAJOR * 1000 + NPP_VERSION_MINOR * 100 + NPP_VERSION_BUILD < NPP_MINIMUM_REQUIRED_VERSION) +# error "Insufficient NPP version, please update it." +# endif #endif #ifdef DYNAMIC_CUDA_SUPPORT -#include -#include -#include -#include +# include +# include +# include +# include #endif #ifdef ANDROID +# ifdef LOG_TAG +# undef LOG_TAG +# endif +# ifdef LOGE +# undef LOGE +# endif +# ifdef LOGD +# undef LOGD +# endif +# ifdef LOGI +# undef LOGI +# endif + # include # define LOG_TAG "OpenCV::CUDA" diff --git a/modules/dynamicuda/CMakeLists.txt b/modules/dynamicuda/CMakeLists.txt index 2e01544..b523bf0 100644 --- a/modules/dynamicuda/CMakeLists.txt +++ b/modules/dynamicuda/CMakeLists.txt @@ -5,7 +5,7 @@ endif() set(the_description "Dynamic CUDA linkage") add_definitions(-DUSE_CUDA) -ocv_warnings_disable(CMAKE_CXX_FLAGS -Wundef) +ocv_warnings_disable(CMAKE_CXX_FLAGS -Wundef -Wshadow) ocv_module_include_directories("${OpenCV_SOURCE_DIR}/modules/gpu/include") set(OPENCV_MODULE_TYPE SHARED) if (BUILD_FAT_JAVA_LIB) diff --git a/modules/dynamicuda/src/main.cpp b/modules/dynamicuda/src/main.cpp index 8eb66fd..0c74ecb 100644 --- a/modules/dynamicuda/src/main.cpp +++ b/modules/dynamicuda/src/main.cpp @@ -6,19 +6,19 @@ #include #ifdef HAVE_CUDA -#include -#include +# include +# include -#define CUDART_MINIMUM_REQUIRED_VERSION 4020 -#define NPP_MINIMUM_REQUIRED_VERSION 4200 +# define CUDART_MINIMUM_REQUIRED_VERSION 4020 +# define NPP_MINIMUM_REQUIRED_VERSION 4200 -#if (CUDART_VERSION < CUDART_MINIMUM_REQUIRED_VERSION) -#error "Insufficient Cuda Runtime library version, please update it." -#endif +# if (CUDART_VERSION < CUDART_MINIMUM_REQUIRED_VERSION) +# error "Insufficient Cuda Runtime library version, please update it." +# endif -#if (NPP_VERSION_MAJOR * 1000 + NPP_VERSION_MINOR * 100 + NPP_VERSION_BUILD < NPP_MINIMUM_REQUIRED_VERSION) -#error "Insufficient NPP version, please update it." -#endif +# if (NPP_VERSION_MAJOR * 1000 + NPP_VERSION_MINOR * 100 + NPP_VERSION_BUILD < NPP_MINIMUM_REQUIRED_VERSION) +# error "Insufficient NPP version, please update it." +# endif #endif using namespace std; -- 2.7.4