From 58ef2c6f797f6bdb962016c519ebbc980ec2ed50 Mon Sep 17 00:00:00 2001 From: Nina Drozd Date: Thu, 16 May 2019 12:09:18 +0100 Subject: IVGCVSW-2967 Support QSymm16 for Constant workloads * Validate that output is any of supported types in WorkloadData * Validate that output is any of supported types in RefLayerSupport * Add test for constant with QuantisedSymm16 in LayerTests * Add test for creating constant workload in RefCreateWorkloadTests * Add test for constant with QuantisedSymm16 in RefLayerTests * Refactor RefConstantWorkload - BaseWorkload instead of TypedWorkload * Refactor RefConstantWorkload - remove m_RanOnce, use PostAllocationConfigure() Signed-off-by: Nina Drozd Change-Id: Ic30e61319ef4ff9c367689901f7c6d498142a9c5 --- src/armnn/test/CreateWorkload.hpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src/armnn') diff --git a/src/armnn/test/CreateWorkload.hpp b/src/armnn/test/CreateWorkload.hpp index 1193ab721e..f758aaa80b 100644 --- a/src/armnn/test/CreateWorkload.hpp +++ b/src/armnn/test/CreateWorkload.hpp @@ -1227,4 +1227,30 @@ std::pair> Cre return std::make_pair(std::move(optimizedNet), std::move(workload)); } +template +std::unique_ptr CreateConstantWorkloadTest(armnn::IWorkloadFactory& factory, + armnn::Graph& graph, + const armnn::TensorShape& outputShape) +{ + armnn::TensorInfo outputTensorInfo(outputShape, DataType); + + auto constant = graph.AddLayer("constant"); + constant->m_LayerOutput = std::make_unique(outputTensorInfo); + BOOST_TEST_CHECKPOINT("created constant layer"); + + Layer* const output = graph.AddLayer(0, "output"); + + // Adds connections. + Connect(constant, output, outputTensorInfo, 0, 0); + BOOST_TEST_CHECKPOINT("connect constant to output"); + + CreateTensorHandles(graph, factory); + BOOST_TEST_CHECKPOINT("created tensor handles"); + + auto workloadConstant = MakeAndCheckWorkload(*constant, graph, factory); + BOOST_TEST_CHECKPOINT("created Constant workload"); + + return std::move(workloadConstant); +} + } -- cgit v1.2.1