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

Method Reserve

src/benchmarks/cusparse-bench/src/statisticalTimer.cpp:120–136  ·  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

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

Callers 1

mainFunction · 0.45

Calls 2

resizeMethod · 0.80
atMethod · 0.80

Tested by

no test coverage detected