Skip to content

Commit

Permalink
Resolve reviews for correctness
Browse files Browse the repository at this point in the history
  • Loading branch information
gonidelis committed Jul 16, 2024
1 parent d9392e6 commit b8e6dfd
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions thrust/benchmarks/bench/equal/basic.cu
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
template <typename T>
static void benchmark(nvbench::state& state, nvbench::type_list<T>)
{
const auto& name = state.get_benchmark().get_name();
const auto elements = static_cast<std::size_t>(state.get_int64("Elements"));
thrust::device_vector<T> a(elements, T{1});
thrust::device_vector<T> b(elements, T{1});
Expand All @@ -21,12 +20,12 @@ 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>(std::max(2 * different_elems, std::size_t(1))); // using `different_elements` instead
state.add_global_memory_reads<T>(2 * std::max(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()));
state.exec(nvbench::exec_tag::no_batch | nvbench::exec_tag::sync, [&](nvbench::launch& launch) {
do_not_optimize(thrust::equal(policy(alloc, launch), a.begin(), a.end(), b.begin()));
});
}

Expand Down

0 comments on commit b8e6dfd

Please sign in to comment.