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