aboutsummaryrefslogtreecommitdiff
path: root/src/backends/neon/NeonLayerSupport.cpp
diff options
context:
space:
mode:
authorjosh minor <josh.minor@arm.com>2020-01-06 16:40:46 -0600
committerDerek Lamberti <derek.lamberti@arm.com>2020-01-23 14:29:14 +0000
commit4a3c61091037e7e86e8b03bb060d8c1ab82731a9 (patch)
tree928644023400ad5ac0c26b33dfff2f975567d6e8 /src/backends/neon/NeonLayerSupport.cpp
parent190a39a4a9598e42b636ae4ab843761884148160 (diff)
downloadarmnn-4a3c61091037e7e86e8b03bb060d8c1ab82731a9.tar.gz
IVGCVSW-4259 Add frontend and reference workload for UnaryOperationLayer
* Added new layer named ElementwiseUnary * Deprecated existing Abs/Rsqrt layer functions * Updated existing Abs/Rsqrt test infrastructure to use new layer * Added boilerplate for new Exp,Neg,Sqrt elemwise op layers * AbsQuantize test removed pending future commit * Serialization support added !android-nn-driver:2550 Change-Id: Ic595c645925e17b45db568187fd05646daf2e87f Signed-off-by: josh minor <josh.minor@arm.com>
Diffstat (limited to 'src/backends/neon/NeonLayerSupport.cpp')
-rw-r--r--src/backends/neon/NeonLayerSupport.cpp32
1 files changed, 27 insertions, 5 deletions
diff --git a/src/backends/neon/NeonLayerSupport.cpp b/src/backends/neon/NeonLayerSupport.cpp
index a73837b884..fe9bffbee9 100644
--- a/src/backends/neon/NeonLayerSupport.cpp
+++ b/src/backends/neon/NeonLayerSupport.cpp
@@ -129,10 +129,8 @@ bool NeonLayerSupport::IsAbsSupported(const TensorInfo& input,
const TensorInfo& output,
Optional<std::string&> reasonIfUnsupported) const
{
- FORWARD_WORKLOAD_VALIDATE_FUNC(NeonAbsWorkloadValidate,
- reasonIfUnsupported,
- input,
- output);
+ ElementwiseUnaryDescriptor descriptor(UnaryOperation::Abs);
+ return IsElementwiseUnarySupported(input, output, descriptor, reasonIfUnsupported);
}
bool NeonLayerSupport::IsActivationSupported(const TensorInfo& input,
@@ -386,6 +384,29 @@ bool NeonLayerSupport::IsDilatedDepthwiseConvolutionSupported(const TensorInfo&
biases);
}
+bool NeonLayerSupport::IsElementwiseUnarySupported(const TensorInfo& input,
+ const TensorInfo& output,
+ const ElementwiseUnaryDescriptor& descriptor,
+ Optional<std::string&> reasonIfUnsupported) const
+{
+ if (descriptor.m_Operation == UnaryOperation::Abs)
+ {
+ FORWARD_WORKLOAD_VALIDATE_FUNC(NeonAbsWorkloadValidate,
+ reasonIfUnsupported,
+ input,
+ output);
+ }
+ else if (descriptor.m_Operation == UnaryOperation::Rsqrt)
+ {
+ FORWARD_WORKLOAD_VALIDATE_FUNC(NeonRsqrtWorkloadValidate,
+ reasonIfUnsupported,
+ input,
+ output);
+ }
+
+ return false;
+}
+
bool NeonLayerSupport::IsFloorSupported(const TensorInfo& input,
const TensorInfo& output,
Optional<std::string&> reasonIfUnsupported) const
@@ -656,7 +677,8 @@ bool NeonLayerSupport::IsRsqrtSupported(const TensorInfo& input,
const TensorInfo& output,
Optional<std::string&> reasonIfUnsupported) const
{
- FORWARD_WORKLOAD_VALIDATE_FUNC(NeonRsqrtWorkloadValidate, reasonIfUnsupported, input, output);
+ ElementwiseUnaryDescriptor descriptor(UnaryOperation::Rsqrt);
+ return IsElementwiseUnarySupported(input, output, descriptor, reasonIfUnsupported);
}
bool NeonLayerSupport::IsSliceSupported(const TensorInfo& input,