MCPcopy Create free account
hub / github.com/apache/arrow / MemoryBandwidth

Function MemoryBandwidth

cpp/src/arrow/io/memory_benchmark.cc:249–262  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

247
248template <ApplyFn Apply>
249static 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
265static void SetCacheBandwidthArgs(benchmark::internal::Benchmark* bench) {

Callers

nothing calls this directly

Calls 3

AllocateBufferFunction · 0.50
random_bytesFunction · 0.50
mutable_dataMethod · 0.45

Tested by

no test coverage detected