9 #if defined(ARMNN_SERIALIZER) 12 #if defined(ARMNN_CAFFE_PARSER) 15 #if defined(ARMNN_TF_PARSER) 18 #if defined(ARMNN_TF_LITE_PARSER) 21 #if defined(ARMNN_ONNX_PARSER) 25 #include "../InferenceTest.hpp" 30 #include <boost/program_options.hpp> 31 #include <boost/variant.hpp> 44 namespace po = boost::program_options;
46 template<
typename T,
typename TParseElementFunc>
47 std::vector<T> ParseArrayImpl(std::istream& stream, TParseElementFunc parseElementFunc,
const char * chars =
"\t ,:")
49 std::vector<T> result;
52 while (std::getline(stream, line))
55 for (
const std::string& token : tokens)
61 result.push_back(parseElementFunc(token));
63 catch (
const std::exception&)
65 ARMNN_LOG(error) <<
"'" << token <<
"' is not a valid number. It has been ignored.";
74 bool CheckOption(
const po::variables_map& vm,
78 if (option ==
nullptr)
84 return vm.find(option) != vm.end();
87 void CheckOptionDependency(
const po::variables_map& vm,
92 if (option ==
nullptr || required ==
nullptr)
94 throw po::error(
"Invalid option to check dependency for");
98 if (CheckOption(vm, option) && !vm[option].defaulted())
100 if (CheckOption(vm, required) == 0 || vm[required].defaulted())
102 throw po::error(std::string(
"Option '") + option +
"' requires option '" + required +
"'.");
107 void CheckOptionDependencies(
const po::variables_map& vm)
109 CheckOptionDependency(vm,
"model-path",
"model-format");
110 CheckOptionDependency(vm,
"model-path",
"input-name");
111 CheckOptionDependency(vm,
"model-path",
"output-name");
112 CheckOptionDependency(vm,
"input-tensor-shape",
"model-path");
115 template<armnn::DataType NonQuantizedType>
116 auto ParseDataArray(std::istream & stream);
118 template<armnn::DataType QuantizedType>
119 auto ParseDataArray(std::istream& stream,
120 const float& quantizationScale,
121 const int32_t& quantizationOffset);
124 auto ParseDataArray<armnn::DataType::Float32>(std::istream & stream)
126 return ParseArrayImpl<float>(stream, [](
const std::string& s) {
return std::stof(s); });
130 auto ParseDataArray<armnn::DataType::Signed32>(std::istream & stream)
132 return ParseArrayImpl<int>(stream, [](
const std::string & s) {
return std::stoi(s); });
136 auto ParseDataArray<armnn::DataType::QAsymmU8>(std::istream& stream)
138 return ParseArrayImpl<uint8_t>(stream,
143 auto ParseDataArray<armnn::DataType::QAsymmU8>(std::istream& stream,
144 const float& quantizationScale,
145 const int32_t& quantizationOffset)
147 return ParseArrayImpl<uint8_t>(stream,
148 [&quantizationScale, &quantizationOffset](
const std::string & s)
151 armnn::Quantize<uint8_t>(std::stof(s),
153 quantizationOffset));
156 std::vector<unsigned int> ParseArray(std::istream& stream)
158 return ParseArrayImpl<unsigned int>(stream,
162 std::vector<std::string> ParseStringList(
const std::string & inputString,
const char * delimiter)
164 std::stringstream stream(inputString);
165 return ParseArrayImpl<std::string>(stream, [](
const std::string& s) {
169 void RemoveDuplicateDevices(std::vector<armnn::BackendId>& computeDevices)
172 for (
auto i = computeDevices.begin(); i != computeDevices.end(); ++i)
174 for (
auto j = std::next(i); j != computeDevices.end(); ++j)
185 computeDevices.end());
188 struct TensorPrinter :
public boost::static_visitor<>
190 TensorPrinter(
const std::string& binding,
192 const std::string& outputTensorFile,
193 bool dequantizeOutput)
194 : m_OutputBinding(binding)
195 , m_Scale(info.GetQuantizationScale())
196 , m_Offset(info.GetQuantizationOffset())
197 , m_OutputTensorFile(outputTensorFile)
198 , m_DequantizeOutput(dequantizeOutput)
201 void operator()(
const std::vector<float>& values)
203 ForEachValue(values, [](
float value)
205 printf(
"%f ", value);
210 void operator()(
const std::vector<uint8_t>& values)
212 if(m_DequantizeOutput)
214 auto& scale = m_Scale;
215 auto& offset = m_Offset;
216 std::vector<float> dequantizedValues;
217 ForEachValue(values, [&scale, &offset, &dequantizedValues](uint8_t value)
220 printf(
"%f ", dequantizedValue);
221 dequantizedValues.push_back(dequantizedValue);
223 WriteToFile(dequantizedValues);
227 const std::vector<int> intValues(values.begin(), values.end());
228 operator()(intValues);
232 void operator()(
const std::vector<int>& values)
234 ForEachValue(values, [](
int value)
236 printf(
"%d ", value);
242 template<
typename Container,
typename Delegate>
243 void ForEachValue(
const Container& c, Delegate delegate)
245 std::cout << m_OutputBinding <<
": ";
246 for (
const auto& value : c)
254 void WriteToFile(
const std::vector<T>& values)
256 if (!m_OutputTensorFile.empty())
258 std::ofstream outputTensorFile;
259 outputTensorFile.open(m_OutputTensorFile, std::ofstream::out | std::ofstream::trunc);
260 if (outputTensorFile.is_open())
262 outputTensorFile << m_OutputBinding <<
": ";
263 std::copy(values.begin(), values.end(), std::ostream_iterator<T>(outputTensorFile,
" "));
267 ARMNN_LOG(info) <<
"Output Tensor File: " << m_OutputTensorFile <<
" could not be opened!";
269 outputTensorFile.close();
273 std::string m_OutputBinding;
276 std::string m_OutputTensorFile;
277 bool m_DequantizeOutput =
false;
282 template<armnn::DataType ArmnnType,
typename T = armnn::ResolveType<ArmnnType>>
283 std::vector<T> GenerateDummyTensorData(
unsigned int numElements)
285 return std::vector<T>(numElements,
static_cast<T
>(0));
288 using TContainer = boost::variant<std::vector<float>, std::vector<int>, std::vector<unsigned char>>;
291 void PopulateTensorWithData(
TContainer& tensorData,
292 unsigned int numElements,
293 const std::string& dataTypeStr,
297 const bool readFromFile = dataFile.
has_value() && !dataFile.
value().empty();
298 const bool quantizeData = qParams.
has_value();
300 std::ifstream inputTensorFile;
303 inputTensorFile = std::ifstream(dataFile.
value());
306 if (dataTypeStr.compare(
"float") == 0)
310 const float qScale = qParams.
value().first;
311 const int qOffset = qParams.
value().second;
313 tensorData = readFromFile ?
314 ParseDataArray<armnn::DataType::QAsymmU8>(inputTensorFile, qScale, qOffset) :
315 GenerateDummyTensorData<armnn::DataType::QAsymmU8>(numElements);
319 tensorData = readFromFile ?
320 ParseDataArray<armnn::DataType::Float32>(inputTensorFile) :
321 GenerateDummyTensorData<armnn::DataType::Float32>(numElements);
324 else if (dataTypeStr.compare(
"int") == 0)
326 tensorData = readFromFile ?
327 ParseDataArray<armnn::DataType::Signed32>(inputTensorFile) :
328 GenerateDummyTensorData<armnn::DataType::Signed32>(numElements);
330 else if (dataTypeStr.compare(
"qasymm8") == 0)
332 tensorData = readFromFile ?
333 ParseDataArray<armnn::DataType::QAsymmU8>(inputTensorFile) :
334 GenerateDummyTensorData<armnn::DataType::QAsymmU8>(numElements);
338 std::string errorMessage =
"Unsupported tensor data type " + dataTypeStr;
341 inputTensorFile.close();
345 inputTensorFile.close();
375 bool m_EnableLayerDetails =
false;
377 bool m_ParseUnsupported =
false;
378 bool m_InferOutputShape =
false;
381 template<
typename TParser,
typename TDataType>
383 const std::shared_ptr<armnn::IRuntime>& runtime =
nullptr,
384 size_t iterations = 1)
386 using TContainer = boost::variant<std::vector<float>, std::vector<int>, std::vector<unsigned char>>;
388 std::vector<TContainer> inputDataContainers;
428 for(
unsigned int i = 0; i < numInputs; ++i)
447 PopulateTensorWithData(tensorData,
453 inputDataContainers.push_back(tensorData);
457 std::vector<TContainer> outputDataContainers;
459 for (
unsigned int i = 0; i < numOutputs; ++i)
463 outputDataContainers.push_back(std::vector<float>(model.
GetOutputSize(i)));
467 outputDataContainers.push_back(std::vector<int>(model.
GetOutputSize(i)));
471 outputDataContainers.push_back(std::vector<uint8_t>(model.
GetOutputSize(i)));
480 for (
size_t x = 0; x < iterations; x++)
483 auto inference_duration = model.
Run(inputDataContainers, outputDataContainers);
487 ARMNN_LOG(warning) <<
"The input data was generated, note that the output will not be useful";
492 for (
size_t i = 0; i < numOutputs; i++)
501 boost::apply_visitor(printer, outputDataContainers[i]);
504 ARMNN_LOG(info) <<
"\nInference time: " << std::setprecision(2)
505 << std::fixed << inference_duration.count() <<
" ms\n";
510 ARMNN_LOG(info) <<
"Threshold time: " << std::setprecision(2)
512 auto thresholdMinusInference = params.
m_ThresholdTime - inference_duration.count();
513 ARMNN_LOG(info) <<
"Threshold time - Inference time: " << std::setprecision(2)
514 << std::fixed << thresholdMinusInference <<
" ms" <<
"\n";
516 if (thresholdMinusInference < 0)
518 std::string errorMessage =
"Elapsed inference time is greater than provided threshold time.";
535 const std::string& inputTensorShapesStr,
536 const vector<armnn::BackendId>& computeDevices,
537 const std::string& dynamicBackendsPath,
538 const std::string& path,
539 const std::string& inputNames,
540 const std::string& inputTensorDataFilePaths,
541 const std::string& inputTypes,
543 const std::string& outputTypes,
544 const std::string& outputNames,
545 const std::string& outputTensorFiles,
546 bool dequantizeOuput,
547 bool enableProfiling,
548 bool enableFp16TurboMode,
549 bool enableBf16TurboMode,
550 const double& thresholdTime,
551 bool printIntermediate,
552 const size_t subgraphId,
553 bool enableLayerDetails =
false,
554 bool parseUnsupported =
false,
555 bool inferOutputShape =
false,
556 const size_t iterations = 1,
557 const std::shared_ptr<armnn::IRuntime>& runtime =
nullptr)
561 std::vector<std::string> inputNamesVector = ParseStringList(inputNames,
",");
562 std::vector<std::string> inputTensorShapesVector = ParseStringList(inputTensorShapesStr,
":");
563 std::vector<std::string> inputTensorDataFilePathsVector = ParseStringList(
564 inputTensorDataFilePaths,
",");
565 std::vector<std::string> outputNamesVector = ParseStringList(outputNames,
",");
566 std::vector<std::string> inputTypesVector = ParseStringList(inputTypes,
",");
567 std::vector<std::string> outputTypesVector = ParseStringList(outputTypes,
",");
568 std::vector<std::string> outputTensorFilesVector = ParseStringList(outputTensorFiles,
",");
572 if (modelFormat.find(
"bin") != std::string::npos)
574 isModelBinary =
true;
576 else if (modelFormat.find(
"txt") != std::string::npos || modelFormat.find(
"text") != std::string::npos)
578 isModelBinary =
false;
582 ARMNN_LOG(fatal) <<
"Unknown model format: '" << modelFormat <<
"'. Please include 'binary' or 'text'";
586 if ((inputTensorShapesVector.size() != 0) && (inputTensorShapesVector.size() != inputNamesVector.size()))
588 ARMNN_LOG(fatal) <<
"input-name and input-tensor-shape must have the same amount of elements.";
592 if ((inputTensorDataFilePathsVector.size() != 0) &&
593 (inputTensorDataFilePathsVector.size() != inputNamesVector.size()))
595 ARMNN_LOG(fatal) <<
"input-name and input-tensor-data must have the same amount of elements.";
599 if ((outputTensorFilesVector.size() != 0) &&
600 (outputTensorFilesVector.size() != outputNamesVector.size()))
602 ARMNN_LOG(fatal) <<
"output-name and write-outputs-to-file must have the same amount of elements.";
606 if (inputTypesVector.size() == 0)
609 inputTypesVector.assign(inputNamesVector.size(),
"float");
611 else if ((inputTypesVector.size() != 0) && (inputTypesVector.size() != inputNamesVector.size()))
613 ARMNN_LOG(fatal) <<
"input-name and input-type must have the same amount of elements.";
617 if (outputTypesVector.size() == 0)
620 outputTypesVector.assign(outputNamesVector.size(),
"float");
622 else if ((outputTypesVector.size() != 0) && (outputTypesVector.size() != outputNamesVector.size()))
624 ARMNN_LOG(fatal) <<
"output-name and output-type must have the same amount of elements.";
629 std::vector<std::unique_ptr<armnn::TensorShape>> inputTensorShapes;
631 if (!inputTensorShapesVector.empty())
633 inputTensorShapes.reserve(inputTensorShapesVector.size());
635 for(
const std::string& shape : inputTensorShapesVector)
637 std::stringstream ss(shape);
638 std::vector<unsigned int> dims = ParseArray(ss);
643 inputTensorShapes.push_back(
644 std::make_unique<armnn::TensorShape>(static_cast<unsigned int>(dims.size()), dims.data()));
648 ARMNN_LOG(fatal) <<
"Cannot create tensor shape: " << e.
what();
655 if (thresholdTime < 0)
657 ARMNN_LOG(fatal) <<
"Threshold time supplied as a command line argument is less than zero.";
689 ARMNN_LOG(warning) <<
"No input files provided, input tensors will be filled with 0s.";
693 if (modelFormat.find(
"armnn") != std::string::npos)
695 #if defined(ARMNN_SERIALIZER) 696 return MainImpl<armnnDeserializer::IDeserializer, float>(params, runtime, iterations);
698 ARMNN_LOG(fatal) <<
"Not built with serialization support.";
702 else if (modelFormat.find(
"caffe") != std::string::npos)
704 #if defined(ARMNN_CAFFE_PARSER) 705 return MainImpl<armnnCaffeParser::ICaffeParser, float>(params, runtime, iterations);
707 ARMNN_LOG(fatal) <<
"Not built with Caffe parser support.";
711 else if (modelFormat.find(
"onnx") != std::string::npos)
713 #if defined(ARMNN_ONNX_PARSER) 714 return MainImpl<armnnOnnxParser::IOnnxParser, float>(params, runtime, iterations);
716 ARMNN_LOG(fatal) <<
"Not built with Onnx parser support.";
720 else if (modelFormat.find(
"tensorflow") != std::string::npos)
722 #if defined(ARMNN_TF_PARSER) 723 return MainImpl<armnnTfParser::ITfParser, float>(params, runtime, iterations);
725 ARMNN_LOG(fatal) <<
"Not built with Tensorflow parser support.";
729 else if(modelFormat.find(
"tflite") != std::string::npos)
731 #if defined(ARMNN_TF_LITE_PARSER) 734 ARMNN_LOG(fatal) <<
"Unknown model format: '" << modelFormat
735 <<
"'. Only 'binary' format supported for tflite files";
738 return MainImpl<armnnTfLiteParser::ITfLiteParser, float>(params, runtime, iterations);
740 ARMNN_LOG(fatal) <<
"Unknown model format: '" << modelFormat
741 <<
"'. Please include 'caffe', 'tensorflow', 'tflite' or 'onnx'";
747 ARMNN_LOG(fatal) <<
"Unknown model format: '" << modelFormat
748 <<
"'. Please include 'caffe', 'tensorflow', 'tflite' or 'onnx'";
754 const bool enableProfiling,
const bool enableFp16TurboMode,
const bool enableBf16TurboMode,
755 const double& thresholdTime,
const bool printIntermediate,
bool enableLayerDetails =
false,
756 bool parseUnuspported =
false,
bool inferOutputShape =
false)
759 std::string modelFormat;
760 std::string modelPath;
761 std::string inputNames;
762 std::string inputTensorShapes;
763 std::string inputTensorDataFilePaths;
764 std::string outputNames;
765 std::string inputTypes;
766 std::string outputTypes;
767 std::string dynamicBackendsPath;
768 std::string outputTensorFiles;
770 size_t subgraphId = 0;
772 const std::string backendsMessage = std::string(
"The preferred order of devices to run layers on by default. ")
773 + std::string(
"Possible choices: ")
776 po::options_description desc(
"Options");
780 (
"model-format,f", po::value(&modelFormat),
781 "armnn-binary, caffe-binary, caffe-text, tflite-binary, onnx-binary, onnx-text, tensorflow-binary or " 783 (
"model-path,m", po::value(&modelPath),
"Path to model file, e.g. .armnn, .caffemodel, .prototxt, " 785 (
"compute,c", po::value<std::vector<armnn::BackendId>>()->multitoken(),
786 backendsMessage.c_str())
787 (
"dynamic-backends-path,b", po::value(&dynamicBackendsPath),
788 "Path where to load any available dynamic backend from. " 789 "If left empty (the default), dynamic backends will not be used.")
790 (
"input-name,i", po::value(&inputNames),
"Identifier of the input tensors in the network separated by comma.")
791 (
"subgraph-number,n", po::value<size_t>(&subgraphId)->default_value(0),
"Id of the subgraph to be " 792 "executed. Defaults to 0.")
793 (
"input-tensor-shape,s", po::value(&inputTensorShapes),
794 "The shape of the input tensors in the network as a flat array of integers separated by comma. " 795 "Several shapes can be passed separating them by semicolon. " 796 "This parameter is optional, depending on the network.")
797 (
"input-tensor-data,d", po::value(&inputTensorDataFilePaths)->default_value(
""),
798 "Path to files containing the input data as a flat array separated by whitespace. " 799 "Several paths can be passed separating them by comma. If not specified, the network will be run with dummy " 800 "data (useful for profiling).")
801 (
"input-type,y",po::value(&inputTypes),
"The type of the input tensors in the network separated by comma. " 802 "If unset, defaults to \"float\" for all defined inputs. " 803 "Accepted values (float, int or qasymm8).")
804 (
"quantize-input,q",po::bool_switch()->default_value(
false),
805 "If this option is enabled, all float inputs will be quantized to qasymm8. " 806 "If unset, default to not quantized. " 807 "Accepted values (true or false)")
808 (
"output-type,z",po::value(&outputTypes),
"The type of the output tensors in the network separated by comma. " 809 "If unset, defaults to \"float\" for all defined outputs. " 810 "Accepted values (float, int or qasymm8).")
811 (
"output-name,o", po::value(&outputNames),
812 "Identifier of the output tensors in the network separated by comma.")
813 (
"dequantize-output,l",po::bool_switch()->default_value(
false),
814 "If this option is enabled, all quantized outputs will be dequantized to float. " 815 "If unset, default to not get dequantized. " 816 "Accepted values (true or false)")
817 (
"write-outputs-to-file,w", po::value(&outputTensorFiles),
818 "Comma-separated list of output file paths keyed with the binding-id of the output slot. " 819 "If left empty (the default), the output tensors will not be written to a file.");
821 catch (
const std::exception& e)
827 ARMNN_LOG(fatal) <<
"Fatal internal error: " << e.what();
831 std::vector<const char*> clOptions;
832 clOptions.reserve(csvRow.
values.size());
833 for (
const std::string& value : csvRow.
values)
835 clOptions.push_back(value.c_str());
838 po::variables_map vm;
841 po::store(po::parse_command_line(static_cast<int>(clOptions.size()), clOptions.data(), desc), vm);
845 CheckOptionDependencies(vm);
847 catch (
const po::error& e)
849 std::cerr << e.what() << std::endl << std::endl;
850 std::cerr << desc << std::endl;
855 bool quantizeInput = vm[
"quantize-input"].as<
bool>();
856 bool dequantizeOutput = vm[
"dequantize-output"].as<
bool>();
859 std::vector<armnn::BackendId> computeDevices = vm[
"compute"].as<std::vector<armnn::BackendId>>();
862 RemoveDuplicateDevices(computeDevices);
865 std::string invalidBackends;
868 ARMNN_LOG(fatal) <<
"The list of preferred devices contains invalid backend IDs: " 873 return RunTest(modelFormat, inputTensorShapes, computeDevices, dynamicBackendsPath, modelPath, inputNames,
874 inputTensorDataFilePaths, inputTypes, quantizeInput, outputTypes, outputNames, outputTensorFiles,
875 dequantizeOutput, enableProfiling, enableFp16TurboMode, enableBf16TurboMode,
876 thresholdTime, printIntermediate, subgraphId, enableLayerDetails, parseUnuspported,
880 #if defined(ARMCOMPUTECL_ENABLED) 882 const int tuningLevel,
883 const std::string& modelFormat,
884 const std::string& inputTensorShapes,
885 const vector<armnn::BackendId>& computeDevices,
886 const std::string& dynamicBackendsPath,
887 const std::string& modelPath,
888 const std::string& inputNames,
889 const std::string& inputTensorDataFilePaths,
890 const std::string& inputTypes,
892 const std::string& outputTypes,
893 const std::string& outputNames,
894 const std::string& outputTensorFiles,
895 bool dequantizeOutput,
896 bool enableProfiling,
897 bool enableFp16TurboMode,
898 bool enableBf16TurboMode,
899 const double& thresholdTime,
900 bool printIntermediate,
901 const size_t subgraphId,
902 bool enableLayerDetails =
false,
903 bool parseUnsupported =
false,
904 bool inferOutputShape =
false)
912 {
"TuningLevel", tuningLevel},
913 {
"TuningFile", tuningPath.c_str()},
914 {
"KernelProfilingEnabled", enableProfiling}
923 int state =
RunTest(modelFormat, inputTensorShapes, computeDevices, dynamicBackendsPath, modelPath, inputNames,
924 inputTensorDataFilePaths, inputTypes, quantizeInput, outputTypes, outputNames,
925 outputTensorFiles, dequantizeOutput, enableProfiling, enableFp16TurboMode, enableBf16TurboMode,
926 thresholdTime, printIntermediate, subgraphId, enableLayerDetails, parseUnsupported,
927 inferOutputShape, 1, runtime);
929 ARMNN_LOG(info) <<
"Tuning time: " << std::setprecision(2)
std::vector< std::string > StringTokenizer(const std::string &str, const char *delimiters, bool tokenCompression=true)
Function to take a string and a list of delimiters and split the string into tokens based on those de...
static IRuntimePtr Create(const CreationOptions &options)
std::vector< string > m_OutputTypes
float Dequantize(QuantizedType value, float scale, int32_t offset)
Dequantize an 8-bit data type into a floating point data type.
std::vector< string > m_OutputTensorFiles
std::chrono::duration< double, std::milli > GetTimeDuration(std::chrono::high_resolution_clock::time_point start_time)
std::unique_ptr< armnn::TensorShape > TensorShapePtr
int RunCsvTest(const armnnUtils::CsvRow &csvRow, const std::shared_ptr< armnn::IRuntime > &runtime, const bool enableProfiling, const bool enableFp16TurboMode, const bool enableBf16TurboMode, const double &thresholdTime, const bool printIntermediate, bool enableLayerDetails=false, bool parseUnuspported=false, bool inferOutputShape=false)
int RunCLTuning(const std::string &tuningPath, const int tuningLevel, const std::string &modelFormat, const std::string &inputTensorShapes, const vector< armnn::BackendId > &computeDevices, const std::string &dynamicBackendsPath, const std::string &modelPath, const std::string &inputNames, const std::string &inputTensorDataFilePaths, const std::string &inputTypes, bool quantizeInput, const std::string &outputTypes, const std::string &outputNames, const std::string &outputTensorFiles, bool dequantizeOutput, bool enableProfiling, bool enableFp16TurboMode, bool enableBf16TurboMode, const double &thresholdTime, bool printIntermediate, const size_t subgraphId, bool enableLayerDetails=false, bool parseUnsupported=false, bool inferOutputShape=false)
std::vector< TensorShapePtr > m_InputTensorShapes
QuantizationParams GetInputQuantizationParams(unsigned int inputIndex=0u) const
const std::vector< armnn::BindingPointInfo > & GetOutputBindingInfos() const
bool m_EnableFp16TurboMode
int RunTest(const std::string &format, const std::string &inputTensorShapesStr, const vector< armnn::BackendId > &computeDevices, const std::string &dynamicBackendsPath, const std::string &path, const std::string &inputNames, const std::string &inputTensorDataFilePaths, const std::string &inputTypes, bool quantizeInput, const std::string &outputTypes, const std::string &outputNames, const std::string &outputTensorFiles, bool dequantizeOuput, bool enableProfiling, bool enableFp16TurboMode, bool enableBf16TurboMode, const double &thresholdTime, bool printIntermediate, const size_t subgraphId, bool enableLayerDetails=false, bool parseUnsupported=false, bool inferOutputShape=false, const size_t iterations=1, const std::shared_ptr< armnn::IRuntime > &runtime=nullptr)
std::string m_DynamicBackendsPath
std::vector< std::string > values
std::string m_DynamicBackendsPath
virtual const char * what() const noexcept override
#define ARMNN_LOG(severity)
BackendRegistry & BackendRegistryInstance()
bool m_EnableFp16TurboMode
std::chrono::high_resolution_clock::time_point GetTimeNow()
void IgnoreUnused(Ts &&...)
std::string GetBackendIdsAsString() const
bool m_VisualizePostOptimizationModel
int MainImpl(const ExecuteNetworkParams ¶ms, const std::shared_ptr< armnn::IRuntime > &runtime=nullptr, size_t iterations=1)
bool m_EnableBf16TurboMode
unsigned int GetOutputSize(unsigned int outputIndex=0u) const
boost::variant< std::vector< float >, std::vector< int >, std::vector< unsigned char > > TContainer
std::vector< std::string > m_InputBindings
std::vector< armnn::BackendId > m_ComputeDevices
std::vector< string > m_InputNames
std::vector< armnn::TensorShape > m_InputShapes
std::string StringTrimCopy(const std::string &str, const std::string &chars="\\\")
Trim from both the start and the end of a string, returns a trimmed copy of the string.
std::vector< BackendOptions > m_BackendOptions
Pass backend specific options.
bool m_GenerateTensorData
#define ARMNN_ASSERT_MSG(COND, MSG)
std::vector< std::string > m_OutputBindings
std::vector< armnn::BackendId > m_ComputeDevices
bool has_value() const noexcept
std::vector< string > m_OutputNames
std::enable_if_t< std::is_unsigned< Source >::value &&std::is_unsigned< Dest >::value, Dest > numeric_cast(Source source)
std::pair< float, int32_t > QuantizationParams
bool m_EnableBf16TurboMode
std::vector< string > m_InputTensorDataFilePaths
Struct for the users to pass backend specific options.
EmptyOptional is used to initialize the Optional class in case we want to have default value for an O...
bool m_PrintIntermediateLayers
std::chrono::duration< double, std::milli > Run(const std::vector< TContainer > &inputContainers, std::vector< TContainer > &outputContainers)
bool m_EnableLayerDetails
Base class for all ArmNN exceptions so that users can filter to just those.
std::vector< string > m_InputTypes
unsigned int GetInputSize(unsigned int inputIndex=0u) const