| 247 | |
| 248 | template <ApplyFn Apply> |
| 249 | static void MemoryBandwidth(benchmark::State& state) { // NOLINT non-const reference |
| 250 | const size_t buffer_size = state.range(0); |
| 251 | BufferPtr src, dst; |
| 252 | |
| 253 | dst = *AllocateBuffer(buffer_size); |
| 254 | src = *AllocateBuffer(buffer_size); |
| 255 | random_bytes(buffer_size, 0, src->mutable_data()); |
| 256 | |
| 257 | while (state.KeepRunning()) { |
| 258 | Apply(src->mutable_data(), dst->mutable_data(), buffer_size); |
| 259 | } |
| 260 | |
| 261 | state.SetBytesProcessed(state.iterations() * buffer_size); |
| 262 | } |
| 263 | |
| 264 | # ifdef ARROW_HAVE_SSE4_2 |
| 265 | static void SetCacheBandwidthArgs(benchmark::internal::Benchmark* bench) { |
nothing calls this directly
no test coverage detected