Skip to content

OpenVINO™ is an open source toolkit for optimizing and deploying AI inference

Fix AArch64 auto-vectorization flag compatibility with GCC 16 (#38268)

Alessandro de Oliveira Faria (A.K.A.CABELO)53054386a3a1
diff --git a/cmake/developer_package/compile_flags/functions.cmake b/cmake/developer_package/compile_flags/functions.cmake
index baff79893fe..962575c2864 100644
--- a/cmake/developer_package/compile_flags/functions.cmake
+++ b/cmake/developer_package/compile_flags/functions.cmake
@@ -290,7 +290,11 @@ macro(ov_arm_sve_optimization_flags flags)
# (svld1/svmla_f32/...) and are unaffected. Both GCC and Clang auto-vectorize to SVE here,
# but the knob is compiler-specific (Android/MSVC/IntelLLVM handled above).
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
- list(APPEND ${flags} --param=aarch64-autovec-preference=1)
+ if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 16)
+ list(APPEND ${flags} -mautovec-preference=asimd-only)
+ else()
+ list(APPEND ${flags} --param=aarch64-autovec-preference=1)
+ endif()
elseif(CMAKE_CXX_COMPILER_ID MATCHES "^(Clang|AppleClang)$")
list(APPEND ${flags} -mllvm -scalable-vectorization=off)
endif()