Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add bytes_per_second to transpose benchmark #14170

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix code style in transpose benchmark
Blonck committed Sep 30, 2023

Verified

This commit was signed with the committer’s verified signature.
Blonck Martin Marenz
commit c50a5ef9f0ffaa857269b682f986dea967f92cc9
20 changes: 9 additions & 11 deletions cpp/benchmarks/transpose/transpose.cpp
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@

static void BM_transpose(benchmark::State& state)
{
auto count = state.range(0);
auto count = state.range(0);
constexpr auto column_type_id = cudf::type_id::INT32;
auto int_column_generator =
thrust::make_transform_iterator(thrust::counting_iterator(0), [count](int i) {
@@ -44,7 +44,8 @@ static void BM_transpose(benchmark::State& state)
}

// Collect memory statistics.
auto const bytes_read = input.num_columns() * input.num_rows() * sizeof(cudf::id_to_type<column_type_id>);
auto const bytes_read =
input.num_columns() * input.num_rows() * sizeof(cudf::id_to_type<column_type_id>);
Blonck marked this conversation as resolved.
Show resolved Hide resolved
auto const bytes_written = bytes_read;
// Account for nullability in input and output.
auto const null_bytes =
@@ -56,15 +57,12 @@ static void BM_transpose(benchmark::State& state)

class Transpose : public cudf::benchmark {};

#define TRANSPOSE_BM_BENCHMARK_DEFINE(name) \
BENCHMARK_DEFINE_F(Transpose, name)(::benchmark::State & state) \
{ \
BM_transpose(state); \
} \
BENCHMARK_REGISTER_F(Transpose, name) \
->RangeMultiplier(4) \
->Range(4, 4 << 13) \
->UseManualTime() \
#define TRANSPOSE_BM_BENCHMARK_DEFINE(name) \
BENCHMARK_DEFINE_F(Transpose, name)(::benchmark::State & state) { BM_transpose(state); } \
BENCHMARK_REGISTER_F(Transpose, name) \
->RangeMultiplier(4) \
->Range(4, 4 << 13) \
->UseManualTime() \
->Unit(benchmark::kMillisecond);

TRANSPOSE_BM_BENCHMARK_DEFINE(transpose_simple);