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 copy_if_else benchmark #13960

Merged
Merged
Changes from all commits
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
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