From 382e21ce95c04479a6900afca81a57949b369f1e Mon Sep 17 00:00:00 2001 From: Aron Virginas-Tar Date: Tue, 22 Jan 2019 14:10:39 +0000 Subject: IVGCVSW-2535 Fix crash in ExecuteNetwork when no compute device is specified Change-Id: If8d6516286557a6381561805cd53b5659b38f6a6 --- tests/ExecuteNetwork/ExecuteNetwork.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'tests') 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 computeDevicesAsStrings = vm["compute"].as>(); + // Get the preferred order of compute devices. If none are specified, default to using CpuRef + const std::string computeOption("compute"); + std::vector computeDevicesAsStrings = CheckOption(vm, computeOption.c_str()) ? + vm[computeOption].as>() : + std::vector({ "CpuRef" }); std::vector computeDevices(computeDevicesAsStrings.begin(), computeDevicesAsStrings.end()); // Remove duplicates from the list of compute devices. -- cgit v1.2.1