aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAron Virginas-Tar <Aron.Virginas-Tar@arm.com>2019-01-22 14:10:39 +0000
committerMatteo Martincigh <matteo.martincigh@arm.com>2019-01-22 15:23:54 +0000
commit382e21ce95c04479a6900afca81a57949b369f1e (patch)
treebed736976998053ac8c41a7fcf530d78ba7a5121 /tests
parent6c2355b1f7dd722eb908dd505826df8df6756471 (diff)
downloadarmnn-382e21ce95c04479a6900afca81a57949b369f1e.tar.gz
IVGCVSW-2535 Fix crash in ExecuteNetwork when no compute device is specified
Change-Id: If8d6516286557a6381561805cd53b5659b38f6a6
Diffstat (limited to 'tests')
-rw-r--r--tests/ExecuteNetwork/ExecuteNetwork.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/ExecuteNetwork/ExecuteNetwork.cpp b/tests/ExecuteNetwork/ExecuteNetwork.cpp
index 7d6aafcfbf..dd769755b4 100644
--- a/tests/ExecuteNetwork/ExecuteNetwork.cpp
+++ b/tests/ExecuteNetwork/ExecuteNetwork.cpp
@@ -588,8 +588,11 @@ int main(int argc, const char* argv[])
}
else // Run single test
{
- // Get the preferred order of compute devices.
- std::vector<std::string> computeDevicesAsStrings = vm["compute"].as<std::vector<std::string>>();
+ // 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<armnn::BackendId> computeDevices(computeDevicesAsStrings.begin(), computeDevicesAsStrings.end());
// Remove duplicates from the list of compute devices.