Skip to content

Commit 92de89f

Browse files
committed
Default pattern_bits in benchmark
1 parent 6644752 commit 92de89f

File tree

3 files changed

+8
-15
lines changed

3 files changed

+8
-15
lines changed

benchmarks/bloom_filter/add_bench.cu

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ void bloom_filter_add(nvbench::state& state,
4949

5050
auto const num_keys = state.get_int64("NumInputs");
5151
auto const filter_size_mb = state.get_int64("FilterSizeMB");
52-
auto const pattern_bits = state.get_int64("PatternBits");
52+
auto const pattern_bits = state.get_int64_or_default("PatternBits", WordsPerBlock);
5353

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

9998
NVBENCH_BENCH_TYPES(bloom_filter_add,
10099
NVBENCH_TYPE_AXES(nvbench::type_list<defaults::BF_KEY>,
@@ -106,8 +105,7 @@ NVBENCH_BENCH_TYPES(bloom_filter_add,
106105
.set_type_axes_names({"Key", "Hash", "Word", "WordsPerBlock", "Distribution"})
107106
.set_max_noise(defaults::MAX_NOISE)
108107
.add_int64_axis("NumInputs", {defaults::BF_N})
109-
.add_int64_axis("FilterSizeMB", {defaults::BF_SIZE_MB})
110-
.add_int64_axis("PatternBits", {defaults::BF_PATTERN_BITS});
108+
.add_int64_axis("FilterSizeMB", {defaults::BF_SIZE_MB});
111109

112110
NVBENCH_BENCH_TYPES(bloom_filter_add,
113111
NVBENCH_TYPE_AXES(nvbench::type_list<defaults::BF_KEY>,
@@ -119,5 +117,4 @@ NVBENCH_BENCH_TYPES(bloom_filter_add,
119117
.set_type_axes_names({"Key", "Hash", "Word", "WordsPerBlock", "Distribution"})
120118
.set_max_noise(defaults::MAX_NOISE)
121119
.add_int64_axis("NumInputs", {defaults::BF_N})
122-
.add_int64_axis("FilterSizeMB", {defaults::BF_SIZE_MB})
123-
.add_int64_axis("PatternBits", {defaults::BF_PATTERN_BITS});
120+
.add_int64_axis("FilterSizeMB", {defaults::BF_SIZE_MB});

benchmarks/bloom_filter/contains_bench.cu

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ void bloom_filter_contains(
5151

5252
auto const num_keys = state.get_int64("NumInputs");
5353
auto const filter_size_mb = state.get_int64("FilterSizeMB");
54-
auto const pattern_bits = state.get_int64("PatternBits");
54+
auto const pattern_bits = state.get_int64_or_default("PatternBits", WordsPerBlock);
5555

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

104103
NVBENCH_BENCH_TYPES(bloom_filter_contains,
105104
NVBENCH_TYPE_AXES(nvbench::type_list<defaults::BF_KEY>,
@@ -111,8 +110,7 @@ NVBENCH_BENCH_TYPES(bloom_filter_contains,
111110
.set_type_axes_names({"Key", "Hash", "Word", "WordsPerBlock", "Distribution"})
112111
.set_max_noise(defaults::MAX_NOISE)
113112
.add_int64_axis("NumInputs", {defaults::BF_N})
114-
.add_int64_axis("FilterSizeMB", {defaults::BF_SIZE_MB})
115-
.add_int64_axis("PatternBits", {defaults::BF_PATTERN_BITS});
113+
.add_int64_axis("FilterSizeMB", {defaults::BF_SIZE_MB});
116114

117115
NVBENCH_BENCH_TYPES(bloom_filter_contains,
118116
NVBENCH_TYPE_AXES(nvbench::type_list<defaults::BF_KEY>,
@@ -124,5 +122,4 @@ NVBENCH_BENCH_TYPES(bloom_filter_contains,
124122
.set_type_axes_names({"Key", "Hash", "Word", "WordsPerBlock", "Distribution"})
125123
.set_max_noise(defaults::MAX_NOISE)
126124
.add_int64_axis("NumInputs", {defaults::BF_N})
127-
.add_int64_axis("FilterSizeMB", {defaults::BF_SIZE_MB})
128-
.add_int64_axis("PatternBits", {defaults::BF_PATTERN_BITS});
125+
.add_int64_axis("FilterSizeMB", {defaults::BF_SIZE_MB});

benchmarks/bloom_filter/defaults.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ using BF_WORD = nvbench::uint32_t;
3333
static constexpr auto BF_N = 400'000'000;
3434
static constexpr auto BF_SIZE_MB = 2'000;
3535
static constexpr auto BF_WORDS_PER_BLOCK = 8;
36-
static constexpr auto BF_PATTERN_BITS = BF_WORDS_PER_BLOCK;
3736

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

0 commit comments

Comments
 (0)