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;
380 template<
typename TParser,
typename TDataType>
382 const std::shared_ptr<armnn::IRuntime>& runtime =
nullptr,
383 size_t iterations = 1)
385 using TContainer = boost::variant<std::vector<float>, std::vector<int>, std::vector<unsigned char>>;
387 std::vector<TContainer> inputDataContainers;
426 for(
unsigned int i = 0; i < numInputs; ++i)
445 PopulateTensorWithData(tensorData,
451 inputDataContainers.push_back(tensorData);
455 std::vector<TContainer> outputDataContainers;
457 for (
unsigned int i = 0; i < numOutputs; ++i)
461 outputDataContainers.push_back(std::vector<float>(model.
GetOutputSize(i)));
465 outputDataContainers.push_back(std::vector<int>(model.
GetOutputSize(i)));
469 outputDataContainers.push_back(std::vector<uint8_t>(model.
GetOutputSize(i)));
478 for (
size_t x = 0; x < iterations; x++)
481 auto inference_duration = model.
Run(inputDataContainers, outputDataContainers);
485 ARMNN_LOG(warning) <<
"The input data was generated, note that the output will not be useful";
490 for (
size_t i = 0; i < numOutputs; i++)
499 boost::apply_visitor(printer, outputDataContainers[i]);
502 ARMNN_LOG(info) <<
"\nInference time: " << std::setprecision(2)
503 << std::fixed << inference_duration.count() <<
" ms\n";
508 ARMNN_LOG(info) <<
"Threshold time: " << std::setprecision(2)
510 auto thresholdMinusInference = params.
m_ThresholdTime - inference_duration.count();
511 ARMNN_LOG(info) <<
"Threshold time - Inference time: " << std::setprecision(2)
512 << std::fixed << thresholdMinusInference <<
" ms" <<
"\n";
514 if (thresholdMinusInference < 0)
516 std::string errorMessage =
"Elapsed inference time is greater than provided threshold time.";
533 const std::string& inputTensorShapesStr,
534 const vector<armnn::BackendId>& computeDevices,
535 const std::string& dynamicBackendsPath,
536 const std::string& path,
537 const std::string& inputNames,
538 const std::string& inputTensorDataFilePaths,
539 const std::string& inputTypes,
541 const std::string& outputTypes,
542 const std::string& outputNames,
543 const std::string& outputTensorFiles,
544 bool dequantizeOuput,
545 bool enableProfiling,
546 bool enableFp16TurboMode,
547 bool enableBf16TurboMode,
548 const double& thresholdTime,
549 bool printIntermediate,
550 const size_t subgraphId,
551 bool enableLayerDetails =
false,
552 bool parseUnsupported =
false,
553 const size_t iterations = 1,
554 const std::shared_ptr<armnn::IRuntime>& runtime =
nullptr)
558 std::vector<std::string> inputNamesVector = ParseStringList(inputNames,
",");
559 std::vector<std::string> inputTensorShapesVector = ParseStringList(inputTensorShapesStr,
":");
560 std::vector<std::string> inputTensorDataFilePathsVector = ParseStringList(
561 inputTensorDataFilePaths,
",");
562 std::vector<std::string> outputNamesVector = ParseStringList(outputNames,
",");
563 std::vector<std::string> inputTypesVector = ParseStringList(inputTypes,
",");
564 std::vector<std::string> outputTypesVector = ParseStringList(outputTypes,
",");
565 std::vector<std::string> outputTensorFilesVector = ParseStringList(outputTensorFiles,
",");
569 if (modelFormat.find(
"bin") != std::string::npos)
571 isModelBinary =
true;
573 else if (modelFormat.find(
"txt") != std::string::npos || modelFormat.find(
"text") != std::string::npos)
575 isModelBinary =
false;
579 ARMNN_LOG(fatal) <<
"Unknown model format: '" << modelFormat <<
"'. Please include 'binary' or 'text'";
583 if ((inputTensorShapesVector.size() != 0) && (inputTensorShapesVector.size() != inputNamesVector.size()))
585 ARMNN_LOG(fatal) <<
"input-name and input-tensor-shape must have the same amount of elements.";
589 if ((inputTensorDataFilePathsVector.size() != 0) &&
590 (inputTensorDataFilePathsVector.size() != inputNamesVector.size()))
592 ARMNN_LOG(fatal) <<
"input-name and input-tensor-data must have the same amount of elements.";
596 if ((outputTensorFilesVector.size() != 0) &&
597 (outputTensorFilesVector.size() != outputNamesVector.size()))
599 ARMNN_LOG(fatal) <<
"output-name and write-outputs-to-file must have the same amount of elements.";
603 if (inputTypesVector.size() == 0)
606 inputTypesVector.assign(inputNamesVector.size(),
"float");
608 else if ((inputTypesVector.size() != 0) && (inputTypesVector.size() != inputNamesVector.size()))
610 ARMNN_LOG(fatal) <<
"input-name and input-type must have the same amount of elements.";
614 if (outputTypesVector.size() == 0)
617 outputTypesVector.assign(outputNamesVector.size(),
"float");
619 else if ((outputTypesVector.size() != 0) && (outputTypesVector.size() != outputNamesVector.size()))
621 ARMNN_LOG(fatal) <<
"output-name and output-type must have the same amount of elements.";
626 std::vector<std::unique_ptr<armnn::TensorShape>> inputTensorShapes;
628 if (!inputTensorShapesVector.empty())
630 inputTensorShapes.reserve(inputTensorShapesVector.size());
632 for(
const std::string& shape : inputTensorShapesVector)
634 std::stringstream ss(shape);
635 std::vector<unsigned int> dims = ParseArray(ss);
640 inputTensorShapes.push_back(std::make_unique<armnn::TensorShape>(dims.size(), dims.data()));
644 ARMNN_LOG(fatal) <<
"Cannot create tensor shape: " << e.
what();
651 if (thresholdTime < 0)
653 ARMNN_LOG(fatal) <<
"Threshold time supplied as a command line argument is less than zero.";
684 ARMNN_LOG(warning) <<
"No input files provided, input tensors will be filled with 0s.";
688 if (modelFormat.find(
"armnn") != std::string::npos)
690 #if defined(ARMNN_SERIALIZER) 691 return MainImpl<armnnDeserializer::IDeserializer, float>(params, runtime, iterations);
693 ARMNN_LOG(fatal) <<
"Not built with serialization support.";
697 else if (modelFormat.find(
"caffe") != std::string::npos)
699 #if defined(ARMNN_CAFFE_PARSER) 700 return MainImpl<armnnCaffeParser::ICaffeParser, float>(params, runtime, iterations);
702 ARMNN_LOG(fatal) <<
"Not built with Caffe parser support.";
706 else if (modelFormat.find(
"onnx") != std::string::npos)
708 #if defined(ARMNN_ONNX_PARSER) 709 return MainImpl<armnnOnnxParser::IOnnxParser, float>(params, runtime, iterations);
711 ARMNN_LOG(fatal) <<
"Not built with Onnx parser support.";
715 else if (modelFormat.find(
"tensorflow") != std::string::npos)
717 #if defined(ARMNN_TF_PARSER) 718 return MainImpl<armnnTfParser::ITfParser, float>(params, runtime, iterations);
720 ARMNN_LOG(fatal) <<
"Not built with Tensorflow parser support.";
724 else if(modelFormat.find(
"tflite") != std::string::npos)
726 #if defined(ARMNN_TF_LITE_PARSER) 729 ARMNN_LOG(fatal) <<
"Unknown model format: '" << modelFormat
730 <<
"'. Only 'binary' format supported for tflite files";
733 return MainImpl<armnnTfLiteParser::ITfLiteParser, float>(params, runtime, iterations);
735 ARMNN_LOG(fatal) <<
"Unknown model format: '" << modelFormat
736 <<
"'. Please include 'caffe', 'tensorflow', 'tflite' or 'onnx'";
742 ARMNN_LOG(fatal) <<
"Unknown model format: '" << modelFormat
743 <<
"'. Please include 'caffe', 'tensorflow', 'tflite' or 'onnx'";
749 const bool enableProfiling,
const bool enableFp16TurboMode,
const bool enableBf16TurboMode,
750 const double& thresholdTime,
const bool printIntermediate,
bool enableLayerDetails =
false,
751 bool parseUnuspported =
false)
754 std::string modelFormat;
755 std::string modelPath;
756 std::string inputNames;
757 std::string inputTensorShapes;
758 std::string inputTensorDataFilePaths;
759 std::string outputNames;
760 std::string inputTypes;
761 std::string outputTypes;
762 std::string dynamicBackendsPath;
763 std::string outputTensorFiles;
765 size_t subgraphId = 0;
767 const std::string backendsMessage = std::string(
"The preferred order of devices to run layers on by default. ")
768 + std::string(
"Possible choices: ")
771 po::options_description desc(
"Options");
775 (
"model-format,f", po::value(&modelFormat),
776 "armnn-binary, caffe-binary, caffe-text, tflite-binary, onnx-binary, onnx-text, tensorflow-binary or " 778 (
"model-path,m", po::value(&modelPath),
"Path to model file, e.g. .armnn, .caffemodel, .prototxt, " 780 (
"compute,c", po::value<std::vector<armnn::BackendId>>()->multitoken(),
781 backendsMessage.c_str())
782 (
"dynamic-backends-path,b", po::value(&dynamicBackendsPath),
783 "Path where to load any available dynamic backend from. " 784 "If left empty (the default), dynamic backends will not be used.")
785 (
"input-name,i", po::value(&inputNames),
"Identifier of the input tensors in the network separated by comma.")
786 (
"subgraph-number,n", po::value<size_t>(&subgraphId)->default_value(0),
"Id of the subgraph to be " 787 "executed. Defaults to 0.")
788 (
"input-tensor-shape,s", po::value(&inputTensorShapes),
789 "The shape of the input tensors in the network as a flat array of integers separated by comma. " 790 "Several shapes can be passed separating them by semicolon. " 791 "This parameter is optional, depending on the network.")
792 (
"input-tensor-data,d", po::value(&inputTensorDataFilePaths)->default_value(
""),
793 "Path to files containing the input data as a flat array separated by whitespace. " 794 "Several paths can be passed separating them by comma. If not specified, the network will be run with dummy " 795 "data (useful for profiling).")
796 (
"input-type,y",po::value(&inputTypes),
"The type of the input tensors in the network separated by comma. " 797 "If unset, defaults to \"float\" for all defined inputs. " 798 "Accepted values (float, int or qasymm8).")
799 (
"quantize-input,q",po::bool_switch()->default_value(
false),
800 "If this option is enabled, all float inputs will be quantized to qasymm8. " 801 "If unset, default to not quantized. " 802 "Accepted values (true or false)")
803 (
"output-type,z",po::value(&outputTypes),
"The type of the output tensors in the network separated by comma. " 804 "If unset, defaults to \"float\" for all defined outputs. " 805 "Accepted values (float, int or qasymm8).")
806 (
"output-name,o", po::value(&outputNames),
807 "Identifier of the output tensors in the network separated by comma.")
808 (
"dequantize-output,l",po::bool_switch()->default_value(
false),
809 "If this option is enabled, all quantized outputs will be dequantized to float. " 810 "If unset, default to not get dequantized. " 811 "Accepted values (true or false)")
812 (
"write-outputs-to-file,w", po::value(&outputTensorFiles),
813 "Comma-separated list of output file paths keyed with the binding-id of the output slot. " 814 "If left empty (the default), the output tensors will not be written to a file.");
816 catch (
const std::exception& e)
822 ARMNN_LOG(fatal) <<
"Fatal internal error: " << e.what();
826 std::vector<const char*> clOptions;
827 clOptions.reserve(csvRow.
values.size());
828 for (
const std::string& value : csvRow.
values)
830 clOptions.push_back(value.c_str());
833 po::variables_map vm;
836 po::store(po::parse_command_line(static_cast<int>(clOptions.size()), clOptions.data(), desc), vm);
840 CheckOptionDependencies(vm);
842 catch (
const po::error& e)
844 std::cerr << e.what() << std::endl << std::endl;
845 std::cerr << desc << std::endl;
850 bool quantizeInput = vm[
"quantize-input"].as<
bool>();
851 bool dequantizeOutput = vm[
"dequantize-output"].as<
bool>();
854 std::vector<armnn::BackendId> computeDevices = vm[
"compute"].as<std::vector<armnn::BackendId>>();
857 RemoveDuplicateDevices(computeDevices);
860 std::string invalidBackends;
863 ARMNN_LOG(fatal) <<
"The list of preferred devices contains invalid backend IDs: " 868 return RunTest(modelFormat, inputTensorShapes, computeDevices, dynamicBackendsPath, modelPath, inputNames,
869 inputTensorDataFilePaths, inputTypes, quantizeInput, outputTypes, outputNames, outputTensorFiles,
870 dequantizeOutput, enableProfiling, enableFp16TurboMode, enableBf16TurboMode,
871 thresholdTime, printIntermediate, subgraphId, enableLayerDetails, parseUnuspported);
874 #if defined(ARMCOMPUTECL_ENABLED) 876 const int tuningLevel,
877 const std::string& modelFormat,
878 const std::string& inputTensorShapes,
879 const vector<armnn::BackendId>& computeDevices,
880 const std::string& dynamicBackendsPath,
881 const std::string& modelPath,
882 const std::string& inputNames,
883 const std::string& inputTensorDataFilePaths,
884 const std::string& inputTypes,
886 const std::string& outputTypes,
887 const std::string& outputNames,
888 const std::string& outputTensorFiles,
889 bool dequantizeOutput,
890 bool enableProfiling,
891 bool enableFp16TurboMode,
892 bool enableBf16TurboMode,
893 const double& thresholdTime,
894 bool printIntermediate,
895 const size_t subgraphId,
896 bool enableLayerDetails =
false,
897 bool parseUnsupported =
false)
905 {
"TuningLevel", tuningLevel},
906 {
"TuningFile", tuningPath.c_str()},
907 {
"KernelProfilingEnabled", enableProfiling}
916 int state =
RunTest(modelFormat, inputTensorShapes, computeDevices, dynamicBackendsPath, modelPath, inputNames,
917 inputTensorDataFilePaths, inputTypes, quantizeInput, outputTypes, outputNames,
918 outputTensorFiles, dequantizeOutput, enableProfiling, enableFp16TurboMode, enableBf16TurboMode,
919 thresholdTime, printIntermediate, subgraphId, enableLayerDetails, parseUnsupported, 1, runtime);
921 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)
std::vector< TensorShapePtr > m_InputTensorShapes
QuantizationParams GetInputQuantizationParams(unsigned int inputIndex=0u) const
const std::vector< armnn::BindingPointInfo > & GetOutputBindingInfos() const
bool m_EnableFp16TurboMode
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)
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, const size_t iterations=1, const std::shared_ptr< armnn::IRuntime > &runtime=nullptr)
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
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)
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
armnn::Runtime::CreationOptions::ExternalProfilingOptions options