ArmNN
 24.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:
[legend]
Collaboration diagram for ProfilingDetails:
[legend]

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 arm::pipe::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  {}

◆ ~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 arm::pipe::ProfilingGuid  guid 
)
inline

Add to the ProfilingDetails.

Definition at line 34 of file ProfilingDetails.hpp.

38  {
39  // Once details exist, we can assume we're on the second iteration of details
40  if (m_DetailsExist)
41  {
43  PrintNewLine();
44  }
45 
46  PrintHeader();
47  PrintTabs();
48  m_ProfilingDetails << std::quoted("Name") << ": " << std::quoted(workloadName);
50  PrintNewLine();
51  PrintTabs();
52  m_ProfilingDetails << std::quoted("GUID") << ": " << std::quoted(std::to_string(guid));
53 
54  // From this point onwards everything is potentially optional so we must be careful of separators and new lines.
55 
56  // Print tensor infos and related data types
57  if (!infos.m_InputTensorInfos.empty())
58  {
60  PrintNewLine();
61  // Only add separator and new line if there is an output tensor info.
62  PrintInfos(infos.m_InputTensorInfos, "Input", !infos.m_OutputTensorInfos.empty());
63  }
64 
65  if (!infos.m_OutputTensorInfos.empty())
66  {
67  // Don't add a separator as we don't know what's next.
68  PrintInfos(infos.m_OutputTensorInfos, "Output", false);
69  }
70 
71  if (infos.m_BiasTensorInfo.has_value())
72  {
74  PrintNewLine();
75  PrintInfo(infos.m_BiasTensorInfo.value(), "Bias", false);
76  }
77 
78  if (infos.m_WeightsTensorInfo.has_value())
79  {
81  PrintNewLine();
82  PrintInfo(infos.m_WeightsTensorInfo.value(), "Weights", false);
83  }
84 
85  if (infos.m_ConvolutionMethod.has_value())
86  {
88  PrintNewLine();
89  PrintTabs();
90 
91  m_ProfilingDetails << std::quoted("Convolution Method") << ": "
92  << std::quoted(infos.m_ConvolutionMethod.value());
93  }
94 
95  ParameterStringifyFunction extractParams = [this](const std::string& name, const std::string& value) {
96  // Always begin with a separator and new line.
98  PrintNewLine();
99  PrintTabs();
100  m_ProfilingDetails << std::quoted(name) << " : " << std::quoted(value);
101  };
102 
104 
105  PrintNewLine();
106  PrintFooter();
107 
108  m_DetailsExist = true;
109  }

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().

◆ DetailsExist()

bool DetailsExist ( )
inline

Definition at line 118 of file ProfilingDetails.hpp.

119  {
120  return m_DetailsExist;
121  }

◆ GetProfilingDetails()

std::string GetProfilingDetails ( ) const
inline

Get the ProfilingDetails.

Returns
the ProfilingDetails

Definition at line 113 of file ProfilingDetails.hpp.

114  {
115  return m_ProfilingDetails.str();
116  }

The documentation for this class was generated from the following file:
armnn::JsonUtils::PrintNewLine
void PrintNewLine()
Definition: JsonUtils.hpp:46
armnn::ParameterStringifyFunction
std::function< void(const std::string &name, const std::string &value)> ParameterStringifyFunction
Definition: SerializeLayerParameters.hpp:14
armnn::StringifyLayerParameters::Serialize
static void Serialize(ParameterStringifyFunction &, const LayerParameter &)
Definition: SerializeLayerParameters.hpp:25
armnn::JsonUtils::PrintHeader
void PrintHeader()
Definition: JsonUtils.hpp:58
armnn::JsonUtils::PrintFooter
void PrintFooter()
Definition: JsonUtils.hpp:51
armnn::JsonUtils::PrintSeparator
void PrintSeparator()
Definition: JsonUtils.hpp:70
armnn::JsonUtils::JsonUtils
JsonUtils(std::ostream &outputStream)
Definition: JsonUtils.hpp:19
armnn::JsonUtils::PrintTabs
void PrintTabs()
Definition: JsonUtils.hpp:23