Compute Library
 21.08
CommonGraphOptions Class Reference

Common command line options used to configure the graph examples. More...

#include <CommonGraphOptions.h>

Collaboration diagram for CommonGraphOptions:
[legend]

Public Member Functions

 CommonGraphOptions (CommandLineParser &parser)
 Constructor. More...
 
 CommonGraphOptions (const CommonGraphOptions &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
CommonGraphOptionsoperator= (const CommonGraphOptions &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
 CommonGraphOptions (CommonGraphOptions &&)=default
 Allow instances of this class to be moved. More...
 
CommonGraphOptionsoperator= (CommonGraphOptions &&)=default
 Allow instances of this class to be moved. More...
 
 ~CommonGraphOptions ()=default
 Default destructor. More...
 

Data Fields

ToggleOptionhelp
 Show help option. More...
 
SimpleOption< int > * threads
 Number of threads option. More...
 
SimpleOption< int > * batches
 Number of batches. More...
 
EnumOption< arm_compute::graph::Target > * target
 Graph execution target. More...
 
EnumOption< arm_compute::DataType > * data_type
 Graph data type. More...
 
EnumOption< arm_compute::DataLayout > * data_layout
 Graph data layout. More...
 
ToggleOptionenable_tuner
 Enable tuner. More...
 
ToggleOptionenable_cl_cache
 Enable opencl kernels cache. More...
 
SimpleOption< arm_compute::CLTunerMode > * tuner_mode
 Tuner mode. More...
 
ToggleOptionfast_math_hint
 Fast math hint. More...
 
SimpleOption< std::string > * data_path
 Trainable parameters path. More...
 
SimpleOption< std::string > * image
 Image. More...
 
SimpleOption< std::string > * labels
 Labels. More...
 
SimpleOption< std::string > * validation_file
 Validation file. More...
 
SimpleOption< std::string > * validation_path
 Validation data path. More...
 
SimpleOption< std::string > * validation_range
 Validation range. More...
 
SimpleOption< std::string > * tuner_file
 File to load/store the tuner's values from. More...
 
SimpleOption< std::string > * mlgo_file
 File to load the MLGO heuristics from. More...
 

Detailed Description

Common command line options used to configure the graph examples.

The options in this object get populated when "parse()" is called on the parser used to construct it. The expected workflow is:

CommandLineParser parser; CommonOptions options( parser ); parser.parse(argc, argv);

Definition at line 134 of file CommonGraphOptions.h.

Constructor & Destructor Documentation

◆ CommonGraphOptions() [1/3]

Constructor.

Parameters
[in,out]parserA parser on which "parse()" hasn't been called yet.

Definition at line 117 of file CommonGraphOptions.cpp.

References CommandLineParser::add_option(), CommonGraphOptions::batches, arm_compute::CL, CommonGraphOptions::data_layout, CommonGraphOptions::data_path, CommonGraphOptions::data_type, CommonGraphOptions::enable_cl_cache, CommonGraphOptions::enable_tuner, arm_compute::EXHAUSTIVE, arm_compute::F16, arm_compute::F32, CommonGraphOptions::fast_math_hint, CommonGraphOptions::help, CommonGraphOptions::image, CommonGraphOptions::labels, CommonGraphOptions::mlgo_file, arm_compute::NCHW, arm_compute::NEON, arm_compute::NHWC, arm_compute::NORMAL, arm_compute::QASYMM8, arm_compute::QASYMM8_SIGNED, arm_compute::RAPID, Option::set_help(), CommonGraphOptions::target, CommonGraphOptions::threads, CommonGraphOptions::tuner_file, CommonGraphOptions::tuner_mode, CommonGraphOptions::validation_file, and CommonGraphOptions::validation_path.

118  : help(parser.add_option<ToggleOption>("help")),
119  threads(parser.add_option<SimpleOption<int>>("threads", 1)),
120  batches(parser.add_option<SimpleOption<int>>("batches", 1)),
121  target(),
122  data_type(),
123  data_layout(),
124  enable_tuner(parser.add_option<ToggleOption>("enable-tuner")),
125  enable_cl_cache(parser.add_option<ToggleOption>("enable-cl-cache")),
126  tuner_mode(),
127  fast_math_hint(parser.add_option<ToggleOption>("fast-math")),
128  data_path(parser.add_option<SimpleOption<std::string>>("data")),
129  image(parser.add_option<SimpleOption<std::string>>("image")),
130  labels(parser.add_option<SimpleOption<std::string>>("labels")),
131  validation_file(parser.add_option<SimpleOption<std::string>>("validation-file")),
132  validation_path(parser.add_option<SimpleOption<std::string>>("validation-path")),
133  validation_range(parser.add_option<SimpleOption<std::string>>("validation-range")),
134  tuner_file(parser.add_option<SimpleOption<std::string>>("tuner-file")),
135  mlgo_file(parser.add_option<SimpleOption<std::string>>("mlgo-file"))
136 {
137  std::set<arm_compute::graph::Target> supported_targets
138  {
139  Target::NEON,
140  Target::CL,
141  Target::CLVK,
142  };
143 
144  std::set<arm_compute::DataType> supported_data_types
145  {
150  };
151 
152  std::set<DataLayout> supported_data_layouts
153  {
156  };
157 
158  const std::set<CLTunerMode> supported_tuner_modes
159  {
163  };
164 
165  target = parser.add_option<EnumOption<Target>>("target", supported_targets, Target::NEON);
166  data_type = parser.add_option<EnumOption<DataType>>("type", supported_data_types, DataType::F32);
167  data_layout = parser.add_option<EnumOption<DataLayout>>("layout", supported_data_layouts);
168  tuner_mode = parser.add_option<EnumOption<CLTunerMode>>("tuner-mode", supported_tuner_modes, CLTunerMode::NORMAL);
169 
170  help->set_help("Show this help message");
171  threads->set_help("Number of threads to use");
172  batches->set_help("Number of batches to use for the inputs");
173  target->set_help("Target to execute on");
174  data_type->set_help("Data type to use");
175  data_layout->set_help("Data layout to use");
176  enable_tuner->set_help("Enable OpenCL dynamic tuner");
177  enable_cl_cache->set_help("Enable OpenCL program caches");
178  tuner_mode->set_help(
179  "Configures the time taken by the tuner to tune. "
180  "Exhaustive: slowest but produces the most performant LWS configuration. "
181  "Normal: slow but produces the LWS configurations on par with Exhaustive most of the time. "
182  "Rapid: fast but produces less performant LWS configurations");
183  fast_math_hint->set_help("Enable fast math");
184  data_path->set_help("Path where graph parameters reside");
185  image->set_help("Input image for the graph");
186  labels->set_help("File containing the output labels");
187  validation_file->set_help("File used to validate the graph");
188  validation_path->set_help("Path to the validation data");
189  validation_range->set_help("Range of the images to validate for (Format : start,end)");
190  tuner_file->set_help("File to load/save CLTuner values");
191  mlgo_file->set_help("File to load MLGO heuristics");
192 }
ToggleOption * enable_tuner
Enable tuner.
SimpleOption< arm_compute::CLTunerMode > * tuner_mode
Tuner mode.
ToggleOption * help
Show help option.
SimpleOption< std::string > * mlgo_file
File to load the MLGO heuristics from.
EnumOption< arm_compute::DataType > * data_type
Graph data type.
EnumOption< arm_compute::DataLayout > * data_layout
Graph data layout.
1 channel, 1 F32 per channel
Searches a subset of LWS configurations while tuning.
SimpleOption< std::string > * tuner_file
File to load/store the tuner&#39;s values from.
1 channel, 1 F16 per channel
EnumOption< arm_compute::graph::Target > * target
Graph execution target.
Searches a minimal subset of LWS configurations while tuning.
ToggleOption * enable_cl_cache
Enable opencl kernels cache.
quantized, asymmetric fixed-point 8-bit number unsigned
SimpleOption< int > * batches
Number of batches.
ToggleOption * fast_math_hint
Fast math hint.
SimpleOption< std::string > * validation_file
Validation file.
Num samples, channels, height, width.
SimpleOption< std::string > * validation_path
Validation data path.
Num samples, height, width, channels.
SimpleOption< std::string > * validation_range
Validation range.
SimpleOption< std::string > * data_path
Trainable parameters path.
SimpleOption< std::string > * labels
Labels.
quantized, asymmetric fixed-point 8-bit number signed
SimpleOption< int > * threads
Number of threads option.
Searches all possible LWS configurations while tuning.
void set_help(std::string help)
Set the help message for the option.
Definition: Option.h:125
SimpleOption< std::string > * image
Image.

◆ CommonGraphOptions() [2/3]

CommonGraphOptions ( const CommonGraphOptions )
delete

Prevent instances of this class from being copied (As this class contains pointers)

◆ CommonGraphOptions() [3/3]

Allow instances of this class to be moved.

◆ ~CommonGraphOptions()

~CommonGraphOptions ( )
default

Default destructor.

Member Function Documentation

◆ operator=() [1/2]

CommonGraphOptions& operator= ( const CommonGraphOptions )
delete

Prevent instances of this class from being copied (As this class contains pointers)

◆ operator=() [2/2]

CommonGraphOptions& operator= ( CommonGraphOptions &&  )
default

Allow instances of this class to be moved.

Field Documentation

◆ batches

SimpleOption<int>* batches

◆ data_layout

◆ data_path

SimpleOption<std::string>* data_path

Trainable parameters path.

Definition at line 163 of file CommonGraphOptions.h.

Referenced by CommonGraphOptions::CommonGraphOptions(), and arm_compute::utils::consume_common_graph_parameters().

◆ data_type

◆ enable_cl_cache

ToggleOption* enable_cl_cache

Enable opencl kernels cache.

Definition at line 160 of file CommonGraphOptions.h.

Referenced by CommonGraphOptions::CommonGraphOptions(), and arm_compute::utils::consume_common_graph_parameters().

◆ enable_tuner

◆ fast_math_hint

ToggleOption* fast_math_hint

◆ help

◆ image

◆ labels

◆ mlgo_file

SimpleOption<std::string>* mlgo_file

File to load the MLGO heuristics from.

Definition at line 170 of file CommonGraphOptions.h.

Referenced by CommonGraphOptions::CommonGraphOptions(), and arm_compute::utils::consume_common_graph_parameters().

◆ target

◆ threads

SimpleOption<int>* threads

Number of threads option.

Definition at line 154 of file CommonGraphOptions.h.

Referenced by CommonGraphOptions::CommonGraphOptions(), and arm_compute::utils::consume_common_graph_parameters().

◆ tuner_file

SimpleOption<std::string>* tuner_file

File to load/store the tuner's values from.

Definition at line 169 of file CommonGraphOptions.h.

Referenced by CommonGraphOptions::CommonGraphOptions(), and arm_compute::utils::consume_common_graph_parameters().

◆ tuner_mode

◆ validation_file

SimpleOption<std::string>* validation_file

◆ validation_path

SimpleOption<std::string>* validation_path

◆ validation_range

SimpleOption<std::string>* validation_range

Validation range.

Definition at line 168 of file CommonGraphOptions.h.

Referenced by arm_compute::utils::consume_common_graph_parameters().


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