ArmNN
 26.07
OptimizerOptionsOpaque Class Reference

#include <INetwork.hpp>

Public Member Functions

 OptimizerOptionsOpaque ()
 
 OptimizerOptionsOpaque (const OptimizerOptionsOpaque &other)
 
 ~OptimizerOptionsOpaque ()
 
 OptimizerOptionsOpaque (const OptimizerOptions &OptimizerStruct)
 
OptimizerOptionsOpaqueoperator= (OptimizerOptionsOpaque other)
 
 OptimizerOptionsOpaque (bool reduceFp32ToFp16, bool debug, bool reduceFp32ToBf16, bool importEnabled, ModelOptions modelOptions={}, bool exportEnabled=false, bool debugToFile=false)
 
 OptimizerOptionsOpaque (bool reduceFp32ToFp16, bool debug, bool reduceFp32ToBf16=false, ShapeInferenceMethod shapeInferenceMethod=armnn::ShapeInferenceMethod::ValidateOnly, bool importEnabled=false, ModelOptions modelOptions={}, bool exportEnabled=false, bool debugToFile=false, bool allowExpandedDims=false)
 
const std::string ToString () const
 
bool GetProfilingEnabled () const
 
bool GetImportEnabled () const
 
bool GetExportEnabled () const
 
bool GetReduceFp32ToFp16 () const
 
bool GetReduceFp32ToBf16 () const
 
bool GetDebugEnabled () const
 
bool GetDebugToFileEnabled () const
 
bool GetAllowExpandedDims () const
 
armnn::ModelOptions GetModelOptions () const
 
armnn::ShapeInferenceMethod GetShapeInferenceMethod () const
 
void SetImportEnabled (bool ImportState)
 
void SetExportEnabled (bool ExportState)
 
void SetProfilingEnabled (bool ProfilingState)
 
void SetDebugEnabled (bool DebugState)
 
void SetDebugToFileEnabled (bool DebugFileState)
 
void SetReduceFp32ToFp16 (bool ReduceFp32ToFp16State)
 
void SetShapeInferenceMethod (armnn::ShapeInferenceMethod ShapeInferenceMethodType)
 
void AddModelOption (armnn::BackendOptions)
 
void SetAllowExpandedDims (bool ExpandedDimsAllowed)
 

Detailed Description

Definition at line 272 of file INetwork.hpp.

Constructor & Destructor Documentation

◆ OptimizerOptionsOpaque() [1/5]

Definition at line 50 of file Network.cpp.

51  : p_OptimizerOptionsImpl(std::make_unique<OptimizerOptionsOpaqueImpl>())
52 {
53 }

◆ OptimizerOptionsOpaque() [2/5]

Definition at line 55 of file Network.cpp.

56  : p_OptimizerOptionsImpl(std::make_unique<OptimizerOptionsOpaqueImpl>(*other.p_OptimizerOptionsImpl))
57 {
58 }

◆ ~OptimizerOptionsOpaque()

~OptimizerOptionsOpaque ( )
default

◆ OptimizerOptionsOpaque() [3/5]

OptimizerOptionsOpaque ( const OptimizerOptions OptimizerStruct)

Definition at line 82 of file Network.cpp.

83  : p_OptimizerOptionsImpl(std::make_unique<OptimizerOptionsOpaqueImpl>())
84 {
85  p_OptimizerOptionsImpl->m_ImportEnabled = OptimizerStruct.m_ImportEnabled;
86  p_OptimizerOptionsImpl->m_shapeInferenceMethod = OptimizerStruct.m_shapeInferenceMethod;
87  p_OptimizerOptionsImpl->m_ModelOptions = OptimizerStruct.m_ModelOptions;
88  p_OptimizerOptionsImpl->m_ProfilingEnabled = OptimizerStruct.m_ProfilingEnabled;
89  p_OptimizerOptionsImpl->m_DebugToFile = OptimizerStruct.m_DebugToFile;
90  p_OptimizerOptionsImpl->m_Debug = OptimizerStruct.m_Debug;
91  p_OptimizerOptionsImpl->m_ReduceFp32ToFp16 = OptimizerStruct.m_ReduceFp32ToFp16;
92  p_OptimizerOptionsImpl->m_ExportEnabled = OptimizerStruct.m_ExportEnabled;
93  p_OptimizerOptionsImpl->m_AllowExpandedDims = OptimizerStruct.m_AllowExpandedDims;
94  p_OptimizerOptionsImpl->m_ReduceFp32ToBf16 = OptimizerStruct.m_ReduceFp32ToBf16;
95 }

