From f0b4845c1c6f24f59d4c88473b852cf69a3c7ae9 Mon Sep 17 00:00:00 2001 From: David Beck Date: Fri, 19 Oct 2018 15:20:56 +0100 Subject: IVGCVSW-2019 : replace Compute enum in the backend preferences list Change-Id: Ie7549fd27378acfa97e68d098e338b8c9d4ea5d2 --- tests/ExecuteNetwork/ExecuteNetwork.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'tests/ExecuteNetwork/ExecuteNetwork.cpp') diff --git a/tests/ExecuteNetwork/ExecuteNetwork.cpp b/tests/ExecuteNetwork/ExecuteNetwork.cpp index ee207472d0..7f1bcd38dc 100644 --- a/tests/ExecuteNetwork/ExecuteNetwork.cpp +++ b/tests/ExecuteNetwork/ExecuteNetwork.cpp @@ -147,7 +147,7 @@ void PrintArray(const std::vector& v) printf("\n"); } -void RemoveDuplicateDevices(std::vector& computeDevices) +void RemoveDuplicateDevices(std::vector& computeDevices) { // Mark the duplicate devices as 'Undefined'. for (auto i = computeDevices.begin(); i != computeDevices.end(); ++i) @@ -166,11 +166,11 @@ void RemoveDuplicateDevices(std::vector& computeDevices) computeDevices.end()); } -bool CheckDevicesAreValid(const std::vector& computeDevices) +bool CheckDevicesAreValid(const std::vector& computeDevices) { return (!computeDevices.empty() && std::none_of(computeDevices.begin(), computeDevices.end(), - [](armnn::Compute c){ return c == armnn::Compute::Undefined; })); + [](armnn::BackendId c){ return c == armnn::Compute::Undefined; })); } } // namespace @@ -178,7 +178,7 @@ bool CheckDevicesAreValid(const std::vector& computeDevices) template int MainImpl(const char* modelPath, bool isModelBinary, - const std::vector& computeDevice, + const std::vector& computeDevice, const char* inputName, const armnn::TensorShape* inputTensorShape, const char* inputTensorDataFilePath, @@ -232,7 +232,7 @@ int MainImpl(const char* modelPath, // This will run a test int RunTest(const std::string& modelFormat, const std::string& inputTensorShapeStr, - const vector& computeDevice, + const vector& computeDevice, const std::string& modelPath, const std::string& inputName, const std::string& inputTensorDataFilePath, @@ -360,7 +360,7 @@ int RunCsvTest(const armnnUtils::CsvRow &csvRow, "caffe-binary, caffe-text, tflite-binary, onnx-binary, onnx-text, tensorflow-binary or tensorflow-text.") ("model-path,m", po::value(&modelPath), "Path to model file, e.g. .caffemodel, .prototxt, .tflite," " .onnx") - ("compute,c", po::value>()->multitoken(), + ("compute,c", po::value>()->multitoken(), "The preferred order of devices to run layers on by default. Possible choices: CpuAcc, CpuRef, GpuAcc") ("input-name,i", po::value(&inputName), "Identifier of the input tensor in the network.") ("subgraph-number,n", po::value(&subgraphId)->default_value(0), "Id of the subgraph to be " @@ -414,7 +414,7 @@ int RunCsvTest(const armnnUtils::CsvRow &csvRow, boost::trim(outputName); // Get the preferred order of compute devices. - std::vector computeDevices = vm["compute"].as>(); + std::vector computeDevices = vm["compute"].as>(); // Remove duplicates from the list of compute devices. RemoveDuplicateDevices(computeDevices); @@ -466,7 +466,7 @@ int main(int argc, const char* argv[]) "caffe-binary, caffe-text, onnx-binary, onnx-text, tflite-binary, tensorflow-binary or tensorflow-text.") ("model-path,m", po::value(&modelPath), "Path to model file, e.g. .caffemodel, .prototxt," " .tflite, .onnx") - ("compute,c", po::value>()->multitoken(), + ("compute,c", po::value>()->multitoken(), "The preferred order of devices to run layers on by default. Possible choices: CpuAcc, CpuRef, GpuAcc") ("input-name,i", po::value(&inputName), "Identifier of the input tensor in the network.") ("subgraph-number,x", po::value(&subgraphId)->default_value(0), "Id of the subgraph to be executed." @@ -588,7 +588,7 @@ int main(int argc, const char* argv[]) else // Run single test { // Get the preferred order of compute devices. - std::vector computeDevices = vm["compute"].as>(); + std::vector computeDevices = vm["compute"].as>(); // Remove duplicates from the list of compute devices. RemoveDuplicateDevices(computeDevices); -- cgit v1.2.1