Skip to content

Commit

Permalink
Merge pull request #126 from vyasr/feature/expose_sentinels_on_device
Browse files Browse the repository at this point in the history
Make sentinel getters part of public device_view API.
  • Loading branch information
jrhemstad authored Dec 13, 2021
2 parents 25a37a6 + b9ece83 commit 57986f4
Showing 1 changed file with 21 additions and 20 deletions.
41 changes: 21 additions & 20 deletions include/cuco/detail/static_multimap/device_view_impl.inl
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,27 @@ template <typename Key,
typename Allocator,
class ProbeSequence>
class static_multimap<Key, Value, Scope, Allocator, ProbeSequence>::device_view_impl_base {
public:
/**
* @brief Gets the sentinel value used to represent an empty key slot.
*
* @return The sentinel value used to represent an empty key slot
*/
__host__ __device__ __forceinline__ Key get_empty_key_sentinel() const noexcept
{
return empty_key_sentinel_;
}

/**
* @brief Gets the sentinel value used to represent an empty value slot.
*
* @return The sentinel value used to represent an empty value slot
*/
__host__ __device__ __forceinline__ Value get_empty_value_sentinel() const noexcept
{
return empty_value_sentinel_;
}

protected:
// Import member type definitions from `static_multimap`
using value_type = value_type;
Expand Down Expand Up @@ -150,26 +171,6 @@ class static_multimap<Key, Value, Scope, Allocator, ProbeSequence>::device_view_
return probe_sequence_.get_capacity();
}

/**
* @brief Gets the sentinel value used to represent an empty key slot.
*
* @return The sentinel value used to represent an empty key slot
*/
__host__ __device__ __forceinline__ Key get_empty_key_sentinel() const noexcept
{
return empty_key_sentinel_;
}

/**
* @brief Gets the sentinel value used to represent an empty value slot.
*
* @return The sentinel value used to represent an empty value slot
*/
__host__ __device__ __forceinline__ Value get_empty_value_sentinel() const noexcept
{
return empty_value_sentinel_;
}

/**
* @brief Load two key/value pairs from the given slot to the target pair array.
*
Expand Down

0 comments on commit 57986f4

Please sign in to comment.