| 290 | |
| 291 | template<typename TFunc> |
| 292 | counter_t rampUpToMeasurableNumberOfMaxOps(TFunc const& func, counter_t startOps = 256) |
| 293 | { |
| 294 | counter_t ops = startOps; |
| 295 | double time; |
| 296 | do { |
| 297 | time = func(ops); |
| 298 | ops *= 2; |
| 299 | } while (time < (precise ? 30 : 10)); |
| 300 | #ifdef NDEBUG |
| 301 | return ops / 2; |
| 302 | #else |
| 303 | return ops / 4; |
| 304 | #endif |
| 305 | } |
| 306 | |
| 307 | counter_t adjustForThreads(counter_t suggestedOps, int nthreads) |
| 308 | { |
no outgoing calls
no test coverage detected