From dcb0536985e973ef9a377691f408603c8dfd0364 Mon Sep 17 00:00:00 2001 From: Daniel Juenger <2955913+sleeepyjack@users.noreply.github.com> Date: Mon, 9 Oct 2023 22:47:19 +0000 Subject: [PATCH] Update docs --- .../open_addressing/open_addressing_impl.cuh | 56 ++++++++++++++++++- include/cuco/static_map.cuh | 17 ++++-- include/cuco/static_set.cuh | 17 ++++-- 3 files changed, 77 insertions(+), 13 deletions(-) diff --git a/include/cuco/detail/open_addressing/open_addressing_impl.cuh b/include/cuco/detail/open_addressing/open_addressing_impl.cuh index 79e3ff736..15a394077 100644 --- a/include/cuco/detail/open_addressing/open_addressing_impl.cuh +++ b/include/cuco/detail/open_addressing/open_addressing_impl.cuh @@ -540,7 +540,19 @@ 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 void rehash(Container const& container, Predicate const& is_filled, cuda_stream_ref stream) { @@ -548,6 +560,22 @@ class open_addressing_impl { 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 void rehash(extent_type extent, Container const& container, @@ -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 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 void rehash_async(extent_type extent, Container const& container, diff --git a/include/cuco/static_map.cuh b/include/cuco/static_map.cuh index 61b7b52f0..0f2ef0553 100644 --- a/include/cuco/static_map.cuh +++ b/include/cuco/static_map.cuh @@ -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 = {}); @@ -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 = {}); diff --git a/include/cuco/static_set.cuh b/include/cuco/static_set.cuh index 6f74a01be..78abcf49e 100644 --- a/include/cuco/static_set.cuh +++ b/include/cuco/static_set.cuh @@ -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 = {}); @@ -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 = {});