Skip to content

Commit

Permalink
Add bytes_per_second to copy_if_else benchmark (#13960)
Browse files Browse the repository at this point in the history
Adds `bytes_per_second` to the `COPY_IF_ELSE_BENCH` benchmark.

This patch relates to #13735.

Authors:
  - Martin Marenz (https://github.com/Blonck)

Approvers:
  - Bradley Dice (https://github.com/bdice)
  - David Wendt (https://github.com/davidwendt)

URL: #13960
  • Loading branch information
Blonck authored Aug 30, 2023
1 parent 04085ac commit 9259a20
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cpp/benchmarks/copying/copy_if_else.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ static void BM_copy_if_else(benchmark::State& state, bool nulls)
cuda_event_timer raii(state, true, cudf::get_default_stream());
cudf::copy_if_else(lhs, rhs, decision);
}

auto const bytes_read = n_rows * (sizeof(TypeParam) + sizeof(bool));
auto const bytes_written = n_rows * sizeof(TypeParam);
auto const null_bytes = nulls ? 2 * cudf::bitmask_allocation_size_bytes(n_rows) : 0;

// Use number of bytes read and written.
state.SetBytesProcessed(static_cast<int64_t>(state.iterations()) *
(bytes_read + bytes_written + null_bytes));
}

#define COPY_BENCHMARK_DEFINE(name, type, b) \
Expand Down

0 comments on commit 9259a20

Please sign in to comment.