Skip to content

Commit

Permalink
Merge branch 'dev' into add-map-retrieve
Browse files Browse the repository at this point in the history
  • Loading branch information
PointKernel authored Nov 22, 2024
2 parents 6b5f7fb + 1bb0ae6 commit 0e96863
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
8 changes: 6 additions & 2 deletions include/cuco/bloom_filter_policies.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

#include <cuco/detail/bloom_filter/arrow_filter_policy.cuh>
#include <cuco/detail/bloom_filter/default_filter_policy_impl.cuh>
#include <cuco/hash_functions.cuh>

#include <cstdint>

Expand All @@ -28,9 +29,12 @@ namespace cuco {
* fingerprint.
*
* @tparam Key The type of the values to generate a fingerprint for.
* @tparam XXHash64 Custom (64 bit) XXHash hasher to generate a key's fingerprint.
* By default, cuco::xxhash_64 hasher will be used.
*
*/
template <class Key>
using arrow_filter_policy = detail::arrow_filter_policy<Key>;
template <class Key, class XXHash64 = cuco::xxhash_64<Key>>
using arrow_filter_policy = detail::arrow_filter_policy<Key, XXHash64>;

/**
* @brief The default policy that defines how a Blocked Bloom Filter generates and stores a key's
Expand Down
7 changes: 4 additions & 3 deletions include/cuco/detail/bloom_filter/arrow_filter_policy.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,13 @@ namespace cuco::detail {
* @endcode
*
* @tparam Key The type of the values to generate a fingerprint for.
* @tparam XXHash64 64-bit XXHash hasher implementation for fingerprint generation.
*/
template <class Key>
template <class Key, class XXHash64>
class arrow_filter_policy {
public:
using hasher = cuco::xxhash_64<Key>; ///< xxhash_64 hasher for Arrow bloom filter policy
using word_type = std::uint32_t; ///< uint32_t for Arrow bloom filter policy
using hasher = XXHash64; ///< 64-bit XXHash hasher for Arrow bloom filter policy
using word_type = std::uint32_t; ///< uint32_t for Arrow bloom filter policy
using hash_argument_type = typename hasher::argument_type; ///< Hash function input type
using hash_result_type = decltype(std::declval<hasher>()(
std::declval<hash_argument_type>())); ///< hash function output type
Expand Down
4 changes: 2 additions & 2 deletions tests/bloom_filter/unique_sequence_test.cu
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ void test_unique_sequence(Filter& filter, size_type num_keys)
{
using Key = typename Filter::key_type;

// Generate keys
thrust::device_vector<Key> keys(num_keys);

thrust::sequence(thrust::device, keys.begin(), keys.end());

thrust::device_vector<bool> contained(num_keys, false);
Expand Down Expand Up @@ -119,4 +119,4 @@ TEMPLATE_TEST_CASE_SIG("bloom_filter arrow policy tests",
auto filter = filter_type{1000};

test_unique_sequence(filter, num_keys);
}
}

0 comments on commit 0e96863

Please sign in to comment.