Skip to content

Commit

Permalink
Fixups
Browse files Browse the repository at this point in the history
  • Loading branch information
sleeepyjack committed Jul 27, 2024
1 parent 1bd9f9a commit 3ce3533
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 13 deletions.
11 changes: 6 additions & 5 deletions benchmarks/hash_function/hash_function_bench.cu
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ void hash_eval(nvbench::state& state, nvbench::type_list<Hash>)
{
bool const materialize_result = false;
constexpr auto block_size = 128;
auto const num_keys = state.get_int64_or_default("NumInputs", cuco::benchmark::defaults::N * 10);
auto const grid_size = (num_keys + block_size * 16 - 1) / block_size * 16;
auto const num_keys = state.get_int64("NumInputs");
auto const grid_size = (num_keys + block_size * 16 - 1) / block_size * 16;

thrust::device_vector<typename Hash::result_type> hash_values((materialize_result) ? num_keys
: 1);
Expand Down Expand Up @@ -193,7 +193,8 @@ NVBENCH_BENCH_TYPES(
cuco::murmurhash3_x64_128<large_key<32>>>))
.set_name("hash_function_eval")
.set_type_axes_names({"Hash"})
.set_max_noise(cuco::benchmark::defaults::MAX_NOISE);
.set_max_noise(cuco::benchmark::defaults::MAX_NOISE)
.add_int64_axis("NumInputs", {cuco::benchmark::defaults::N * 10});

NVBENCH_BENCH_TYPES(string_hash_eval,
NVBENCH_TYPE_AXES(nvbench::type_list<cuco::murmurhash3_32<std::byte>,
Expand All @@ -203,7 +204,7 @@ NVBENCH_BENCH_TYPES(string_hash_eval,
cuco::murmurhash3_x64_128<std::byte>>))
.set_name("string_hash_function_eval")
.set_type_axes_names({"Hash"})
.set_max_noise(cuco::benchmark::defaults::MAX_NOISE)
.add_int64_axis("NumInputs", {cuco::benchmark::defaults::N / 4})
.add_int64_axis("MinLength", {1, 4})
.add_int64_axis("MaxLength", {4, 32, 64})
.set_max_noise(cuco::benchmark::defaults::MAX_NOISE);
.add_int64_axis("MaxLength", {4, 32, 64});
2 changes: 1 addition & 1 deletion benchmarks/static_map/find_bench.cu
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ NVBENCH_BENCH_TYPES(static_map_find,
NVBENCH_TYPE_AXES(defaults::KEY_TYPE_RANGE,
defaults::VALUE_TYPE_RANGE,
nvbench::type_list<distribution::unique>))
.set_name("static_map_find_unique_occupancy")
.set_name("static_map_find_unique_capacity")
.set_type_axes_names({"Key", "Value", "Distribution"})
.set_max_noise(defaults::MAX_NOISE)
.add_int64_axis("NumInputs", defaults::N_RANGE_CACHE)
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/static_map/insert_bench.cu
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ std::enable_if_t<(sizeof(Key) == sizeof(Value)), void> static_map_insert(

auto map = cuco::static_map{size, cuco::empty_key<Key>{-1}, cuco::empty_value<Value>{-1}};

state.exec(nvbench::exec_tag::timer, [&](nvbench::launch& launch, auto& timer) {
state.exec([&](nvbench::launch& launch) {
map.insert_async(pairs.begin(), pairs.end(), {launch.get_stream()});
});
}
Expand Down
6 changes: 3 additions & 3 deletions benchmarks/static_multimap/query_bench.cu
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ std::enable_if_t<(sizeof(Key) == sizeof(Value)), void> static_multimap_query(
size, cuco::empty_key<Key>{-1}, cuco::empty_value<Value>{-1}};
map.insert(pairs.begin(), pairs.end());

auto const output_size = map.count_outer(keys.begin(), keys.end());
auto const output_size = map.count(keys.begin(), keys.end());
thrust::device_vector<pair_type> output(output_size);

state.exec(nvbench::exec_tag::sync, [&](nvbench::launch& launch) {
auto const count = map.count_outer(keys.begin(), keys.end(), launch.get_stream());
map.retrieve_outer(keys.begin(), keys.end(), output.begin(), launch.get_stream());
auto const count = map.count(keys.begin(), keys.end(), launch.get_stream());
map.retrieve(keys.begin(), keys.end(), output.begin(), launch.get_stream());
});
}

Expand Down
6 changes: 3 additions & 3 deletions benchmarks/static_multimap/retrieve_bench.cu
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ using namespace cuco::benchmark; // defaults, dist_from_state
using namespace cuco::utility; // key_generator, distribution

/**
* @brief A benchmark evaluating `cuco::static_multimap::retrieve_outer` performance
* @brief A benchmark evaluating `cuco::static_multimap::retrieve` performance
*/
template <typename Key, typename Value, typename Dist>
std::enable_if_t<(sizeof(Key) == sizeof(Value)), void> static_multimap_retrieve(
Expand Down Expand Up @@ -61,11 +61,11 @@ std::enable_if_t<(sizeof(Key) == sizeof(Value)), void> static_multimap_retrieve(
size, cuco::empty_key<Key>{-1}, cuco::empty_value<Value>{-1}};
map.insert(pairs.begin(), pairs.end());

auto const output_size = map.count_outer(keys.begin(), keys.end());
auto const output_size = map.count(keys.begin(), keys.end());
thrust::device_vector<pair_type> output(output_size);

state.exec(nvbench::exec_tag::sync, [&](nvbench::launch& launch) {
map.retrieve_outer(keys.begin(), keys.end(), output.begin(), launch.get_stream());
map.retrieve(keys.begin(), keys.end(), output.begin(), launch.get_stream());
});
}

Expand Down
3 changes: 3 additions & 0 deletions benchmarks/static_multiset/count_bench.cu
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
using namespace cuco::benchmark; // defaults, dist_from_state
using namespace cuco::utility; // key_generator, distribution

/**
* @brief A benchmark evaluating `cuco::static_multiset::count` performance
*/
template <typename Key, typename Dist>
void static_multiset_count(nvbench::state& state, nvbench::type_list<Key, Dist>)
{
Expand Down

0 comments on commit 3ce3533

Please sign in to comment.