MCPcopy Create free account
hub / github.com/clMathLibraries/clSPARSE / getVariance

Method getVariance

src/clsparseTimer/clsparseTimer-host.cpp:265–284  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

263}
264
265cl_double
266clsparseHostTimer::getVariance( size_t id ) const
267{
268 if( clkTicks.empty( ) )
269 return 0;
270
271 cl_double mean = getMean( id );
272
273 size_t N = clkTicks.at( id ).size( );
274 cl_double sum = 0;
275
276 for( cl_uint i = 0; i < N; ++i )
277 {
278 cl_double diff = clkTicks.at( id ).at( i ) - mean;
279 diff *= diff;
280 sum += diff;
281 }
282
283 return sum / N;
284}
285
286cl_double
287clsparseHostTimer::getStdDev( size_t id ) const

Callers

nothing calls this directly

Calls 3

emptyMethod · 0.80
atMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected