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

Function main

tests/main.cpp:100–388  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98} //namespace
99
100int main(int argc, char **argv)
101{
102 framework::Framework &framework = framework::Framework::get();
103
104 utils::CommandLineParser parser;
105
106 std::set<framework::DatasetMode> allowed_modes{framework::DatasetMode::DISABLED, framework::DatasetMode::PRECOMMIT,
107 framework::DatasetMode::NIGHTLY, framework::DatasetMode::ALL};
108
109 framework::CommonOptions options(parser);
110
111 auto dataset_mode = parser.add_option<utils::EnumOption<framework::DatasetMode>>("mode", allowed_modes,
112 framework::DatasetMode::PRECOMMIT);
113 dataset_mode->set_help("For managed datasets select which group to use");
114 auto filter = parser.add_option<utils::SimpleOption<std::string>>("filter", ".*");
115 filter->set_help("Regular expression to select test cases");
116 auto filter_id = parser.add_option<utils::SimpleOption<std::string>>("filter-id");
117 filter_id->set_help("List of test ids. ... can be used to define a range.");
118 auto stop_on_error = parser.add_option<utils::ToggleOption>("stop-on-error");
119 stop_on_error->set_help("Stop execution after the first failed test (useful for debugging)");
120 auto seed = parser.add_option<utils::SimpleOption<std::random_device::result_type>>("seed");
121 seed->set_help(
122 "Global seed for random number generation. When not set, each test iteration will use different random seed");
123 auto list_tests = parser.add_option<utils::ToggleOption>("list-tests", false);
124 list_tests->set_help("List all test names");
125 auto test_instruments = parser.add_option<utils::ToggleOption>("test-instruments", false);
126 test_instruments->set_help("Test if the instruments work on the platform");
127 auto error_on_missing_assets = parser.add_option<utils::ToggleOption>("error-on-missing-assets", false);
128 error_on_missing_assets->set_help("Mark a test as failed instead of skipping it when assets are missing");
129 auto assets = parser.add_positional_option<utils::SimpleOption<std::string>>("assets");
130 assets->set_help("Path to the assets directory");
131 auto print_rerun_command = parser.add_option<utils::ToggleOption>("rerun-cmd");
132 print_rerun_command->set_help("Print out the command to rerun the exact failed testcase");
133#ifdef ARM_COMPUTE_CL
134 auto enable_tuner = parser.add_option<utils::ToggleOption>("enable-tuner");
135 enable_tuner->set_help("Enable OpenCL dynamic tuner");
136
137 const std::set<CLTunerMode> supported_tuner_modes{CLTunerMode::EXHAUSTIVE, CLTunerMode::NORMAL, CLTunerMode::RAPID};
138 auto tuner_mode =
139 parser.add_option<utils::EnumOption<CLTunerMode>>("tuner-mode", supported_tuner_modes, CLTunerMode::NORMAL);
140 tuner_mode->set_help(
141 "Configures the time taken by the tuner to tune. Slow tuner produces the most performant LWS configuration");
142
143 auto tuner_file = parser.add_option<utils::SimpleOption<std::string>>("tuner-file", "");
144 tuner_file->set_help("File to load/save CLTuner values");
145
146 auto mlgo_file = parser.add_option<utils::SimpleOption<std::string>>("mlgo-file", "");
147 mlgo_file->set_help("File to load MLGO heuristics");
148#endif /* ARM_COMPUTE_CL */
149 auto threads = parser.add_option<utils::SimpleOption<int>>("threads", 1);
150 threads->set_help("Number of threads to use");
151 auto cooldown_sec = parser.add_option<utils::SimpleOption<float>>("delay", -1.f);
152 cooldown_sec->set_help("Delay to add between test executions in seconds");
153 auto configure_only = parser.add_option<utils::ToggleOption>("configure-only", false);
154 configure_only->set_help(
155 "Only configures kernels, without allocating, running or validating. Needed in order to validate OpenCL kernel "
156 "run-time compilation, without necessarily running or validating the kernels' execution");
157 auto print_iterations_figures = parser.add_option<utils::ToggleOption>("print_iterations_figures", false);

Callers

nothing calls this directly

Calls 15

opencl_is_availableFunction · 0.85
build_informationFunction · 0.85
cpu_model_to_stringFunction · 0.85
set_helpMethod · 0.80
is_setMethod · 0.80
print_helpMethod · 0.80
create_printersMethod · 0.80
set_schedulerMethod · 0.80
set_cpu_ctxMethod · 0.80
set_tune_new_kernelsMethod · 0.80

Tested by

no test coverage detected