blob: 7e366a7664353f454a3e277034f86cc489567161 [file] [log] [blame]
Jim Flynn3091b062019-02-15 14:45:04 +00001//
2// Copyright © 2017 Arm Ltd. All rights reserved.
3// SPDX-License-Identifier: MIT
4//
5#pragma once
6
7#include <string>
8#include <iostream>
9
10namespace armnnQuantizer
11{
12
13// parses the command line to extract
14// * the input file -f containing the serialized fp32 ArmNN input graph (must exist...and be a input graph file)
Sadik Armagan2b03d642019-04-12 15:17:02 +010015// * the csv file -c <optional> detailing the paths for RAW input tensors to use for refinement
Jim Flynn3091b062019-02-15 14:45:04 +000016// * the directory -d to place the output file into (must already exist and be writable)
17// * the name of the file -o the quantized ArmNN input graph will be written to (must not already exist)
18// * LATER: the min and max overrides to be applied to the inputs
19// specified as -i <int> (input id) -n <float> (minimum) -x <float> (maximum)
20// multiple sets of -i, -n, -x can appear on the command line but they must match
21// in number i.e. a -n and -x for each -i and the id of the input must correspond
22// to an input layer in the fp32 graph when it is loaded.
23class CommandLineProcessor
24{
25public:
26 bool ProcessCommandLine(int argc, char* argv[]);
27
28 std::string GetInputFileName() {return m_InputFileName;}
Sadik Armagan2b03d642019-04-12 15:17:02 +010029 std::string GetCsvFileName() {return m_CsvFileName;}
30 std::string GetCsvFileDirectory() {return m_CsvFileDirectory;}
Jim Flynn3091b062019-02-15 14:45:04 +000031 std::string GetOutputDirectoryName() {return m_OutputDirectory;}
32 std::string GetOutputFileName() {return m_OutputFileName;}
Sadik Armagandc2f7f42019-04-26 17:11:47 +010033 std::string GetQuantizationScheme() {return m_QuantizationScheme;}
Jim Flynn3091b062019-02-15 14:45:04 +000034private:
35 std::string m_InputFileName;
Sadik Armagan2b03d642019-04-12 15:17:02 +010036 std::string m_CsvFileName;
37 std::string m_CsvFileDirectory;
Jim Flynn3091b062019-02-15 14:45:04 +000038 std::string m_OutputDirectory;
39 std::string m_OutputFileName;
Sadik Armagandc2f7f42019-04-26 17:11:47 +010040 std::string m_QuantizationScheme;
Jim Flynn3091b062019-02-15 14:45:04 +000041};
42
43} // namespace armnnQuantizer
44