ArmNN
 21.02
IGpuAccTunedParameters Class Referenceabstract

Manages a set of GpuAcc parameters which have been tuned for maximum performance. More...

#include <IRuntime.hpp>

Inheritance diagram for IGpuAccTunedParameters:
ClTunedParameters

Public Types

enum  Mode { UseTunedParameters, UpdateTunedParameters }
 
enum  TuningLevel { Rapid = 0, Normal = 1, Exhaustive = 2 }
 

Public Member Functions

virtual void Load (const char *filename)=0
 Loads an existing set of tuned parameters from the given file. More...
 
virtual void Save (const char *filename) const =0
 Saves the current set of tuned parameters to the given file. More...
 

Static Public Member Functions

static void Destroy (IGpuAccTunedParameters *params)
 
static IGpuAccTunedParametersCreateRaw (Mode mode, TuningLevel tunerMode)
 Creates an IClTunedParameters with the given mode. More...
 
static IGpuAccTunedParametersPtr Create (Mode mode, TuningLevel tunerMode)
 

Protected Member Functions

virtual ~IGpuAccTunedParameters ()
 

Detailed Description

Manages a set of GpuAcc parameters which have been tuned for maximum performance.

Passes an instance of this object to the IRuntime::Create() method (via IRuntime::CreationOptions) to use it for all GPU workload execution.

Can be created in two modes:

  • In UseTunedParameters mode, the parameters stored in this object are used to execute GPU workloads.
  • In UpdateTunedParameters mode, additionally, whenever a GPU workload is executed for the first time, the optimum parameters will be found and stored in this object. WARNING - This tuning can be slow.

The parameters can be loaded from and saved to a file so that you can first run a slow initial read-write execution, save the parameters for later and then run fast read-only executions using the optimised parameters.

Definition at line 195 of file IRuntime.hpp.

Member Enumeration Documentation

◆ Mode

enum Mode
strong
Enumerator
UseTunedParameters 
UpdateTunedParameters 

Definition at line 198 of file IRuntime.hpp.

199  {
200  UseTunedParameters,
201  UpdateTunedParameters
202  };

◆ TuningLevel

enum TuningLevel
strong
Enumerator
Rapid 
Normal 
Exhaustive 

Definition at line 204 of file IRuntime.hpp.

Constructor & Destructor Documentation

◆ ~IGpuAccTunedParameters()

virtual ~IGpuAccTunedParameters ( )
inlineprotectedvirtual

Definition at line 227 of file IRuntime.hpp.

227 {};

Member Function Documentation

◆ Create()

armnn::IGpuAccTunedParametersPtr Create ( Mode  mode,
TuningLevel  tunerMode 
)
static

Definition at line 175 of file ClContextControl.cpp.

References IGpuAccTunedParameters::Destroy().

177 {
179 }
static IGpuAccTunedParameters * CreateRaw(Mode mode, TuningLevel tunerMode)
Creates an IClTunedParameters with the given mode.
static void Destroy(IGpuAccTunedParameters *params)
std::shared_ptr< IGpuAccTunedParameters > IGpuAccTunedParametersPtr
The following API is replaced by the backend options API.
Definition: IRuntime.hpp:182

◆ CreateRaw()

armnn::IGpuAccTunedParameters * CreateRaw ( Mode  mode,
TuningLevel  tunerMode 
)
static

Creates an IClTunedParameters with the given mode.

Definition at line 169 of file ClContextControl.cpp.

171 {
172  return new ClTunedParameters(mode, tuningLevel);
173 }

◆ Destroy()

void Destroy ( IGpuAccTunedParameters params)
static

Definition at line 181 of file ClContextControl.cpp.

Referenced by IGpuAccTunedParameters::Create().

182 {
183  delete params;
184 }

◆ Load()

virtual void Load ( const char *  filename)
pure virtual

Loads an existing set of tuned parameters from the given file.

If there is an error loading the file, an armnn::Exception is thrown.

Implemented in ClTunedParameters.

◆ Save()

virtual void Save ( const char *  filename) const
pure virtual

Saves the current set of tuned parameters to the given file.

If there is an error saving to the file, an armnn::Exception is thrown.

Implemented in ClTunedParameters.


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