References OptimizerOptions::m_AllowExpandedDims, OptimizerOptions::m_Debug, OptimizerOptions::m_DebugToFile, OptimizerOptions::m_ExportEnabled, OptimizerOptions::m_ImportEnabled, OptimizerOptions::m_ModelOptions, OptimizerOptions::m_ProfilingEnabled, OptimizerOptions::m_ReduceFp32ToBf16, OptimizerOptions::m_ReduceFp32ToFp16, and OptimizerOptions::m_shapeInferenceMethod.

◆ OptimizerOptionsOpaque() [4/5]

OptimizerOptionsOpaque ( bool  reduceFp32ToFp16,
bool  debug,
bool  reduceFp32ToBf16,
bool  importEnabled,
ModelOptions  modelOptions = {},
bool  exportEnabled = false,
bool  debugToFile = false 
)

Definition at line 62 of file Network.cpp.

65  : p_OptimizerOptionsImpl(std::make_unique<OptimizerOptionsOpaqueImpl>(reduceFp32ToFp16, debug, reduceFp32ToBf16,
66  importEnabled, modelOptions,
67  exportEnabled, debugToFile))
68 {
69 }

References armnn::debug.

◆ OptimizerOptionsOpaque() [5/5]

OptimizerOptionsOpaque ( bool  reduceFp32ToFp16,
bool  debug,
bool  reduceFp32ToBf16 = false,
ShapeInferenceMethod  shapeInferenceMethod = armnn::ShapeInferenceMethod::ValidateOnly,
bool  importEnabled = false,
ModelOptions  modelOptions = {},
bool  exportEnabled = false,
bool  debugToFile = false,
bool  allowExpandedDims = false 
)

Definition at line 71 of file Network.cpp.

75  : p_OptimizerOptionsImpl(std::make_unique<OptimizerOptionsOpaqueImpl>(reduceFp32ToFp16, debug, reduceFp32ToBf16,
76  shapeInferenceMethod, importEnabled,
77  modelOptions, exportEnabled,
78  debugToFile, allowExpandedDims))
79 {
80 }

References armnn::debug.

Member Function Documentation

◆ AddModelOption()

void AddModelOption ( armnn::BackendOptions  NewModelOption)

Definition at line 152 of file Network.cpp.

153 {
154  p_OptimizerOptionsImpl->m_ModelOptions.push_back(NewModelOption);
155 }

◆ GetAllowExpandedDims()

bool GetAllowExpandedDims ( ) const

Definition at line 192 of file Network.cpp.

193 {
194  return p_OptimizerOptionsImpl->m_AllowExpandedDims;
195 }

Referenced by OptimizerOptionsOpaque::operator=().

◆ GetDebugEnabled()

bool GetDebugEnabled ( ) const

Definition at line 182 of file Network.cpp.

183 {
184  return p_OptimizerOptionsImpl->m_Debug;
185 }

Referenced by OptimizerOptionsOpaque::operator=().

◆ GetDebugToFileEnabled()

bool GetDebugToFileEnabled ( ) const

Definition at line 187 of file Network.cpp.

188 {
189  return p_OptimizerOptionsImpl->m_DebugToFile;
190 }

Referenced by OptimizerOptionsOpaque::operator=().

◆ GetExportEnabled()

bool GetExportEnabled ( ) const

Definition at line 167 of file Network.cpp.

168 {
169  return p_OptimizerOptionsImpl->m_ExportEnabled;
170 };

Referenced by OptimizerOptionsOpaque::operator=().

◆ GetImportEnabled()

bool GetImportEnabled ( ) const

Definition at line 162 of file Network.cpp.

163 {
164  return p_OptimizerOptionsImpl->m_ImportEnabled;
165 };

Referenced by OptimizerOptionsOpaque::operator=().

◆ GetModelOptions()

armnn::ModelOptions GetModelOptions ( ) const

Definition at line 197 of file Network.cpp.

198 {
199  return p_OptimizerOptionsImpl->m_ModelOptions;
200 }

Referenced by OptimizerOptionsOpaque::operator=().

◆ GetProfilingEnabled()

bool GetProfilingEnabled ( ) const

Definition at line 157 of file Network.cpp.

158 {
159  return p_OptimizerOptionsImpl->m_ProfilingEnabled;
160 };

Referenced by OptimizerOptionsOpaque::operator=().

◆ GetReduceFp32ToBf16()

bool GetReduceFp32ToBf16 ( ) const

Definition at line 177 of file Network.cpp.

178 {
179  return p_OptimizerOptionsImpl->m_ReduceFp32ToBf16;
180 }

Referenced by OptimizerOptionsOpaque::operator=().

◆ GetReduceFp32ToFp16()

bool GetReduceFp32ToFp16 ( ) const

Definition at line 172 of file Network.cpp.

173 {
174  return p_OptimizerOptionsImpl->m_ReduceFp32ToFp16;
175 };

Referenced by OptimizerOptionsOpaque::operator=().

◆ GetShapeInferenceMethod()

armnn::ShapeInferenceMethod GetShapeInferenceMethod ( ) const

Definition at line 202 of file Network.cpp.

203 {
204  return p_OptimizerOptionsImpl->m_shapeInferenceMethod;
205 }

Referenced by OptimizerOptionsOpaque::operator=().

◆ operator=()

Definition at line 97 of file Network.cpp.

98 {
99  p_OptimizerOptionsImpl->m_ImportEnabled = other.GetImportEnabled();
100  p_OptimizerOptionsImpl->m_shapeInferenceMethod = other.GetShapeInferenceMethod();
101  p_OptimizerOptionsImpl->m_ModelOptions = other.GetModelOptions();
102  p_OptimizerOptionsImpl->m_ProfilingEnabled = other.GetProfilingEnabled();
103  p_OptimizerOptionsImpl->m_DebugToFile = other.GetDebugToFileEnabled();
104  p_OptimizerOptionsImpl->m_Debug = other.GetDebugEnabled();
105  p_OptimizerOptionsImpl->m_ReduceFp32ToFp16 = other.GetReduceFp32ToFp16();
106  p_OptimizerOptionsImpl->m_ExportEnabled = other.GetExportEnabled();
107  p_OptimizerOptionsImpl->m_AllowExpandedDims = other.GetAllowExpandedDims();
108  p_OptimizerOptionsImpl->m_ReduceFp32ToBf16 = other.GetReduceFp32ToBf16();
109  return *this;
110 }

References OptimizerOptionsOpaque::GetAllowExpandedDims(), OptimizerOptionsOpaque::GetDebugEnabled(), OptimizerOptionsOpaque::GetDebugToFileEnabled(), OptimizerOptionsOpaque::GetExportEnabled(), OptimizerOptionsOpaque::GetImportEnabled(), OptimizerOptionsOpaque::GetModelOptions(), OptimizerOptionsOpaque::GetProfilingEnabled(), OptimizerOptionsOpaque::GetReduceFp32ToBf16(), OptimizerOptionsOpaque::GetReduceFp32ToFp16(), and OptimizerOptionsOpaque::GetShapeInferenceMethod().

◆ SetAllowExpandedDims()

void SetAllowExpandedDims ( bool  ExpandedDimsAllowed)

Definition at line 147 of file Network.cpp.

148 {
149  p_OptimizerOptionsImpl->m_AllowExpandedDims = ExpandedDimsAllowed;
150 }

◆ SetDebugEnabled()

void SetDebugEnabled ( bool  DebugState)

Definition at line 127 of file Network.cpp.

