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 rapidsai#13735.
  • Loading branch information
Blonck committed Sep 22, 2023
1 parent f0ba859 commit ad49fe4
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions cpp/benchmarks/transpose/transpose.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,17 @@ 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));
// output size is input size for transpose
auto const bytes_written = bytes_read;
// both output and input are nullable
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 ad49fe4

Please sign in to comment.