message: Automatic NEON detection for ARM native build
diff: @@ -68,6 +68,21 @@ ifeq ($(HOST_OS),windows)
  CXXFLAGS += -fext-numeric-literals -D__LITTLE_ENDIAN__
  endif
  +# Auto-detect optimization opportunity if building natively.
  +ifeq ($(HOST_OS),$(TARGET))
  +ifeq ($(HOST_ARCH),$(TARGET_ARCH))
  +ifeq ($(TARGET_ARCH),armv7l)
  +ifneq ($(shell cat /proc/cpuinfo | grep Features | grep neon),)
  + ifneq ($(shell cat /proc/cpuinfo | grep Features | grep vfpv4),)
  + CXXFLAGS += -mfpu=neon-vfpv4
  + else
  + CXXFLAGS += -mfpu=neon
  + endif
  +endif # ifeq ($(TARGET_ARCH),armv7l)
  +endif # ifeq ($(HOST_ARCH),$(TARGET_ARCH))
  +endif # ifeq ($(HOST_OS),$(TARGET))
  +endif
  +
  # This library is the main target for this makefile. It will contain a minimal
  # runtime that can be linked in to other programs.
  LIB_NAME := libtensorflow-lite.a
  