diff options
Diffstat (limited to 'src/armnnSerializer/Serializer.cpp')
-rw-r--r-- | src/armnnSerializer/Serializer.cpp | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/src/armnnSerializer/Serializer.cpp b/src/armnnSerializer/Serializer.cpp index c9a3022b8d..5a095d9887 100644 --- a/src/armnnSerializer/Serializer.cpp +++ b/src/armnnSerializer/Serializer.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2017 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2017,2019-2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // #include "Serializer.hpp" @@ -533,6 +533,21 @@ void SerializerStrategy::SerializeDivisionLayer(const armnn::IConnectableLayer* CreateAnyLayer(fbDivisionLayer.o, serializer::Layer::Layer_DivisionLayer); } +void SerializerStrategy::SerializeElementwiseBinaryLayer(const armnn::IConnectableLayer* layer, + const armnn::ElementwiseBinaryDescriptor& descriptor, + const char* name) +{ + IgnoreUnused(name); + + auto fbBaseLayer = CreateLayerBase(layer, serializer::LayerType::LayerType_ElementwiseBinary); + auto fbDescriptor = serializer::CreateElementwiseBinaryDescriptor( + m_flatBufferBuilder, + GetFlatBufferBinaryOperation(descriptor.m_Operation)); + + auto fbLayer = serializer::CreateElementwiseBinaryLayer(m_flatBufferBuilder, fbBaseLayer, fbDescriptor); + CreateAnyLayer(fbLayer.o, serializer::Layer::Layer_ElementwiseBinaryLayer); +} + void SerializerStrategy::SerializeElementwiseUnaryLayer(const armnn::IConnectableLayer* layer, const armnn::ElementwiseUnaryDescriptor& descriptor, const char* name) @@ -2119,6 +2134,13 @@ void SerializerStrategy::ExecuteStrategy(const armnn::IConnectableLayer* layer, SerializeDivisionLayer(layer, name); break; } + case armnn::LayerType::ElementwiseBinary : + { + const armnn::ElementwiseBinaryDescriptor& layerDescriptor = + static_cast<const armnn::ElementwiseBinaryDescriptor&>(descriptor); + SerializeElementwiseBinaryLayer(layer, layerDescriptor, name); + break; + } case armnn::LayerType::ElementwiseUnary : { const armnn::ElementwiseUnaryDescriptor& layerDescriptor = |