Skip to content

Commit

Permalink
[runtime] Remove unused parameter. (apache#8580)
Browse files Browse the repository at this point in the history
* [runtime] Remove unused parameter.

* fix build issue when TVM_CRT_DEBUG enabled
  • Loading branch information
huajsj authored and ylc committed Jan 13, 2022
1 parent b7dced9 commit fe04cbf
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 11 deletions.
5 changes: 2 additions & 3 deletions src/runtime/crt/graph_executor/graph_executor.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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_
5 changes: 2 additions & 3 deletions src/runtime/graph_executor/graph_executor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ void GraphExecutor::SetupOpExecs() {
ICHECK(inode.op_type == "tvm_op") << "Can only take tvm_op as op";

std::shared_ptr<OpArgs> 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]);
Expand All @@ -434,8 +434,7 @@ void GraphExecutor::SetupOpExecs() {
}

std::pair<std::function<void()>, std::shared_ptr<GraphExecutor::OpArgs> >
GraphExecutor::CreateTVMOp(const TVMOpParam& param, const std::vector<DLTensor>& args,
size_t num_inputs) {
GraphExecutor::CreateTVMOp(const TVMOpParam& param, const std::vector<DLTensor>& args) {
std::shared_ptr<GraphExecutor::OpArgs> arg_ptr = std::make_shared<GraphExecutor::OpArgs>();
// setup address.
arg_ptr->args = args;
Expand Down
3 changes: 1 addition & 2 deletions src/runtime/graph_executor/graph_executor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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::function<void()>, std::shared_ptr<OpArgs>> CreateTVMOp(
const TVMOpParam& attrs, const std::vector<DLTensor>& args, size_t num_inputs);
const TVMOpParam& attrs, const std::vector<DLTensor>& 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.
Expand Down
4 changes: 2 additions & 2 deletions src/runtime/micro/standalone/microtvm_graph_executor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ void MicroGraphExecutor::SetupStorage() {
}

std::function<void()> CreateTVMOp(const DSOModule& module, const TVMOpParam& param,
const DynArray<DLTensor>& args, size_t num_inputs) {
const DynArray<DLTensor>& args) {
typedef union {
void* v_handle;
} TVMValue;
Expand Down Expand Up @@ -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);
}
}

Expand Down

0 comments on commit fe04cbf

Please sign in to comment.