From 052016c240176b61a87ffc819eb9fe0ee8d2aeff Mon Sep 17 00:00:00 2001 From: windclarion Date: Mon, 13 Jul 2020 22:05:46 +0800 Subject: [PATCH] [RUNTIME][CRT] init TVMPackedFunc's name or else src/runtime/crt/graph_runtime/graph_runtime.c TVMGraphRuntime_Run Line 639 will show messy code. Signed-off-by: windclarion --- src/runtime/crt/common/packed_func.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/runtime/crt/common/packed_func.c b/src/runtime/crt/common/packed_func.c index 81dfcb54c3033..8fc94529b839d 100644 --- a/src/runtime/crt/common/packed_func.c +++ b/src/runtime/crt/common/packed_func.c @@ -23,6 +23,7 @@ * \file src/runtime/crt/common/packed_func.c * \brief PackedFunc implementation. */ +#include #include #include #include @@ -85,6 +86,7 @@ int TVMPackedFunc_InitGlobalFunc(TVMPackedFunc* pf, const char* name, const TVMA return status; } + snprintf(pf->name, sizeof(pf->name), "%s", name); TVMPackedFunc_SetArgs(pf, args); return status; } @@ -101,6 +103,7 @@ int TVMPackedFunc_InitModuleFunc(TVMPackedFunc* pf, TVMModuleHandle module, cons return status; } + snprintf(pf->name, sizeof(pf->name), "%s", name); TVMPackedFunc_SetArgs(pf, args); return status; }