Skip to content

Commit

Permalink
Fix code style in shift benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
Blonck committed Sep 26, 2023
1 parent f2f7392 commit 6148cb2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cpp/benchmarks/copying/shift.cu
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@ static void BM_shift(benchmark::State& state)
auto output = cudf::shift(input, offset, *fill);
}

auto const elems_read = (size - offset);
auto const bytes_read = elems_read * sizeof(int);
auto const elems_read = (size - offset);
auto const bytes_read = elems_read * sizeof(int);

// If 'use_validity' is false, the fill value is a number, and the entire column
// (excluding the null bitmask) needs to be written. On the other hand, if 'use_validity'
// is true, only the elements that can be shifted are written, along with the full null bitmask.
auto const elems_written = use_validity ? (size - offset) : size;
auto const bytes_written = elems_written * sizeof(int);
auto const null_bytes = use_validity ? 2 * cudf::bitmask_allocation_size_bytes(size) : 0;
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));
Expand Down

0 comments on commit 6148cb2

Please sign in to comment.