Skip to content

Commit

Permalink
Fix BWUtil report on early exit
Browse files Browse the repository at this point in the history
  • Loading branch information
gonidelis committed Jul 15, 2024
1 parent 6b95f43 commit d9392e6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion thrust/benchmarks/bench/equal/basic.cu
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ static void benchmark(nvbench::state& state, nvbench::type_list<T>)
thrust::fill(policy(alloc), b.begin() + different_elems, b.end(), T{2});

state.add_element_count(elements);
state.add_global_memory_reads<T>(2 * elements);
state.add_global_memory_reads<T>(std::max(2 * different_elems, std::size_t(1))); // using `different_elements` instead
// of `elements` corresponds to the
// actual elements read in an early
// exit
state.exec(nvbench::exec_tag::no_batch | nvbench::exec_tag::sync, [&](nvbench::launch&) {
do_not_optimize(thrust::equal(policy(alloc), a.begin(), a.end(), b.begin()));
});
Expand Down

0 comments on commit d9392e6

Please sign in to comment.