~one-compiler/onecc-docker/master

« back to all changes in this revision

Viewing changes to runtime/onert/core/src/backend/builtin/KernelGenerator.cc

  • Committer: GitHub
  • Author(s): Hyeongseok Oh
  • Date: 2022-09-27 01:00:43 UTC
  • Revision ID: git-v1:4b33246486c6fb4b675042cc2dccce603617b2ee
[onert] Support multiple model on builtin backend (#9795)

This commit updates builtin backend to support multiple model on controlflow.

ONE-DCO-1.0-Signed-off-by: Hyeongseok Oh <hseok82.oh@samsung.com>

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
                                 const std::shared_ptr<TensorRegistry> &tensor_reg,
34
34
                                 const std::shared_ptr<ExternalContext> &external_context)
35
35
  : basic::KernelGeneratorBase{graph}, _dyn_tensor_manager{dyn_tensor_manager},
36
 
    _tensor_reg{tensor_reg}, _tensor_registries{}, _executors{nullptr}, _external_context{
37
 
                                                                          external_context}
 
36
    _tensor_reg{tensor_reg}, _tensor_registries{}, _executors{nullptr}, _model_index{},
 
37
    _external_context{external_context}
38
38
{
39
39
  UNUSED_RELEASE(_graph);
40
40
  UNUSED_RELEASE(_tensor_registries);
90
90
  input_tensors.erase(input_tensors.begin());
91
91
  auto fn = std::make_unique<::onert::backend::builtin::kernel::IfLayer>(
92
92
    cond_tensor, input_tensors, output_tensors, then_subg_index, else_subg_index, _executors,
93
 
    _external_context);
 
93
    _model_index, _external_context);
94
94
 
95
95
  _return_fn = std::move(fn);
96
96
}
133
133
  // WhileLayer just set Executors instead of cond and body executor to avoid complexity of
134
134
  // creating executor recusively
135
135
  auto fn = std::make_unique<::onert::backend::builtin::kernel::WhileLayer>(
136
 
    input_tensors, output_tensors, cond_subg_index, body_subg_index, _executors,
 
136
    input_tensors, output_tensors, cond_subg_index, body_subg_index, _executors, _model_index,
137
137
    _dyn_tensor_manager->dynamic_mem_mgr().get(), _external_context);
138
138
 
139
139
  _return_fn = std::move(fn);