Commit eb161942 authored by Alexander Alekhin's avatar Alexander Alekhin

Merge pull request #14486 from alalek:cmake_dispatch_all

parents 55c02ff6 6b6222bf
...@@ -380,6 +380,10 @@ if(CV_DISABLE_OPTIMIZATION) ...@@ -380,6 +380,10 @@ if(CV_DISABLE_OPTIMIZATION)
set(CPU_DISPATCH_REQUIRE "") set(CPU_DISPATCH_REQUIRE "")
endif() endif()
if("x${CPU_DISPATCH}" STREQUAL "xALL")
set(CPU_DISPATCH "${CPU_KNOWN_OPTIMIZATIONS}")
endif()
macro(ocv_check_compiler_optimization OPT) macro(ocv_check_compiler_optimization OPT)
if(NOT DEFINED CPU_${OPT}_SUPPORTED) if(NOT DEFINED CPU_${OPT}_SUPPORTED)
if((DEFINED CPU_${OPT}_FLAGS_ON AND NOT "x${CPU_${OPT}_FLAGS_ON}" STREQUAL "x") OR CPU_${OPT}_TEST_FILE) if((DEFINED CPU_${OPT}_FLAGS_ON AND NOT "x${CPU_${OPT}_FLAGS_ON}" STREQUAL "x") OR CPU_${OPT}_TEST_FILE)
...@@ -854,19 +858,19 @@ macro(__ocv_add_dispatched_file filename target_src_var src_directory dst_direct ...@@ -854,19 +858,19 @@ macro(__ocv_add_dispatched_file filename target_src_var src_directory dst_direct
file(WRITE "${__file}" "${__codestr}") file(WRITE "${__file}" "${__codestr}")
endif() endif()
if(";${CPU_DISPATCH};" MATCHES "${OPT}" OR __CPU_DISPATCH_INCLUDE_ALL) if(";${CPU_DISPATCH_FINAL};" MATCHES "${OPT}" OR __CPU_DISPATCH_INCLUDE_ALL)
if(EXISTS "${src_directory}/${filename}.${OPT_LOWER}.cpp") if(EXISTS "${src_directory}/${filename}.${OPT_LOWER}.cpp")
message(STATUS "Using overrided ${OPT} source: ${src_directory}/${filename}.${OPT_LOWER}.cpp") message(STATUS "Using overrided ${OPT} source: ${src_directory}/${filename}.${OPT_LOWER}.cpp")
else() else()
list(APPEND ${target_src_var} "${__file}") list(APPEND ${target_src_var} "${__file}")
endif() endif()
endif()
set(__declarations_str "${__declarations_str} set(__declarations_str "${__declarations_str}
#define CV_CPU_DISPATCH_MODE ${OPT} #define CV_CPU_DISPATCH_MODE ${OPT}
#include \"opencv2/core/private/cv_cpu_include_simd_declarations.hpp\" #include \"opencv2/core/private/cv_cpu_include_simd_declarations.hpp\"
") ")
set(__dispatch_modes "${OPT}, ${__dispatch_modes}") set(__dispatch_modes "${OPT}, ${__dispatch_modes}")
endif()
endforeach() endforeach()
set(__declarations_str "${__declarations_str} set(__declarations_str "${__declarations_str}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment