Skip to content

Commit

Permalink
Add bytes_per_second to shift benchmark
Browse files Browse the repository at this point in the history
This patch relates to rapidsai#13735.
  • Loading branch information
Martin Marenz authored and Blonck committed Sep 26, 2023
1 parent f42231f commit 0664c8b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions cpp/benchmarks/copying/shift.cu
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,17 @@ static void BM_shift(benchmark::State& state)
cuda_event_timer raii(state, true);
auto output = cudf::shift(input, offset, *fill);
}

auto const elems_read = (size - offset);
auto const elems_written = use_validity ? (size - offset) : size;
auto const bytes_read = elems_read * sizeof(int);
auto const bytes_written = elems_written * sizeof(int);

// null bytes for input and output
auto const null_bytes = use_validity ? 2 * cudf::bitmask_allocation_size_bytes(size) : 0;

state.SetBytesProcessed(static_cast<int64_t>(state.iterations()) *
(bytes_written + bytes_read + null_bytes));
}

class Shift : public cudf::benchmark {};
Expand Down

0 comments on commit 0664c8b

Please sign in to comment.