@@ -69,8 +69,13 @@ if(DEFINED ENV{TARGET_ARCH})
6969 set (TFLITE_ENABLE_XNNPACK OFF CACHE BOOL "Disable XNNPACK in TensorFlow Lite for armv7l" )
7070 elseif ("$ENV{TARGET_ARCH} " MATCHES "arm" )
7171 if (DEFINED ENV{TARGET_CPU})
72- if ("$ENV{TARGET_CPU} " STREQUAL "cortex_a53" OR "$ENV{TARGET_CPU} " STREQUAL "cortex_a57" )
72+ if ("$ENV{TARGET_CPU} " STREQUAL "cortex_a35" OR " $ENV{TARGET_CPU} " STREQUAL " cortex_a53" OR "$ENV{TARGET_CPU} " STREQUAL "cortex_a57" OR " $ENV{TARGET_CPU} " STREQUAL "cortex_a72" OR " $ENV{TARGET_CPU} " STREQUAL "cortex_a73 " )
7373 set (CMAKE_SYSTEM_PROCESSOR "armv8l" CACHE STRING "Updates CMAKE_SYSTEM_PROCESSOR" )
74+ set (XNNPACK_ENABLE_ARM_FP16_SCALAR OFF CACHE BOOL "Disable XNNPACK fp16 scalar in TensorFlow Lite as it only available on armv8.2+" )
75+ set (XNNPACK_ENABLE_ARM_FP16_VECTOR OFF CACHE BOOL "Disable XNNPACK fp16 vector in TensorFlow Lite as it only available on armv8.2+" )
76+ set (XNNPACK_ENABLE_ARM_BF16 OFF CACHE BOOL "Disable XNNPACK bf16 in TensorFlow Lite as it only available on armv8.2+" )
77+ set (XNNPACK_ENABLE_ARM_DOTPROD OFF CACHE BOOL "Disable XNNPACK dotprod in TensorFlow Lite as it only available on armv8.2+" )
78+ set (XNNPACK_ENABLE_ARM_I8MM OFF CACHE BOOL "Disable XNNPACK i8mm in TensorFlow Lite as it only available on armv8.2+" )
7479 elseif ("$ENV{TARGET_CPU} " STREQUAL "cortex_a8" OR "$ENV{TARGET_CPU} " STREQUAL "cortex_a7" )
7580 set (CMAKE_SYSTEM_PROCESSOR "armv7l" CACHE STRING "Updates CMAKE_SYSTEM_PROCESSOR" )
7681 set (TFLITE_ENABLE_XNNPACK OFF CACHE BOOL "Disable XNNPACK in TensorFlow Lite for armv7l" )
@@ -86,6 +91,22 @@ if(DEFINED ENV{TARGET_ARCH})
8691 endif ()
8792endif ()
8893
94+ if (DEFINED ENV{TARGET_ARCH})
95+ if (NOT "$ENV{TARGET_ARCH} " STREQUAL "arm" )
96+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DTF_HAS_vcvtaq_s32_f32" )
97+ endif ()
98+ endif ()
99+
100+ if (DEFINED ENV{TFBEAM_XNNPACK_ENABLE_ARM_I8MM})
101+ if ("$ENV{TFBEAM_XNNPACK_ENABLE_ARM_I8MM} " STREQUAL "OFF" )
102+ set (XNNPACK_ENABLE_ARM_I8MM OFF CACHE BOOL "Disable XNNPACK i8mm in TensorFlow Lite as TFBEAM_XNNPACK_ENABLE_ARM_I8MM is set to OFF" )
103+ else ()
104+ set (XNNPACK_ENABLE_ARM_I8MM ON CACHE BOOL "Enable XNNPACK i8mm in TensorFlow Lite as TFBEAM_XNNPACK_ENABLE_ARM_I8MM is set to ON" )
105+ endif ()
106+ else ()
107+ set (XNNPACK_ENABLE_ARM_I8MM OFF CACHE BOOL "Disable XNNPACK i8mm in TensorFlow Lite as TFBEAM_XNNPACK_ENABLE_ARM_I8MM is default to OFF" )
108+ endif ()
109+
89110if (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang" )
90111 if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 10.0)
91112 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-gnu-inline-cpp-without-extern" )
0 commit comments