diff --git a/SConscript b/SConscript index f476a18..620e255 100644 --- a/SConscript +++ b/SConscript @@ -5,17 +5,17 @@ cwd = GetCurrentDir() objs = [] objs += Glob('src/*.c') +CPPPATH=['%s/inc'%(cwd), '%s/port'%(cwd)] try: # here for as Import('asenv') MODULES = asenv['MODULES'] - CPPPATH=['%s/inc'%(cwd), '%s/port/stdc'%(cwd)] + asenv.Append(CPPPATH = CPPPATH) except: # here for rt-thread - CPPPATH=['%s/inc'%(cwd), '%s/port/rt-thread'%(cwd)] objs = DefineGroup('nnom', objs, depend = ['PKG_USING_NNOM'], CPPPATH = CPPPATH) diff --git a/port/stdc/nnom_port.h b/port/nnom_port.h similarity index 91% rename from port/stdc/nnom_port.h rename to port/nnom_port.h index 6cf3140..e54d7c2 100644 --- a/port/stdc/nnom_port.h +++ b/port/nnom_port.h @@ -3,9 +3,8 @@ * Jianjia Ma, Wearable Bio-Robotics Group (WBR) * majianjia@live.com * - * This file (nnom_porting.h) is UNLICENSED, independently to NNoM. - * - * + * SPDX-License-Identifier: LGPL-3.0 + * * Change Logs: * Date Author Notes * 2019-02-05 Jianjia Ma The first version diff --git a/port/rt-thread/nnom_port.h b/port/rt-thread/nnom_port.h deleted file mode 100644 index 648d736..0000000 --- a/port/rt-thread/nnom_port.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2018-2019, Jianjia Ma, Wearable Bio-Robotics Group (WBR) - * - * This file (nnom_port.h) is unlicensed, independently to NNoM. - * - * Change Logs: - * Date Author Notes - * 2019-02-05 Jianjia Ma The first version - */ - -#ifndef __NNOM_PORT_H__ -#define __NNOM_PORT_H__ - -#include -#include -#include -#include -#include - -// Porting -#include "rtthread.h" - -// memory interfaces -#define nnom_malloc(n) rt_malloc(n) -#define nnom_free(p) rt_free(p) -#define nnom_memset(p,v,s) rt_memset(p,v,s) - -// runtime & debuges -#define nnom_us_get() 0 -#define nnom_ms_get() rt_tick_get() -#define LOG(...) rt_kprintf(__VA_ARGS__) - -// NNoM configuration -#define NNOM_BLOCK_NUM (8) // maximum number of memory block -#define DENSE_WEIGHT_OPT (1) // if used fully connected layer optimized weights. - -// CMSIS-NN backend -//#define NNOM_USING_CMSIS_NN // uncomment if use cmsis-nn - -#endif - - - diff --git a/src/nnom.c b/src/nnom.c index fc958aa..d12884c 100644 --- a/src/nnom.c +++ b/src/nnom.c @@ -551,10 +551,10 @@ nnom_status_t compile_layers(nnom_layer_t *start, nnom_mem_block_t *block_pool) else compsize = 0; // names - LOG(" %-10s - ", &default_layer_names[layer->type]); + LOG(" %-10s - ", default_layer_names[layer->type]); // activations if (layer->actail != NULL) - LOG("%-8s - ", &default_activation_names[layer->actail->type]); + LOG("%-8s - ", default_activation_names[layer->actail->type]); else LOG(" - "); @@ -810,7 +810,7 @@ nnom_status_t model_compile(nnom_model_t *m, nnom_layer_t *input, nnom_layer_t * // if model's tail is not the last layer which built by user. if (output != find_last(input)) LOG("WARNING: model returned at #%d %s layer, but this layer is not the end of shortcut list \n", - find_index(m->head, output), &default_layer_names[output->type]); + find_index(m->head, output), default_layer_names[output->type]); // get the total (aligned) memory requirement buf_size = mem_analysis_result(m); @@ -904,7 +904,7 @@ nnom_status_t model_run_to(nnom_model_t *m, nnom_layer_t *end_layer) result = layer_run(layer); if (result != NN_SUCCESS) { - LOG("Error: #%d %s layer return error code:%d\n", layer_num, &default_layer_names[layer->type], result); + LOG("Error: #%d %s layer return error code:%d\n", layer_num, default_layer_names[layer->type], result); return result; } #ifdef USE_NNOM_OUTPUT_SAVE