From fe04cbfaedcf295643510db7f42c9f9bf5af068f Mon Sep 17 00:00:00 2001 From: Hua Jiang Date: Mon, 2 Aug 2021 15:37:02 -0700 Subject: [PATCH] [runtime] Remove unused parameter. (#8580) * [runtime] Remove unused parameter. * fix build issue when TVM_CRT_DEBUG enabled --- src/runtime/crt/graph_executor/graph_executor.c | 5 ++--- .../tvm/runtime/crt/internal/graph_executor/graph_executor.h | 2 +- src/runtime/graph_executor/graph_executor.cc | 5 ++--- src/runtime/graph_executor/graph_executor.h | 3 +-- src/runtime/micro/standalone/microtvm_graph_executor.cc | 4 ++-- 5 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/runtime/crt/graph_executor/graph_executor.c b/src/runtime/crt/graph_executor/graph_executor.c index bf64096441be..7b7690b66528 100644 --- a/src/runtime/crt/graph_executor/graph_executor.c +++ b/src/runtime/crt/graph_executor/graph_executor.c @@ -1088,8 +1088,7 @@ int TVMGraphExecutor_SetupOpExecs(TVMGraphExecutor* executor) { printf("tvm_op: creating %s with node_id=%d\n", inode->param.func_name, nid); #endif // TVM_CRT_DEBUG TVMPackedFunc pf; - TVMGraphExecutor_CreateTVMOp(executor, &(inode->param), args, args_count, inode->inputs_count, - &pf); + TVMGraphExecutor_CreateTVMOp(executor, &(inode->param), args, args_count, &pf); executor->op_execs[nid] = pf; } } @@ -1109,7 +1108,7 @@ typedef struct TVMOpArgs { int32_t TVMGraphExecutor_CreateTVMOp(TVMGraphExecutor* executor, const TVMOpParam* param, DLTensorPtr* args, const uint32_t args_count, - uint32_t num_inputs, TVMPackedFunc* pf) { + TVMPackedFunc* pf) { int status = 0; uint32_t idx; TVMOpArgs arg_ptr; diff --git a/src/runtime/crt/include/tvm/runtime/crt/internal/graph_executor/graph_executor.h b/src/runtime/crt/include/tvm/runtime/crt/internal/graph_executor/graph_executor.h index 47ef474778e0..c9b3ebe5c643 100644 --- a/src/runtime/crt/include/tvm/runtime/crt/internal/graph_executor/graph_executor.h +++ b/src/runtime/crt/include/tvm/runtime/crt/internal/graph_executor/graph_executor.h @@ -116,6 +116,6 @@ int TVMGraphExecutor_GetOutput(TVMGraphExecutor* executor, const int32_t idx, DL int32_t TVMGraphExecutor_CreateTVMOp(TVMGraphExecutor* executor, const TVMOpParam* param, DLTensorPtr* args, const uint32_t args_count, - uint32_t num_inputs, TVMPackedFunc* pf); + TVMPackedFunc* pf); #endif // TVM_RUNTIME_CRT_INCLUDE_TVM_RUNTIME_CRT_INTERNAL_GRAPH_EXECUTOR_GRAPH_EXECUTOR_H_ diff --git a/src/runtime/graph_executor/graph_executor.cc b/src/runtime/graph_executor/graph_executor.cc index 60b102c80d29..0414434674ab 100644 --- a/src/runtime/graph_executor/graph_executor.cc +++ b/src/runtime/graph_executor/graph_executor.cc @@ -421,7 +421,7 @@ void GraphExecutor::SetupOpExecs() { ICHECK(inode.op_type == "tvm_op") << "Can only take tvm_op as op"; std::shared_ptr op_args = nullptr; - std::tie(op_execs_[nid], op_args) = CreateTVMOp(inode.param, args, inode.inputs.size()); + std::tie(op_execs_[nid], op_args) = CreateTVMOp(inode.param, args); for (size_t i = 0; i < inode.inputs.size(); i++) { uint32_t eid = this->entry_id(inode.inputs[i]); @@ -434,8 +434,7 @@ void GraphExecutor::SetupOpExecs() { } std::pair, std::shared_ptr > -GraphExecutor::CreateTVMOp(const TVMOpParam& param, const std::vector& args, - size_t num_inputs) { +GraphExecutor::CreateTVMOp(const TVMOpParam& param, const std::vector& args) { std::shared_ptr arg_ptr = std::make_shared(); // setup address. arg_ptr->args = args; diff --git a/src/runtime/graph_executor/graph_executor.h b/src/runtime/graph_executor/graph_executor.h index c48ee38af0e1..551791681b21 100644 --- a/src/runtime/graph_executor/graph_executor.h +++ b/src/runtime/graph_executor/graph_executor.h @@ -408,11 +408,10 @@ class TVM_DLL GraphExecutor : public ModuleNode { * \brief Create an execution function given input. * \param attrs The node attributes. * \param args The arguments to the functor, including inputs and outputs. - * \param num_inputs Number of inputs. * \return The created executor. */ std::pair, std::shared_ptr> CreateTVMOp( - const TVMOpParam& attrs, const std::vector& args, size_t num_inputs); + const TVMOpParam& attrs, const std::vector& args); // Get node entry index. uint32_t entry_id(uint32_t nid, uint32_t index) const { return node_row_ptr_[nid] + index; } // Get node entry index. diff --git a/src/runtime/micro/standalone/microtvm_graph_executor.cc b/src/runtime/micro/standalone/microtvm_graph_executor.cc index d91d0ea74ba4..d09efc4be50e 100644 --- a/src/runtime/micro/standalone/microtvm_graph_executor.cc +++ b/src/runtime/micro/standalone/microtvm_graph_executor.cc @@ -321,7 +321,7 @@ void MicroGraphExecutor::SetupStorage() { } std::function CreateTVMOp(const DSOModule& module, const TVMOpParam& param, - const DynArray& args, size_t num_inputs) { + const DynArray& args) { typedef union { void* v_handle; } TVMValue; @@ -389,7 +389,7 @@ void MicroGraphExecutor::SetupOpExecs() { args[index + inode.inputs.size()] = data_entry_[eid].ToDLTensor(); } assert(inode.op_type == "tvm_op"); - op_execs_[nid] = CreateTVMOp(*module_, inode.param, args, inode.inputs.size()); + op_execs_[nid] = CreateTVMOp(*module_, inode.param, args); } }