Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -380,7 +380,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 @@ -393,8 +393,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 @@ -381,11 +381,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