diff options
author | Cathal Corbett <cathal.corbett@arm.com> | 2021-12-24 12:24:40 +0000 |
---|---|---|
committer | Cathal Corbett <cathal.corbett@arm.com> | 2022-01-19 12:58:56 +0000 |
commit | 34b429c2215bab7fd12b761dd5c200414c1b4a5b (patch) | |
tree | 7518ec40c8e56dbf229421d47d9527ed7aadd33e /src/armnn/test/OptimizerTests.cpp | |
parent | 479e230479c10dcf9b9a79a3e80f0847d6ae5293 (diff) | |
download | armnn-34b429c2215bab7fd12b761dd5c200414c1b4a5b.tar.gz |
IVGCVSW-6629 Stabilize the ILayerSupport interface with unified strategy.
* New Virtual Function Added.
* Implemented in Ref Neon CL with switch statement for all layers.
* Deprecate original IsXXXLayerSupported functions.
* Ensure Npu not broken with change.
Change-Id: Icf61b16beec83d6af1cb287e24ab1e98a6138c8c
Signed-off-by: Cathal Corbett <cathal.corbett@arm.com>
Diffstat (limited to 'src/armnn/test/OptimizerTests.cpp')
-rw-r--r-- | src/armnn/test/OptimizerTests.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/armnn/test/OptimizerTests.cpp b/src/armnn/test/OptimizerTests.cpp index 900d4d6335..a3949affce 100644 --- a/src/armnn/test/OptimizerTests.cpp +++ b/src/armnn/test/OptimizerTests.cpp @@ -142,6 +142,29 @@ void CreateLSTMLayerHelper(Graph &graph, bool CifgEnabled) class MockLayerSupport : public LayerSupportBase { public: + bool IsLayerSupported(const LayerType& type, + const std::vector<TensorInfo>& infos, + const BaseDescriptor& descriptor, + const Optional<LstmInputParamsInfo>& /*lstmParamsInfo*/, + const Optional<QuantizedLstmInputParamsInfo>& /*quantizedLstmParamsInfo*/, + Optional<std::string&> reasonIfUnsupported) const override + { + switch (type) + { + case LayerType::Input: + return IsInputSupported(infos[0], reasonIfUnsupported); + case LayerType::Output: + return IsOutputSupported(infos[0], reasonIfUnsupported); + case LayerType::Activation: + return IsActivationSupported(infos[0], + infos[1], + *(PolymorphicDowncast<const ActivationDescriptor*>(&descriptor)), + reasonIfUnsupported); + default: + return false; + } + } + bool IsInputSupported(const TensorInfo& /*input*/, Optional<std::string&> /*reasonIfUnsupported = EmptyOptional()*/) const override { |