diff options
author | Matteo Martincigh <matteo.martincigh@arm.com> | 2019-08-14 11:42:30 +0100 |
---|---|---|
committer | Matteo Martincigh <matteo.martincigh@arm.com> | 2019-08-23 12:44:27 +0000 |
commit | 00dda4a66c10a56b02bdd534ba3b5fdb27527ebc (patch) | |
tree | cb752587ba5c2ea64e2de6ec402cbce7fc63981d /tests/ExecuteNetwork | |
parent | e898db9aaf07b4d0ea0242a1f3296f0192c42939 (diff) | |
download | armnn-00dda4a66c10a56b02bdd534ba3b5fdb27527ebc.tar.gz |
IVGCVSW-3547 Use ExecuteNetwork to run a dynamic backend end to end test
* Added path override for dynamic backend loading
* Do not default to CpuRef, as there could be dynamic backends loaded at
runtime
* Do not check right away whether the backends are correct, as more of
them can be loaded at runtime as dynamic backends
Change-Id: If23f79aa1480b8dfce57e49b1746c23b6b9e6f82
Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com>
Diffstat (limited to 'tests/ExecuteNetwork')
-rw-r--r-- | tests/ExecuteNetwork/ExecuteNetwork.cpp | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/tests/ExecuteNetwork/ExecuteNetwork.cpp b/tests/ExecuteNetwork/ExecuteNetwork.cpp index a8f3b3d71d..1a0306244b 100644 --- a/tests/ExecuteNetwork/ExecuteNetwork.cpp +++ b/tests/ExecuteNetwork/ExecuteNetwork.cpp @@ -27,6 +27,7 @@ int main(int argc, const char* argv[]) std::string outputNames; std::string inputTypes; std::string outputTypes; + std::string dynamicBackendsPath; double thresholdTime = 0.0; @@ -52,6 +53,9 @@ int main(int argc, const char* argv[]) ".prototxt, .tflite, .onnx") ("compute,c", po::value<std::vector<std::string>>()->multitoken(), backendsMessage.c_str()) + ("dynamic-backends-path,b", po::value(&dynamicBackendsPath), + "Path where to load any available dynamic backend from. " + "If left empty (the default), dynamic backends will not be used.") ("input-name,i", po::value(&inputNames), "Identifier of the input tensors in the network separated by comma.") ("subgraph-number,x", po::value<size_t>(&subgraphId)->default_value(0), "Id of the subgraph to be executed." @@ -62,7 +66,7 @@ int main(int argc, const char* argv[]) "This parameter is optional, depending on the network.") ("input-tensor-data,d", po::value(&inputTensorDataFilePaths), "Path to files containing the input data as a flat array separated by whitespace. " - "Several paths can be passed separating them by comma. ") + "Several paths can be passed separating them by comma.") ("input-type,y",po::value(&inputTypes), "The type of the input tensors in the network separated by comma. " "If unset, defaults to \"float\" for all defined inputs. " "Accepted values (float, int or qasymm8)") @@ -196,23 +200,15 @@ int main(int argc, const char* argv[]) { // Get the preferred order of compute devices. If none are specified, default to using CpuRef const std::string computeOption("compute"); - std::vector<std::string> computeDevicesAsStrings = CheckOption(vm, computeOption.c_str()) ? - vm[computeOption].as<std::vector<std::string>>() : - std::vector<std::string>({ "CpuRef" }); + std::vector<std::string> computeDevicesAsStrings = + CheckOption(vm, computeOption.c_str()) ? + vm[computeOption].as<std::vector<std::string>>() : + std::vector<std::string>(); std::vector<armnn::BackendId> computeDevices(computeDevicesAsStrings.begin(), computeDevicesAsStrings.end()); // Remove duplicates from the list of compute devices. RemoveDuplicateDevices(computeDevices); - // Check that the specified compute devices are valid. - std::string invalidBackends; - if (!CheckRequestedBackendsAreValid(computeDevices, armnn::Optional<std::string&>(invalidBackends))) - { - BOOST_LOG_TRIVIAL(fatal) << "The list of preferred devices contains invalid backend IDs: " - << invalidBackends; - return EXIT_FAILURE; - } - try { CheckOptionDependencies(vm); @@ -224,7 +220,7 @@ int main(int argc, const char* argv[]) return EXIT_FAILURE; } - return RunTest(modelFormat, inputTensorShapes, computeDevices, modelPath, inputNames, + return RunTest(modelFormat, inputTensorShapes, computeDevices, dynamicBackendsPath, modelPath, inputNames, inputTensorDataFilePaths, inputTypes, quantizeInput, outputTypes, outputNames, enableProfiling, enableFp16TurboMode, thresholdTime, subgraphId); } |