Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
sleeepyjack committed Oct 9, 2023
1 parent d29b8a9 commit dcb0536
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 13 deletions.
56 changes: 55 additions & 1 deletion include/cuco/detail/open_addressing/open_addressing_impl.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -540,14 +540,42 @@ class open_addressing_impl {
return counter.load_to_host(stream);
}

// TODO docs
/**
* @brief Rebuilds the container.
*
* @note This function synchronizes the given stream.
*
* @tparam Container The container type this function operates on
* @tparam Predicate Type of predicate indicating if the given slot is filled
*
* @param container The container to be rehashed
* @param is_filled Predicate indicating if the given slot is filled
* @param stream CUDA stream used for this operation
*
*/
template <typename Container, typename Predicate>
void rehash(Container const& container, Predicate const& is_filled, cuda_stream_ref stream)
{
this->rehash_async(container, is_filled, stream);
stream.synchronize();
}

/**
* @brief Rebuilds the container.
*
* @note This function synchronizes the given stream.
* @note Behavior is undefined if the desired `extent` is insufficient to store all of contained
* elements.
*
* @tparam Container The container type this function operates on
* @tparam Predicate Type of predicate indicating if the given slot is filled
*
* @param extent The container's new `window_extent` after this operation took place
* @param container The container to be rehashed
* @param is_filled Predicate indicating if the given slot is filled
* @param stream CUDA stream used for this operation
*
*/
template <typename Container, typename Predicate>
void rehash(extent_type extent,
Container const& container,
Expand All @@ -558,12 +586,38 @@ class open_addressing_impl {
stream.synchronize();
}

/**
* @brief Asynchonously rebuilds the container.
*
* @tparam Container The container type this function operates on
* @tparam Predicate Type of predicate indicating if the given slot is filled
*
* @param container The container to be rehashed
* @param is_filled Predicate indicating if the given slot is filled
* @param stream CUDA stream used for this operation
*
*/
template <typename Container, typename Predicate>
void rehash_async(Container const& container, Predicate const& is_filled, cuda_stream_ref stream)
{
this->rehash_async(this->storage_.window_extent(), container, is_filled, stream);
}

/**
* @brief Asynchonously rebuilds the container.
*
* @note Behavior is undefined if the desired `extent` is insufficient to store all of contained
* elements.
*
* @tparam Container The container type this function operates on
* @tparam Predicate Type of predicate indicating if the given slot is filled
*
* @param extent The container's new `window_extent` after this operation took place
* @param container The container to be rehashed
* @param is_filled Predicate indicating if the given slot is filled
* @param stream CUDA stream used for this operation
*
*/
template <typename Container, typename Predicate>
void rehash_async(extent_type extent,
Container const& container,
Expand Down
17 changes: 11 additions & 6 deletions include/cuco/static_map.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ class static_map {
* @note This function synchronizes the given stream. For asynchronous execution use
* `rehash_async`.
*
* @param stream CUDA stream used to get the number of inserted elements
* @param stream CUDA stream used for this operation
*/
void rehash(cuda_stream_ref stream = {});

Expand All @@ -551,24 +551,29 @@ class static_map {
*
* @note This function synchronizes the given stream. For asynchronous execution use
* `rehash_async`.
* @note Behavior is undefined if the desired `capacity` is insufficient to store all of contained
* elements.
*
* @param capacity New capacity of the container
* @param stream CUDA stream used to get the number of inserted elements
* @param stream CUDA stream used for this operation
*/
void rehash(size_type capacity, cuda_stream_ref stream = {});

/**
* @brief Rebuilds the container.
* @brief Asynchonously rebuilds the container.
*
* @param stream CUDA stream used to get the number of inserted elements
* @param stream CUDA stream used for this operation
*/
void rehash_async(cuda_stream_ref stream = {});

/**
* @brief Rebuilds the container.
* @brief Asynchonously rebuilds the container.
*
* @note Behavior is undefined if the desired `capacity` is insufficient to store all of contained
* elements.
*
* @param capacity New capacity of the container
* @param stream CUDA stream used to get the number of inserted elements
* @param stream CUDA stream used for this operation
*/
void rehash_async(size_type capacity, cuda_stream_ref stream = {});

Expand Down
17 changes: 11 additions & 6 deletions include/cuco/static_set.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ class static_set {
* @note This function synchronizes the given stream. For asynchronous execution use
* `rehash_async`.
*
* @param stream CUDA stream used to get the number of inserted elements
* @param stream CUDA stream used for this operation
*/
void rehash(cuda_stream_ref stream = {});

Expand All @@ -475,24 +475,29 @@ class static_set {
*
* @note This function synchronizes the given stream. For asynchronous execution use
* `rehash_async`.
* @note Behavior is undefined if the desired `capacity` is insufficient to store all of contained
* elements.
*
* @param capacity New capacity of the container
* @param stream CUDA stream used to get the number of inserted elements
* @param stream CUDA stream used for this operation
*/
void rehash(size_type capacity, cuda_stream_ref stream = {});

/**
* @brief Rebuilds the container.
* @brief Asynchonously rebuilds the container.
*
* @param stream CUDA stream used to get the number of inserted elements
* @param stream CUDA stream used for this operation
*/
void rehash_async(cuda_stream_ref stream = {});

/**
* @brief Rebuilds the container.
* @brief Asynchonously rebuilds the container.
*
* @note Behavior is undefined if the desired `capacity` is insufficient to store all of contained
* elements.
*
* @param capacity New capacity of the container
* @param stream CUDA stream used to get the number of inserted elements
* @param stream CUDA stream used for this operation
*/
void rehash_async(size_type capacity, cuda_stream_ref stream = {});

Expand Down

0 comments on commit dcb0536

Please sign in to comment.