26 #include "../Framework.h" 27 #include "../printers/Printers.h" 41 iterations(parser.add_option<
SimpleOption<int>>(
"iterations", 1)),
45 throw_errors(parser.add_option<
ToggleOption>(
"throw-errors")),
46 color_output(parser.add_option<
ToggleOption>(
"color-output", isatty(STDOUT_FILENO))),
47 pretty_console(parser.add_option<
ToggleOption>(
"pretty-console", false)),
49 pretty_file(parser.add_option<
SimpleOption<
std::string>>(
"pretty-file")),
53 std::set<InstrumentsDescription> allowed_instruments
61 allowed_instruments.insert(
type);
64 std::set<LogFormat> supported_log_formats
71 std::set<LogLevel> supported_log_levels
89 log_format->
set_help(
"Output format for measurements and failures (affects only log-file)");
90 log_file->
set_help(
"Write output to file instead of to the console (affected by log-format)");
91 log_level->
set_help(
"Verbosity of the output");
100 std::vector<std::unique_ptr<Printer>> printers;
104 auto pretty_printer = std::make_unique<PrettyPrinter>();
106 printers.push_back(std::move(pretty_printer));
109 std::unique_ptr<Printer> printer;
113 printer = std::make_unique<JSONPrinter>();
119 auto pretty_printer = std::make_unique<PrettyPrinter>();
122 printer = std::move(pretty_printer);
129 if(printer !=
nullptr)
135 if(printer !=
nullptr)
137 printers.push_back(std::move(printer));
142 printers.push_back(std::make_unique<JSONPrinter>());
144 printers.back()->set_stream(*
log_streams.back().get());
149 printers.push_back(std::make_unique<PrettyPrinter>());
151 printers.back()->set_stream(*
log_streams.back().get());
arm_compute::utils::ToggleOption * help
Show help option.
arm_compute::utils::EnumOption< LogFormat > * log_format
Log format option.
Implementation of an option that can be either true or false.
arm_compute::utils::ToggleOption * color_output
Color output option.
Class to parse command line arguments.
decltype(strategy::transforms) typedef type
Copyright (c) 2017-2021 Arm Limited.
static Framework & get()
Access to the singleton.
T * add_option(const std::string &name, As &&... args)
Function to add a new option to the parser.
std::vector< std::unique_ptr< Printer > > create_printers()
Create the printers based on parsed command line options.
std::vector< std::shared_ptr< std::ofstream > > log_streams
Log streams.
std::set< InstrumentsDescription > available_instruments() const
Supported instrument types for benchmarking.
arm_compute::utils::SimpleOption< std::string > * pretty_file
Pretty output file option.
const T & value() const
Get the option value.
arm_compute::utils::SimpleOption< int > * iterations
Number of iterations option.
arm_compute::utils::EnumListOption< InstrumentsDescription > * instruments
Instruments option.
arm_compute::utils::EnumOption< LogLevel > * log_level
Logging level option.
bool is_set() const
Has a value been assigned to the option?
arm_compute::utils::SimpleOption< std::string > * log_file
Log file option.
const T & value() const
Get the selected value.
arm_compute::utils::ToggleOption * pretty_console
Pretty console option.
arm_compute::utils::SimpleOption< std::string > * json_file
JSON output file option.
Implementation of an option that accepts a single value.
void set_help(std::string help)
Set the help message for the option.
arm_compute::utils::ToggleOption * throw_errors
Throw errors option.