aboutsummaryrefslogtreecommitdiff
path: root/src/armnn/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/armnn/test')
-rw-r--r--src/armnn/test/CreateWorkload.hpp37
-rw-r--r--src/armnn/test/QuantizerTest.cpp55
-rw-r--r--src/armnn/test/TestNameAndDescriptorLayerVisitor.cpp7
-rw-r--r--src/armnn/test/TestNameAndDescriptorLayerVisitor.hpp1
-rw-r--r--src/armnn/test/TestNameOnlyLayerVisitor.cpp2
-rw-r--r--src/armnn/test/TestNameOnlyLayerVisitor.hpp2
6 files changed, 13 insertions, 91 deletions
diff --git a/src/armnn/test/CreateWorkload.hpp b/src/armnn/test/CreateWorkload.hpp
index 02ce12a304..4782c432a2 100644
--- a/src/armnn/test/CreateWorkload.hpp
+++ b/src/armnn/test/CreateWorkload.hpp
@@ -131,14 +131,15 @@ std::unique_ptr<WorkloadType> CreateElementwiseWorkloadTest(armnn::IWorkloadFact
return workload;
}
-template <typename WorkloadType,
+template <typename WorkloadType,
typename DescriptorType,
- typename LayerType,
armnn::DataType DataType>
std::unique_ptr<WorkloadType> CreateElementwiseUnaryWorkloadTest(armnn::IWorkloadFactory & factory,
- armnn::Graph & graph)
+ armnn::Graph & graph,
+ armnn::UnaryOperation op)
{
- Layer* const layer = graph.AddLayer<LayerType>("layer");
+ ElementwiseUnaryDescriptor desc = ElementwiseUnaryDescriptor(op);
+ Layer* const layer = graph.AddLayer<armnn::ElementwiseUnaryLayer>(desc, "layer");
Layer* const input = graph.AddLayer<InputLayer>(0, "input");
Layer* const output = graph.AddLayer<OutputLayer>(0, "output");
@@ -1059,34 +1060,6 @@ std::unique_ptr<ResizeWorkload> CreateResizeBilinearWorkloadTest(armnn::IWorkloa
return workload;
}
-template <typename RsqrtWorkload, armnn::DataType DataType>
-std::unique_ptr<RsqrtWorkload> CreateRsqrtWorkloadTest(armnn::IWorkloadFactory& factory,
- armnn::Graph& graph)
-{
- Layer* const layer = graph.AddLayer<RsqrtLayer>("rsqrt");
-
- // Creates extra layers.
- Layer* const input = graph.AddLayer<InputLayer>(0, "input");
- Layer* const output = graph.AddLayer<OutputLayer>(0, "output");
-
- // Connects up.
- armnn::TensorInfo tensorInfo({1, 1}, DataType);
-
- Connect(input, layer, tensorInfo);
- Connect(layer, output, tensorInfo);
-
- CreateTensorHandles(graph, factory);
-
- // Makes the workload and checks it.
- auto workload = MakeAndCheckWorkload<RsqrtWorkload>(*layer, factory);
-
- RsqrtQueueDescriptor queueDescriptor = workload->GetData();
- BOOST_TEST(queueDescriptor.m_Inputs.size() == 1);
- BOOST_TEST(queueDescriptor.m_Outputs.size() == 1);
-
- return workload;
-}
-
template <typename BatchToSpaceNdWorkload, armnn::DataType DataType>
std::unique_ptr<BatchToSpaceNdWorkload> CreateBatchToSpaceNdWorkloadTest(armnn::IWorkloadFactory& factory,
armnn::Graph& graph)
diff --git a/src/armnn/test/QuantizerTest.cpp b/src/armnn/test/QuantizerTest.cpp
index 52beb630f9..d568b2cbc0 100644
--- a/src/armnn/test/QuantizerTest.cpp
+++ b/src/armnn/test/QuantizerTest.cpp
@@ -1672,61 +1672,6 @@ BOOST_AUTO_TEST_CASE(QuantizeConstant)
VisitLayersTopologically(quantizedNetworkQSymm16.get(), validatorQSymm16);
}
-BOOST_AUTO_TEST_CASE(QuantizeAbs)
-{
- class TestAbsQuantization : public TestLeakyReLuActivationQuantization
- {
- public:
- TestAbsQuantization(const TensorShape& inputShape, const TensorShape& outputShape) :
- TestLeakyReLuActivationQuantization(inputShape, outputShape)
- {}
-
- TestAbsQuantization(const QuantizerOptions& options,
- const TensorShape& inputShape,
- const TensorShape& outputShape) :
- TestLeakyReLuActivationQuantization(options, inputShape, outputShape)
- {}
-
- void VisitAbsLayer(const IConnectableLayer *layer,
- const char *name = nullptr) override
- {
- boost::ignore_unused(name);
- TensorInfo outputInfo = layer->GetOutputSlot(0).GetTensorInfo();
-
- TestQuantizationParams(outputInfo,
- { 30.0f / g_Asymm8QuantizationBase, 128 },
- { 15.0f / g_Symm8QuantizationBase, 0},
- { 15.0f / g_Symm16QuantizationBase, 0 });
- }
- };
-
- INetworkPtr network = INetwork::Create();
-
- //Add the layer being tested
- IConnectableLayer* absLayer = network->AddAbsLayer();
-
- const TensorShape shape{1U};
- TensorInfo info(shape, DataType::Float32);
-
- IConnectableLayer* activation = CreateStartOfLeakyReluNetwork(network.get(), info);
-
- CompleteLeakyReluNetwork(network.get(), activation, absLayer, info);
-
- INetworkPtr quantizedNetworkQAsymm8 = INetworkQuantizer::Create(network.get())->ExportNetwork();
- TestAbsQuantization validatorQAsymm8(shape, shape);
- VisitLayersTopologically(quantizedNetworkQAsymm8.get(), validatorQAsymm8);
-
- const QuantizerOptions qSymm8Options(DataType::QSymmS8);
- INetworkPtr quantizedNetworkQSymm8 = INetworkQuantizer::Create(network.get(), qSymm8Options)->ExportNetwork();
- TestAbsQuantization validatorQSymm8(qSymm8Options, shape, shape);
- VisitLayersTopologically(quantizedNetworkQSymm8.get(), validatorQSymm8);
-
- const QuantizerOptions qSymm16options(DataType::QSymmS16);
- INetworkPtr quantizedNetworkQSymm16 = INetworkQuantizer::Create(network.get(), qSymm16options)->ExportNetwork();
- TestAbsQuantization validatorQSymm16(qSymm16options, shape, shape);
- VisitLayersTopologically(quantizedNetworkQSymm16.get(), validatorQSymm16);
-}
-
BOOST_AUTO_TEST_CASE(QuantizeArgMinMax)
{
class TestArgMinMaxQuantization : public TestQuantization
diff --git a/src/armnn/test/TestNameAndDescriptorLayerVisitor.cpp b/src/armnn/test/TestNameAndDescriptorLayerVisitor.cpp
index 36bbd36792..efe50a5b58 100644
--- a/src/armnn/test/TestNameAndDescriptorLayerVisitor.cpp
+++ b/src/armnn/test/TestNameAndDescriptorLayerVisitor.cpp
@@ -86,6 +86,12 @@ armnn::ConcatDescriptor GetDescriptor<armnn::ConcatDescriptor>()
}
template<>
+armnn::ElementwiseUnaryDescriptor GetDescriptor<armnn::ElementwiseUnaryDescriptor>()
+{
+ return armnn::ElementwiseUnaryDescriptor(armnn::UnaryOperation::Abs);
+}
+
+template<>
armnn::InstanceNormalizationDescriptor GetDescriptor<armnn::InstanceNormalizationDescriptor>()
{
armnn::InstanceNormalizationDescriptor descriptor;
@@ -251,6 +257,7 @@ TEST_SUITE_NAME_AND_DESCRIPTOR_LAYER_VISITOR(DepthToSpace)
TEST_SUITE_NAME_AND_DESCRIPTOR_LAYER_VISITOR(BatchToSpaceNd)
TEST_SUITE_NAME_AND_DESCRIPTOR_LAYER_VISITOR(Comparison)
TEST_SUITE_NAME_AND_DESCRIPTOR_LAYER_VISITOR(Concat)
+TEST_SUITE_NAME_AND_DESCRIPTOR_LAYER_VISITOR(ElementwiseUnary)
TEST_SUITE_NAME_AND_DESCRIPTOR_LAYER_VISITOR(InstanceNormalization)
TEST_SUITE_NAME_AND_DESCRIPTOR_LAYER_VISITOR(L2Normalization)
TEST_SUITE_NAME_AND_DESCRIPTOR_LAYER_VISITOR(LogSoftmax)
diff --git a/src/armnn/test/TestNameAndDescriptorLayerVisitor.hpp b/src/armnn/test/TestNameAndDescriptorLayerVisitor.hpp
index 221057cbdc..f792bc3554 100644
--- a/src/armnn/test/TestNameAndDescriptorLayerVisitor.hpp
+++ b/src/armnn/test/TestNameAndDescriptorLayerVisitor.hpp
@@ -48,6 +48,7 @@ DECLARE_TEST_NAME_AND_DESCRIPTOR_LAYER_VISITOR_CLASS(BatchToSpaceNd)
DECLARE_TEST_NAME_AND_DESCRIPTOR_LAYER_VISITOR_CLASS(Comparison)
DECLARE_TEST_NAME_AND_DESCRIPTOR_LAYER_VISITOR_CLASS(Concat)
DECLARE_TEST_NAME_AND_DESCRIPTOR_LAYER_VISITOR_CLASS(DepthToSpace)
+DECLARE_TEST_NAME_AND_DESCRIPTOR_LAYER_VISITOR_CLASS(ElementwiseUnary)
DECLARE_TEST_NAME_AND_DESCRIPTOR_LAYER_VISITOR_CLASS(InstanceNormalization)
DECLARE_TEST_NAME_AND_DESCRIPTOR_LAYER_VISITOR_CLASS(L2Normalization)
DECLARE_TEST_NAME_AND_DESCRIPTOR_LAYER_VISITOR_CLASS(LogSoftmax)
diff --git a/src/armnn/test/TestNameOnlyLayerVisitor.cpp b/src/armnn/test/TestNameOnlyLayerVisitor.cpp
index 32de94e7ef..0653b39e58 100644
--- a/src/armnn/test/TestNameOnlyLayerVisitor.cpp
+++ b/src/armnn/test/TestNameOnlyLayerVisitor.cpp
@@ -38,7 +38,6 @@ TEST_CASE_CHECK_LAYER_VISITOR_NAME_NULLPTR(name)
BOOST_AUTO_TEST_SUITE(TestNameOnlyLayerVisitor)
-TEST_SUITE_NAME_ONLY_LAYER_VISITOR(Abs)
TEST_SUITE_NAME_ONLY_LAYER_VISITOR(Addition)
TEST_SUITE_NAME_ONLY_LAYER_VISITOR(Dequantize)
TEST_SUITE_NAME_ONLY_LAYER_VISITOR(Division)
@@ -50,7 +49,6 @@ TEST_SUITE_NAME_ONLY_LAYER_VISITOR(Minimum)
TEST_SUITE_NAME_ONLY_LAYER_VISITOR(Multiplication)
TEST_SUITE_NAME_ONLY_LAYER_VISITOR(Prelu)
TEST_SUITE_NAME_ONLY_LAYER_VISITOR(Quantize)
-TEST_SUITE_NAME_ONLY_LAYER_VISITOR(Rsqrt)
TEST_SUITE_NAME_ONLY_LAYER_VISITOR(Subtraction)
TEST_SUITE_NAME_ONLY_LAYER_VISITOR(Switch)
diff --git a/src/armnn/test/TestNameOnlyLayerVisitor.hpp b/src/armnn/test/TestNameOnlyLayerVisitor.hpp
index c770b5e9e0..84dfdd6539 100644
--- a/src/armnn/test/TestNameOnlyLayerVisitor.hpp
+++ b/src/armnn/test/TestNameOnlyLayerVisitor.hpp
@@ -25,7 +25,6 @@ public: \
} // anonymous namespace
-DECLARE_TEST_NAME_ONLY_LAYER_VISITOR_CLASS(Abs)
DECLARE_TEST_NAME_ONLY_LAYER_VISITOR_CLASS(Addition)
DECLARE_TEST_NAME_ONLY_LAYER_VISITOR_CLASS(Dequantize)
DECLARE_TEST_NAME_ONLY_LAYER_VISITOR_CLASS(Division)
@@ -37,6 +36,5 @@ DECLARE_TEST_NAME_ONLY_LAYER_VISITOR_CLASS(Minimum)
DECLARE_TEST_NAME_ONLY_LAYER_VISITOR_CLASS(Multiplication)
DECLARE_TEST_NAME_ONLY_LAYER_VISITOR_CLASS(Prelu)
DECLARE_TEST_NAME_ONLY_LAYER_VISITOR_CLASS(Quantize)
-DECLARE_TEST_NAME_ONLY_LAYER_VISITOR_CLASS(Rsqrt)
DECLARE_TEST_NAME_ONLY_LAYER_VISITOR_CLASS(Subtraction)
DECLARE_TEST_NAME_ONLY_LAYER_VISITOR_CLASS(Switch)