Skip to content

Commit

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

This patch relates to rapidsai#13735.
  • Loading branch information
Martin Marenz committed Aug 25, 2023
1 parent 6095a92 commit 808fdc1
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 808fdc1

Please sign in to comment.