From 9f892600887f80c5ac6ae4638e86b6a22f6db03b Mon Sep 17 00:00:00 2001 From: Daniel Juenger <2955913+sleeepyjack@users.noreply.github.com> Date: Sat, 7 Oct 2023 00:03:40 +0000 Subject: [PATCH] Fix rehash benchmark --- benchmarks/hash_table/static_set/rehash_bench.cu | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/benchmarks/hash_table/static_set/rehash_bench.cu b/benchmarks/hash_table/static_set/rehash_bench.cu index 167f51cec..266e1f887 100644 --- a/benchmarks/hash_table/static_set/rehash_bench.cu +++ b/benchmarks/hash_table/static_set/rehash_bench.cu @@ -25,25 +25,25 @@ #include /** - * @brief A benchmark evaluating `cuco::static_set::size` performance + * @brief A benchmark evaluating `cuco::static_set::rehash` performance */ template void static_set_rehash(nvbench::state& state, nvbench::type_list) { - auto const num_keys = state.get_int64_or_default("NumInputs", cuco::benchmark::defaults::N); + std::size_t const capacity = state.get_int64_or_default("Capacity", cuco::benchmark::defaults::N); auto const occupancy = state.get_float64_or_default("Occupancy", cuco::benchmark::defaults::OCCUPANCY); - std::size_t const size = num_keys / occupancy; + std::size_t const num_keys = capacity * occupancy; - thrust::device_vector keys(num_keys); + thrust::device_vector keys(num_keys); // slots per second cuco::utility::key_generator gen; gen.generate(cuco::benchmark::dist_from_state(state), keys.begin(), keys.end()); - state.add_element_count(num_keys); + state.add_element_count(capacity); - cuco::experimental::static_set set{size, cuco::empty_key{-1}}; + cuco::experimental::static_set set{capacity, cuco::empty_key{-1}}; set.insert(keys.begin(), keys.end());