CLUtils  0.2.1
 Hosted by GitHub
Public Member Functions | List of all members
clutils::ProfilingInfo< nSize, rep > Class Template Reference

A class that collects and manipulates timing information about a test. More...

#include <CLUtils.hpp>

Public Member Functions

 ProfilingInfo (std::string pLabel=std::string(), std::string pUnit=std::string("ms"))
 
rep & operator[] (const int idx)
 
rep total (rep initVal=0.0)
 Returns the sum of the #nSize executon times. More...
 
rep mean ()
 Returns the mean time of the #nSize executon times. More...
 
rep min ()
 Returns the min time of the #nSize executon times. More...
 
rep max ()
 Returns the max time of the #nSize executon times. More...
 
rep speedup (ProfilingInfo &refProf)
 Returns the relative performance speedup wrt refProf. More...
 
void print (const char *title=nullptr, bool bLine=true)
 Displays summarizing results on the test. More...
 
void print (ProfilingInfo &refProf, const char *title=nullptr)
 Displays summarizing results on two tests. More...
 

Detailed Description

template<uint nSize, typename rep = double>
class clutils::ProfilingInfo< nSize, rep >

A class that collects and manipulates timing information about a test.

It stores the execution times of a test in a vector, and then offers summarizing results.

Template Parameters
nSizethe number of test repetitions.
repthe type of the values the class stores and returns.

Constructor & Destructor Documentation

template<uint nSize, typename rep = double>
clutils::ProfilingInfo< nSize, rep >::ProfilingInfo ( std::string  pLabel = std::string (),
std::string  pUnit = std::string ("ms") 
)
inline
Parameters
[in]pLabela label characterizing the test.
[in]pUnita name for the time unit to be printed when displaying the results.

Member Function Documentation

template<uint nSize, typename rep = double>
rep clutils::ProfilingInfo< nSize, rep >::max ( )
inline

Returns the max time of the #nSize executon times.

Returns
The max of the vector elements.
template<uint nSize, typename rep = double>
rep clutils::ProfilingInfo< nSize, rep >::mean ( )
inline

Returns the mean time of the #nSize executon times.

Returns
The mean of the vector elements.
template<uint nSize, typename rep = double>
rep clutils::ProfilingInfo< nSize, rep >::min ( )
inline

Returns the min time of the #nSize executon times.

Returns
The min of the vector elements.
template<uint nSize, typename rep = double>
rep& clutils::ProfilingInfo< nSize, rep >::operator[] ( const int  idx)
inline
Parameters
[in]idxsubscript index.
template<uint nSize, typename rep = double>
void clutils::ProfilingInfo< nSize, rep >::print ( const char *  title = nullptr,
bool  bLine = true 
)
inline

Displays summarizing results on the test.

Parameters
[in]titlea title for the table of results.
[in]bLinea flag for whether or not to print a newline at the end of the table.
template<uint nSize, typename rep = double>
void clutils::ProfilingInfo< nSize, rep >::print ( ProfilingInfo< nSize, rep > &  refProf,
const char *  title = nullptr 
)
inline

Displays summarizing results on two tests.

Compares the two tests by calculating the speedup on the mean execution times.

Note
I didn't bother handling the units. It's your responsibility to enforce the same unit of time on the two objects.
Parameters
[in]refProfa reference test.
[in]titlea title for the table of results.
template<uint nSize, typename rep = double>
rep clutils::ProfilingInfo< nSize, rep >::speedup ( ProfilingInfo< nSize, rep > &  refProf)
inline

Returns the relative performance speedup wrt refProf.

Parameters
[in]refProfa reference test.
Returns
The factor of execution time decrease.
template<uint nSize, typename rep = double>
rep clutils::ProfilingInfo< nSize, rep >::total ( rep  initVal = 0.0)
inline

Returns the sum of the #nSize executon times.

Parameters
[in]initValan initial value from which to start counting.
Returns
The sum of the vector elements.

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