From fd627ffaec8fd8801d980b4c91ee7c0607ab6aaf Mon Sep 17 00:00:00 2001 From: Jan Eilers Date: Thu, 25 Feb 2021 17:44:00 +0000 Subject: IVGCVSW-5687 Update Doxygen Docu * Update Doxygen Documentation for 21.02 release Signed-off-by: Jan Eilers Change-Id: I9ed2f9caab038836ea99d7b378d7899fe431a4e5 --- 21.02/classarmnn_1_1_cl_context_serializer.xhtml | 261 +++++++++++++++++++++++ 1 file changed, 261 insertions(+) create mode 100644 21.02/classarmnn_1_1_cl_context_serializer.xhtml (limited to '21.02/classarmnn_1_1_cl_context_serializer.xhtml') diff --git a/21.02/classarmnn_1_1_cl_context_serializer.xhtml b/21.02/classarmnn_1_1_cl_context_serializer.xhtml new file mode 100644 index 0000000000..8c078bb7df --- /dev/null +++ b/21.02/classarmnn_1_1_cl_context_serializer.xhtml @@ -0,0 +1,261 @@ + + + + + + + + + + + + + +ArmNN: ClContextSerializer Class Reference + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  21.02 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
ClContextSerializer Class Reference
+
+
+ +

#include <ClContextSerializer.hpp>

+ + + + + + + + + + + + +

+Public Member Functions

 ClContextSerializer ()=default
 
 ~ClContextSerializer ()=default
 
void Serialize (const arm_compute::CLCompileContext &clCompileContext)
 Serializes the CLCompileContext built-in programs. More...
 
bool SaveSerializedToStream (std::ostream &stream)
 Serializes the ClContext to the stream. More...
 
+

Detailed Description

+
+

Definition at line 15 of file ClContextSerializer.hpp.

+

Constructor & Destructor Documentation

+ +

◆ ClContextSerializer()

+ +
+
+ + + + + +
+ + + + + + + +
ClContextSerializer ()
+
+default
+
+ +
+
+ +

◆ ~ClContextSerializer()

+ +
+
+ + + + + +
+ + + + + + + +
~ClContextSerializer ()
+
+default
+
+ +
+
+

Member Function Documentation

+ +

◆ 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.

+ +

References armnn::numeric_cast().

+ +

Referenced by ClWorkloadFactory::AfterWorkloadsCreated().

+
50 {
51  // Write to a stream
52  auto bytesToWrite = armnn::numeric_cast<std::streamsize>(m_FlatBufferBuilder.GetSize());
53  stream.write(reinterpret_cast<const char*>(m_FlatBufferBuilder.GetBufferPointer()), bytesToWrite);
54  return !stream.bad();
55 }
std::enable_if_t< std::is_unsigned< Source >::value &&std::is_unsigned< Dest >::value, Dest > numeric_cast(Source source)
Definition: NumericCast.hpp:35
+
+
+
+ +

◆ Serialize()

+ +
+
+ + + + + + + + +
void Serialize (const arm_compute::CLCompileContext & clCompileContext)
+
+ +

Serializes the CLCompileContext built-in programs.

+
Parameters
+ + +
[in]clCompileContextThe CLCompileContext to be serialized.
+
+
+ +

Definition at line 23 of file ClContextSerializer.cpp.

+ +

References ARMNN_LOG, armnn::CreateClContext(), armnn::CreateProgram(), and armnn::warning.

+ +

Referenced by ClWorkloadFactory::AfterWorkloadsCreated().

+
24 {
25  // Get map of built programs from clCompileContext
26  std::map<std::string, cl::Program> builtProgramsMap = clCompileContext.get_built_programs();
27  if (builtProgramsMap.empty())
28  {
29  ARMNN_LOG(warning) << "There are no built programs to be serialised.";
30  return;
31  }
32 
33  // Create Flatbuffer CL Programs
34  std::vector<flatbuffers::Offset<armnn::Program>> clPrograms;
35  for(const auto& program : builtProgramsMap)
36  {
37  std::vector<std::vector<uint8_t>> binaries = program.second.getInfo<CL_PROGRAM_BINARIES>();
38  clPrograms.push_back(CreateProgram(m_FlatBufferBuilder,
39  m_FlatBufferBuilder.CreateString(program.first),
40  m_FlatBufferBuilder.CreateVector(binaries[0])));
41  }
42 
43  // Create Flatbuffer CLContext
44  auto clContext = CreateClContext(m_FlatBufferBuilder, m_FlatBufferBuilder.CreateVector(clPrograms));
45 
46  m_FlatBufferBuilder.Finish(clContext);
47 }
flatbuffers::Offset< Program > CreateProgram(flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::Offset< flatbuffers::String > name=0, flatbuffers::Offset< flatbuffers::Vector< uint8_t >> binary=0)
+
#define ARMNN_LOG(severity)
Definition: Logging.hpp:202
+ +
flatbuffers::Offset< ClContext > CreateClContext(flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::Offset< flatbuffers::Vector< flatbuffers::Offset< armnn::Program >>> programs=0)
+
+
+
+
The documentation for this class was generated from the following files: +
+
+ + + + -- cgit v1.2.1