build: cuda warnings

This commit is contained in:
Alexander Alekhin 2016-12-04 01:51:28 +03:00
parent 380cc520f3
commit 0724d13bcd
5 changed files with 10 additions and 42 deletions

View File

@ -164,7 +164,7 @@ if(CUDA_FOUND)
mark_as_advanced(CUDA_BUILD_CUBIN CUDA_BUILD_EMULATION CUDA_VERBOSE_BUILD CUDA_SDK_ROOT_DIR)
macro(ocv_cuda_compile VAR)
macro(ocv_cuda_filter_options)
foreach(var CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_DEBUG)
set(${var}_backup_in_cuda_compile_ "${${var}}")
@ -190,6 +190,10 @@ if(CUDA_FOUND)
string(REPLACE "-fvisibility-inlines-hidden" "" ${var} "${${var}}")
endforeach()
endmacro()
macro(ocv_cuda_compile VAR)
ocv_cuda_filter_options()
if(BUILD_SHARED_LIBS)
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} -Xcompiler -DCVAPI_EXPORTS)

View File

@ -43,6 +43,10 @@
#ifndef OPENCV_CUDA_REDUCE_HPP
#define OPENCV_CUDA_REDUCE_HPP
#ifndef THRUST_DEBUG // eliminate -Wundef warning
#define THRUST_DEBUG 0
#endif
#include <thrust/tuple.h>
#include "detail/reduce.hpp"
#include "detail/reduce_key_val.hpp"

View File

@ -61,11 +61,6 @@ namespace
cv::Rect roi(ksize.width, ksize.height, m.cols - 2 * ksize.width, m.rows - 2 * ksize.height);
return m(roi);
}
cv::Mat getInnerROI(cv::InputArray m, int ksize)
{
return getInnerROI(m, cv::Size(ksize, ksize));
}
}
namespace {

View File

@ -684,28 +684,6 @@ namespace
std::vector<int> h_buf_;
};
double toRad(double a)
{
return a * CV_PI / 180.0;
}
double clampAngle(double a)
{
double res = a;
while (res > 360.0)
res -= 360.0;
while (res < 0)
res += 360.0;
return res;
}
bool angleEq(double a, double b, double eps = 1.0)
{
return (fabs(clampAngle(a - b)) <= eps);
}
GeneralizedHoughGuilImpl::GeneralizedHoughGuilImpl()
{
maxBufferSize_ = 1000;

View File

@ -13,20 +13,7 @@ if(OCV_DEPENDENCIES_FOUND)
source_group("Include" FILES ${test_hdrs})
set(OPENCV_TEST_${the_module}_SOURCES ${test_srcs} ${test_hdrs})
foreach(var CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_DEBUG)
# we remove /EHa as it generates warnings under windows
string(REPLACE "/EHa" "" ${var} "${${var}}")
# we remove -ggdb3 flag as it leads to preprocessor errors when compiling CUDA files (CUDA 4.1)
string(REPLACE "-ggdb3" "" ${var} "${${var}}")
# we remove -Wsign-promo as it generates warnings under linux
string(REPLACE "-Wsign-promo" "" ${var} "${${var}}")
# we remove -fvisibility-inlines-hidden because it's used for C++ compiler
# but NVCC uses C compiler by default
string(REPLACE "-fvisibility-inlines-hidden" "" ${var} "${${var}}")
endforeach()
ocv_cuda_filter_options()
CUDA_ADD_EXECUTABLE(${the_target} ${OPENCV_TEST_${the_module}_SOURCES})
ocv_target_link_libraries(${the_target} ${test_deps} ${OPENCV_LINKER_LIBS} ${CUDA_LIBRARIES})