128 {
129  p_OptimizerOptionsImpl->m_Debug = DebugState;
130 }

◆ SetDebugToFileEnabled()

void SetDebugToFileEnabled ( bool  DebugFileState)

Definition at line 132 of file Network.cpp.

133 {
134  p_OptimizerOptionsImpl->m_DebugToFile = DebugFileState;
135 }

◆ SetExportEnabled()

void SetExportEnabled ( bool  ExportState)

Definition at line 117 of file Network.cpp.

118 {
119  p_OptimizerOptionsImpl->m_ExportEnabled = ExportState;
120 }

◆ SetImportEnabled()

void SetImportEnabled ( bool  ImportState)

Definition at line 112 of file Network.cpp.

113 {
114  p_OptimizerOptionsImpl->m_ImportEnabled = ImportState;
115 }

◆ SetProfilingEnabled()

void SetProfilingEnabled ( bool  ProfilingState)

Definition at line 122 of file Network.cpp.

123 {
124  p_OptimizerOptionsImpl->m_ProfilingEnabled = ProfilingState;
125 }

◆ SetReduceFp32ToFp16()

void SetReduceFp32ToFp16 ( bool  ReduceFp32ToFp16State)

Definition at line 137 of file Network.cpp.

138 {
139  p_OptimizerOptionsImpl->m_ReduceFp32ToFp16 = ReduceFp32ToFp16State;
140 }

◆ SetShapeInferenceMethod()

void SetShapeInferenceMethod ( armnn::ShapeInferenceMethod  ShapeInferenceMethodType)

Definition at line 142 of file Network.cpp.

143 {
144  p_OptimizerOptionsImpl->m_shapeInferenceMethod = ShapeInferenceMethodType;
145 }

◆ ToString()

const std::string ToString ( ) const

Definition at line 207 of file Network.cpp.

208 {
209  std::stringstream stream;
210  stream << "OptimizerOptions: \n";
211  stream << "\tReduceFp32ToFp16: " << p_OptimizerOptionsImpl->m_ReduceFp32ToFp16 << "\n";
212  stream << "\tReduceFp32ToBf16: " << p_OptimizerOptionsImpl->m_ReduceFp32ToBf16 << "\n";
213  stream << "\tDebug: " << p_OptimizerOptionsImpl->m_Debug << "\n";
214  stream << "\tDebug to file: " << p_OptimizerOptionsImpl->m_DebugToFile << "\n";
215  stream << "\tShapeInferenceMethod: " <<
216  (p_OptimizerOptionsImpl->m_shapeInferenceMethod == ShapeInferenceMethod::ValidateOnly ?
217  "ValidateOnly" : "InferAndValidate") << "\n";
218  stream << "\tImportEnabled: " << p_OptimizerOptionsImpl->m_ImportEnabled << "\n";
219  stream << "\tExportEnabled: " << p_OptimizerOptionsImpl->m_ExportEnabled << "\n";
220  stream << "\tProfilingEnabled: " << p_OptimizerOptionsImpl->m_ProfilingEnabled << "\n";
221  stream << "\tAllowExpandedDims: " << p_OptimizerOptionsImpl->m_AllowExpandedDims << "\n";
222 
223  stream << "\tModelOptions: \n";
224  for (auto optionsGroup : p_OptimizerOptionsImpl->m_ModelOptions)
225  {
226  for (size_t i=0; i < optionsGroup.GetOptionCount(); i++)
227  {
228  const armnn::BackendOptions::BackendOption option = optionsGroup.GetOption(i);
229  stream << "\t\tBackend: " << optionsGroup.GetBackendId() << "\n"
230  << "\t\t\tOption: " << option.GetName() << "\n"
231  << "\t\t\tValue: " << std::string(option.GetValue().ToString()) << "\n";
232  }
233  }
234 
235  return stream.str();
236 }
@ ValidateOnly
Validate all output shapes.

References BackendOptions::BackendOption::GetName(), BackendOptions::BackendOption::GetValue(), BackendOptions::Var::ToString(), and armnn::ValidateOnly.


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