Skip to content

Commit

Permalink
Default pattern_bits in benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
sleeepyjack committed Oct 2, 2024
1 parent 6644752 commit 92de89f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 15 deletions.
11 changes: 4 additions & 7 deletions benchmarks/bloom_filter/add_bench.cu
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ void bloom_filter_add(nvbench::state& state,

auto const num_keys = state.get_int64("NumInputs");
auto const filter_size_mb = state.get_int64("FilterSizeMB");
auto const pattern_bits = state.get_int64("PatternBits");
auto const pattern_bits = state.get_int64_or_default("PatternBits", WordsPerBlock);

try {
auto const policy = policy_type{static_cast<uint32_t>(pattern_bits)};
Expand Down Expand Up @@ -93,8 +93,7 @@ NVBENCH_BENCH_TYPES(bloom_filter_add,
.set_type_axes_names({"Key", "Hash", "Word", "WordsPerBlock", "Distribution"})
.set_max_noise(defaults::MAX_NOISE)
.add_int64_axis("NumInputs", {defaults::BF_N})
.add_int64_axis("FilterSizeMB", defaults::BF_SIZE_MB_RANGE_CACHE)
.add_int64_axis("PatternBits", {defaults::BF_PATTERN_BITS});
.add_int64_axis("FilterSizeMB", defaults::BF_SIZE_MB_RANGE_CACHE);

NVBENCH_BENCH_TYPES(bloom_filter_add,
NVBENCH_TYPE_AXES(nvbench::type_list<defaults::BF_KEY>,
Expand All @@ -106,8 +105,7 @@ NVBENCH_BENCH_TYPES(bloom_filter_add,
.set_type_axes_names({"Key", "Hash", "Word", "WordsPerBlock", "Distribution"})
.set_max_noise(defaults::MAX_NOISE)
.add_int64_axis("NumInputs", {defaults::BF_N})
.add_int64_axis("FilterSizeMB", {defaults::BF_SIZE_MB})
.add_int64_axis("PatternBits", {defaults::BF_PATTERN_BITS});
.add_int64_axis("FilterSizeMB", {defaults::BF_SIZE_MB});

NVBENCH_BENCH_TYPES(bloom_filter_add,
NVBENCH_TYPE_AXES(nvbench::type_list<defaults::BF_KEY>,
Expand All @@ -119,5 +117,4 @@ NVBENCH_BENCH_TYPES(bloom_filter_add,
.set_type_axes_names({"Key", "Hash", "Word", "WordsPerBlock", "Distribution"})
.set_max_noise(defaults::MAX_NOISE)
.add_int64_axis("NumInputs", {defaults::BF_N})
.add_int64_axis("FilterSizeMB", {defaults::BF_SIZE_MB})
.add_int64_axis("PatternBits", {defaults::BF_PATTERN_BITS});
.add_int64_axis("FilterSizeMB", {defaults::BF_SIZE_MB});
11 changes: 4 additions & 7 deletions benchmarks/bloom_filter/contains_bench.cu
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ void bloom_filter_contains(

auto const num_keys = state.get_int64("NumInputs");
auto const filter_size_mb = state.get_int64("FilterSizeMB");
auto const pattern_bits = state.get_int64("PatternBits");
auto const pattern_bits = state.get_int64_or_default("PatternBits", WordsPerBlock);

try {
auto const policy = policy_type{static_cast<uint32_t>(pattern_bits)};
Expand Down Expand Up @@ -98,8 +98,7 @@ NVBENCH_BENCH_TYPES(bloom_filter_contains,
.set_type_axes_names({"Key", "Hash", "Word", "WordsPerBlock", "Distribution"})
.set_max_noise(defaults::MAX_NOISE)
.add_int64_axis("NumInputs", {defaults::BF_N})
.add_int64_axis("FilterSizeMB", defaults::BF_SIZE_MB_RANGE_CACHE)
.add_int64_axis("PatternBits", {defaults::BF_PATTERN_BITS});
.add_int64_axis("FilterSizeMB", defaults::BF_SIZE_MB_RANGE_CACHE);

NVBENCH_BENCH_TYPES(bloom_filter_contains,
NVBENCH_TYPE_AXES(nvbench::type_list<defaults::BF_KEY>,
Expand All @@ -111,8 +110,7 @@ NVBENCH_BENCH_TYPES(bloom_filter_contains,
.set_type_axes_names({"Key", "Hash", "Word", "WordsPerBlock", "Distribution"})
.set_max_noise(defaults::MAX_NOISE)
.add_int64_axis("NumInputs", {defaults::BF_N})
.add_int64_axis("FilterSizeMB", {defaults::BF_SIZE_MB})
.add_int64_axis("PatternBits", {defaults::BF_PATTERN_BITS});
.add_int64_axis("FilterSizeMB", {defaults::BF_SIZE_MB});

NVBENCH_BENCH_TYPES(bloom_filter_contains,
NVBENCH_TYPE_AXES(nvbench::type_list<defaults::BF_KEY>,
Expand All @@ -124,5 +122,4 @@ NVBENCH_BENCH_TYPES(bloom_filter_contains,
.set_type_axes_names({"Key", "Hash", "Word", "WordsPerBlock", "Distribution"})
.set_max_noise(defaults::MAX_NOISE)
.add_int64_axis("NumInputs", {defaults::BF_N})
.add_int64_axis("FilterSizeMB", {defaults::BF_SIZE_MB})
.add_int64_axis("PatternBits", {defaults::BF_PATTERN_BITS});
.add_int64_axis("FilterSizeMB", {defaults::BF_SIZE_MB});
1 change: 0 additions & 1 deletion benchmarks/bloom_filter/defaults.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ using BF_WORD = nvbench::uint32_t;
static constexpr auto BF_N = 400'000'000;
static constexpr auto BF_SIZE_MB = 2'000;
static constexpr auto BF_WORDS_PER_BLOCK = 8;
static constexpr auto BF_PATTERN_BITS = BF_WORDS_PER_BLOCK;

auto const BF_SIZE_MB_RANGE_CACHE =
std::vector<nvbench::int64_t>{1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048};
Expand Down

0 comments on commit 92de89f

Please sign in to comment.