diff --git a/cmake/FindCUDA.cmake b/cmake/FindCUDA.cmake index 6e7ab9081a..4a19d5ce5c 100644 --- a/cmake/FindCUDA.cmake +++ b/cmake/FindCUDA.cmake @@ -787,8 +787,8 @@ if(NOT CUDA_VERSION VERSION_LESS "3.2") find_cuda_helper_libs(nvcuvid) endif() endif() -if(CUDA_VERSION VERSION_GREATER "5.0") - # In CUDA 5.5 NPP was splitted onto 3 separate libraries. +if(CUDA_VERSION VERSION_GREATER "7.5") + # In CUDA 8.0 NPPI was split in to many libraries. find_cuda_helper_libs(nppc) find_cuda_helper_libs(nppial) find_cuda_helper_libs(nppicc) @@ -803,6 +803,12 @@ if(CUDA_VERSION VERSION_GREATER "5.0") find_cuda_helper_libs(npps) set(CUDA_nppi_LIBRARY "${CUDA_nppial_LIBRARY};${CUDA_nppicc_LIBRARY};${CUDA_nppicom_LIBRARY};${CUDA_nppidei_LIBRARY};${CUDA_nppif_LIBRARY};${CUDA_nppig_LIBRARY};${CUDA_nppim_LIBRARY};${CUDA_nppist_LIBRARY};${CUDA_nppisu_LIBRARY};${CUDA_nppitc_LIBRARY}") set(CUDA_npp_LIBRARY "${CUDA_nppc_LIBRARY};${CUDA_nppi_LIBRARY};${CUDA_npps_LIBRARY}") +elseif(CUDA_VERSION VERSION_GREATER "5.0") + # In CUDA 5.5 NPP was split in to 3 separate libraries. + find_cuda_helper_libs(nppc) + find_cuda_helper_libs(nppi) + find_cuda_helper_libs(npps) + set(CUDA_npp_LIBRARY "${CUDA_nppc_LIBRARY};${CUDA_nppi_LIBRARY};${CUDA_npps_LIBRARY}") elseif(NOT CUDA_VERSION VERSION_LESS "4.0") find_cuda_helper_libs(npp) endif() diff --git a/modules/core/include/opencv2/core/private.cuda.hpp b/modules/core/include/opencv2/core/private.cuda.hpp index 1e8ea3d4f5..cea280b122 100644 --- a/modules/core/include/opencv2/core/private.cuda.hpp +++ b/modules/core/include/opencv2/core/private.cuda.hpp @@ -58,14 +58,16 @@ #ifdef HAVE_CUDA # include # include -# if defined (__GNUC__) -# pragma GCC diagnostic push -# pragma GCC diagnostic ignored "-Wstrict-aliasing" -# include -# pragma GCC diagnostic pop -# else -# include -# endif /* __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) */ +# if defined(__CUDACC_VER_MAJOR__) && (8 <= __CUDACC_VER_MAJOR__) +# if defined (__GNUC__) && !defined(__CUDACC__) +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wstrict-aliasing" +# include +# pragma GCC diagnostic pop +# else +# include +# endif +# endif // defined(__CUDACC_VER_MAJOR__) && (8 <= __CUDACC_VER_MAJOR__) # include # include "opencv2/core/cuda_stream_accessor.hpp" # include "opencv2/core/cuda/common.hpp"