提交 5e8a9a95 编写于 作者: M Megvii Engine Team

feat(lite): add get static mem info function in lite c

GitOrigin-RevId: f0d1b3009ea716b94eb34586a479421acd9b7545
上级 8bdcf6b5
......@@ -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
......
......@@ -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<lite::Network*>(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}}}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册