From 6d85a539aca0c262c1a90efb7e740411f370ebb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20J=C3=BCnger?= Date: Wed, 18 Sep 2024 17:31:09 +0000 Subject: [PATCH] Clarify docs --- include/cuco/bloom_filter.cuh | 5 +++-- include/cuco/bloom_filter_ref.cuh | 5 +++-- include/cuco/default_filter_policy.cuh | 20 +++++++++---------- .../detail/bloom_filter/bloom_filter_impl.cuh | 2 +- 4 files changed, 17 insertions(+), 15 deletions(-) diff --git a/include/cuco/bloom_filter.cuh b/include/cuco/bloom_filter.cuh index bc8c085ed..0313af44d 100644 --- a/include/cuco/bloom_filter.cuh +++ b/include/cuco/bloom_filter.cuh @@ -76,12 +76,13 @@ class bloom_filter { static constexpr auto thread_scope = ref_type<>::thread_scope; ///< CUDA thread scope static constexpr auto words_per_block = - ref_type<>::words_per_block; ///< Number of machine words in each filter block + ref_type<>::words_per_block; ///< Number of machine words/segments in each filter block using key_type = typename ref_type<>::key_type; ///< Key Type using extent_type = typename ref_type<>::extent_type; ///< Extent type using size_type = typename extent_type::value_type; ///< Underlying type of the extent type - using word_type = typename ref_type<>::word_type; ///< Machine word type + using word_type = + typename ref_type<>::word_type; ///< Underlying word/segment type of a filter block using allocator_type = typename std::allocator_traits::template rebind_alloc; ///< Allocator ///< type diff --git a/include/cuco/bloom_filter_ref.cuh b/include/cuco/bloom_filter_ref.cuh index 92ecd8432..370cf7861 100644 --- a/include/cuco/bloom_filter_ref.cuh +++ b/include/cuco/bloom_filter_ref.cuh @@ -42,12 +42,13 @@ class bloom_filter_ref { public: static constexpr auto thread_scope = impl_type::thread_scope; ///< CUDA thread scope static constexpr auto words_per_block = - impl_type::words_per_block; ///< Number of machine words in each filter block + impl_type::words_per_block; ///< Number of words/segments in each filter block using key_type = typename impl_type::key_type; ///< Key Type using extent_type = typename impl_type::extent_type; ///< Extent type using size_type = typename extent_type::value_type; ///< Underlying type of the extent type - using word_type = typename impl_type::word_type; ///< Machine word type + using word_type = + typename impl_type::word_type; ///< Underlying word/segment type of a filter block /** * @brief Constructs the ref object from existing storage. diff --git a/include/cuco/default_filter_policy.cuh b/include/cuco/default_filter_policy.cuh index cf9972dc7..2d1e58c1e 100644 --- a/include/cuco/default_filter_policy.cuh +++ b/include/cuco/default_filter_policy.cuh @@ -25,12 +25,12 @@ namespace cuco { /** * @brief A policy that defines how a Blocked Bloom Filter generates and stores a key's fingerprint. * - * @note `Block` is used **only** to determine `block_words` via `cuda::std::tuple_size` and - * `word_type` via `Block::value_type` and does not represent the actual storage type of the filter. - * We recommend using `cuda::std::array`. + * @note `Block` is used **only** to determine `words_per_block` via `cuda::std::tuple_size` + * and `word_type` via `Block::value_type` and does not represent the actual storage type of the + * filter. We recommend using `cuda::std::array`. * * @tparam Hash Hash function used to generate a key's fingerprint - * @tparam Block Type to determine the filter's block size and underlying word type + * @tparam Block Type to determine the filter's block size and underlying word/segment type */ template class default_filter_policy { @@ -41,10 +41,10 @@ class default_filter_policy { using hash_argument_type = typename impl_type::hash_argument_type; ///< Hash function input type using hash_result_type = typename impl_type::hash_result_type; ///< hash function output type using word_type = - typename impl_type::word_type; ///< Underlying machine word type of the filter's storage + typename impl_type::word_type; ///< Underlying word/segment type of a filter block static constexpr std::uint32_t words_per_block = - impl_type::words_per_block; ///< Number of machine words in each filter block + impl_type::words_per_block; ///< Number of words/segments in each filter block public: /** @@ -96,16 +96,16 @@ class default_filter_policy { __device__ constexpr auto block_index(hash_result_type hash, Extent num_blocks) const; /** - * @brief Determines the fingerprint pattern for a word within the filter block for a given key's - * hash value. + * @brief Determines the fingerprint pattern for a word/segment within the filter block for a + * given key's hash value. * * @note This function is meant as a customization point and is only used in the internals of the * `bloom_filter(_ref)` implementation. * * @param hash Hash value of the key - * @param word_index Target word within the filter block + * @param word_index Target word/segment within the filter block * - * @return The bit pattern for the word in the filter block + * @return The bit pattern for the word/segment in the filter block */ __device__ constexpr word_type word_pattern(hash_result_type hash, std::uint32_t word_index) const; diff --git a/include/cuco/detail/bloom_filter/bloom_filter_impl.cuh b/include/cuco/detail/bloom_filter/bloom_filter_impl.cuh index c5d1beff4..ab62cdb06 100644 --- a/include/cuco/detail/bloom_filter/bloom_filter_impl.cuh +++ b/include/cuco/detail/bloom_filter/bloom_filter_impl.cuh @@ -281,7 +281,7 @@ class bloom_filter_impl { __host__ __device__ static constexpr size_t required_alignment() noexcept { - return sizeof(word_type) * words_per_block; // TODO check if a maximum of 16byte is suffiecient + return sizeof(word_type) * words_per_block; // TODO check if a maximum of 16byte is sufficient } word_type* words_;