MCPcopy Create free account
hub / github.com/clMathLibraries/clBLAS / Reserve

Method Reserve

src/client/statisticalTimer.cpp:117–133  ·  view source on GitHub ↗

The caller can pre-allocate memory, to improve performance. nEvents is an approximate value for how many seperate events the caller will think they will need, and nSamples is a hint on how many samples we think we will take per event

Source from the content-addressed store, hash-verified

115// they will need, and nSamples is a hint on how many samples we think we will take
116// per event
117void
118StatisticalTimer::Reserve( unsigned int nEvents, unsigned int nSamples )
119{
120 this->nEvents = std::max<unsigned int> (1, nEvents);
121 this->nSamples = std::max<unsigned int> (1, nSamples);
122
123 Clear( );
124 labelID.reserve( nEvents );
125
126 clkStart.resize( nEvents );
127 clkTicks.resize( nEvents );
128
129 for( unsigned int i = 0; i < nEvents; ++i )
130 {
131 clkTicks.at( i ).reserve( nSamples );
132 }
133}
134
135void
136StatisticalTimer::setNormalize( bool norm )

Callers 1

mainFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected