From bf386409467982168dc497a24ca44afe5c6e977c Mon Sep 17 00:00:00 2001 From: Daniel Juenger <2955913+sleeepyjack@users.noreply.github.com> Date: Wed, 11 Oct 2023 00:21:05 +0000 Subject: [PATCH] Update docs --- .../open_addressing/open_addressing_impl.cuh | 43 +++++++++++++------ include/cuco/static_map.cuh | 30 +++++++++---- include/cuco/static_set.cuh | 30 +++++++++---- 3 files changed, 73 insertions(+), 30 deletions(-) diff --git a/include/cuco/detail/open_addressing/open_addressing_impl.cuh b/include/cuco/detail/open_addressing/open_addressing_impl.cuh index 15a394077..96dad6fcd 100644 --- a/include/cuco/detail/open_addressing/open_addressing_impl.cuh +++ b/include/cuco/detail/open_addressing/open_addressing_impl.cuh @@ -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 void rehash(Container const& container, Predicate const& is_filled, cuda_stream_ref stream) @@ -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 @@ -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 void rehash(extent_type extent, @@ -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 void rehash_async(Container const& container, Predicate const& is_filled, cuda_stream_ref stream) @@ -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 @@ -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 void rehash_async(extent_type extent, diff --git a/include/cuco/static_map.cuh b/include/cuco/static_map.cuh index 0f2ef0553..cfdfa8179 100644 --- a/include/cuco/static_map.cuh +++ b/include/cuco/static_map.cuh @@ -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`. @@ -547,12 +547,19 @@ 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 @@ -560,17 +567,24 @@ class static_map { 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 diff --git a/include/cuco/static_set.cuh b/include/cuco/static_set.cuh index 78abcf49e..d0a297482 100644 --- a/include/cuco/static_set.cuh +++ b/include/cuco/static_set.cuh @@ -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`. @@ -471,12 +471,19 @@ 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 @@ -484,17 +491,24 @@ class static_set { 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