Compute Library
 22.05
CommonGraphValidateOptions Class Reference

CommonGraphValidateOptions command line options used to configure the graph examples. More...

#include <graph_validate_utils.h>

Collaboration diagram for CommonGraphValidateOptions:
[legend]

Public Member Functions

 CommonGraphValidateOptions (CommandLineParser &parser) noexcept
 
 CommonGraphValidateOptions (const CommonGraphValidateOptions &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
CommonGraphValidateOptionsoperator= (const CommonGraphValidateOptions &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
 CommonGraphValidateOptions (CommonGraphValidateOptions &&) noexcept(true)=default
 Allow instances of this class to be moved. More...
 
CommonGraphValidateOptionsoperator= (CommonGraphValidateOptions &&) noexcept(true)=default
 Allow instances of this class to be moved. More...
 
virtual ~CommonGraphValidateOptions ()=default
 Default destructor. More...
 
void consume_common_parameters (CommonParams &common_params)
 
virtual void print_parameters (::std::ostream &os, const ExampleParams &common_params)
 Formatted output of the ExampleParams type. More...
 

Data Fields

ToggleOptionhelp
 show help message More...
 
SimpleOption< int > * threads
 Number of threads option. More...
 
EnumOption< arm_compute::graph::Target > * target
 Graph execution target. More...
 
EnumOption< arm_compute::DataType > * data_type
 Graph data type. More...
 
SimpleOption< float > * absolute_tolerance
 Absolute tolerance used in verification. More...
 
SimpleOption< float > * relative_tolerance
 Relative tolerance used in verification. More...
 
SimpleOption< float > * tolerance_number
 Tolerance number used in verification. More...
 

Detailed Description

CommonGraphValidateOptions command line options used to configure the graph examples.

(Similar to common options) The options in this object get populated when "parse()" is called on the parser used to construct it. The expected workflow is:

CommandLineParser parser; CommonOptions options( parser ); parser.parse(argc, argv);

Definition at line 227 of file graph_validate_utils.h.

Constructor & Destructor Documentation

◆ CommonGraphValidateOptions() [1/3]

CommonGraphValidateOptions ( CommandLineParser parser)
inlineexplicitnoexcept

Definition at line 230 of file graph_validate_utils.h.

References arm_compute::graph::CL, arm_compute::test::validation::data_type, arm_compute::F16, arm_compute::F32, GemmTuner::help, arm_compute::graph::NEON, GemmTuner::parser, arm_compute::QASYMM8, and Option::set_help().

231  : help(parser.add_option<ToggleOption>("help")),
232  threads(parser.add_option<SimpleOption<int>>("threads")),
233  target(),
234  data_type(),
235  absolute_tolerance(parser.add_option<SimpleOption<float>>("abs_tolerance", -1.0f)),
236  relative_tolerance(parser.add_option<SimpleOption<float>>("rel_tolerance", -1.0f)),
237  tolerance_number(parser.add_option<SimpleOption<float>>("tolerance_num", -1.0f))
238  {
239  const std::set<arm_compute::graph::Target> supported_targets
240  {
243  };
244 
245  const std::set<arm_compute::DataType> supported_data_types
246  {
250  };
251 
252  target = parser.add_option<EnumOption<arm_compute::graph::Target>>("target", supported_targets, arm_compute::graph::Target::NEON);
253  data_type = parser.add_option<EnumOption<DataType>>("type", supported_data_types, DataType::F32);
254 
255  target->set_help("Target to execute on");
256  data_type->set_help("Data type to use");
257  help->set_help("Show this help message");
258  absolute_tolerance->set_help("Absolute tolerance used for verification");
259  relative_tolerance->set_help("Absolute tolerance used for verification");
260  tolerance_number->set_help("Absolute tolerance used for verification");
261  }
Arm® Neon™ capable target device.
1 channel, 1 F32 per channel
1 channel, 1 F16 per channel
quantized, asymmetric fixed-point 8-bit number unsigned
SimpleOption< float > * absolute_tolerance
Absolute tolerance used in verification.
EnumOption< arm_compute::graph::Target > * target
Graph execution target.
SimpleOption< int > * threads
Number of threads option.
EnumOption< arm_compute::DataType > * data_type
Graph data type.
SimpleOption< float > * tolerance_number
Tolerance number used in verification.
OpenCL capable target device.
void set_help(std::string help)
Set the help message for the option.
Definition: Option.h:125
SimpleOption< float > * relative_tolerance
Relative tolerance used in verification.

◆ CommonGraphValidateOptions() [2/3]

Prevent instances of this class from being copied (As this class contains pointers)

◆ CommonGraphValidateOptions() [3/3]

Allow instances of this class to be moved.

◆ ~CommonGraphValidateOptions()

virtual ~CommonGraphValidateOptions ( )
virtualdefault

Default destructor.

Member Function Documentation

◆ consume_common_parameters()

void consume_common_parameters ( CommonParams common_params)
inline

Definition at line 274 of file graph_validate_utils.h.

References VerificationParams::absolute_tolerance, CommonParams::common_params, FrameworkParams::help, GemmTuner::help, VerificationParams::relative_tolerance, FrameworkParams::target, FrameworkParams::threads, VerificationParams::tolerance_number, and CommonParams::verification.

275  {
276  common_params.common_params.help = help->is_set() ? help->value() : false;
277  common_params.common_params.threads = threads->value();
278  common_params.common_params.target = target->value();
279 
280  common_params.verification.absolute_tolerance = absolute_tolerance->value();
281  common_params.verification.relative_tolerance = relative_tolerance->value();
282  common_params.verification.tolerance_number = tolerance_number->value();
283  }
const T & value() const
Get the option value.
Definition: SimpleOption.h:112
SimpleOption< float > * absolute_tolerance
Absolute tolerance used in verification.
EnumOption< arm_compute::graph::Target > * target
Graph execution target.
SimpleOption< int > * threads
Number of threads option.
bool is_set() const
Has a value been assigned to the option?
Definition: Option.h:135
const T & value() const
Get the selected value.
SimpleOption< float > * tolerance_number
Tolerance number used in verification.
SimpleOption< float > * relative_tolerance
Relative tolerance used in verification.

◆ operator=() [1/2]

CommonGraphValidateOptions& operator= ( const CommonGraphValidateOptions )
delete

Prevent instances of this class from being copied (As this class contains pointers)

◆ operator=() [2/2]

CommonGraphValidateOptions& operator= ( CommonGraphValidateOptions &&  )
defaultnoexcept

Allow instances of this class to be moved.

◆ print_parameters()

virtual void print_parameters ( ::std::ostream &  os,
const ExampleParams common_params 
)
inlinevirtual

Formatted output of the ExampleParams type.

Parameters
[out]osOutput stream.
[in]common_paramsExample parameters to output
Returns
None.

Definition at line 292 of file graph_validate_utils.h.

References CommonParams::common_params, CommonParams::data_type, FrameworkParams::target, and FrameworkParams::threads.

293  {
294  os << "Threads : " << common_params.common_params.threads << std::endl;
295  os << "Target : " << common_params.common_params.target << std::endl;
296  os << "Data type : " << common_params.data_type << std::endl;
297  }

Field Documentation

◆ absolute_tolerance

SimpleOption<float>* absolute_tolerance

Absolute tolerance used in verification.

Definition at line 303 of file graph_validate_utils.h.

Referenced by arm_compute::utils::consume_common_graph_parameters().

◆ data_type

Graph data type.

Definition at line 302 of file graph_validate_utils.h.

◆ help

ToggleOption* help

show help message

Definition at line 299 of file graph_validate_utils.h.

Referenced by arm_compute::utils::consume_common_graph_parameters().

◆ relative_tolerance

SimpleOption<float>* relative_tolerance

Relative tolerance used in verification.

Definition at line 304 of file graph_validate_utils.h.

Referenced by arm_compute::utils::consume_common_graph_parameters().

◆ target

Graph execution target.

Definition at line 301 of file graph_validate_utils.h.

Referenced by arm_compute::utils::consume_common_graph_parameters().

◆ threads

SimpleOption<int>* threads

Number of threads option.

Definition at line 300 of file graph_validate_utils.h.

Referenced by arm_compute::utils::consume_common_graph_parameters().

◆ tolerance_number

SimpleOption<float>* tolerance_number

Tolerance number used in verification.

Definition at line 305 of file graph_validate_utils.h.

Referenced by arm_compute::utils::consume_common_graph_parameters().


The documentation for this class was generated from the following file: