Added CUDA fast math flag

pull/33/merge
Anatoly Baksheev 12 years ago
parent 354b77e2e1
commit 1d68850cb2
  1. 1
      CMakeLists.txt
  2. 8
      cmake/OpenCVDetectCUDA.cmake

@ -768,6 +768,7 @@ if(HAVE_CUDA)
status(" Use CUBLAS:" HAVE_CUBLAS THEN YES ELSE NO)
status(" NVIDIA GPU arch:" ${OPENCV_CUDA_ARCH_BIN})
status(" NVIDIA PTX archs:" ${OPENCV_CUDA_ARCH_PTX})
status(" Use fast math:" CUDA_FAST_MATH THEN YES ELSE NO)
endif()
# ========================== python ==========================

@ -78,6 +78,14 @@ if(CUDA_FOUND)
set(OpenCV_CUDA_CC "${NVCC_FLAGS_EXTRA}")
message(STATUS "CUDA NVCC target flags: ${CUDA_NVCC_FLAGS}")
OCV_OPTION(CUDA_FAST_MATH "Enable --use_fast_math for CUDA compiler " OFF)
if(ENABLE_CUDA_MATH)
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} --use_fast_math)
endif()
mark_as_advanced(CUDA_BUILD_CUBIN CUDA_BUILD_EMULATION CUDA_VERBOSE_BUILD CUDA_SDK_ROOT_DIR)
unset(CUDA_npp_LIBRARY CACHE)
find_cuda_helper_libs(npp)

Loading…
Cancel
Save