Skip to content

Commit

Permalink
Add bytes_per_second to transpose benchmark
Browse files Browse the repository at this point in the history
This patch relates to #13735.
  • Loading branch information
Blonck committed Sep 26, 2023
1 parent f42231f commit 66f43e4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cpp/benchmarks/transpose/transpose.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<int64_t>(state.iterations()) *
(bytes_read + bytes_written + null_bytes));
}

class Transpose : public cudf::benchmark {};
Expand Down

0 comments on commit 66f43e4

Please sign in to comment.