aboutsummaryrefslogtreecommitdiff
path: root/src/backends/reference/RefLayerSupport.cpp
diff options
context:
space:
mode:
authorSimon Obute <simon.obute@arm.com>2021-09-03 15:50:13 +0100
committerTeresa Charlin <teresa.charlinreyes@arm.com>2021-09-24 16:06:30 +0100
commit51f67776a695c217a32596af806afeeb080f5528 (patch)
tree33ccfd87ba365bcc6fc86d5a2181991a130b3061 /src/backends/reference/RefLayerSupport.cpp
parentf10b15a8946f39bdf3f60cebc59d2963069eedca (diff)
downloadarmnn-51f67776a695c217a32596af806afeeb080f5528.tar.gz
IVGCVSW-3705 Add Channel Shuffle Front end and Ref Implementation
* Add front end * Add reference workload * Add unit tests * Add Serializer and Deserializer * Update ArmNN Versioning Signed-off-by: Simon Obute <simon.obute@arm.com> Change-Id: I9ac1f953af3974382eac8e8d62d794d2344e8f47
Diffstat (limited to 'src/backends/reference/RefLayerSupport.cpp')
-rw-r--r--src/backends/reference/RefLayerSupport.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/backends/reference/RefLayerSupport.cpp b/src/backends/reference/RefLayerSupport.cpp
index 5eba3e5919..aaf9aa0e7c 100644
--- a/src/backends/reference/RefLayerSupport.cpp
+++ b/src/backends/reference/RefLayerSupport.cpp
@@ -333,6 +333,39 @@ bool RefLayerSupport::IsCastSupported(const TensorInfo& input,
return supported;
}
+bool RefLayerSupport::IsChannelShuffleSupported(const TensorInfo& input,
+ const TensorInfo& output,
+ const ChannelShuffleDescriptor& descriptor,
+ Optional<std::string&> reasonIfUnsupported) const
+{
+ IgnoreUnused(descriptor);
+ bool supported = true;
+
+ // Define supported output and inputs types.
+ std::array<DataType, 7> supportedTypes =
+ {
+ DataType::BFloat16,
+ DataType::Float32,
+ DataType::Float16,
+ DataType::QAsymmS8,
+ DataType::QAsymmU8,
+ DataType::QSymmS8,
+ DataType::QSymmS16
+ };
+
+ supported &= CheckSupportRule(TypeAnyOf(input, supportedTypes), reasonIfUnsupported,
+ "Reference ChannelShuffle: input is not a supported type.");
+
+ supported &= CheckSupportRule(TypeAnyOf(output, supportedTypes), reasonIfUnsupported,
+ "Reference ChannelShuffle: output is not a supported type.");
+
+ supported &= CheckSupportRule(TypesAreEqual(input, output), reasonIfUnsupported,
+ "Reference ChannelShuffle: input and output types are mismatched.");
+
+ return supported;
+}
+
+
bool RefLayerSupport::IsComparisonSupported(const TensorInfo& input0,
const TensorInfo& input1,
const TensorInfo& output,