diff options
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 { |