Skip to content

Commit

Permalink
mlearning/tflite-micro: add tflm tool into cmake build
Browse files Browse the repository at this point in the history
Signed-off-by: chao an <[email protected]>
  • Loading branch information
anchao committed Nov 30, 2024
1 parent 7d442c5 commit 7290146
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion mlearning/tflite-micro/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ if(CONFIG_TFLITEMICRO)
set(COMMON_FLAGS
-DTF_LITE_STATIC_MEMORY
-DTF_LITE_DISABLE_X86_NEON
-DTF_LITE_STRIP_ERROR_STRINGS
-Wno-sign-compare
-Wno-unused-variable
-Wno-undef
Expand All @@ -70,6 +69,13 @@ if(CONFIG_TFLITEMICRO)
list(APPEND COMMON_FLAGS -DCMSIS_NN)
endif()

if(CONFIG_TFLITEMICRO_DEBUG)
list(APPEND COMMON_FLAGS -DTF_LITE_SHOW_MEMORY_USE)
list(APPEND COMMON_FLAGS -DTF_LITE_USE_CTIME)
else()
list(APPEND COMMON_FLAGS -DTF_LITE_STRIP_ERROR_STRINGS)
endif()

# ############################################################################
# Sources
# ############################################################################
Expand Down Expand Up @@ -156,4 +162,20 @@ if(CONFIG_TFLITEMICRO)
target_sources(tflite_micro PRIVATE ${TFLITE_MICRO_SRCS})
target_include_directories(tflite_micro PUBLIC ${INCDIR})

if(CONFIG_TFLITEMICRO_TOOL)
nuttx_add_application(
NAME
tflm
STACKSIZE
${CONFIG_TFLITEMICRO_TOOL_STACKSIZE}
PRIORITY
${CONFIG_TFLITEMICRO_TOOL_PRIORITY}
SRCS
${CMAKE_CURRENT_LIST_DIR}/tflm_tool.cc
INCLUDE_DIRECTORIES
${INCDIR}
COMPILE_FLAGS
${COMMON_FLAGS})
endif()

endif()

0 comments on commit 7290146

Please sign in to comment.