Skip to content

Commit

Permalink
Fix AoW leftovers
Browse files Browse the repository at this point in the history
  • Loading branch information
PointKernel committed Nov 2, 2024
1 parent b71a2fd commit 4e7ddec
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 14 deletions.
19 changes: 11 additions & 8 deletions include/cuco/bucket_storage.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ template <typename T, int32_t BucketSize>
using window = bucket<T, BucketSize>;

/**
* @brief Non-owning AoW storage reference type.
* @brief Non-owning array of buckets storage reference type.
*
* @tparam T Storage element type
* @tparam BucketSize Number of slots in each bucket
Expand All @@ -47,7 +47,8 @@ using window = bucket<T, BucketSize>;
template <typename T, int32_t BucketSize, typename Extent = cuco::extent<std::size_t>>
class bucket_storage_ref : public detail::bucket_storage_base<T, BucketSize, Extent> {
public:
using base_type = detail::bucket_storage_base<T, BucketSize, Extent>; ///< AoW base class type
/// Array of buckets base class type
using base_type = detail::bucket_storage_base<T, BucketSize, Extent>;

using base_type::bucket_size; ///< Number of elements processed per bucket

Expand Down Expand Up @@ -123,7 +124,7 @@ class bucket_storage_ref : public detail::bucket_storage_base<T, BucketSize, Ext
};

/**
* @brief Array of Bucket open addressing storage class.
* @brief Array of buckets open addressing storage class.
*
* @tparam T Slot type
* @tparam BucketSize Number of slots in each bucket
Expand All @@ -136,7 +137,8 @@ template <typename T,
typename Allocator = cuco::cuda_allocator<cuco::bucket<T, BucketSize>>>
class bucket_storage : public detail::bucket_storage_base<T, BucketSize, Extent> {
public:
using base_type = detail::bucket_storage_base<T, BucketSize, Extent>; ///< AoW base class type
/// Array of buckets base class type
using base_type = detail::bucket_storage_base<T, BucketSize, Extent>;

using base_type::bucket_size; ///< Number of elements processed per bucket

Expand All @@ -156,7 +158,7 @@ class bucket_storage : public detail::bucket_storage_base<T, BucketSize, Extent>
using ref_type = bucket_storage_ref<value_type, bucket_size, extent_type>; ///< Storage ref type

/**
* @brief Constructor of AoW storage.
* @brief Constructor of bucket storage.
*
* @note The input `size` should be exclusively determined by the return value of
* `make_bucket_extent` since it depends on the requested low-bound value, the probing scheme, and
Expand Down Expand Up @@ -201,15 +203,15 @@ class bucket_storage : public detail::bucket_storage_base<T, BucketSize, Extent>
[[nodiscard]] constexpr ref_type ref() const noexcept;

/**
* @brief Initializes each slot in the AoW storage to contain `key`.
* @brief Initializes each slot in the bucket storage to contain `key`.
*
* @param key Key to which all keys in `slots` are initialized
* @param stream Stream used for executing the kernel
*/
void initialize(value_type key, cuda::stream_ref stream = {});

/**
* @brief Asynchronously initializes each slot in the AoW storage to contain `key`.
* @brief Asynchronously initializes each slot in the bucket storage to contain `key`.
*
* @param key Key to which all keys in `slots` are initialized
* @param stream Stream used for executing the kernel
Expand All @@ -219,7 +221,8 @@ class bucket_storage : public detail::bucket_storage_base<T, BucketSize, Extent>
private:
allocator_type allocator_; ///< Allocator used to (de)allocate buckets
bucket_deleter_type bucket_deleter_; ///< Custom buckets deleter
std::unique_ptr<bucket_type, bucket_deleter_type> buckets_; ///< Pointer to AoW storage
/// Pointer to the bucket storage
std::unique_ptr<bucket_type, bucket_deleter_type> buckets_;
};

/// Alias for bucket_storage_ref
Expand Down
2 changes: 1 addition & 1 deletion include/cuco/detail/storage/bucket_storage_base.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class bucket_storage_base : public storage_base<Extent> {
using bucket_type = bucket<value_type, bucket_size>; ///< Slot bucket type

/**
* @brief Constructor of AoW base storage.
* @brief Constructor of array of bucket base storage.
*
* @param size Number of buckets to store
*/
Expand Down
10 changes: 5 additions & 5 deletions include/cuco/storage.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ namespace cuco {
* @note This is a public interface used to control storage bucket size. A bucket consists of one
* or multiple contiguous slots. The bucket size defines the workload granularity for each CUDA
* thread, i.e., how many slots a thread would concurrently operate on when performing modify or
* lookup operations. cuCollections uses the AoW storage to supersede the raw flat slot storage due
* to its superior granularity control: When bucket size equals one, AoW performs the same as the
* flat storage. If the underlying operation is more memory bandwidth bound, e.g., high occupancy
* multimap operations, a larger bucket size can reduce the length of probing sequences thus improve
* runtime performance.
* lookup operations. cuCollections uses the array of bucket storage to supersede the raw flat slot
* storage due to its superior granularity control: When bucket size equals one, array of buckets
* performs the same as the flat storage. If the underlying operation is more memory bandwidth
* bound, e.g., high occupancy multimap operations, a larger bucket size can reduce the length of
* probing sequences thus improve runtime performance.
*
* @tparam BucketSize Number of elements per bucket storage
*/
Expand Down

0 comments on commit 4e7ddec

Please sign in to comment.