From 087246ea0f0f4a7640d4d4358d2e1243e295c4f7 Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Sat, 23 Nov 2019 14:48:31 +0100 Subject: [PATCH] pkg: add support for utensor as a package --- pkg/utensor/Makefile | 16 ++++++++++++++++ pkg/utensor/Makefile.dep | 4 ++++ pkg/utensor/Makefile.include | 17 +++++++++++++++++ pkg/utensor/Makefile.utensor | 5 +++++ pkg/utensor/Makefile.utensor.ops | 3 +++ pkg/utensor/Makefile.utensor.util | 5 +++++ pkg/utensor/doc.txt | 7 +++++++ .../patches/0001-fix-integer-format.patch | Bin 0 -> 2140 bytes .../patches/0002-fix-mbed-specific-code.patch | Bin 0 -> 1281 bytes .../patches/0003-fix-variadic-macro.patch | Bin 0 -> 1640 bytes 10 files changed, 57 insertions(+) create mode 100644 pkg/utensor/Makefile create mode 100644 pkg/utensor/Makefile.dep create mode 100644 pkg/utensor/Makefile.include create mode 100644 pkg/utensor/Makefile.utensor create mode 100644 pkg/utensor/Makefile.utensor.ops create mode 100644 pkg/utensor/Makefile.utensor.util create mode 100644 pkg/utensor/doc.txt create mode 100644 pkg/utensor/patches/0001-fix-integer-format.patch create mode 100644 pkg/utensor/patches/0002-fix-mbed-specific-code.patch create mode 100644 pkg/utensor/patches/0003-fix-variadic-macro.patch diff --git a/pkg/utensor/Makefile b/pkg/utensor/Makefile new file mode 100644 index 0000000000..de34ac9732 --- /dev/null +++ b/pkg/utensor/Makefile @@ -0,0 +1,16 @@ +PKG_NAME=utensor +PKG_URL=https://github.com/uTensor/uTensor +PKG_VERSION=b22aa5cbc1ef1b3dd42a899b393a9b999afd1305 +PKG_LICENSE=Apache2.0 + +PKG_BASEDIR = $(PKG_BUILDDIR)/src/uTensor + +.PHONY: all + +all: + "$(MAKE)" -C $(PKG_BASEDIR)/core -f $(CURDIR)/Makefile.$(PKG_NAME) + "$(MAKE)" -C $(PKG_BASEDIR)/util -f $(CURDIR)/Makefile.$(PKG_NAME).util + "$(MAKE)" -C $(PKG_BASEDIR)/ops -f $(CURDIR)/Makefile.$(PKG_NAME).ops + + +include $(RIOTBASE)/pkg/pkg.mk diff --git a/pkg/utensor/Makefile.dep b/pkg/utensor/Makefile.dep new file mode 100644 index 0000000000..657b56d8f9 --- /dev/null +++ b/pkg/utensor/Makefile.dep @@ -0,0 +1,4 @@ +FEATURES_REQUIRED += cpp + +USEMODULE += utensor-ops +USEMODULE += utensor-util diff --git a/pkg/utensor/Makefile.include b/pkg/utensor/Makefile.include new file mode 100644 index 0000000000..6b0ee8302c --- /dev/null +++ b/pkg/utensor/Makefile.include @@ -0,0 +1,17 @@ +INCLUDES += -I$(PKGDIRBASE)/utensor +INCLUDES += -I$(PKGDIRBASE)/utensor/src +INCLUDES += -I$(PKGDIRBASE)/utensor/src/uTensor +INCLUDES += -I$(PKGDIRBASE)/utensor/src/uTensor/core +INCLUDES += -I$(PKGDIRBASE)/utensor/src/uTensor/ops +INCLUDES += -I$(PKGDIRBASE)/utensor/src/uTensor/util + +CXXEXFLAGS += -Wno-sign-compare + +ifeq (llvm,$(TOOLCHAIN)) + CXXEXFLAGS += -Wno-unused-variable + CXXEXFLAGS += -Wno-shift-count-negative +endif + +ifneq (native,$(BOARD)) + CXXEXFLAGS += -std=c++11 +endif diff --git a/pkg/utensor/Makefile.utensor b/pkg/utensor/Makefile.utensor new file mode 100644 index 0000000000..21009d92bd --- /dev/null +++ b/pkg/utensor/Makefile.utensor @@ -0,0 +1,5 @@ +MODULE = utensor + +CXXEXFLAGS += -Wno-unused-parameter + +include $(RIOTBASE)/Makefile.base diff --git a/pkg/utensor/Makefile.utensor.ops b/pkg/utensor/Makefile.utensor.ops new file mode 100644 index 0000000000..267fd924ed --- /dev/null +++ b/pkg/utensor/Makefile.utensor.ops @@ -0,0 +1,3 @@ +MODULE = utensor-ops + +include $(RIOTBASE)/Makefile.base diff --git a/pkg/utensor/Makefile.utensor.util b/pkg/utensor/Makefile.utensor.util new file mode 100644 index 0000000000..e5dc1a5361 --- /dev/null +++ b/pkg/utensor/Makefile.utensor.util @@ -0,0 +1,5 @@ +MODULE = utensor-util + +CXXEXFLAGS += -Wno-c++14-binary-literal + +include $(RIOTBASE)/Makefile.base diff --git a/pkg/utensor/doc.txt b/pkg/utensor/doc.txt new file mode 100644 index 0000000000..ce1a8b14e0 --- /dev/null +++ b/pkg/utensor/doc.txt @@ -0,0 +1,7 @@ +/** + * @defgroup pkg_utensor uTensor + * @ingroup pkg + * @brief Provides a package for AI inference based on TensorFlow + * + * @see https://github.com/uTensor/uTensor + */ diff --git a/pkg/utensor/patches/0001-fix-integer-format.patch b/pkg/utensor/patches/0001-fix-integer-format.patch new file mode 100644 index 0000000000000000000000000000000000000000..f0366d3c43c3d092b2bdd081ce078e791b731081 GIT binary patch literal 2140 zcmb`IVQ-sA5Qe|=E9NY9A3uVfc3OX^ea{`<`W zPU56#s=HX$0>gUV-S^oUpDK9`lW>yfV+=6L!zc*Y-ri&t=94HKV>XSVagdHDqiBlo zQ3_aK3Bd$>KW@G-^8LU%r8F@d7r0>}QwYZ^mT`o)Y#Z@d6Paq*wzN8rP^Gm+G2n zdW2F@%(7h9wV+bzuwJ65q#CADAq_NtqrJ2&;cwW7K7D8=O${LD1wwko#2T{!M3k#S zrMVQ9-FHkN!vfo9*RiaO=Q+6UnrmRgp9-yh`r6_m!wm$%DD?Ny^QL2ec5mmrJ3ewlCny_twqJx0<$CgNoA5IW%9#Z zXjav&uXW?VGSo&5wq~Tq7s1vDKF&m**e!Lc5;E_#?x-{ni1dA6+jqo%m)ITtGuc7E zqZPxe%%ErzKZfv<8c(2jtlUCSsB0y*~rrFHtcq)f z924T!WK6gyYh5)bh?<|xYAvZg?!^BmrVUX8b5aRq4IOK()?Rr>E3wtl(F=eWsSU%?**3iFV_N} A@&Et; literal 0 HcmV?d00001 diff --git a/pkg/utensor/patches/0002-fix-mbed-specific-code.patch b/pkg/utensor/patches/0002-fix-mbed-specific-code.patch new file mode 100644 index 0000000000000000000000000000000000000000..3c6b7e60a4e6a91ea6dba43d3c53cee1bf98591d GIT binary patch literal 1281 zcmb7EO;6iE5WVlOm?oD*j=!BR7onsDS`I)3flF0IYwwtB>#U>oI;AT8@0~RPK@SbA zEU)KjW_IT78=vTE4KW{a9_5p1GL7OQ76~8nq6m-&QyhoII3G`h(O6o;%QqXihXfpFzwfH`jlgcjm#arJ=DFORNI z&oBCY=1>5k@Zo~6<@tPZdUO2j%!B$@?bn7IZ*}+_7E+_yfvAXdX6sIdgE2Vmo6JTk z6Guw}%2ca3>OI+8UiRTP0|1St(aLV`8T?_;)^E$%71)+X^#5DmwvvLBV3w%1y*3vG zcd@MTEdsDg+jk}8vlBox#4Imj&l|?m0LA1j0>XUm!fIiS?E`w+(!fo1JxU)v?63 zHw?btB@fiP($Kk9KUDQo(LZ3lp&8ZWXP56oDUB%+Y!FvqD#+yR&Z21n7I{(Ng^c|L D8PSr= literal 0 HcmV?d00001 diff --git a/pkg/utensor/patches/0003-fix-variadic-macro.patch b/pkg/utensor/patches/0003-fix-variadic-macro.patch new file mode 100644 index 0000000000000000000000000000000000000000..051056af10793a3a30bd2612ac4e6e9991ac3ef1 GIT binary patch literal 1640 zcma)6ZBN@U5dQ98aiT&>)g+CRHf_T+wS$%+L5C!~svmsq)fQV*K~nZfGdV zfGCRZo;%;=?jC!RCXW#NeeCyW?65)Cp<&naoCWQ6`+l$6XNxH8^}>bkQw$f0fEil> z?t$Y3`UTf`}X#3-oi;sN}7ZKaQAdX|Fzp!l&yN*vikWKJA9aYb&IpnJ zBXhiRd27>Q<9JzQ4@Q1qeUgL7lLzb@JH0&7O84B-?z!5o_0nF_j|-j?Cf0_eomEnEE^llQ?9Wo2cACqB X5kV5`YgCeYOJ8|qA=h>t8zb}&^6#bX literal 0 HcmV?d00001