clSPARSE  v0.10.0.0
a software library containing Sparse functions written in OpenCL
Public Member Functions | Protected Member Functions | List of all members
clsparseTimer Class Referenceabstract

Counter that provides a fairly accurate timing mechanism for both windows and linux. This timer is used extensively in all the samples. More...

#include <clsparseTimer.hpp>

Public Member Functions

virtual void Start (size_t id)=0
 Start a timing sample.
 
virtual void Stop (size_t id)=0
 Stop a timing sample.
 
virtual void Clear ()=0
 Clear all internal data structures, deallocate all memory.
 
virtual void Reset ()=0
 Clear all internal data structures, freeing all memory, then reallocate the same amount of memory requested with Reserve.
 
virtual void Reserve (size_t nEvents, size_t nSamples)=0
 The implementation of the timing class may contains data structures that need to grow as more samples are collected. More...
 
virtual size_t getUniqueID (const std::string &label, cl_uint groupID)=0
 Provide a mapping from a 'friendly' human readable text string to an index into internal data structures. More...
 
virtual void setNormalize (bool norm)=0
 Request that the timer divides total samples collected by sample frequency, converting tick counts into seconds. More...
 
virtual void Print (cl_ulong flopCount, std::string unit)=0
 Print the output of the timing information to the console. This includes information specific to the derived timer class. More...
 
virtual size_t pruneOutliers (cl_double multiple)=0
 Using the stdDev of the entire population (of an id), eliminate those samples that fall outside some specified multiple of the stdDev. This assumes that the population form a Gaussian curve. More...
 

Protected Member Functions

virtual ~clsparseTimer ()
 Destructor for StatisticalTimer that cleans up the class.
 

Detailed Description

Counter that provides a fairly accurate timing mechanism for both windows and linux. This timer is used extensively in all the samples.

Member Function Documentation

virtual size_t clsparseTimer::getUniqueID ( const std::string &  label,
cl_uint  groupID 
)
pure virtual

Provide a mapping from a 'friendly' human readable text string to an index into internal data structures.

Parameters
[in]labelHuman readable string to textually identify the event
[in]groupIDA number paired with the string to differentiate identical strings
virtual void clsparseTimer::Print ( cl_ulong  flopCount,
std::string  unit 
)
pure virtual

Print the output of the timing information to the console. This includes information specific to the derived timer class.

Parameters
[in]flopCountThe number of flops in a calculation, to calculate the flop rate
[in]unitString to represent the Unit to print
virtual size_t clsparseTimer::pruneOutliers ( cl_double  multiple)
pure virtual

Using the stdDev of the entire population (of an id), eliminate those samples that fall outside some specified multiple of the stdDev. This assumes that the population form a Gaussian curve.

Parameters
[in]multipleHow many standard deviates to prune outliers, typically integer between 1..3
virtual void clsparseTimer::Reserve ( size_t  nEvents,
size_t  nSamples 
)
pure virtual

The implementation of the timing class may contains data structures that need to grow as more samples are collected.

This function allows the client to specify to the timing class an estimate for the amount of memory required for the duration of the benchmark

Parameters
[in]nEventsAn event is an independent timing location of benchmark interest, such as two different functions
[in]nSamplesThe number of samples that associated with an event, often a loop-count
virtual void clsparseTimer::setNormalize ( bool  norm)
pure virtual

Request that the timer divides total samples collected by sample frequency, converting tick counts into seconds.

Parameters
[in]normTrue value will divide return result by frequency

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