| 136 | } |
| 137 | |
| 138 | void |
| 139 | CpuStatTimer::Reset( ) |
| 140 | { |
| 141 | if( nEvents == 0 || nSamples == 0 ) |
| 142 | throw std::runtime_error( "StatisticalTimer::Reserve( ) was not called before Reset( )" ); |
| 143 | |
| 144 | clkStart.clear( ); |
| 145 | clkTicks.clear( ); |
| 146 | |
| 147 | clkStart.resize( nEvents ); |
| 148 | clkTicks.resize( nEvents ); |
| 149 | |
| 150 | for( cl_uint i = 0; i < nEvents; ++i ) |
| 151 | { |
| 152 | clkTicks.at( i ).reserve( nSamples ); |
| 153 | } |
| 154 | |
| 155 | return; |
| 156 | } |
| 157 | |
| 158 | // The caller can pre-allocate memory, to improve performance. |
| 159 | // nEvents is an approximate value for how many seperate events the caller will think |