treelite
compiler.cc
Go to the documentation of this file.
1 
6 #include <treelite/compiler.h>
7 #include <dmlc/registry.h>
8 #include "./param.h"
9 
10 namespace dmlc {
11 DMLC_REGISTRY_ENABLE(::treelite::CompilerReg);
12 } // namespace dmlc
13 
14 namespace treelite {
15 Compiler* Compiler::Create(const std::string& name,
16  const compiler::CompilerParam& param) {
17  auto *e = ::dmlc::Registry< ::treelite::CompilerReg>::Get()->Find(name);
18  if (e == nullptr) {
19  LOG(FATAL) << "Unknown compiler type " << name;
20  }
21  return (e->body)(param);
22 }
23 } // namespace treelite
24 
25 namespace treelite {
26 namespace compiler {
27 // register compiler parameter
28 DMLC_REGISTER_PARAMETER(CompilerParam);
29 
30 // List of files that will be force linked in static links.
31 DMLC_REGISTRY_LINK_TAG(ast_native);
32 } // namespace compiler
33 } // namespace treelite
parameters for tree compiler
Definition: param.h:18
Parameters for tree compiler.
interface of compiler
Definition: compiler.h:34
Interface of compiler that compiles a tree ensemble model.
Definition: compiler.cc:10
Registry entry for compiler.
Definition: compiler.h:55