24 #ifndef ARM_COMPUTE_TEST_ENUMOPTION 25 #define ARM_COMPUTE_TEST_ENUMOPTION 58 EnumOption(std::string name, std::set<T> allowed_values, T default_value);
61 std::string
help()
const override;
67 const T &
value()
const;
70 std::set<T> _allowed_values{};
75 :
SimpleOption<T>{ std::move(name) }, _allowed_values{ std::move(allowed_values) }
81 :
SimpleOption<T>{ std::move(name), std::move(default_value) }, _allowed_values{ std::move(allowed_values) }
90 std::stringstream stream{ value };
93 stream >> typed_value;
97 if(_allowed_values.count(typed_value) == 0)
102 this->_value = std::move(typed_value);
103 this->_is_set =
true;
109 catch(
const std::invalid_argument &)
115 template <
typename T>
118 std::stringstream msg;
119 msg <<
"--" + this->
name() +
"={";
121 for(
const auto &value : _allowed_values)
126 msg <<
"} - " << this->_help;
131 template <
typename T>
EnumOption(std::string name, std::set< T > allowed_values)
Construct option with allowed values.
Implementation of an option that accepts a single value.
std::string help() const override
Help message for the option.
This file contains all available output stages for GEMMLowp on OpenCL.
const T & value() const
Get the selected value.
std::string name() const
Name of the option.
Implementation of a simple option that accepts a value from a fixed set.
bool parse(std::string value) override
Parses the given string.