This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git

commit b15e71cd221caa6b3706b86d36beac99115d2ae4
Author: jihandong <jihand...@xiaomi.com>
AuthorDate: Fri Apr 26 10:01:39 2024 +0800

    ml: update Makefile
    
    -O3: reduce code size.
    -DTF_LITE_STATIC_MEMORY: cause bugs on some cores.
    +DTFLITE_EMULATE_FLOAT: robuster to emulate float cucalation by fix-point.
    Signed-off-by: jihandong <jihand...@xiaomi.com>
---
 mlearning/cmsis-nn/Makefile     |  3 +--
 mlearning/tflite-micro/Kconfig  |  6 ++++++
 mlearning/tflite-micro/Makefile | 17 +++++++++--------
 3 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/mlearning/cmsis-nn/Makefile b/mlearning/cmsis-nn/Makefile
index f45d1b1e0..9254c8502 100644
--- a/mlearning/cmsis-nn/Makefile
+++ b/mlearning/cmsis-nn/Makefile
@@ -37,7 +37,6 @@ distclean::
 endif
 
 CFLAGS += -Wno-undef
-CFLAGS += -O3
 
 CSRCS += $(wildcard $(CMSIS_NN)/ActivationFunctions/*.c)
 CSRCS += $(wildcard $(CMSIS_NN)/BasicMathFunctions/*.c)
@@ -58,4 +57,4 @@ CSRCS := $(filter-out $(addprefix 
$(CMSIS_NN)/NNSupportFunctions/, $(EXCLUDED_FI
 CSRCS := $(filter-out $(addprefix $(CMSIS_NN)/ConvolutionFunctions/, 
$(EXCLUDED_FILES)), $(CSRCS))
 endif
 
-include $(APPDIR)/Application.mk
\ No newline at end of file
+include $(APPDIR)/Application.mk
diff --git a/mlearning/tflite-micro/Kconfig b/mlearning/tflite-micro/Kconfig
index 15b841ef6..603ec4abb 100644
--- a/mlearning/tflite-micro/Kconfig
+++ b/mlearning/tflite-micro/Kconfig
@@ -22,3 +22,9 @@ config TFLITEMICRO
        bool "TFLiteMicro"
        default n
        depends on SYSTEM_FLATBUFFERS && MATH_GEMMLOWP && MATH_KISSFFT && 
MATH_RUY
+
+if TFLITEMICRO
+       config TFLITEMICRO_DEBUG
+       bool "TFLITEMICRO_DEBUG"
+       default n
+endif
diff --git a/mlearning/tflite-micro/Makefile b/mlearning/tflite-micro/Makefile
index 8a2b28ed8..098ac76a7 100644
--- a/mlearning/tflite-micro/Makefile
+++ b/mlearning/tflite-micro/Makefile
@@ -45,18 +45,19 @@ distclean::
        $(call DELFILE, tflite-micro.zip)
 endif
 
-COMMON_FLAGS += -DTF_LITE_STATIC_MEMORY
-COMMON_FLAGS += -DTF_LITE_DISABLE_X86_NEON
-COMMON_FLAGS += -DTF_LITE_STRIP_ERROR_STRINGS
-COMMON_FLAGS += -Wno-sign-compare
-COMMON_FLAGS += -Wno-unused-variable
-COMMON_FLAGS += -Wno-undef
-COMMON_FLAGS += -Wno-shadow
-COMMON_FLAGS += -O3
 COMMON_FLAGS += ${INCDIR_PREFIX}$(TFLM_DIR)
 COMMON_FLAGS += ${INCDIR_PREFIX}$(APPDIR)/math/gemmlowp/gemmlowp
 COMMON_FLAGS += ${INCDIR_PREFIX}$(APPDIR)/math/kissfft/kissfft
 COMMON_FLAGS += ${INCDIR_PREFIX}$(APPDIR)/math/ruy/ruy
+COMMON_FLAGS += -Wno-shadow
+COMMON_FLAGS += -Wno-sign-compare
+COMMON_FLAGS += -Wno-undef
+COMMON_FLAGS += -Wno-unused-variable
+COMMON_FLAGS += -DTFLITE_EMULATE_FLOAT
+COMMON_FLAGS += -DTF_LITE_DISABLE_X86_NEON
+ifeq ($(CONFIG_TFLITEMICRO_DEBUG),)
+COMMON_FLAGS += -DTF_LITE_STRIP_ERROR_STRINGS
+endif
 
 # tflite micro
 CXXSRCS += $(wildcard $(TFLM_DIR)/tensorflow/lite/c/*.cc)

Reply via email to