Treelite
compiler_param.h
Go to the documentation of this file.
1 
7 #ifndef TREELITE_COMPILER_PARAM_H_
8 #define TREELITE_COMPILER_PARAM_H_
9 
10 #include <dmlc/parameter.h>
11 #include <string>
12 #include <limits>
13 
14 namespace treelite {
15 namespace compiler {
16 
18 struct CompilerParam : public dmlc::Parameter<CompilerParam> {
26  std::string annotate_in;
28  int quantize;
36  int verbose;
38  std::string native_lib_name;
52  // declare parameters
53  DMLC_DECLARE_PARAMETER(CompilerParam) {
54  DMLC_DECLARE_FIELD(annotate_in).set_default("NULL")
55  .describe("Name of model annotation file");
56  DMLC_DECLARE_FIELD(quantize).set_lower_bound(0).set_default(0)
57  .describe("whether to quantize threshold points (0: no, >0: yes)");
58  DMLC_DECLARE_FIELD(parallel_comp).set_lower_bound(0).set_default(0)
59  .describe("option to enable parallel compilation;"
60  "if set to nonzero, the trees will be evely distributed"
61  "into [parallel_comp] files.");
62  DMLC_DECLARE_FIELD(verbose).set_default(0)
63  .describe("if >0, produce extra messages");
64  DMLC_DECLARE_FIELD(native_lib_name).set_default("predictor");
65  DMLC_DECLARE_FIELD(code_folding_req)
66  .set_default(std::numeric_limits<double>::infinity())
67  .set_lower_bound(0);
68  DMLC_DECLARE_FIELD(dump_array_as_elf).set_lower_bound(0).set_default(0);
69  }
70 };
71 
72 } // namespace compiler
73 } // namespace treelite
74 
75 #endif // TREELITE_COMPILER_PARAM_H_
parameters for tree compiler
std::string native_lib_name
native lib name (without extension)
std::string annotate_in
name of model annotation file. Use the class treelite.Annotator to generate this file.
int dump_array_as_elf
Only applicable when compiler is set to failsafe. If set to a positive value, the fail-safe compiler ...
double code_folding_req
parameter for folding rarely visited subtrees (no if/else blocks); all nodes whose data counts are lo...
int parallel_comp
option to enable parallel compilation; if set to nonzero, the trees will be evely distributed into [p...
int quantize
whether to quantize threshold points (0: no, >0: yes)
int verbose
if >0, produce extra messages