ArmNN
 24.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:
[legend]

Public Types

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

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 313 of file IRuntime.hpp.

Member Enumeration Documentation

◆ Mode

enum Mode
strong
Enumerator
UseTunedParameters 
UpdateTunedParameters 

Definition at line 316 of file IRuntime.hpp.

317  {
318  UseTunedParameters,
319  UpdateTunedParameters
320  };

◆ TuningLevel

enum TuningLevel
strong
Enumerator
Rapid 
Normal 
Exhaustive 

Definition at line 322 of file IRuntime.hpp.

323  {
324  Rapid = 1,
325  Normal = 2,
326  Exhaustive = 3
327  };

Constructor & Destructor Documentation

◆ ~IGpuAccTunedParameters()

virtual ~IGpuAccTunedParameters ( )
inlineprotectedvirtual

Definition at line 345 of file IRuntime.hpp.

345 {};

Member Function Documentation

◆ Create()

◆ CreateRaw()

Creates an IClTunedParameters with the given mode.

Definition at line 11 of file ArmComputeTuningUtils.cpp.

13 {
14  return new ClTunedParameters(mode, tuningLevel);
15 }

Referenced by IGpuAccTunedParameters::Create().

◆ Destroy()

void Destroy ( IGpuAccTunedParameters params)
static

Definition at line 23 of file ArmComputeTuningUtils.cpp.

24 {
25  delete params;
26 }

Referenced by IGpuAccTunedParameters::Create().

◆ 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:
armnn::TuningLevel::Exhaustive
@ Exhaustive
armnn::IGpuAccTunedParameters::Destroy
static void Destroy(IGpuAccTunedParameters *params)
Definition: ArmComputeTuningUtils.cpp:23
armnn::TuningLevel::Rapid
@ Rapid
armnn::TuningLevel::Normal
@ Normal
armnn::IGpuAccTunedParameters::CreateRaw
static IGpuAccTunedParameters * CreateRaw(Mode mode, TuningLevel tunerMode)
Creates an IClTunedParameters with the given mode.
Definition: ArmComputeTuningUtils.cpp:11
armnn::IGpuAccTunedParametersPtr
std::shared_ptr< IGpuAccTunedParameters > IGpuAccTunedParametersPtr
The following API is replaced by the backend options API.
Definition: IRuntime.hpp:300