Skip to content

Commit 034aaa7

Browse files
committed
Merge pull request opencv#9465 from tomoaki0705:fixJetsonTK1Build
2 parents 518c6ae + 6531fd1 commit 034aaa7

File tree

2 files changed

+18
-10
lines changed

2 files changed

+18
-10
lines changed

cmake/FindCUDA.cmake

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -787,8 +787,8 @@ if(NOT CUDA_VERSION VERSION_LESS "3.2")
787787
find_cuda_helper_libs(nvcuvid)
788788
endif()
789789
endif()
790-
if(CUDA_VERSION VERSION_GREATER "5.0")
791-
# In CUDA 5.5 NPP was splitted onto 3 separate libraries.
790+
if(CUDA_VERSION VERSION_GREATER "7.5")
791+
# In CUDA 8.0 NPPI was split in to many libraries.
792792
find_cuda_helper_libs(nppc)
793793
find_cuda_helper_libs(nppial)
794794
find_cuda_helper_libs(nppicc)
@@ -803,6 +803,12 @@ if(CUDA_VERSION VERSION_GREATER "5.0")
803803
find_cuda_helper_libs(npps)
804804
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}")
805805
set(CUDA_npp_LIBRARY "${CUDA_nppc_LIBRARY};${CUDA_nppi_LIBRARY};${CUDA_npps_LIBRARY}")
806+
elseif(CUDA_VERSION VERSION_GREATER "5.0")
807+
# In CUDA 5.5 NPP was split in to 3 separate libraries.
808+
find_cuda_helper_libs(nppc)
809+
find_cuda_helper_libs(nppi)
810+
find_cuda_helper_libs(npps)
811+
set(CUDA_npp_LIBRARY "${CUDA_nppc_LIBRARY};${CUDA_nppi_LIBRARY};${CUDA_npps_LIBRARY}")
806812
elseif(NOT CUDA_VERSION VERSION_LESS "4.0")
807813
find_cuda_helper_libs(npp)
808814
endif()

modules/core/include/opencv2/core/private.cuda.hpp

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,16 @@
5858
#ifdef HAVE_CUDA
5959
# include <cuda.h>
6060
# include <cuda_runtime.h>
61-
# if defined (__GNUC__)
62-
# pragma GCC diagnostic push
63-
# pragma GCC diagnostic ignored "-Wstrict-aliasing"
64-
# include <cuda_fp16.h>
65-
# pragma GCC diagnostic pop
66-
# else
67-
# include <cuda_fp16.h>
68-
# endif /* __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) */
61+
# if defined(__CUDACC_VER_MAJOR__) && (8 <= __CUDACC_VER_MAJOR__)
62+
# if defined (__GNUC__) && !defined(__CUDACC__)
63+
# pragma GCC diagnostic push
64+
# pragma GCC diagnostic ignored "-Wstrict-aliasing"
65+
# include <cuda_fp16.h>
66+
# pragma GCC diagnostic pop
67+
# else
68+
# include <cuda_fp16.h>
69+
# endif
70+
# endif // defined(__CUDACC_VER_MAJOR__) && (8 <= __CUDACC_VER_MAJOR__)
6971
# include <npp.h>
7072
# include "opencv2/core/cuda_stream_accessor.hpp"
7173
# include "opencv2/core/cuda/common.hpp"

0 commit comments

Comments
 (0)