aboutsummaryrefslogtreecommitdiff
path: root/src/armnnUtils/ParserPrototxtFixture.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/armnnUtils/ParserPrototxtFixture.hpp')
-rw-r--r--src/armnnUtils/ParserPrototxtFixture.hpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/armnnUtils/ParserPrototxtFixture.hpp b/src/armnnUtils/ParserPrototxtFixture.hpp
index 669b1fd0ca..fa21aba479 100644
--- a/src/armnnUtils/ParserPrototxtFixture.hpp
+++ b/src/armnnUtils/ParserPrototxtFixture.hpp
@@ -6,10 +6,12 @@
#pragma once
#include <armnn/IRuntime.hpp>
+
#include <test/TensorHelpers.hpp>
#include <armnnOnnxParser/IOnnxParser.hpp>
+#include <Network.hpp>
#include <VerificationHelpers.hpp>
#include <backendsCommon/BackendRegistry.hpp>
@@ -40,6 +42,9 @@ struct ParserPrototxtFixture
void Setup(const std::map<std::string, armnn::TensorShape>& inputShapes,
const std::vector<std::string>& requestedOutputs);
void Setup();
+ armnn::IOptimizedNetworkPtr SetupOptimizedNetwork(
+ const std::map<std::string,armnn::TensorShape>& inputShapes,
+ const std::vector<std::string>& requestedOutputs);
/// @}
/// Executes the network with the given input tensor and checks the result against the given output tensor.
@@ -125,6 +130,17 @@ void ParserPrototxtFixture<TParser>::Setup()
}
template<typename TParser>
+armnn::IOptimizedNetworkPtr ParserPrototxtFixture<TParser>::SetupOptimizedNetwork(
+ const std::map<std::string,armnn::TensorShape>& inputShapes,
+ const std::vector<std::string>& requestedOutputs)
+{
+ armnn::INetworkPtr network =
+ m_Parser->CreateNetworkFromString(m_Prototext.c_str(), inputShapes, requestedOutputs);
+ auto optimized = Optimize(*network, { armnn::Compute::CpuRef }, m_Runtime->GetDeviceSpec());
+ return optimized;
+}
+
+template<typename TParser>
template <std::size_t NumOutputDimensions>
void ParserPrototxtFixture<TParser>::RunTest(const std::vector<float>& inputData,
const std::vector<float>& expectedOutputData)