Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
sleeepyjack committed Oct 11, 2023
1 parent dcb0536 commit bf38640
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 30 deletions.
43 changes: 29 additions & 14 deletions include/cuco/detail/open_addressing/open_addressing_impl.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -541,17 +541,18 @@ class open_addressing_impl {
}

/**
* @brief Rebuilds the container.
* @brief Regenerates the container
*
* @note This function synchronizes the given stream.
* @note This function synchronizes the given stream. For asynchronous execution use
* `rehash_async`.
*
* @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(Container const& container, Predicate const& is_filled, cuda_stream_ref stream)
Expand All @@ -561,11 +562,20 @@ class open_addressing_impl {
}

/**
* @brief Rebuilds the container.
* @brief Asynchronously reserves at least the specified number of slots and regenerates 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.
* @note Changes the number of windows to a value that is not less than `extent`, then
* rehashes the container, i.e. puts the elements into appropriate slots considering
* that the total number of slots has changed.
*
* @note This function synchronizes the given stream. For asynchronous execution use
* `rehash_async`.
*
* @note Behavior is undefined if the desired `extent` is insufficient to store all of the
* contained elements.
*
* @note This function is not available if the conatiner's `extent_type` is static.
*
* @tparam Container The container type this function operates on
* @tparam Predicate Type of predicate indicating if the given slot is filled
Expand All @@ -574,7 +584,6 @@ class open_addressing_impl {
* @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,
Expand All @@ -587,15 +596,15 @@ class open_addressing_impl {
}

/**
* @brief Asynchonously rebuilds the container.
* @brief Asynchronously regenerates the container
*
* @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(Container const& container, Predicate const& is_filled, cuda_stream_ref stream)
Expand All @@ -604,10 +613,17 @@ class open_addressing_impl {
}

/**
* @brief Asynchonously rebuilds the container.
* @brief Asynchronously reserves at least the specified number of slots and regenerates the
* container
*
* @note Behavior is undefined if the desired `extent` is insufficient to store all of contained
* elements.
* @note Changes the number of windows to a value that is not less than `extent`, then
* rehashes the container, i.e. puts the elements into appropriate slots considering
* that the total number of slots has changed.
*
* @note Behavior is undefined if the desired `extent` is insufficient to store all of the
* contained elements.
*
* @note This function is not available if the conatiner's `extent_type` is static.
*
* @tparam Container The container type this function operates on
* @tparam Predicate Type of predicate indicating if the given slot is filled
Expand All @@ -616,7 +632,6 @@ class open_addressing_impl {
* @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,
Expand Down
30 changes: 22 additions & 8 deletions include/cuco/static_map.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ class static_map {
cuda_stream_ref stream = {}) const;

/**
* @brief Rebuilds the container.
* @brief Regenerates the container.
*
* @note This function synchronizes the given stream. For asynchronous execution use
* `rehash_async`.
Expand All @@ -547,30 +547,44 @@ class static_map {
void rehash(cuda_stream_ref stream = {});

/**
* @brief Rebuilds the container.
* @brief Reserves at least the specified number of slots and regenerates the container
*
* @note Changes the number of slots to a value that is not less than `capacity`, then
* rehashes the container, i.e. puts the elements into appropriate slots considering
* that the total number of slots has changed.
*
* @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.
*
* @note Behavior is undefined if the desired `capacity` is insufficient to store all of the
* contained elements.
*
* @note This function is not available if the conatiner's `extent_type` is static.
*
* @param capacity New capacity of the container
* @param stream CUDA stream used for this operation
*/
void rehash(size_type capacity, cuda_stream_ref stream = {});

/**
* @brief Asynchonously rebuilds the container.
* @brief Asynchronously regenerates the container.
*
* @param stream CUDA stream used for this operation
*/
void rehash_async(cuda_stream_ref stream = {});

/**
* @brief Asynchonously rebuilds the container.
* @brief Asynchronously reserves at least the specified number of slots and regenerates the
* container
*
* @note Changes the number of slots to a value that is not less than `capacity`, then
* rehashes the container, i.e. puts the elements into appropriate slots considering
* that the total number of slots has changed.
*
* @note Behavior is undefined if the desired `capacity` is insufficient to store all of the
* contained elements.
*
* @note Behavior is undefined if the desired `capacity` is insufficient to store all of contained
* elements.
* @note This function is not available if the conatiner's `extent_type` is static.
*
* @param capacity New capacity of the container
* @param stream CUDA stream used for this operation
Expand Down
30 changes: 22 additions & 8 deletions include/cuco/static_set.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ class static_set {
OutputIt retrieve_all(OutputIt output_begin, cuda_stream_ref stream = {}) const;

/**
* @brief Rebuilds the container.
* @brief Regenerates the container.
*
* @note This function synchronizes the given stream. For asynchronous execution use
* `rehash_async`.
Expand All @@ -471,30 +471,44 @@ class static_set {
void rehash(cuda_stream_ref stream = {});

/**
* @brief Rebuilds the container.
* @brief Reserves at least the specified number of slots and regenerates the container
*
* @note Changes the number of slots to a value that is not less than `capacity`, then
* rehashes the container, i.e. puts the elements into appropriate slots considering
* that the total number of slots has changed.
*
* @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.
*
* @note Behavior is undefined if the desired `capacity` is insufficient to store all of the
* contained elements.
*
* @note This function is not available if the conatiner's `extent_type` is static.
*
* @param capacity New capacity of the container
* @param stream CUDA stream used for this operation
*/
void rehash(size_type capacity, cuda_stream_ref stream = {});

/**
* @brief Asynchonously rebuilds the container.
* @brief Asynchronously regenerates the container.
*
* @param stream CUDA stream used for this operation
*/
void rehash_async(cuda_stream_ref stream = {});

/**
* @brief Asynchonously rebuilds the container.
* @brief Asynchronously reserves at least the specified number of slots and regenerates the
* container
*
* @note Changes the number of slots to a value that is not less than `capacity`, then
* rehashes the container, i.e. puts the elements into appropriate slots considering
* that the total number of slots has changed.
*
* @note Behavior is undefined if the desired `capacity` is insufficient to store all of the
* contained elements.
*
* @note Behavior is undefined if the desired `capacity` is insufficient to store all of contained
* elements.
* @note This function is not available if the conatiner's `extent_type` is static.
*
* @param capacity New capacity of the container
* @param stream CUDA stream used for this operation
Expand Down

0 comments on commit bf38640

Please sign in to comment.