MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / CommonGraphOptions

Method CommonGraphOptions

utils/CommonGraphOptions.cpp:119–185  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

117}
118
119CommonGraphOptions::CommonGraphOptions(CommandLineParser &parser)
120 : help(parser.add_option<ToggleOption>("help")),
121 threads(parser.add_option<SimpleOption<int>>("threads", 1)),
122 batches(parser.add_option<SimpleOption<int>>("batches", 1)),
123 target(),
124 data_type(),
125 data_layout(),
126 enable_tuner(parser.add_option<ToggleOption>("enable-tuner")),
127 enable_cl_cache(parser.add_option<ToggleOption>("enable-cl-cache")),
128 tuner_mode(),
129 fast_math_hint(parser.add_option<ToggleOption>("fast-math")),
130 data_path(parser.add_option<SimpleOption<std::string>>("data")),
131 image(parser.add_option<SimpleOption<std::string>>("image")),
132 labels(parser.add_option<SimpleOption<std::string>>("labels")),
133 validation_file(parser.add_option<SimpleOption<std::string>>("validation-file")),
134 validation_path(parser.add_option<SimpleOption<std::string>>("validation-path")),
135 validation_range(parser.add_option<SimpleOption<std::string>>("validation-range")),
136 tuner_file(parser.add_option<SimpleOption<std::string>>("tuner-file")),
137 mlgo_file(parser.add_option<SimpleOption<std::string>>("mlgo-file"))
138{
139 std::set<arm_compute::graph::Target> supported_targets{
140 Target::NEON,
141 Target::CL,
142 Target::CLVK,
143 };
144
145 std::set<arm_compute::DataType> supported_data_types{
146 DataType::F16,
147 DataType::F32,
148 DataType::QASYMM8,
149 DataType::QASYMM8_SIGNED,
150 };
151
152 std::set<DataLayout> supported_data_layouts{
153 DataLayout::NHWC,
154 DataLayout::NCHW,
155 };
156
157 const std::set<CLTunerMode> supported_tuner_modes{CLTunerMode::EXHAUSTIVE, CLTunerMode::NORMAL, CLTunerMode::RAPID};
158
159 target = parser.add_option<EnumOption<Target>>("target", supported_targets, Target::NEON);
160 data_type = parser.add_option<EnumOption<DataType>>("type", supported_data_types, DataType::F32);
161 data_layout = parser.add_option<EnumOption<DataLayout>>("layout", supported_data_layouts);
162 tuner_mode = parser.add_option<EnumOption<CLTunerMode>>("tuner-mode", supported_tuner_modes, CLTunerMode::NORMAL);
163
164 help->set_help("Show this help message");
165 threads->set_help("Number of threads to use");
166 batches->set_help("Number of batches to use for the inputs");
167 target->set_help("Target to execute on");
168 data_type->set_help("Data type to use");
169 data_layout->set_help("Data layout to use");
170 enable_tuner->set_help("Enable OpenCL dynamic tuner");
171 enable_cl_cache->set_help("Enable OpenCL program caches");
172 tuner_mode->set_help("Configures the time taken by the tuner to tune. "
173 "Exhaustive: slowest but produces the most performant LWS configuration. "
174 "Normal: slow but produces the LWS configurations on par with Exhaustive most of the time. "
175 "Rapid: fast but produces less performant LWS configurations");
176 fast_math_hint->set_help("Enable fast math");

Callers

nothing calls this directly

Calls 1

set_helpMethod · 0.80

Tested by

no test coverage detected