ONE - On-device Neural Engine
Loading...
Searching...
No Matches
onert::compiler::CompilerFactory Class Reference

#include <CompilerFactory.h>

Public Member Functions

std::unique_ptr< ICompilercreate (const std::shared_ptr< ir::NNPkg > &nnpkg, CompilerOptions *copts, const ir::train::TrainingInfo *training_info=nullptr)
 

Static Public Member Functions

static CompilerFactoryget ()
 

Detailed Description

Definition at line 31 of file CompilerFactory.h.

Member Function Documentation

◆ create()

std::unique_ptr< ICompiler > onert::compiler::CompilerFactory::create ( const std::shared_ptr< ir::NNPkg > &  nnpkg,
CompilerOptions copts,
const ir::train::TrainingInfo training_info = nullptr 
)

Definition at line 34 of file CompilerFactory.cc.

37{
38 // Returing compiler for training
39 if (training_info)
40 return std::make_unique<train::TrainingCompiler>(nnpkg, copts, *training_info);
41
42 // Returing compiler for inference
43 if (nnpkg->model_count() == 1)
44 return std::make_unique<Compiler>(nnpkg, copts);
45
46 return std::make_unique<MultiModelCompiler>(nnpkg, copts);
47}

Referenced by nnfw_session::prepare().

◆ get()

CompilerFactory & onert::compiler::CompilerFactory::get ( )
static

Definition at line 28 of file CompilerFactory.cc.

29{
30 static CompilerFactory singleton;
31 return singleton;
32}

Referenced by nnfw_session::prepare().


The documentation for this class was generated from the following files: