Skip to content

Commit

Permalink
Clarify docs
Browse files Browse the repository at this point in the history
  • Loading branch information
sleeepyjack committed Sep 18, 2024
1 parent 8527e01 commit 6d85a53
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 15 deletions.
5 changes: 3 additions & 2 deletions include/cuco/bloom_filter.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -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<Allocator>::template rebind_alloc<word_type>; ///< Allocator
///< type
Expand Down
5 changes: 3 additions & 2 deletions include/cuco/bloom_filter_ref.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
20 changes: 10 additions & 10 deletions include/cuco/default_filter_policy.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -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<Block>` 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<Block>`
* 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 Hash, class Block>
class default_filter_policy {
Expand All @@ -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:
/**
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion include/cuco/detail/bloom_filter/bloom_filter_impl.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -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_;
Expand Down

0 comments on commit 6d85a53

Please sign in to comment.