diff options
-rw-r--r-- | README.md | 10 | ||||
-rw-r--r-- | ethosu/mlw_codec/makefile | 3 | ||||
-rw-r--r-- | ethosu/mlw_codec/mlw_main.c | 4 |
3 files changed, 4 insertions, 13 deletions
@@ -104,16 +104,6 @@ If you plan to contribute to the Vela project (highly encouraged!) then it is recommended to install Vela along with the pre-commit tools (see [Vela Testing](TESTING.md) for more details). -### `mlw_codec` - -As part of the installation process, Vela will compile a C based module. - -The build flags used for this module are as follows: - -```none --Wall -Werror -Wno-unused-function -Wno-unused-variable -``` - ## Running Vela is run with an input `.tflite` file passed on the command line. This file diff --git a/ethosu/mlw_codec/makefile b/ethosu/mlw_codec/makefile index 68eb0d94..aa214f9b 100644 --- a/ethosu/mlw_codec/makefile +++ b/ethosu/mlw_codec/makefile @@ -20,7 +20,8 @@ UNAME=$(shell uname -o) -CFLAGS=-Wall -Werror -Wno-unused-function -Wno-unused-variable +CFLAGS=-Wall -Werror -Wno-unused-variable +CFLAGS+=-fwrapv -fstack-protector-strong -flto -fuse-linker-plugin -ffat-lto-objects ifeq ($(DEBUG),1) CFLAGS+=-g -O0 -DDEBUG diff --git a/ethosu/mlw_codec/mlw_main.c b/ethosu/mlw_codec/mlw_main.c index 9f720495..315c899d 100644 --- a/ethosu/mlw_codec/mlw_main.c +++ b/ethosu/mlw_codec/mlw_main.c @@ -132,7 +132,7 @@ int main(int argc, char *argv[]) if (!decode) { // Encode - int i, n = int16_format ? inbuf_size/sizeof(int16_t) : inbuf_size; + int i, n = int16_format ? inbuf_size/(int)sizeof(int16_t) : inbuf_size; int16_t *weights = malloc( n * sizeof(int16_t) ); for(i=0; i<n; i++) { weights[i] = int16_format ? ((int16_t*)inbuf)[i] : ((int8_t*)inbuf)[i]; @@ -145,7 +145,7 @@ int main(int argc, char *argv[]) int i, n; int16_t *weights; n = mlw_decode( inbuf, inbuf_size, &weights, verbose); - outbuf_size = int16_format ? n*sizeof(int16_t) : n; + outbuf_size = int16_format ? n*(int)sizeof(int16_t) : n; outbuf = malloc( outbuf_size ); assert(outbuf); for(i=0; i<n; i++) { |