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

Method pruneOutliers

src/clsparseTimer/clsparseTimer-device.cpp:376–399  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

374}
375
376std::vector< size_t >
377clsparseDeviceTimer::pruneOutliers( size_t id, cl_double multiple )
378{
379 std::vector< StatData > mean = getMean( id );
380 std::vector< StatData > stdDev = getStdDev( id );
381
382 std::vector< size_t > totalPrune;
383 for( size_t s = 0; s < timerData.at( id ).size( ); ++s )
384 {
385 // Look on p. 379, "The C++ Standard Library"
386 // std::remove_if does not actually erase, it only copies elements, it returns new 'logical' end
387 StatDataVec::iterator newEnd = std::remove_if( timerData.at( id ).at( s ).begin( ), timerData.at( id ).at( s ).end( ),
388 PruneRange< StatData, cl_double >( mean[ s ], multiple * stdDev[ s ].doubleNanoSec ) );
389
390 StatDataVec::difference_type dist = std::distance( newEnd, timerData.at( id ).at( s ).end( ) );
391
392 if( dist != 0 )
393 timerData.at( id ).at( s ).erase( newEnd, timerData.at( id ).at( s ).end( ) );
394
395 totalPrune.push_back( dist );
396 }
397
398 return totalPrune;
399}
400
401size_t
402clsparseDeviceTimer::pruneOutliers( cl_double multiple )

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected