Skip to content

Commit

Permalink
Add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
PointKernel committed Aug 22, 2023
1 parent 5d6616e commit 1921748
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions include/cuco/detail/static_map/static_map_ref.inl
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,10 @@ class operator_impl<

public:
/**
* @brief Inserts an element.
* @brief Inserts a key-value pair `{k, v}` if it's not present in the map. Otherwise, assigns `v`
* to the mapped_type corresponding to the key `k`.
*
* @param value The element to insert
* @return True if the given element is successfully inserted
*/
__device__ void insert_or_assign(value_type const& value) noexcept
{
Expand Down Expand Up @@ -288,9 +288,11 @@ class operator_impl<
/**
* @brief Inserts an element.
*
* @brief Inserts a key-value pair `{k, v}` if it's not present in the map. Otherwise, assigns `v`
* to the mapped_type corresponding to the key `k`.
*
* @param group The Cooperative Group used to perform group insert
* @param value The element to insert
* @return True if the given element is successfully inserted
*/
__device__ void insert_or_assign(cooperative_groups::thread_block_tile<cg_size> const& group,
value_type const& value) noexcept
Expand Down Expand Up @@ -337,6 +339,18 @@ class operator_impl<
}

private:
/**
* @brief Attempts to insert an element into a slot or update the matching payload with the given
* element
*
* @brief Inserts a key-value pair `{k, v}` if it's not present in the map. Otherwise, assigns `v`
* to the mapped_type corresponding to the key `k`.
*
* @param group The Cooperative Group used to perform group insert
* @param value The element to insert
*
* @return Returns `true` if the given `value` is inserted or `value` has a match in the map.
*/
__device__ constexpr bool attempt_insert_or_assign(value_type* slot,
value_type const& value) noexcept
{
Expand Down

0 comments on commit 1921748

Please sign in to comment.