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
| 161 | // they will need, and nSamples is a hint on how many samples we think we will take |
| 162 | // per event |
| 163 | void |
| 164 | clsparseHostTimer::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 | |
| 181 | void |
| 182 | clsparseHostTimer::setNormalize( bool norm ) |