#include <ClContextSerializer.hpp>
Definition at line 15 of file ClContextSerializer.hpp.
◆ ClContextSerializer()
◆ ~ClContextSerializer()
◆ SaveSerializedToStream()
bool SaveSerializedToStream |
( |
std::ostream & |
stream | ) |
|
Serializes the ClContext to the stream.
- Parameters
-
[stream] | the stream to save to |
- Returns
- true if ClContext is Serialized to the Stream, false otherwise
Definition at line 49 of file ClContextSerializer.cpp.
52 auto bytesToWrite = armnn::numeric_cast<std::streamsize>(m_FlatBufferBuilder.GetSize());
53 stream.write(
reinterpret_cast<const char*
>(m_FlatBufferBuilder.GetBufferPointer()), bytesToWrite);
◆ Serialize()
void Serialize |
( |
const arm_compute::CLCompileContext & |
clCompileContext | ) |
|
Serializes the CLCompileContext built-in programs.
- Parameters
-
[in] | clCompileContext | The CLCompileContext to be serialized. |
Definition at line 23 of file ClContextSerializer.cpp.
26 std::map<std::string, cl::Program> builtProgramsMap = clCompileContext.get_built_programs();
27 if (builtProgramsMap.empty())
29 ARMNN_LOG(warning) <<
"There are no built programs to be serialised.";
34 std::vector<flatbuffers::Offset<armnn::Program>> clPrograms;
35 for(
const auto& program : builtProgramsMap)
37 std::vector<std::vector<uint8_t>> binaries = program.second.getInfo<CL_PROGRAM_BINARIES>();
39 m_FlatBufferBuilder.CreateString(program.first),
40 m_FlatBufferBuilder.CreateVector(binaries[0])));
44 auto clContext =
CreateClContext(m_FlatBufferBuilder, m_FlatBufferBuilder.CreateVector(clPrograms));
46 m_FlatBufferBuilder.Finish(clContext);
References ARMNN_LOG, armnn::CreateClContext(), armnn::CreateProgram(), and armnn::warning.
The documentation for this class was generated from the following files: