| 28 | } |
| 29 | |
| 30 | double run(const sq::DotKernel* k, const std::vector<uint8_t>& w, size_t rb, int n, size_t rows, const void* act, float* sink) { |
| 31 | using C = std::chrono::steady_clock; |
| 32 | const auto t0 = C::now(); |
| 33 | float acc = 0.f; |
| 34 | for (size_t r = 0; r < rows; ++r) { |
| 35 | float s; |
| 36 | k->fn(n, &s, w.data() + r * rb, act); |
| 37 | acc += s; |
| 38 | } |
| 39 | *sink += acc; |
| 40 | return std::chrono::duration<double>(C::now() - t0).count(); |
| 41 | } |
| 42 | } // namespace |
| 43 | |
| 44 | int main(int argc, char** argv) { |