Imported Upstream version 1.21.0
[platform/core/ml/nnfw.git] / runtime / onert / frontend / nnapi / wrapper / ANeuralNetworksCompilation.cc
index 63036a3..bb247b9 100644 (file)
 
 #include "util/logging.h"
 
+using namespace onert;
+
 // TODO Support multiple subgraphs
 ANeuralNetworksCompilation::ANeuralNetworksCompilation(const ANeuralNetworksModel *model) noexcept
-  : _subgraphs{model->getSubGraphs()}, _tracing_ctx{std::make_unique<onert::util::TracingCtx>(
-                                         _subgraphs.get())},
-    _compiler{new onert::compiler::Compiler{_subgraphs, _tracing_ctx.get()}}
+  : _model{model->getModel()}, _coptions{compiler::CompilerOptions::fromGlobalConfig()},
+    _compiler{std::make_shared<compiler::Compiler>(_model, *_coptions)}
 {
   if (model->allowedToFp16())
   {
@@ -34,7 +35,7 @@ bool ANeuralNetworksCompilation::finish() noexcept
 {
   try
   {
-    _executors = _compiler->compile();
+    _artifact = _compiler->compile();
   }
   catch (const std::exception &e)
   {