diff --git a/lite/lite-c/include/lite-c/network_c.h b/lite/lite-c/include/lite-c/network_c.h index 3e0ffef1d5e0e6b83ddc224b6612c3ad37577a51..64ca7a377f7358eebb86afff97acc7ffde0623b6 100644 --- a/lite/lite-c/include/lite-c/network_c.h +++ b/lite/lite-c/include/lite-c/network_c.h @@ -512,6 +512,15 @@ LITE_API int LITE_enable_io_txt_dump(LiteNetwork network, const char* io_txt_out */ LITE_API int LITE_enable_io_bin_dump(LiteNetwork network, const char* io_bin_out_dir); +/** + * \brief get static peak memory info showed by Graph visualization + * \param[in] log_dir The dumped json file directory + * \return int if the return is not zero, error happened, the error message + * can get by LITE_get_last_error + */ +LITE_API int LITE_get_static_memory_alloc_info( + LiteNetwork network, const char* log_dir); + #ifdef __cplusplus } #endif diff --git a/lite/lite-c/src/network.cpp b/lite/lite-c/src/network.cpp index c4aa631fb09802fdcaaae260e11ddfb82e31c169..d9419df6028967cc0cc90419102bb947dc2f1e93 100644 --- a/lite/lite-c/src/network.cpp +++ b/lite/lite-c/src/network.cpp @@ -558,4 +558,19 @@ int LITE_share_runtime_memroy(LiteNetwork dst_network, LiteNetwork src_network) LITE_CAPI_END(); } +int LITE_get_static_memory_alloc_info(LiteNetwork network, const char* log_dir) { + LITE_CAPI_BEGIN(); +#ifndef __IN_TEE_ENV__ +#if MGB_ENABLE_JSON + LITE_ASSERT(network, "The network pass to LITE api is null"); + static_cast(network)->get_static_memory_alloc_info(log_dir); + return 0; +#endif +#endif + LITE_MARK_USED_VAR(network); + LITE_MARK_USED_VAR(log_dir); + LITE_THROW("Doesn't support get_static_memory_alloc_info().Please check macro."); + LITE_CAPI_END(); +} + // vim: syntax=cpp.doxygen foldmethod=marker foldmarker=f{{{,f}}}