@@ -580,7 +580,8 @@ macro(ocv_compiler_optimization_process_sources SOURCES_VAR_NAME LIBS_VAR_NAME T
580
580
list (APPEND __result "${fname} " )
581
581
#continue()
582
582
elseif (CV_DISABLE_OPTIMIZATION OR NOT CV_ENABLE_INTRINSICS)
583
- message (STATUS "Excluding from source files list (optimization is disabled): ${fname} " )
583
+ ocv_get_smart_file_name(fname_ "${fname} " )
584
+ message (STATUS "Excluding from source files list (optimization is disabled): ${fname_} " )
584
585
#continue()
585
586
else ()
586
587
get_source_file_property (__definitions "${fname} " COMPILE_DEFINITIONS )
@@ -622,7 +623,8 @@ macro(ocv_compiler_optimization_process_sources SOURCES_VAR_NAME LIBS_VAR_NAME T
622
623
endif ()
623
624
endforeach ()
624
625
if (NOT __opt_found)
625
- message (STATUS "Excluding from source files list: ${fname} " )
626
+ ocv_get_smart_file_name(fname_ "${fname} " )
627
+ message (STATUS "Excluding from source files list: ${fname_} " )
626
628
endif ()
627
629
endif ()
628
630
else ()
@@ -702,15 +704,18 @@ macro(ocv_compiler_optimization_fill_cpu_config)
702
704
#if !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_COMPILE_${OPT}
703
705
# define CV_TRY_${OPT} 1
704
706
# define CV_CPU_HAS_SUPPORT_${OPT} 1
705
- # define CV_CPU_CALL_${OPT} (fn, args) return (opt_${OPT} ::fn args)
707
+ # define CV_CPU_CALL_${OPT} (fn, args) return (cpu_baseline::fn args)
708
+ # define CV_CPU_CALL_${OPT} _(fn, args) return (opt_${OPT} ::fn args)
706
709
#elif !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_DISPATCH_COMPILE_${OPT}
707
710
# define CV_TRY_${OPT} 1
708
711
# define CV_CPU_HAS_SUPPORT_${OPT} (cv::checkHardwareSupport(CV_CPU_${OPT} ))
709
712
# define CV_CPU_CALL_${OPT} (fn, args) if (CV_CPU_HAS_SUPPORT_${OPT} ) return (opt_${OPT} ::fn args)
713
+ # define CV_CPU_CALL_${OPT} _(fn, args) if (CV_CPU_HAS_SUPPORT_${OPT} ) return (opt_${OPT} ::fn args)
710
714
#else
711
715
# define CV_TRY_${OPT} 0
712
716
# define CV_CPU_HAS_SUPPORT_${OPT} 0
713
717
# define CV_CPU_CALL_${OPT} (fn, args)
718
+ # define CV_CPU_CALL_${OPT} _(fn, args)
714
719
#endif
715
720
#define __CV_CPU_DISPATCH_CHAIN_${OPT} (fn, args, mode, ...) CV_CPU_CALL_${OPT} (fn, args); __CV_EXPAND(__CV_CPU_DISPATCH_CHAIN_ ## mode(fn, args, __VA_ARGS__))
716
721
" )
@@ -761,7 +766,10 @@ macro(ocv_add_dispatched_file filename)
761
766
else ()
762
767
file (WRITE "${__file} " "${__codestr} " )
763
768
endif ()
764
- list (APPEND OPENCV_MODULE_${the_module} _SOURCES_DISPATCHED "${__file} " )
769
+
770
+ if (";${CPU_DISPATCH} ;" MATCHES "${OPT} " OR __CPU_DISPATCH_INCLUDE_ALL)
771
+ list (APPEND OPENCV_MODULE_${the_module} _SOURCES_DISPATCHED "${__file} " )
772
+ endif ()
765
773
766
774
set (__declarations_str "${__declarations_str}
767
775
#define CV_CPU_DISPATCH_MODE ${OPT}
@@ -786,6 +794,14 @@ macro(ocv_add_dispatched_file filename)
786
794
endif ()
787
795
endmacro ()
788
796
797
+ # Workaround to support code which always require all code paths
798
+ macro (ocv_add_dispatched_file_force_all)
799
+ set (__CPU_DISPATCH_INCLUDE_ALL 1)
800
+ ocv_add_dispatched_file(${ARGN} )
801
+ unset (__CPU_DISPATCH_INCLUDE_ALL)
802
+ endmacro ()
803
+
804
+
789
805
if (CV_DISABLE_OPTIMIZATION OR CV_ICC)
790
806
ocv_update(CV_ENABLE_UNROLLED 0)
791
807
else ()
0 commit comments