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 e25536e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions cpp/benchmarks/transpose/transpose.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,18 @@ 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
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());

// Use number of bytes read and written.
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 e25536e

Please sign in to comment.