ArmNN
 21.02
ExecuteNetworkProgramOptions.hpp
Go to the documentation of this file.
1 //
2 // Copyright © 2020 Arm Ltd and Contributors. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #pragma once
7 
9 #include <armnn/IRuntime.hpp>
10 
11 /*
12  * Historically we use the ',' character to separate dimensions in a tensor shape. However, cxxopts will read this
13  * an an array of values which is fine until we have multiple tensors specified. This lumps the values of all shapes
14  * together in a single array and we cannot break it up again. We'll change the vector delimiter to a '.'. We do this
15  * as close as possible to the usage of cxxopts to avoid polluting other possible uses.
16  */
17 #define CXXOPTS_VECTOR_DELIMITER '.'
18 #include <cxxopts/cxxopts.hpp>
19 
20 /// Holds and parses program options for the ExecuteNetwork application
22 {
23  /// Initializes ProgramOptions by adding options to the underlying cxxopts::options object.
24  /// (Does not parse any options)
26 
27  /// Runs ParseOptions() on initialization
28  ProgramOptions(int ac, const char* av[]);
29 
30  /// Parses program options from the command line or another source and stores
31  /// the values in member variables. It also checks the validity of the parsed parameters.
32  /// Throws a cxxopts exception if parsing fails or an armnn exception if parameters are not valid.
33  void ParseOptions(int ac, const char* av[]);
34 
35  /// Ensures that the parameters for ExecuteNetwork fit together
37 
38  /// Ensures that the runtime options are valid
40 
41  cxxopts::Options m_CxxOptions;
42  cxxopts::ParseResult m_CxxResult;
43 
46 };
ExecuteNetworkParams m_ExNetParams
void ValidateExecuteNetworkParams()
Ensures that the parameters for ExecuteNetwork fit together.
armnn::IRuntime::CreationOptions m_RuntimeOptions
ProgramOptions()
Initializes ProgramOptions by adding options to the underlying cxxopts::options object.
Holds all parameters necessary to execute a network Check ExecuteNetworkProgramOptions.cpp for a description of each parameter.
void ParseOptions(int ac, const char *av[])
Parses program options from the command line or another source and stores the values in member variab...
Holds and parses program options for the ExecuteNetwork application.
void ValidateRuntimeOptions()
Ensures that the runtime options are valid.
cxxopts::ParseResult m_CxxResult