mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
pkg/tflite-micro: add support for tflite-micro
This commit is contained in:
parent
b3ea22952c
commit
0efe0f838a
43
pkg/tflite-micro/Makefile
Normal file
43
pkg/tflite-micro/Makefile
Normal file
@ -0,0 +1,43 @@
|
||||
PKG_NAME=tflite-micro
|
||||
PKG_URL=https://github.com/tensorflow/tflite-micro
|
||||
PKG_VERSION=1501b574b74fd7877aba30aa9d8b667f41b139c3 # sync from 2022.04.07
|
||||
PKG_LICENSE=Apache 2.0
|
||||
|
||||
include $(RIOTBASE)/pkg/pkg.mk
|
||||
|
||||
CFLAGS += -Wno-cast-align
|
||||
CFLAGS += -Wno-maybe-uninitialized
|
||||
CFLAGS += -Wno-pedantic
|
||||
CFLAGS += -Wno-unused-parameter
|
||||
|
||||
TFLITE_MODULES := \
|
||||
tflite-c \
|
||||
tflite-core-api \
|
||||
tflite-kernels \
|
||||
tflite-kernels-internal \
|
||||
tflite-kernels-internal-reference \
|
||||
tflite-micro \
|
||||
tflite-micro-kernels \
|
||||
tflite-micro-memory-planner \
|
||||
tflite-schema \
|
||||
#
|
||||
|
||||
DIR_tflite-c := tensorflow/lite/c
|
||||
DIR_tflite-core-api := tensorflow/lite/core/api
|
||||
DIR_tflite-kernels := tensorflow/lite/kernels
|
||||
DIR_tflite-kernels-internal := tensorflow/lite/kernels/internal
|
||||
DIR_tflite-kernels-internal-reference := tensorflow/lite/kernels/internal/reference
|
||||
DIR_tflite-micro := tensorflow/lite/micro
|
||||
DIR_tflite-micro-kernels := tensorflow/lite/micro/kernels
|
||||
DIR_tflite-micro-memory-planner := tensorflow/lite/micro/memory_planner
|
||||
DIR_tflite-schema := tensorflow/lite/schema
|
||||
|
||||
TFLITE_MODULES_USED := $(filter $(TFLITE_MODULES),$(USEMODULE))
|
||||
|
||||
all: $(TFLITE_MODULES_USED)
|
||||
@:
|
||||
|
||||
.PHONY: tflite-%
|
||||
|
||||
tflite-%:
|
||||
$(QQ)"$(MAKE)" -C $(PKG_SOURCE_DIR)/$(DIR_$@) -f $(CURDIR)/$@.mk
|
19
pkg/tflite-micro/Makefile.dep
Normal file
19
pkg/tflite-micro/Makefile.dep
Normal file
@ -0,0 +1,19 @@
|
||||
FEATURES_REQUIRED += cpp
|
||||
USEMODULE += cpp11-compat
|
||||
|
||||
USEPKG += flatbuffers
|
||||
USEPKG += gemmlowp
|
||||
USEPKG += ruy
|
||||
|
||||
USEMODULE += tflite-c
|
||||
USEMODULE += tflite-core-api
|
||||
USEMODULE += tflite-kernels
|
||||
USEMODULE += tflite-kernels-internal
|
||||
USEMODULE += tflite-kernels-internal-reference
|
||||
USEMODULE += tflite-micro
|
||||
USEMODULE += tflite-micro-kernels
|
||||
USEMODULE += tflite-micro-memory-planner
|
||||
USEMODULE += tflite-schema
|
||||
|
||||
# This package doesn't work on riscv and mips
|
||||
FEATURES_BLACKLIST += arch_mips32r2 arch_riscv
|
8
pkg/tflite-micro/Makefile.include
Normal file
8
pkg/tflite-micro/Makefile.include
Normal file
@ -0,0 +1,8 @@
|
||||
INCLUDES += -I$(PKGDIRBASE)/tflite-micro
|
||||
|
||||
CFLAGS += -DTF_LITE_STATIC_MEMORY
|
||||
CFLAGS += -DTF_LITE_DISABLE_X86_NEON
|
||||
CFLAGS += -DTF_LITE_USE_GLOBAL_CMATH_FUNCTIONS
|
||||
CFLAGS += -DTF_LITE_USE_GLOBAL_MIN
|
||||
CFLAGS += -DTF_LITE_USE_GLOBAL_MAX
|
||||
CFLAGS += -DFLATBUFFERS_LOCALE_INDEPENDENT=0
|
11
pkg/tflite-micro/doc.txt
Normal file
11
pkg/tflite-micro/doc.txt
Normal file
@ -0,0 +1,11 @@
|
||||
/**
|
||||
* @defgroup pkg_tflite-micro Tensorflow Lite Micro
|
||||
* @ingroup pkg
|
||||
* @brief Portable C++ library for signal processing and machine learning inferencing
|
||||
*
|
||||
* # License
|
||||
*
|
||||
* Licensed under Apache 2.0.
|
||||
*
|
||||
* @see https://github.com/tensorflow/tflite-micro
|
||||
*/
|
Binary file not shown.
5
pkg/tflite-micro/tflite-c.mk
Normal file
5
pkg/tflite-micro/tflite-c.mk
Normal file
@ -0,0 +1,5 @@
|
||||
MODULE = tflite-c
|
||||
|
||||
SRCXXEXT = cc
|
||||
|
||||
include $(RIOTBASE)/Makefile.base
|
5
pkg/tflite-micro/tflite-core-api.mk
Normal file
5
pkg/tflite-micro/tflite-core-api.mk
Normal file
@ -0,0 +1,5 @@
|
||||
MODULE = tflite-core-api
|
||||
|
||||
SRCXXEXT = cc
|
||||
|
||||
include $(RIOTBASE)/Makefile.base
|
5
pkg/tflite-micro/tflite-kernels-internal-reference.mk
Normal file
5
pkg/tflite-micro/tflite-kernels-internal-reference.mk
Normal file
@ -0,0 +1,5 @@
|
||||
MODULE = tflite-kernels-internal-reference
|
||||
|
||||
SRCXXEXT = cc
|
||||
|
||||
include $(RIOTBASE)/Makefile.base
|
5
pkg/tflite-micro/tflite-kernels-internal.mk
Normal file
5
pkg/tflite-micro/tflite-kernels-internal.mk
Normal file
@ -0,0 +1,5 @@
|
||||
MODULE = tflite-kernels-internal
|
||||
|
||||
SRCXXEXT = cc
|
||||
|
||||
include $(RIOTBASE)/Makefile.base
|
5
pkg/tflite-micro/tflite-kernels.mk
Normal file
5
pkg/tflite-micro/tflite-kernels.mk
Normal file
@ -0,0 +1,5 @@
|
||||
MODULE = tflite-kernels
|
||||
|
||||
SRCXXEXT = cc
|
||||
|
||||
include $(RIOTBASE)/Makefile.base
|
6
pkg/tflite-micro/tflite-micro-kernels.mk
Normal file
6
pkg/tflite-micro/tflite-micro-kernels.mk
Normal file
@ -0,0 +1,6 @@
|
||||
MODULE = tflite-micro-kernels
|
||||
|
||||
SRCXXEXT = cc
|
||||
SRCXXEXCLUDE = $(wildcard *_test.$(SRCXXEXT))
|
||||
|
||||
include $(RIOTBASE)/Makefile.base
|
6
pkg/tflite-micro/tflite-micro-memory-planner.mk
Normal file
6
pkg/tflite-micro/tflite-micro-memory-planner.mk
Normal file
@ -0,0 +1,6 @@
|
||||
MODULE = tflite-micro-memory-planner
|
||||
|
||||
SRCXXEXT = cc
|
||||
SRCXXEXCLUDE = $(wildcard *_test.$(SRCXXEXT))
|
||||
|
||||
include $(RIOTBASE)/Makefile.base
|
6
pkg/tflite-micro/tflite-micro.mk
Normal file
6
pkg/tflite-micro/tflite-micro.mk
Normal file
@ -0,0 +1,6 @@
|
||||
MODULE = tflite-micro
|
||||
|
||||
SRCXXEXT = cc
|
||||
SRCXXEXCLUDE = $(wildcard *_test.$(SRCXXEXT))
|
||||
|
||||
include $(RIOTBASE)/Makefile.base
|
5
pkg/tflite-micro/tflite-schema.mk
Normal file
5
pkg/tflite-micro/tflite-schema.mk
Normal file
@ -0,0 +1,5 @@
|
||||
MODULE = tflite-schema
|
||||
|
||||
SRCXXEXT = cc
|
||||
|
||||
include $(RIOTBASE)/Makefile.base
|
Loading…
Reference in New Issue
Block a user