diff options
author | David Beck <david.beck@arm.com> | 2018-10-19 15:20:56 +0100 |
---|---|---|
committer | Matthew Bentham <matthew.bentham@arm.com> | 2018-10-22 16:57:54 +0100 |
commit | f0b4845c1c6f24f59d4c88473b852cf69a3c7ae9 (patch) | |
tree | 5a8726ee4a397c421a6a41d6edca1a2d3183f168 /tests/InferenceTest.hpp | |
parent | 7bc8c9fc9726d3c9ac002138c594688a006faac6 (diff) | |
download | armnn-f0b4845c1c6f24f59d4c88473b852cf69a3c7ae9.tar.gz |
IVGCVSW-2019 : replace Compute enum in the backend preferences list
Change-Id: Ie7549fd27378acfa97e68d098e338b8c9d4ea5d2
Diffstat (limited to 'tests/InferenceTest.hpp')
-rw-r--r-- | tests/InferenceTest.hpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/tests/InferenceTest.hpp b/tests/InferenceTest.hpp index 32d828ddbc..3ea70962d2 100644 --- a/tests/InferenceTest.hpp +++ b/tests/InferenceTest.hpp @@ -4,8 +4,8 @@ // #pragma once -#include "armnn/ArmNN.hpp" -#include "armnn/TypesUtils.hpp" +#include <armnn/ArmNN.hpp> +#include <armnn/TypesUtils.hpp> #include "InferenceModel.hpp" #include <Logging.hpp> @@ -30,6 +30,20 @@ inline std::istream& operator>>(std::istream& in, armnn::Compute& compute) return in; } +inline std::istream& operator>>(std::istream& in, armnn::BackendId& backend) +{ + std::string token; + in >> token; + armnn::Compute compute = armnn::ParseComputeDevice(token.c_str()); + if (compute == armnn::Compute::Undefined) + { + in.setstate(std::ios_base::failbit); + throw boost::program_options::validation_error(boost::program_options::validation_error::invalid_option_value); + } + backend = compute; + return in; +} + namespace test { |