blob: 71e2b1f1c946cf758cf326abe85d568cd7a2cb76 [file] [log] [blame]
Matthew Sloyan80fbcd52021-01-07 13:28:47 +00001//
2// Copyright © 2020 Arm Ltd and Contributors. All rights reserved.
3// SPDX-License-Identifier: MIT
4//
5
6#pragma once
7
8#include <arm_compute/core/CL/CLCompileContext.h>
9
10#include <flatbuffers/flatbuffers.h>
11
12namespace armnn
13{
14
15class ClContextSerializer
16{
17public:
18 ClContextSerializer() = default;
19 ~ClContextSerializer() = default;
20
21 /// Serializes the CLCompileContext built-in programs
22 /// @param [in] clCompileContext The CLCompileContext to be serialized.
23 void Serialize(const arm_compute::CLCompileContext& clCompileContext);
24
25 /// Serializes the ClContext to the stream.
26 /// @param [stream] the stream to save to
27 /// @return true if ClContext is Serialized to the Stream, false otherwise
28 bool SaveSerializedToStream(std::ostream& stream);
29
30private:
31 /// FlatBufferBuilder to create the CLContext FlatBuffers.
32 flatbuffers::FlatBufferBuilder m_FlatBufferBuilder;
33};
34
35} // namespace armnn