26 #include "../Framework.h" 27 #include "../printers/Printers.h" 30 #endif // !defined(_WIN64) 43 iterations(parser.add_option<
SimpleOption<int>>(
"iterations", 1)),
47 throw_errors(parser.add_option<
ToggleOption>(
"throw-errors")),
49 color_output(parser.add_option<
ToggleOption>(
"color-output", isatty(STDOUT_FILENO))),
51 pretty_console(parser.add_option<
ToggleOption>(
"pretty-console", false)),
53 pretty_file(parser.add_option<
SimpleOption<
std::string>>(
"pretty-file")),
57 std::set<InstrumentsDescription> allowed_instruments
65 allowed_instruments.insert(
type);
68 std::set<LogFormat> supported_log_formats
75 std::set<LogLevel> supported_log_levels
93 log_format->
set_help(
"Output format for measurements and failures (affects only log-file)");
94 log_file->
set_help(
"Write output to file instead of to the console (affected by log-format)");
95 log_level->
set_help(
"Verbosity of the output");
104 std::vector<std::unique_ptr<Printer>> printers;
108 auto pretty_printer = std::make_unique<PrettyPrinter>();
110 printers.push_back(std::move(pretty_printer));
113 std::unique_ptr<Printer> printer;
117 printer = std::make_unique<JSONPrinter>();
123 auto pretty_printer = std::make_unique<PrettyPrinter>();
126 printer = std::move(pretty_printer);
133 if(printer !=
nullptr)
139 if(printer !=
nullptr)
141 printers.push_back(std::move(printer));
146 printers.push_back(std::make_unique<JSONPrinter>());
148 printers.back()->set_stream(*
log_streams.back().get());
153 printers.push_back(std::make_unique<PrettyPrinter>());
155 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-2022 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.