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 67f495e360872309d1fdf4f9a5c01af82ca086cc Author: xinhaiteng <xinhait...@xiaomi.com> AuthorDate: Wed Mar 6 10:17:25 2024 +0800 Added Cortex-A compilation environment. Cortex-A compilation options are added to tflite-micro and cmsis-nn, and new operator compilation environments are configured. Signed-off-by: xinhaiteng <xinhait...@xiaomi.com> --- mlearning/cmsis-nn/Makefile | 10 ++++++++++ mlearning/tflite-micro/Makefile | 12 ++++++++++++ 2 files changed, 22 insertions(+) diff --git a/mlearning/cmsis-nn/Makefile b/mlearning/cmsis-nn/Makefile index ccefca81a..f45d1b1e0 100644 --- a/mlearning/cmsis-nn/Makefile +++ b/mlearning/cmsis-nn/Makefile @@ -36,6 +36,9 @@ distclean:: $(call DELFILE, cmsis-nn.zip) endif +CFLAGS += -Wno-undef +CFLAGS += -O3 + CSRCS += $(wildcard $(CMSIS_NN)/ActivationFunctions/*.c) CSRCS += $(wildcard $(CMSIS_NN)/BasicMathFunctions/*.c) CSRCS += $(wildcard $(CMSIS_NN)/PoolingFunctions/*.c) @@ -48,4 +51,11 @@ CSRCS += $(wildcard $(CMSIS_NN)/SoftmaxFunctions/*.c) CSRCS += $(wildcard $(CMSIS_NN)/LSTMFunctions/*.c) CSRCS += $(wildcard $(CMSIS_NN)/ReshapeFunctions/*.c) +ifeq ($(CONFIG_ARM_NEON),y) +EXCLUDED_FILES := arm_elementwise_add_s8.c arm_convolve_s8.c arm_nn_mat_mult_kernel_s8_s16.c arm_q7_to_q15_with_offset.c +CSRCS := $(filter-out $(addprefix $(CMSIS_NN)/BasicMathFunctions/, $(EXCLUDED_FILES)), $(CSRCS)) +CSRCS := $(filter-out $(addprefix $(CMSIS_NN)/NNSupportFunctions/, $(EXCLUDED_FILES)), $(CSRCS)) +CSRCS := $(filter-out $(addprefix $(CMSIS_NN)/ConvolutionFunctions/, $(EXCLUDED_FILES)), $(CSRCS)) +endif + include $(APPDIR)/Application.mk \ No newline at end of file diff --git a/mlearning/tflite-micro/Makefile b/mlearning/tflite-micro/Makefile index 7d758a84f..60bc2fbe0 100644 --- a/mlearning/tflite-micro/Makefile +++ b/mlearning/tflite-micro/Makefile @@ -41,8 +41,12 @@ CXXEXT := .cc 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 SRC_FILES := $(wildcard $(APPDIR)/mlearning/tflite-micro/tflite-micro/tensorflow/lite/micro/kernels/*.cc) @@ -53,6 +57,14 @@ NEW_SRC_FILES := $(wildcard $(APPDIR)/mlearning/tflite-micro/tflite-micro/tensor SRC_FILES := $(filter-out $(notdir $(NEW_SRC_FILES)), $(notdir $(SRC_FILES))) SRC_FILES := $(addprefix $(APPDIR)/mlearning/tflite-micro/tflite-micro/tensorflow/lite/micro/kernels/, $(SRC_FILES)) SRC_FILES += $(NEW_SRC_FILES) + +ifeq ($(CONFIG_ARM_NEON),y) +CSRCS += operators/neon/arm_convolve_s8.c +CSRCS += operators/neon/arm_nn_mat_mult_kernel_s8_s16.c +CSRCS += operators/neon/arm_q7_to_q15_with_offset.c +CSRCS += operators/neon/arm_elementwise_add_s8.c +endif + endif COMMON_FLAGS += ${INCDIR_PREFIX}$(APPDIR)/math/gemmlowp/gemmlowp