21.02
|
Instrument creating measurements based on the information returned by clGetEventProfilingInfo for each OpenCL kernel executed. More...
#include <OpenCLTimer.h>
Public Member Functions | |
OpenCLClock (ScaleFactor scale_factor) | |
Construct an OpenCL timer. More... | |
std::string | id () const override |
Identifier for the instrument. More... | |
void | test_start () override |
Start of the test. More... | |
void | start () override |
Start measuring. More... | |
void | stop () override |
Stop measuring. More... | |
void | test_stop () override |
End of the test. More... | |
MeasurementsMap | measurements () const override |
Return the latest measurements. More... | |
MeasurementsMap | test_measurements () const override |
Return the latest test measurements. More... | |
Public Member Functions inherited from Instrument | |
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... | |
Instrument & | operator= (const Instrument &)=default |
Allow instances of this class to be copied. More... | |
Instrument & | operator= (Instrument &&)=default |
Allow instances of this class to be moved. More... | |
virtual | ~Instrument ()=default |
Default destructor. More... | |
Additional Inherited Members | |
Public Types inherited from Instrument | |
using | MeasurementsMap = std::map< std::string, Measurement > |
Map of measurements. More... | |
Static Public Member Functions inherited from Instrument | |
template<typename T , ScaleFactor scale> | |
static std::unique_ptr< Instrument > | make_instrument () |
Helper function to create an instrument of the given type. More... | |
Instrument creating measurements based on the information returned by clGetEventProfilingInfo for each OpenCL kernel executed.
Definition at line 45 of file OpenCLTimer.h.
OpenCLClock | ( | ScaleFactor | scale_factor | ) |
Construct an OpenCL timer.
[in] | scale_factor | Measurement scale factor. |
Definition at line 56 of file OpenCLTimer.cpp.
References ARM_COMPUTE_ERROR, CLScheduler::get(), arm_compute::test::framework::NONE, CLScheduler::queue(), CLScheduler::set_queue(), arm_compute::test::framework::TIME_MS, arm_compute::test::framework::TIME_S, and arm_compute::test::framework::TIME_US.
|
overridevirtual |
Identifier for the instrument.
Implements Instrument.
Definition at line 43 of file OpenCLTimer.cpp.
|
overridevirtual |
Return the latest measurements.
Reimplemented from Instrument.
Definition at line 184 of file OpenCLTimer.cpp.
References arm_compute::mlgo::parser::end(), name, OpenCLClock< output_timestamps >::start(), and arm_compute::support::cpp11::to_string().
Referenced by OpenCLClock< output_timestamps >::test_measurements().
|
overridevirtual |
Start measuring.
Called just before the run of the test starts
Reimplemented from Instrument.
Definition at line 162 of file OpenCLTimer.cpp.
Referenced by OpenCLClock< output_timestamps >::measurements().
|
overridevirtual |
Stop measuring.
Called just after the run of the test ends
Reimplemented from Instrument.
Definition at line 168 of file OpenCLTimer.cpp.
|
overridevirtual |
Return the latest test measurements.
Reimplemented from Instrument.
Definition at line 217 of file OpenCLTimer.cpp.
References CLScheduler::get(), OpenCLClock< output_timestamps >::measurements(), and CLScheduler::queue().
|
overridevirtual |
Start of the test.
Called before the test set up starts
Reimplemented from Instrument.
Definition at line 90 of file OpenCLTimer.cpp.
References ARM_COMPUTE_ERROR_ON, CLSymbols::clEnqueueNDRangeKernel_ptr, clRetainEvent(), TaskExecutor::execute_function, TaskExecutor::get(), CLSymbols::get(), arm_compute::test::validation::info, and arm_compute::test::validation::ss().
|
overridevirtual |
End of the test.
Called after the test teardown ended
Reimplemented from Instrument.
Definition at line 174 of file OpenCLTimer.cpp.
References CLSymbols::clEnqueueNDRangeKernel_ptr, TaskExecutor::execute_function, TaskExecutor::get(), and CLSymbols::get().