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

Method Reserve

src/clsparseTimer/clsparseTimer-host.cpp:163–179  ·  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

161// they will need, and nSamples is a hint on how many samples we think we will take
162// per event
163void
164clsparseHostTimer::Reserve( size_t nEvents, size_t nSamples )
165{
166 this->nEvents = std::max< size_t >( 1, nEvents );
167 this->nSamples = std::max< size_t >( 1, nSamples );
168
169 Clear( );
170 labelID.reserve( nEvents );
171
172 clkStart.resize( nEvents );
173 clkTicks.resize( nEvents );
174
175 for( cl_uint i = 0; i < nEvents; ++i )
176 {
177 clkTicks.at( i ).reserve( nSamples );
178 }
179}
180
181void
182clsparseHostTimer::setNormalize( bool norm )

Callers

nothing calls this directly

Calls 2

resizeMethod · 0.80
atMethod · 0.80

Tested by

no test coverage detected