Compute Library
 21.05
Instrument Class Referenceabstract

Interface for classes that can be used to measure performance. More...

#include <Instrument.h>

Public Types

using MeasurementsMap = std::map< std::string, Measurement >
 Map of measurements. More...
 

Public Member Functions

 Instrument ()=default
 Default constructor. More...
 
 Instrument (const Instrument &)=default
 Allow instances of this class to be copy constructed. More...
 
 Instrument (Instrument &&)=default
 Allow instances of this class to be move constructed. More...
 
Instrumentoperator= (const Instrument &)=default
 Allow instances of this class to be copied. More...
 
Instrumentoperator= (Instrument &&)=default
 Allow instances of this class to be moved. More...
 
virtual ~Instrument ()=default
 Default destructor. More...
 
virtual std::string id () const =0
 Identifier for the instrument. More...
 
virtual void test_start ()
 Start of the test. More...
 
virtual void start ()
 Start measuring. More...
 
virtual void stop ()
 Stop measuring. More...
 
virtual void test_stop ()
 End of the test. More...
 
virtual MeasurementsMap measurements () const
 Return the latest measurements. More...
 
virtual MeasurementsMap test_measurements () const
 Return the latest test measurements. More...
 

Static Public Member Functions

template<typename T , ScaleFactor scale>
static std::unique_ptr< Instrumentmake_instrument ()
 Helper function to create an instrument of the given type. More...
 

Detailed Description

Interface for classes that can be used to measure performance.

Definition at line 50 of file Instrument.h.

Member Typedef Documentation

◆ MeasurementsMap

using MeasurementsMap = std::map<std::string, Measurement>

Map of measurements.

Definition at line 109 of file Instrument.h.

Constructor & Destructor Documentation

◆ Instrument() [1/3]

Instrument ( )
default

Default constructor.

◆ Instrument() [2/3]

Instrument ( const Instrument )
default

Allow instances of this class to be copy constructed.

◆ Instrument() [3/3]

Instrument ( Instrument &&  )
default

Allow instances of this class to be move constructed.

◆ ~Instrument()

virtual ~Instrument ( )
virtualdefault

Default destructor.

Member Function Documentation

◆ id()

virtual std::string id ( ) const
pure virtual

◆ make_instrument()

std::unique_ptr< Instrument > make_instrument ( )
inlinestatic

Helper function to create an instrument of the given type.

Returns
Instance of an instrument of the given type.

Definition at line 134 of file Instrument.h.

135 {
136  return std::make_unique<T>(scale);
137 }

References arm_compute::test::validation::scale.

◆ measurements()

virtual MeasurementsMap measurements ( ) const
inlinevirtual

Return the latest measurements.

Returns
the latest measurements.

Reimplemented in SchedulerClock< output_timestamps >, WallClock< output_timestamps >, PMUCounter, MaliCounter, OpenCLClock< output_timestamps >, and OpenCLMemoryUsage.

Definition at line 115 of file Instrument.h.

116  {
117  return MeasurementsMap();
118  }
std::map< std::string, Measurement > MeasurementsMap
Map of measurements.
Definition: Instrument.h:109

◆ operator=() [1/2]

Instrument& operator= ( const Instrument )
default

Allow instances of this class to be copied.

◆ operator=() [2/2]

Instrument& operator= ( Instrument &&  )
default

Allow instances of this class to be moved.

◆ start()

virtual void start ( )
inlinevirtual

Start measuring.

Called just before the run of the test starts

Reimplemented in SchedulerClock< output_timestamps >, WallClock< output_timestamps >, PMUCounter, MaliCounter, OpenCLClock< output_timestamps >, and OpenCLMemoryUsage.

Definition at line 89 of file Instrument.h.

90  {
91  }

◆ stop()

virtual void stop ( )
inlinevirtual

Stop measuring.

Called just after the run of the test ends

Reimplemented in WallClock< output_timestamps >, PMUCounter, MaliCounter, OpenCLClock< output_timestamps >, and OpenCLMemoryUsage.

Definition at line 97 of file Instrument.h.

98  {
99  }

◆ test_measurements()

virtual MeasurementsMap test_measurements ( ) const
inlinevirtual

Return the latest test measurements.

Returns
the latest test measurements.

Reimplemented in OpenCLClock< output_timestamps >, and OpenCLMemoryUsage.

Definition at line 124 of file Instrument.h.

125  {
126  return MeasurementsMap();
127  }
std::map< std::string, Measurement > MeasurementsMap
Map of measurements.
Definition: Instrument.h:109

◆ test_start()

virtual void test_start ( )
inlinevirtual

Start of the test.

Called before the test set up starts

Reimplemented in SchedulerClock< output_timestamps >, OpenCLClock< output_timestamps >, and OpenCLMemoryUsage.

Definition at line 81 of file Instrument.h.

82  {
83  }

◆ test_stop()

virtual void test_stop ( )
inlinevirtual

End of the test.

Called after the test teardown ended

Reimplemented in SchedulerClock< output_timestamps >, OpenCLClock< output_timestamps >, and OpenCLMemoryUsage.

Definition at line 105 of file Instrument.h.

106  {
107  }

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