ArmNN
 21.08
ProfilingDetails Class Reference

ProfilingDetails class records any details associated with the operator and passes on for outputting to the user. More...

#include <ProfilingDetails.hpp>

Inheritance diagram for ProfilingDetails:
JsonUtils

Public Member Functions

 ProfilingDetails ()
 Constructor. More...
 
 ~ProfilingDetails () noexcept
 Destructor. More...
 
template<typename DescriptorType >
void AddDetailsToString (const std::string &workloadName, const DescriptorType &desc, const WorkloadInfo &infos, const profiling::ProfilingGuid guid)
 Add to the ProfilingDetails. More...
 
std::string GetProfilingDetails () const
 Get the ProfilingDetails. More...
 
bool DetailsExist ()
 
- Public Member Functions inherited from JsonUtils
 JsonUtils (std::ostream &outputStream)
 
void PrintTabs ()
 
void DecrementNumberOfTabs ()
 
void IncrementNumberOfTabs ()
 
void PrintNewLine ()
 
void PrintFooter ()
 
void PrintHeader ()
 
void PrintArmNNHeader ()
 
void PrintSeparator ()
 

Detailed Description

ProfilingDetails class records any details associated with the operator and passes on for outputting to the user.

Definition at line 21 of file ProfilingDetails.hpp.

Constructor & Destructor Documentation

◆ ProfilingDetails()

ProfilingDetails ( )
inline

Constructor.

Definition at line 25 of file ProfilingDetails.hpp.

25  : JsonUtils(m_ProfilingDetails), m_DetailsExist(false)
26  {}
JsonUtils(std::ostream &outputStream)
Definition: JsonUtils.hpp:19

◆ ~ProfilingDetails()

~ProfilingDetails ( )
inlinenoexcept

Destructor.

Definition at line 29 of file ProfilingDetails.hpp.

30  {}

Member Function Documentation

◆ AddDetailsToString()

void AddDetailsToString ( const std::string &  workloadName,
const DescriptorType &  desc,
const WorkloadInfo infos,
const profiling::ProfilingGuid  guid 
)
inline

Add to the ProfilingDetails.

Definition at line 34 of file ProfilingDetails.hpp.

References OptionalBase::has_value(), WorkloadInfo::m_BiasTensorInfo, WorkloadInfo::m_ConvolutionMethod, WorkloadInfo::m_InputTensorInfos, WorkloadInfo::m_OutputTensorInfos, WorkloadInfo::m_WeightsTensorInfo, JsonUtils::PrintFooter(), JsonUtils::PrintHeader(), JsonUtils::PrintNewLine(), JsonUtils::PrintSeparator(), JsonUtils::PrintTabs(), StringifyLayerParameters< LayerParameter >::Serialize(), and OptionalReferenceSwitch< IsReference, T >::value().

38  {
39  m_ProfilingDetails << std::quoted("Name") << ": " << std::quoted(workloadName) << " ";
40  PrintHeader();
41 
42  PrintTabs();
43  m_ProfilingDetails << std::quoted("GUID") << ": " << std::quoted(std::to_string(guid));
45  PrintNewLine();
46 
47  // Print tensor infos and related data types
48  PrintInfos(infos.m_InputTensorInfos, "Input");
49 
50  PrintInfos(infos.m_OutputTensorInfos, "Output");
51 
52  if ( infos.m_BiasTensorInfo.has_value())
53  {
54  PrintInfo(infos.m_BiasTensorInfo.value(), "Bias");
55  }
56  if ( infos.m_WeightsTensorInfo.has_value())
57  {
58  PrintInfo(infos.m_WeightsTensorInfo.value(), "Weights");
59  }
60  if ( infos.m_ConvolutionMethod.has_value())
61  {
62  PrintTabs();
63 
64  m_ProfilingDetails << std::quoted("Convolution Method") << ": "
65  << std::quoted(infos.m_ConvolutionMethod.value());
66 
68  PrintNewLine();
69  }
70 
71  ParameterStringifyFunction extractParams = [this](const std::string& name, const std::string& value) {
72  PrintTabs();
73  m_ProfilingDetails << std::quoted(name) << " : " << std::quoted(value);
74  if (name != "DataLayout") PrintSeparator();
75  PrintNewLine();
76  };
77 
79 
80  PrintFooter();
82  PrintNewLine();
83 
84  m_DetailsExist = true;
85  }
void PrintHeader()
Definition: JsonUtils.hpp:58
void PrintFooter()
Definition: JsonUtils.hpp:51
void PrintNewLine()
Definition: JsonUtils.hpp:46
void PrintSeparator()
Definition: JsonUtils.hpp:70
std::function< void(const std::string &name, const std::string &value)> ParameterStringifyFunction
static void Serialize(ParameterStringifyFunction &, const LayerParameter &)

◆ DetailsExist()

bool DetailsExist ( )
inline

◆ GetProfilingDetails()

std::string GetProfilingDetails ( ) const
inline

Get the ProfilingDetails.

Returns
the ProfilingDetails

Definition at line 89 of file ProfilingDetails.hpp.

90  {
91  return m_ProfilingDetails.str();
92  }

The documentation for this class was generated from the following file: