diff options
author | Matteo Martincigh <matteo.martincigh@arm.com> | 2019-01-10 17:34:20 +0000 |
---|---|---|
committer | Matteo Martincigh <matteo.martincigh@arm.com> | 2019-01-11 12:20:47 +0000 |
commit | 992d6dc57d8463729910b688f0fb5825d0d3ccf2 (patch) | |
tree | 87b504d174848169550240f300f359dd57aaa1fd /src/backends/neon | |
parent | 1f0ff35236c1dd05954735f7fed9c2807770479e (diff) | |
download | armnn-992d6dc57d8463729910b688f0fb5825d0d3ccf2.tar.gz |
IVGCVSW-2454 Refactor ArmNN to support pluggable backends from a separate
code base
* Made the virtual functions in ILayerSupport.hpp pure
* Created a LayerSupportBase class with the default implementation of
the interface
* Made the backend layer support classes inherit from the base
class, instead of directly from the interface
* Refactored the profiler and the profiling event classes to use
the BackendId instead of the Compute
* Implemented a proper MemCopy support method
* Changed Compute to BackendId in the profiling API and objects
* Removed static references to pluggable backends
!android-nn-driver:492
Change-Id: Id6332b5f48c980819e0a09adc818d1effd057296
Diffstat (limited to 'src/backends/neon')
-rw-r--r-- | src/backends/neon/NeonLayerSupport.cpp | 19 | ||||
-rw-r--r-- | src/backends/neon/NeonLayerSupport.hpp | 12 |
2 files changed, 18 insertions, 13 deletions
diff --git a/src/backends/neon/NeonLayerSupport.cpp b/src/backends/neon/NeonLayerSupport.cpp index cc8f973510..1f205ed6d6 100644 --- a/src/backends/neon/NeonLayerSupport.cpp +++ b/src/backends/neon/NeonLayerSupport.cpp @@ -271,6 +271,15 @@ bool NeonLayerSupport::IsMeanSupported(const TensorInfo& input, descriptor); } +bool NeonLayerSupport::IsMemCopySupported(const TensorInfo &input, + const TensorInfo &output, + Optional<std::string &> reasonIfUnsupported) const +{ + ignore_unused(input); + ignore_unused(output); + return true; +} + bool NeonLayerSupport::IsMergerSupported(const std::vector<const TensorInfo*> inputs, const TensorInfo& output, const OriginsDescriptor& descriptor, @@ -355,22 +364,16 @@ bool NeonLayerSupport::IsPooling2dSupported(const TensorInfo& input, } bool NeonLayerSupport::IsReshapeSupported(const TensorInfo& input, + const ReshapeDescriptor& descriptor, Optional<std::string&> reasonIfUnsupported) const { + ignore_unused(descriptor); return IsSupportedForDataTypeNeon(reasonIfUnsupported, input.GetDataType(), &TrueFunc<>, &TrueFunc<>); } -bool NeonLayerSupport::IsResizeBilinearSupported(const TensorInfo& input, - Optional<std::string&> reasonIfUnsupported) const -{ - ignore_unused(input); - ignore_unused(reasonIfUnsupported); - return false; -} - bool NeonLayerSupport::IsSoftmaxSupported(const TensorInfo& input, const TensorInfo& output, const SoftmaxDescriptor& descriptor, diff --git a/src/backends/neon/NeonLayerSupport.hpp b/src/backends/neon/NeonLayerSupport.hpp index 73193d34b7..c522c6ee0a 100644 --- a/src/backends/neon/NeonLayerSupport.hpp +++ b/src/backends/neon/NeonLayerSupport.hpp @@ -4,12 +4,12 @@ // #pragma once -#include <armnn/ILayerSupport.hpp> +#include <backendsCommon/LayerSupportBase.hpp> namespace armnn { -class NeonLayerSupport : public ILayerSupport +class NeonLayerSupport : public LayerSupportBase { public: bool IsActivationSupported(const TensorInfo& input, @@ -85,6 +85,10 @@ public: const MeanDescriptor& descriptor, Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; + bool IsMemCopySupported(const TensorInfo& input, + const TensorInfo& output, + Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; + bool IsMergerSupported(const std::vector<const TensorInfo*> inputs, const TensorInfo& output, const OriginsDescriptor& descriptor, @@ -119,11 +123,9 @@ public: Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; bool IsReshapeSupported(const TensorInfo& input, + const ReshapeDescriptor& descriptor, Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; - bool IsResizeBilinearSupported(const TensorInfo& input, - Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; - bool IsSoftmaxSupported(const TensorInfo& input, const TensorInfo& output, const SoftmaxDescriptor& descriptor, |