| 69 | struct Timer { |
| 70 | cudaEvent_t e0 = nullptr, e1 = nullptr; |
| 71 | Timer() { ck(cudaEventCreate(&e0), "event"); ck(cudaEventCreate(&e1), "event"); } |
| 72 | ~Timer() { cudaEventDestroy(e0); cudaEventDestroy(e1); } |
| 73 | // microseconds per call over `iters` back-to-back calls, warmed; the median of three such runs |
| 74 | template <typename F> double us(F&& f, int iters) { |