("threshold-time,r", po::value<double>(&thresholdTime)->default_value(0.0),
"Threshold time is the maximum allowed time for inference measured in milliseconds. If the actual "
"inference time is greater than the threshold time, the test will fail. By default, no threshold "
- "time is used.");
+ "time is used.")
+ ("print-intermediate-layers,p", po::bool_switch()->default_value(false),
+ "If this option is enabled, the output of every graph layer will be printed.");
}
catch (const std::exception& e)
{
bool enableProfiling = vm["event-based-profiling"].as<bool>();
bool enableFp16TurboMode = vm["fp16-turbo-mode"].as<bool>();
bool quantizeInput = vm["quantize-input"].as<bool>();
+ bool printIntermediate = vm["print-intermediate-layers"].as<bool>();
// Check whether we have to load test cases from a file.
if (CheckOption(vm, "test-cases"))
{
testCase.values.insert(testCase.values.begin(), executableName);
results.push_back(std::async(std::launch::async, RunCsvTest, std::cref(testCase), std::cref(runtime),
- enableProfiling, enableFp16TurboMode, thresholdTime));
+ enableProfiling, enableFp16TurboMode, thresholdTime, printIntermediate));
}
// Check results
for (auto& testCase : testCases)
{
testCase.values.insert(testCase.values.begin(), executableName);
- if (RunCsvTest(testCase, runtime, enableProfiling, enableFp16TurboMode, thresholdTime) != EXIT_SUCCESS)
+ if (RunCsvTest(testCase, runtime, enableProfiling,
+ enableFp16TurboMode, thresholdTime, printIntermediate) != EXIT_SUCCESS)
{
return EXIT_FAILURE;
}
return RunTest(modelFormat, inputTensorShapes, computeDevices, dynamicBackendsPath, modelPath, inputNames,
inputTensorDataFilePaths, inputTypes, quantizeInput, outputTypes, outputNames,
- enableProfiling, enableFp16TurboMode, thresholdTime, subgraphId);
+ enableProfiling, enableFp16TurboMode, thresholdTime, printIntermediate, subgraphId);
}
}
bool enableProfiling,
bool enableFp16TurboMode,
const double& thresholdTime,
+ bool printIntermediate,
const size_t subgraphId,
const std::shared_ptr<armnn::IRuntime>& runtime = nullptr)
{
params.m_IsModelBinary = isModelBinary;
params.m_ComputeDevices = computeDevices;
params.m_DynamicBackendsPath = dynamicBackendsPath;
+ params.m_PrintIntermediateLayers = printIntermediate;
for(const std::string& inputName: inputNames)
{
bool enableProfiling,
bool enableFp16TurboMode,
const double& thresholdTime,
+ bool printIntermediate,
const size_t subgraphId,
const std::shared_ptr<armnn::IRuntime>& runtime = nullptr)
{
dynamicBackendsPath, inputNamesVector, inputTensorShapes,
inputTensorDataFilePathsVector, inputTypesVector, quantizeInput,
outputTypesVector, outputNamesVector, enableProfiling,
- enableFp16TurboMode, thresholdTime, subgraphId, runtime);
+ enableFp16TurboMode, thresholdTime, printIntermediate, subgraphId, runtime);
#else
BOOST_LOG_TRIVIAL(fatal) << "Not built with serialization support.";
return EXIT_FAILURE;
inputTensorDataFilePathsVector, inputTypesVector,
quantizeInput, outputTypesVector, outputNamesVector,
enableProfiling, enableFp16TurboMode, thresholdTime,
- subgraphId, runtime);
+ printIntermediate, subgraphId, runtime);
#else
BOOST_LOG_TRIVIAL(fatal) << "Not built with Caffe parser support.";
return EXIT_FAILURE;
inputTensorDataFilePathsVector, inputTypesVector,
quantizeInput, outputTypesVector, outputNamesVector,
enableProfiling, enableFp16TurboMode, thresholdTime,
- subgraphId, runtime);
+ printIntermediate, subgraphId, runtime);
#else
BOOST_LOG_TRIVIAL(fatal) << "Not built with Onnx parser support.";
return EXIT_FAILURE;
inputTensorDataFilePathsVector, inputTypesVector,
quantizeInput, outputTypesVector, outputNamesVector,
enableProfiling, enableFp16TurboMode, thresholdTime,
- subgraphId, runtime);
+ printIntermediate, subgraphId, runtime);
#else
BOOST_LOG_TRIVIAL(fatal) << "Not built with Tensorflow parser support.";
return EXIT_FAILURE;
inputTensorDataFilePathsVector, inputTypesVector,
quantizeInput, outputTypesVector, outputNamesVector,
enableProfiling, enableFp16TurboMode, thresholdTime,
- subgraphId, runtime);
+ printIntermediate, subgraphId, runtime);
#else
BOOST_LOG_TRIVIAL(fatal) << "Unknown model format: '" << modelFormat <<
"'. Please include 'caffe', 'tensorflow', 'tflite' or 'onnx'";
}
int RunCsvTest(const armnnUtils::CsvRow &csvRow, const std::shared_ptr<armnn::IRuntime>& runtime,
- const bool enableProfiling, const bool enableFp16TurboMode, const double& thresholdTime)
+ const bool enableProfiling, const bool enableFp16TurboMode, const double& thresholdTime,
+ const bool printIntermediate)
{
std::string modelFormat;
std::string modelPath;
return RunTest(modelFormat, inputTensorShapes, computeDevices, dynamicBackendsPath, modelPath, inputNames,
inputTensorDataFilePaths, inputTypes, quantizeInput, outputTypes, outputNames,
- enableProfiling, enableFp16TurboMode, thresholdTime, subgraphId);
+ enableProfiling, enableFp16TurboMode, thresholdTime, printIntermediate, subgraphId);
}