APP_Framework/Framework/:add Kconfig file and SConscript file about NNoM(v0.4.3)

This commit is contained in:
WentaoWong 2022-02-18 14:40:20 +08:00
parent 48dfa06f79
commit e4393985f8
3 changed files with 65 additions and 0 deletions

View File

@ -10,4 +10,5 @@ if SUPPORT_KNOWING_FRAMEWORK
source "$APP_DIR/Framework/knowing/image_processing/Kconfig"
source "$APP_DIR/Framework/knowing/cmsis_5/Kconfig"
source "$APP_DIR/Framework/knowing/kpu/Kconfig"
source "$APP_DIR/Framework/knowing/nnom/Kconfig"
endif

View File

@ -0,0 +1,46 @@
menuconfig USING_NNOM
bool "NNOM"
default n
if USING_NNOM
config NNOM_USING_STATIC_MEMORY
bool "Using static memory"
default n
help
must set buf using "nnom_set_static_buf()" before creating a model.
config NNOM_TRUNCATE
bool "Using NNOM Truncate"
default n
help
disable: backend ops use round to the nearest int (default). enable: floor
choice
prompt "Select NNOM Format"
default NNOM_USING_HWC
config NNOM_USING_HWC
bool "Using HWC Format"
config NNOM_USING_CHW
bool "Using CHW Format"
help
CHW is incompatible with CMSIS-NN and must be used when using hardware accelerator such as KPU in K210 chip
endchoice
choice
prompt "Select NNOM Backend"
default USING_NNOM_NORMAL
config NNOM_USING_LOCAL
bool "Using NNOM local backend"
config NNOM_USING_CMSIS_NN
bool "Using CMSIS-NN backend"
select USING_CMSIS_5
select USING_CMSIS_5_NN
endchoice
endif

View File

@ -0,0 +1,18 @@
import os
from building import *
cwd = GetCurrentDir()
src = []
CPPDEFINES = []
CPPPATH = []
src += Glob('src/core/*.c')
src += Glob('src/layers/*.c')
src += Glob('src/backends/*.c')
CPPPATH+=['%s/inc'%(cwd), '%s/port'%(cwd)]
group = DefineGroup('nnom', src, depend = ['USING_NNOM'], CPPPATH = CPPPATH, LOCAL_CPPDEFINES=CPPDEFINES)
Return('group')