From a56aadb8b2063e7ed5ad48641de5b0ddf6e86a50 Mon Sep 17 00:00:00 2001 From: Martin Marenz Date: Fri, 22 Sep 2023 12:21:03 +0200 Subject: [PATCH] Add `bytes_per_second` to transpose benchmark This patch relates to #13735. --- cpp/benchmarks/transpose/transpose.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cpp/benchmarks/transpose/transpose.cpp b/cpp/benchmarks/transpose/transpose.cpp index 2f41bda4b88..b9ec5055451 100644 --- a/cpp/benchmarks/transpose/transpose.cpp +++ b/cpp/benchmarks/transpose/transpose.cpp @@ -40,6 +40,16 @@ static void BM_transpose(benchmark::State& state) cuda_event_timer raii(state, true); auto output = cudf::transpose(input); } + + // Collect memory statistics. + auto const bytes_read = input.num_columns() * input.num_rows() * (sizeof(int32_t)); + auto const bytes_written = bytes_read; + // Account for nullability in input and output. + auto const null_bytes = + 2 * input.num_columns() * cudf::bitmask_allocation_size_bytes(input.num_rows()); + + state.SetBytesProcessed(static_cast(state.iterations()) * + (bytes_read + bytes_written + null_bytes)); } class Transpose : public cudf::benchmark {};