blob: 7d91af8afeac1b8a83eedf5b6c60ea3852552a40 [file] [log] [blame]
Nattapat Chaimanowongac9cadc2019-02-13 15:52:41 +00001//
2// Copyright © 2017 Arm Ltd. All rights reserved.
3// SPDX-License-Identifier: MIT
4//
5#pragma once
6
7#include "armnn/INetwork.hpp"
8#include "armnn/NetworkFwd.hpp"
9#include "armnn/Types.hpp"
10
11namespace armnnSerializer
12{
13
14class ISerializer;
15using ISerializerPtr = std::unique_ptr<ISerializer, void(*)(ISerializer* serializer)>;
16
17class ISerializer
18{
19public:
20 static ISerializer* CreateRaw();
21 static ISerializerPtr Create();
22 static void Destroy(ISerializer* serializer);
23
24 /// Serializes the network to ArmNN SerializedGraph.
25 /// @param [in] inNetwork The network to be serialized.
26 virtual void Serialize(const armnn::INetwork& inNetwork) = 0;
27
28 /// Serializes the SerializedGraph to the stream.
29 /// @param [stream] the stream to save to
30 /// @return true if graph is Serialized to the Stream, false otherwise
31 virtual bool SaveSerializedToStream(std::ostream& stream) = 0;
32
33protected:
Matteo Martincighec333912019-02-13 15:12:39 +000034 virtual ~ISerializer() {}
Nattapat Chaimanowongac9cadc2019-02-13 15:52:41 +000035};
36
37} //namespace armnnSerializer