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

Method pruneOutliers

src/clsparseTimer/clsparseTimer-host.cpp:319–342  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

317}
318
319size_t
320clsparseHostTimer::pruneOutliers( size_t id, cl_double multiple )
321{
322 if( clkTicks.empty( ) )
323 return 0;
324
325 cl_double mean = getMean( id );
326 cl_double stdDev = getStdDev( id );
327
328 clkVector& clks = clkTicks.at( id );
329
330 // Look on p. 379, "The C++ Standard Library"
331 // std::remove_if does not actually erase, it only copies elements, it returns new 'logical' end
332 clkVector::iterator newEnd = std::remove_if( clks.begin( ), clks.end( ), PruneRange< cl_double, cl_ulong >( mean, multiple*stdDev ) );
333
334 clkVector::difference_type dist = std::distance( newEnd, clks.end( ) );
335
336 if( dist != 0 )
337 clks.erase( newEnd, clks.end( ) );
338
339 assert( dist < std::numeric_limits< cl_uint >::max( ) );
340
341 return dist;
342}
343
344size_t
345clsparseHostTimer::pruneOutliers( cl_double multiple )

Callers

nothing calls this directly

Calls 5

emptyMethod · 0.80
atMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected