diff options
author | Matteo Martincigh <matteo.martincigh@arm.com> | 2019-06-05 14:12:48 +0100 |
---|---|---|
committer | Teresa Charlin <teresa.charlinreyes@arm.com> | 2019-06-06 13:02:22 +0000 |
commit | 2fc70c5f7bebd95da7c718907011c92fd29e3603 (patch) | |
tree | 9b3e4b0e7e4b4ff2079dafc0528534f944729231 /src/backends/reference/RefLayerSupport.cpp | |
parent | a3b20473ea0583ba4c6a2c17ba2d59ed958c0aa7 (diff) | |
download | armnn-2fc70c5f7bebd95da7c718907011c92fd29e3603.tar.gz |
IVGCVSW-3226 Refactor the reference normalization workload
* Refactored RefNormalizationFloat32Workload into RefNormalizationWorkload
* Added ref support of Uint8 norm workloads
* Added workload unit tests for Uint8
Change-Id: I063ce919c267e02a32e739848e49d75fd98a5eb6
Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com>
Diffstat (limited to 'src/backends/reference/RefLayerSupport.cpp')
-rw-r--r-- | src/backends/reference/RefLayerSupport.cpp | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/src/backends/reference/RefLayerSupport.cpp b/src/backends/reference/RefLayerSupport.cpp index f177385837..60536081be 100644 --- a/src/backends/reference/RefLayerSupport.cpp +++ b/src/backends/reference/RefLayerSupport.cpp @@ -959,12 +959,29 @@ bool RefLayerSupport::IsNormalizationSupported(const TensorInfo& input, const NormalizationDescriptor& descriptor, Optional<std::string&> reasonIfUnsupported) const { - ignore_unused(output); ignore_unused(descriptor); - return IsSupportedForDataTypeRef(reasonIfUnsupported, - input.GetDataType(), - &TrueFunc<>, - &FalseFuncU8<>); + + // Define supported types + std::array<DataType, 3> supportedTypes = + { + DataType::Float16, + DataType::Float32, + DataType::QuantisedAsymm8 + }; + + bool supported = true; + + supported &= CheckSupportRule(TypeAnyOf(input, supportedTypes), reasonIfUnsupported, + "Reference normalization: input type not supported."); + + supported &= CheckSupportRule(TypeAnyOf(output, supportedTypes), reasonIfUnsupported, + "Reference normalization: output type not supported."); + + supported &= CheckSupportRule(ShapesAreSameTotalSize(input, output), reasonIfUnsupported, + "Reference normalization: input and output shapes have different " + "num total elements."); + + return supported; } bool RefLayerSupport::IsOutputSupported(const TensorInfo& output, |