mirror of
https://github.com/opencv/opencv.git
synced 2026-07-30 07:43:03 +04:00
Use fast math for dnn module.
This commit is contained in:
@@ -1519,6 +1519,17 @@ function(ocv_target_compile_definitions target)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(ocv_target_compile_options target)
|
||||
_ocv_fix_target(target)
|
||||
if(NOT TARGET ${target})
|
||||
if(NOT DEFINED OPENCV_MODULE_${target}_LOCATION)
|
||||
message(FATAL_ERROR "ocv_target_compile_definitions: invalid target: '${target}'")
|
||||
endif()
|
||||
set(OPENCV_MODULE_${target}_COMPILE_OPTIONS ${OPENCV_MODULE_${target}_COMPILE_OPTIONS} ${ARGN} CACHE INTERNAL "" FORCE)
|
||||
else()
|
||||
target_compile_options(${target} ${ARGN})
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(_ocv_append_target_includes target)
|
||||
if(DEFINED OCV_TARGET_INCLUDE_DIRS_${target})
|
||||
|
||||
@@ -37,6 +37,13 @@ if(HAVE_CANN)
|
||||
ocv_target_compile_definitions(${the_module} PRIVATE "HAVE_CANN=1")
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
ocv_target_compile_options(${the_module} PRIVATE "/fp:fast")
|
||||
elseif(CV_GCC OR CV_CLANG)
|
||||
ocv_target_compile_options(${the_module} PRIVATE -ffast-math)
|
||||
ocv_target_compile_options(${the_module} PRIVATE -fno-finite-math-only)
|
||||
endif()
|
||||
|
||||
ocv_option(OPENCV_DNN_CUDA "Build with CUDA support"
|
||||
HAVE_CUDA
|
||||
AND HAVE_CUBLAS
|
||||
|
||||
Reference in New Issue
Block a user