|
|
|
@ -349,12 +349,18 @@ elseif(ARM OR AARCH64) |
|
|
|
|
ocv_update(CPU_KNOWN_OPTIMIZATIONS "NEON;FP16;NEON_DOTPROD;NEON_FP16;NEON_BF16") |
|
|
|
|
ocv_update(CPU_NEON_FLAGS_ON "") |
|
|
|
|
ocv_update(CPU_FP16_IMPLIES "NEON") |
|
|
|
|
ocv_update(CPU_NEON_DOTPROD_FLAGS_ON "-march=armv8.2-a+dotprod") |
|
|
|
|
ocv_update(CPU_NEON_DOTPROD_IMPLIES "NEON") |
|
|
|
|
ocv_update(CPU_NEON_FP16_FLAGS_ON "-march=armv8.2-a+fp16") |
|
|
|
|
ocv_update(CPU_NEON_FP16_IMPLIES "NEON") |
|
|
|
|
ocv_update(CPU_NEON_BF16_FLAGS_ON "-march=armv8.2-a+bf16") |
|
|
|
|
ocv_update(CPU_NEON_BF16_IMPLIES "NEON") |
|
|
|
|
if(MSVC) |
|
|
|
|
ocv_update(CPU_NEON_DOTPROD_FLAGS_ON "") |
|
|
|
|
ocv_update(CPU_NEON_FP16_FLAGS_ON "") |
|
|
|
|
ocv_update(CPU_NEON_BF16_FLAGS_ON "") |
|
|
|
|
else() |
|
|
|
|
ocv_update(CPU_NEON_DOTPROD_FLAGS_ON "-march=armv8.2-a+dotprod") |
|
|
|
|
ocv_update(CPU_NEON_FP16_FLAGS_ON "-march=armv8.2-a+fp16") |
|
|
|
|
ocv_update(CPU_NEON_BF16_FLAGS_ON "-march=armv8.2-a+bf16") |
|
|
|
|
endif() |
|
|
|
|
set(CPU_BASELINE "NEON;FP16" CACHE STRING "${HELP_CPU_BASELINE}") |
|
|
|
|
set(CPU_DISPATCH "NEON_FP16;NEON_BF16;NEON_DOTPROD" CACHE STRING "${HELP_CPU_DISPATCH}") |
|
|
|
|
endif() |
|
|
|
@ -478,20 +484,22 @@ macro(ocv_check_compiler_optimization OPT) |
|
|
|
|
endmacro() |
|
|
|
|
|
|
|
|
|
macro(ocv_cpu_aarch64_baseline_merge_feature_options FEATURE_NAME_LIST FLAG_STRING COMMON_OPTION) |
|
|
|
|
if(NOT MSVC) |
|
|
|
|
unset(_POSTFIX) |
|
|
|
|
# Check each feature option |
|
|
|
|
foreach(OPT IN LISTS ${FEATURE_NAME_LIST}) |
|
|
|
|
string(FIND "${${FLAG_STRING}}" "${CPU_${OPT}_FLAGS_ON}" OPT_FOUND) |
|
|
|
|
if(NOT ${OPT_FOUND} EQUAL -1) |
|
|
|
|
string(REPLACE "${COMMON_OPTION}" "" TRAILING_PART "${CPU_${OPT}_FLAGS_ON}") |
|
|
|
|
string(APPEND _POSTFIX "${TRAILING_PART}") |
|
|
|
|
string(REPLACE " ${CPU_${OPT}_FLAGS_ON}" "" ${FLAG_STRING} ${${FLAG_STRING}}) |
|
|
|
|
endif() |
|
|
|
|
string(FIND "${${FLAG_STRING}}" "${CPU_${OPT}_FLAGS_ON}" OPT_FOUND) |
|
|
|
|
if(NOT ${OPT_FOUND} EQUAL -1) |
|
|
|
|
string(REPLACE "${COMMON_OPTION}" "" TRAILING_PART "${CPU_${OPT}_FLAGS_ON}") |
|
|
|
|
string(APPEND _POSTFIX "${TRAILING_PART}") |
|
|
|
|
string(REPLACE " ${CPU_${OPT}_FLAGS_ON}" "" ${FLAG_STRING} ${${FLAG_STRING}}) |
|
|
|
|
endif() |
|
|
|
|
endforeach() |
|
|
|
|
# If more than one option found, merge them |
|
|
|
|
if(NOT "x${_POSTFIX}" STREQUAL "x") |
|
|
|
|
set(${FLAG_STRING} "${${FLAG_STRING}} ${COMMON_OPTION}${_POSTFIX}") |
|
|
|
|
set(${FLAG_STRING} "${${FLAG_STRING}} ${COMMON_OPTION}${_POSTFIX}") |
|
|
|
|
endif() |
|
|
|
|
endif() |
|
|
|
|
endmacro() |
|
|
|
|
|
|
|
|
|
foreach(OPT ${CPU_KNOWN_OPTIMIZATIONS}) |
|
|
|
|