Merge pull request #5597 from andy-held:cmakecudacross

pull/5653/head
Vadim Pisarevsky 9 years ago
commit 38909d7959
  1. 5
      cmake/FindCUDA.cmake
  2. 18
      cmake/OpenCVDetectCUDA.cmake

@ -685,6 +685,9 @@ macro(cuda_find_library_local_first_with_path_ext _var _names _doc _path_ext )
# and old paths.
set(_cuda_64bit_lib_dir "${_path_ext}lib/x64" "${_path_ext}lib64" "${_path_ext}libx64" )
endif()
if(CMAKE_CROSSCOMPILING AND (ARM OR AARCH64))
set(_cuda_cross_arm_lib_dir "${_path_ext}lib/stubs")
endif()
if(CUDA_VERSION VERSION_GREATER "6.0")
set(_cuda_static_lib_names "")
foreach(name ${_names})
@ -698,7 +701,7 @@ macro(cuda_find_library_local_first_with_path_ext _var _names _doc _path_ext )
PATHS "${CUDA_TOOLKIT_TARGET_DIR}" "${CUDA_TOOLKIT_ROOT_DIR}"
ENV CUDA_PATH
ENV CUDA_LIB_PATH
PATH_SUFFIXES ${_cuda_64bit_lib_dir} "${_path_ext}lib/Win32" "${_path_ext}lib" "${_path_ext}libWin32"
PATH_SUFFIXES ${_cuda_64bit_lib_dir} ${_cuda_cross_arm_lib_dir} "${_path_ext}lib/Win32" "${_path_ext}lib" "${_path_ext}libWin32"
DOC ${_doc}
NO_DEFAULT_PATH
)

@ -79,14 +79,12 @@ if(CUDA_FOUND)
endif()
if(NOT DEFINED __cuda_arch_bin)
if(ANDROID)
if(ARM)
set(__cuda_arch_bin "3.2")
set(__cuda_arch_ptx "")
elseif(AARCH64)
set(__cuda_arch_bin "5.3")
set(__cuda_arch_ptx "")
endif()
if(ARM)
set(__cuda_arch_bin "3.2")
set(__cuda_arch_ptx "")
elseif(AARCH64)
set(__cuda_arch_bin "5.3")
set(__cuda_arch_ptx "")
else()
if(${CUDA_VERSION} VERSION_LESS "5.0")
set(__cuda_arch_bin "1.1 1.2 1.3 2.0 2.1(2.0) 3.0")
@ -200,6 +198,10 @@ if(CUDA_FOUND)
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} -Xcompiler -fno-finite-math-only)
endif()
if(CMAKE_CROSSCOMPILING AND (ARM OR AARCH64))
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} -Xlinker --unresolved-symbols=ignore-in-shared-libs)
endif()
# disabled because of multiple warnings during building nvcc auto generated files
if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_GCC_REGEX_VERSION VERSION_GREATER "4.6.0")
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wunused-but-set-variable)

Loading…
Cancel
Save