ArmNN
 25.11
Loading...
Searching...
No Matches
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.
 ~ProfilingDetails () noexcept
 Destructor.
template<typename DescriptorType>
void AddDetailsToString (const std::string &workloadName, const DescriptorType &desc, const WorkloadInfo &infos, const arm::pipe::ProfilingGuid guid)
 Add to the ProfilingDetails.
std::string GetProfilingDetails () const
 Get the ProfilingDetails.
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 {}

References JsonUtils::JsonUtils().

◆ ~ProfilingDetails()

~ProfilingDetails ( )
inlinenoexcept

Destructor.

Definition at line 29 of file ProfilingDetails.hpp.

30 {}

Member Function Documentation

◆ AddDetailsToString()

template<typename DescriptorType>
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 {
42 PrintSeparator();
43 PrintNewLine();
44 }
45
46 PrintHeader();
47 PrintTabs();
48 m_ProfilingDetails << std::quoted("Name") << ": " << std::quoted(workloadName);
49 PrintSeparator();
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 {
59 PrintSeparator();
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 {
73 PrintSeparator();
74 PrintNewLine();
75 PrintInfo(infos.m_BiasTensorInfo.value(), "Bias", false);
76 }
77
78 if (infos.m_WeightsTensorInfo.has_value())
79 {
80 PrintSeparator();
81 PrintNewLine();
82 PrintInfo(infos.m_WeightsTensorInfo.value(), "Weights", false);
83 }
84
85 if (infos.m_ConvolutionMethod.has_value())
86 {
87 PrintSeparator();
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.
97 PrintSeparator();
98 PrintNewLine();
99 PrintTabs();
100 m_ProfilingDetails << std::quoted(name) << " : " << std::quoted(value);
101 };
102
103 StringifyLayerParameters<DescriptorType>::Serialize(extractParams, desc);
104
105 PrintNewLine();
106 PrintFooter();
107
108 m_DetailsExist = true;
109 }
std::function< void(const std::string &name, const std::string &value)> ParameterStringifyFunction

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: