1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

pkg/tensorflow-lite: add support to RIOT

This commit is contained in:
Alexandre Abadie 2019-11-27 11:55:29 +01:00
parent 2af88551e7
commit 2c3c967244
No known key found for this signature in database
GPG Key ID: 1C919A403CAE1405
13 changed files with 152 additions and 0 deletions

View File

@ -0,0 +1,29 @@
PKG_NAME=tensorflow-lite
PKG_URL=https://github.com/tensorflow/tensorflow
PKG_VERSION=1768c8f2fa155d4c6406e8ff7addf374c83de7ad
PKG_LICENSE=Apache2.0
include $(RIOTBASE)/pkg/pkg.mk
TF_MODULES = tensorflow-lite-hello_world
TF_USEMODULE = $(filter $(TF_MODULES),$(USEMODULE))
.PHONY: tensorflow-lite tensorflow-lite-%
CFLAGS += -Wno-pedantic
CFLAGS += -DTF_LITE_STATIC_MEMORY
CFLAGS += -DTF_LITE_USE_GLOBAL_ROUND
all: tensorflow-lite
tensorflow-lite: $(TF_USEMODULE)
"$(MAKE)" -C $(PKG_BUILDDIR)/tensorflow/lite/c -f $(CURDIR)/Makefile.$(PKG_NAME)-c
"$(MAKE)" -C $(PKG_BUILDDIR)/tensorflow/lite/core/api -f $(CURDIR)/Makefile.$(PKG_NAME)-core
"$(MAKE)" -C $(PKG_BUILDDIR)/tensorflow/lite/kernels -f $(CURDIR)/Makefile.$(PKG_NAME)-kernels
"$(MAKE)" -C $(PKG_BUILDDIR)/tensorflow/lite/kernels/internal -f $(CURDIR)/Makefile.$(PKG_NAME)-kernels-internal
"$(MAKE)" -C $(PKG_BUILDDIR)/tensorflow/lite/micro/kernels -f $(CURDIR)/Makefile.$(PKG_NAME)-micro-kernels
"$(MAKE)" -C $(PKG_BUILDDIR)/tensorflow/lite/micro/memory_planner -f $(CURDIR)/Makefile.$(PKG_NAME)-memory
"$(MAKE)" -C $(PKG_BUILDDIR)/tensorflow/lite/micro -f $(CURDIR)/Makefile.$(PKG_NAME)
tensorflow-lite-%:
"$(MAKE)" -C $(PKG_BUILDDIR)/tensorflow/lite/micro/examples/$* -f $(CURDIR)/Makefile.$(PKG_NAME)-$*

View File

@ -0,0 +1,12 @@
USEMODULE += cpp11-compat
USEPKG += flatbuffers
USEPKG += gemmlowp
USEMODULE += tensorflow-lite
USEMODULE += tensorflow-lite-c
USEMODULE += tensorflow-lite-core
USEMODULE += tensorflow-lite-kernels
USEMODULE += tensorflow-lite-kernels-internal
USEMODULE += tensorflow-lite-memory
USEMODULE += tensorflow-lite-micro-kernels

View File

@ -0,0 +1 @@
INCLUDES += -I$(PKGDIRBASE)/tensorflow-lite

View File

@ -0,0 +1,12 @@
MODULE = tensorflow-lite
CXXEXFLAGS += -Wno-sign-compare
CXXEXFLAGS += -Wno-strict-aliasing
CXXEXFLAGS += -Wno-type-limits
CXXEXFLAGS += -Wno-unused-parameter
CXXEXFLAGS += -Wno-unused-variable
SRCXXEXT = cc
SRCXXEXCLUDE = $(wildcard *_test.$(SRCXXEXT))
include $(RIOTBASE)/Makefile.base

View File

@ -0,0 +1,9 @@
MODULE = tensorflow-lite-c
CFLAGS += -Wno-strict-prototypes
CFLAGS += -Wno-old-style-definition
NO_AUTO_SRC = 1
SRC = common.c
include $(RIOTBASE)/Makefile.base

View File

@ -0,0 +1,17 @@
MODULE = tensorflow-lite-core
CXXEXFLAGS += -Wno-sign-compare
CXXEXFLAGS += -Wno-type-limits
SRCXXEXT = cc
SRCXXEXCLUDE = $(wildcard *_test.$(SRCXXEXT))
NO_AUTO_SRC = 1
SRCXX = \
error_reporter.cc \
flatbuffer_conversions.cc \
op_resolver.cc \
tensor_utils.cc \
#
include $(RIOTBASE)/Makefile.base

View File

@ -0,0 +1,17 @@
MODULE = tensorflow-lite-hello_world
CXXEXFLAGS += -Wno-type-limits
CXXEXFLAGS += -Wno-unused-parameter
SRCXXEXT = cc
SRCXXEXCLUDE = $(wildcard *_test.$(SRCXXEXT))
NO_AUTO_SRC = 1
SRCXX = \
constants.cc \
main_functions.cc \
output_handler.cc \
sine_model_data.cc \
#
include $(RIOTBASE)/Makefile.base

View File

@ -0,0 +1,12 @@
MODULE = tensorflow-lite-kernels
CXXEXFLAGS += -Wno-missing-field-initializers
CXXEXFLAGS += -Wno-unused-function
CXXEXFLAGS += -Wno-unused-parameter
SRCXXEXT = cc
NO_AUTO_SRC = 1
SRCXX = kernel_util.cc
include $(RIOTBASE)/Makefile.base

View File

@ -0,0 +1,12 @@
MODULE = tensorflow-lite-kernels-internal
CXXEXFLAGS += -Wno-missing-field-initializers
CXXEXFLAGS += -Wno-unused-function
CXXEXFLAGS += -Wno-unused-parameter
SRCXXEXT = cc
NO_AUTO_SRC = 1
SRCXX = quantization_util.cc
include $(RIOTBASE)/Makefile.base

View File

@ -0,0 +1,9 @@
MODULE = tensorflow-lite-memory
CXXEXFLAGS += -Wno-sign-compare
CXXEXFLAGS += -Wno-unused-parameter
SRCXXEXT = cc
SRCXXEXCLUDE = $(wildcard *_test.$(SRCXXEXT))
include $(RIOTBASE)/Makefile.base

View File

@ -0,0 +1,15 @@
MODULE = tensorflow-lite-micro-kernels
CXXEXFLAGS += -Wno-missing-field-initializers
CXXEXFLAGS += -Wno-strict-overflow
CXXEXFLAGS += -Wno-type-limits
CXXEXFLAGS += -Wno-unused-parameter
ifeq (llvm,$(TOOLCHAIN))
CXXEXFLAGS += -Wno-unused-const-variable
endif
SRCXXEXT = cc
SRCXXEXCLUDE = $(wildcard *_test.$(SRCXXEXT))
include $(RIOTBASE)/Makefile.base

View File

@ -0,0 +1,7 @@
/**
* @defgroup pkg_tensorflow-lite TensorFlow Lite
* @ingroup pkg
* @brief Provides a RIOT support for TensorFlow Lite AI library
*
* @see https://www.tensorflow.org/lite/microcontrollers
*/

Binary file not shown.