MCPcopy Create free account
hub / github.com/clMathLibraries/clFFT / GpuStatTimer

Class GpuStatTimer

src/statTimer/statisticalTimer.GPU.h:122–254  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

120bool operator<( const StatData& lhs, const StatData& rhs);
121
122class GpuStatTimer : public baseStatTimer
123{
124 // Typedefs to handle the data that we store
125 typedef std::vector< StatData > StatDataVec;
126 typedef std::vector< StatDataVec > PerEnqueueVec;
127
128 // In order to calculate statistics <std. dev.>, we need to keep a history of our timings
129 std::vector< PerEnqueueVec > timerData;
130
131 // Typedefs to handle the identifiers we use for our timers
132 typedef std::pair< std::string, cl_uint > idPair;
133 typedef std::vector< idPair > idVector;
134 idVector labelID;
135
136 // Between each Start/Stop pair, we need to count how many AddSamples were made.
137 size_t currSample, currRecord;
138
139 // Saved sizes for our vectors, used in Reset() to reallocate vectors
140 StatDataVec::size_type nEvents, nSamples;
141 size_t currID;
142
143 /**
144 * \fn GpuStatTimer()
145 * \brief Constructor for StatisticalTimer that initializes the class
146 * This is private so that user code cannot create their own instantiation. Instead, you
147 * must go through getInstance( ) to get a reference to the class.
148 */
149 GpuStatTimer( );
150
151 /**
152 * \fn ~GpuStatTimer()
153 * \brief Destructor for StatisticalTimer that cleans up the class
154 */
155 ~GpuStatTimer( );
156
157 /**
158 * \fn GpuStatTimer(const StatisticalTimer& )
159 * \brief Copy constructors do not make sense for a singleton, disallow copies
160 */
161 GpuStatTimer( const GpuStatTimer& );
162
163 /**
164 * \fn operator=( const StatisticalTimer& )
165 * \brief Assignment operator does not make sense for a singleton, disallow assignments
166 */
167 GpuStatTimer& operator=( const GpuStatTimer& );
168
169 friend std::ostream& operator<<( std::ostream& os, const GpuStatTimer& s );
170
171 // Calculate the average/mean of data for a given event
172 std::vector< StatData > getMean( size_t id );
173
174 // Calculate the variance of data for a given event
175 // Variance - average of the squared differences between data points and the mean
176 std::vector< StatData > getVariance( size_t id );
177
178 // Sqrt of variance, also in units of the original data
179 std::vector< StatData > getStdDev( size_t id );

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected