From 606b82604425ffd66d40b54144e215c52251d998 Mon Sep 17 00:00:00 2001 From: Yunsong Wang Date: Fri, 13 Dec 2024 12:12:25 -0800 Subject: [PATCH] Deprecate window in implementations --- include/cuco/bucket_storage.cuh | 6 -- include/cuco/detail/extent/extent.inl | 30 ---------- include/cuco/extent.cuh | 76 ------------------------ include/cuco/static_map_ref.cuh | 1 - include/cuco/static_multimap_ref.cuh | 1 - include/cuco/static_multiset_ref.cuh | 1 - include/cuco/static_set_ref.cuh | 1 - tests/static_map/insert_or_apply_test.cu | 4 +- tests/utility/extent_test.cu | 6 +- tests/utility/probing_scheme_test.cu | 4 +- 10 files changed, 7 insertions(+), 123 deletions(-) diff --git a/include/cuco/bucket_storage.cuh b/include/cuco/bucket_storage.cuh index eb16c8313..f895d79aa 100644 --- a/include/cuco/bucket_storage.cuh +++ b/include/cuco/bucket_storage.cuh @@ -33,10 +33,6 @@ namespace cuco { template using bucket = detail::bucket; -/// Alias for bucket -template -using window = bucket; - /** * @brief Non-owning array of buckets storage reference type. * @@ -56,7 +52,6 @@ class bucket_storage_ref : public detail::bucket_storage_base using size_type = typename base_type::size_type; ///< Storage size type using value_type = typename base_type::value_type; ///< Slot type using bucket_type = typename base_type::bucket_type; ///< Slot bucket type - using window_type = bucket_type; ///< Slot bucket type using base_type::capacity; using base_type::num_buckets; diff --git a/include/cuco/detail/extent/extent.inl b/include/cuco/detail/extent/extent.inl index 916d75e2c..bb5145c70 100644 --- a/include/cuco/detail/extent/extent.inl +++ b/include/cuco/detail/extent/extent.inl @@ -111,24 +111,12 @@ template } } -template -[[nodiscard]] auto constexpr make_window_extent(extent ext) -{ - return make_bucket_extent(ext); -} - template [[nodiscard]] auto constexpr make_bucket_extent(SizeType size) { return make_bucket_extent(extent{size}); } -template -[[nodiscard]] auto constexpr make_window_extent(SizeType size) -{ - return make_bucket_extent(extent{size}); -} - template [[nodiscard]] auto constexpr make_bucket_extent(extent ext) { @@ -167,15 +155,6 @@ template N>(ext); } -template -[[nodiscard]] auto constexpr make_window_extent(extent ext) -{ - return make_bucket_extent(ext); -} - template [[nodiscard]] auto constexpr make_bucket_extent(SizeType size) { @@ -185,15 +164,6 @@ template dynamic_extent>(extent{size}); } -template -[[nodiscard]] auto constexpr make_window_extent(SizeType size) -{ - return make_bucket_extent(extent{size}); -} - namespace detail { template diff --git a/include/cuco/extent.cuh b/include/cuco/extent.cuh index 157aff9e4..e7059ab2a 100644 --- a/include/cuco/extent.cuh +++ b/include/cuco/extent.cuh @@ -85,10 +85,6 @@ struct extent { template struct bucket_extent; -/// Alias for bucket_extent -template -using window_extent = bucket_extent; - /** * @brief Computes valid bucket extent based on given parameters. * @@ -112,25 +108,6 @@ using window_extent = bucket_extent; template [[nodiscard]] auto constexpr make_bucket_extent(extent ext); -/** - * @brief Computes valid bucket extent based on given parameters. - * - * @deprecated Use the equivalent `make_bucket_extent` instead. - * - * @tparam CGSize Number of elements handled per CG - * @tparam BucketSize Number of elements handled per Bucket - * @tparam SizeType Size type - * @tparam N Extent - * - * @param ext The input extent - * - * @throw If the input extent is invalid - * - * @return Resulting valid extent - */ -template -[[nodiscard]] auto constexpr make_window_extent(extent ext); - /** * @brief Computes valid bucket extent/capacity based on given parameters. * @@ -153,24 +130,6 @@ template template [[nodiscard]] auto constexpr make_bucket_extent(SizeType size); -/** - * @brief Computes valid bucket extent/capacity based on given parameters. - * - * @deprecated Use the equivalent `make_bucket_extent` instead. - * - * @tparam CGSize Number of elements handled per CG - * @tparam BucketSize Number of elements handled per Bucket - * @tparam SizeType Size type - * - * @param size The input size - * - * @throw If the input size is invalid - * - * @return Resulting valid extent - */ -template -[[nodiscard]] auto constexpr make_window_extent(SizeType size); - template [[nodiscard]] auto constexpr make_bucket_extent(cuco::extent ext); @@ -199,24 +158,6 @@ template template [[nodiscard]] auto constexpr make_bucket_extent(extent ext); -/** - * @brief Computes a valid bucket extent/capacity for a given container type. - * - * @deprecated Use the equivalent `make_bucket_extent` instead. - * - * @tparam Container Container type to compute the extent for - * @tparam SizeType Size type - * @tparam N Extent - * - * @param ext The input extent - * - * @throw If the input extent is invalid - * - * @return Resulting valid `bucket extent` - */ -template -[[nodiscard]] auto constexpr make_window_extent(extent ext); - /** * @brief Computes a valid capacity for a given container type. * @@ -238,23 +179,6 @@ template template [[nodiscard]] auto constexpr make_bucket_extent(SizeType size); -/** - * @brief Computes a valid capacity for a given container type. - * - * @deprecated Use the equivalent `make_bucket_extent` instead. - * - * @tparam Container Container type to compute the extent for - * @tparam SizeType Size type - * - * @param size The input size - * - * @throw If the input size is invalid - * - * @return Resulting valid extent - */ -template -[[nodiscard]] auto constexpr make_window_extent(SizeType size); - } // namespace cuco #include diff --git a/include/cuco/static_map_ref.cuh b/include/cuco/static_map_ref.cuh index 75f654a73..d9b043ff5 100644 --- a/include/cuco/static_map_ref.cuh +++ b/include/cuco/static_map_ref.cuh @@ -89,7 +89,6 @@ class static_map_ref using hasher = typename probing_scheme_type::hasher; ///< Hash function type using storage_ref_type = StorageRef; ///< Type of storage ref using bucket_type = typename storage_ref_type::bucket_type; ///< Bucket type - using window_type = bucket_type; ///< Bucket type using value_type = typename storage_ref_type::value_type; ///< Storage element type using extent_type = typename storage_ref_type::extent_type; ///< Extent type using size_type = typename storage_ref_type::size_type; ///< Probing scheme size type diff --git a/include/cuco/static_multimap_ref.cuh b/include/cuco/static_multimap_ref.cuh index 0407d2d70..cb5a5a337 100644 --- a/include/cuco/static_multimap_ref.cuh +++ b/include/cuco/static_multimap_ref.cuh @@ -86,7 +86,6 @@ class static_multimap_ref using hasher = typename probing_scheme_type::hasher; ///< Hash function type using storage_ref_type = StorageRef; ///< Type of storage ref using bucket_type = typename storage_ref_type::bucket_type; ///< Bucket type - using window_type = bucket_type; ///< Bucket type using value_type = typename storage_ref_type::value_type; ///< Storage element type using extent_type = typename storage_ref_type::extent_type; ///< Extent type using size_type = typename storage_ref_type::size_type; ///< Probing scheme size type diff --git a/include/cuco/static_multiset_ref.cuh b/include/cuco/static_multiset_ref.cuh index 203cdc8b5..569a4551c 100644 --- a/include/cuco/static_multiset_ref.cuh +++ b/include/cuco/static_multiset_ref.cuh @@ -77,7 +77,6 @@ class static_multiset_ref using hasher = typename probing_scheme_type::hasher; ///< Hash function type using storage_ref_type = StorageRef; ///< Type of storage ref using bucket_type = typename storage_ref_type::bucket_type; ///< Bucket type - using window_type = bucket_type; ///< Bucket type using value_type = typename storage_ref_type::value_type; ///< Storage element type using extent_type = typename storage_ref_type::extent_type; ///< Extent type using size_type = typename storage_ref_type::size_type; ///< Probing scheme size type diff --git a/include/cuco/static_set_ref.cuh b/include/cuco/static_set_ref.cuh index 846ad9252..0bf2ed4e3 100644 --- a/include/cuco/static_set_ref.cuh +++ b/include/cuco/static_set_ref.cuh @@ -77,7 +77,6 @@ class static_set_ref using hasher = typename probing_scheme_type::hasher; ///< Hash function type using storage_ref_type = StorageRef; ///< Type of storage ref using bucket_type = typename storage_ref_type::bucket_type; ///< Bucket type - using window_type = bucket_type; ///< Bucket type using value_type = typename storage_ref_type::value_type; ///< Storage element type using extent_type = typename storage_ref_type::extent_type; ///< Extent type using size_type = typename storage_ref_type::size_type; ///< Probing scheme size type diff --git a/tests/static_map/insert_or_apply_test.cu b/tests/static_map/insert_or_apply_test.cu index 03d8ce5c9..451a310b2 100644 --- a/tests/static_map/insert_or_apply_test.cu +++ b/tests/static_map/insert_or_apply_test.cu @@ -101,7 +101,7 @@ void test_insert_or_apply_shmem(Map& map, size_type num_keys, size_type num_uniq cuco::storage<1>>; using shared_map_ref_type = typename shared_map_type::ref_type<>; - auto constexpr window_extent = cuco::make_window_extent(extent_type{}); + auto constexpr bucket_extent = cuco::make_bucket_extent(extent_type{}); // Insert pairs auto pairs_begin = thrust::make_transform_iterator( @@ -122,7 +122,7 @@ void test_insert_or_apply_shmem(Map& map, size_type num_keys, size_type num_uniq init, cuco::reduce::plus{}, map.ref(cuco::op::insert_or_apply), - window_extent); + bucket_extent); REQUIRE(map.size() == num_unique_keys); diff --git a/tests/utility/extent_test.cu b/tests/utility/extent_test.cu index 96e97e4b9..c88ae08d3 100644 --- a/tests/utility/extent_test.cu +++ b/tests/utility/extent_test.cu @@ -26,7 +26,7 @@ TEMPLATE_TEST_CASE_SIG( SizeType constexpr num = 1234; SizeType constexpr gold_reference = 314; // 157 x 2 auto constexpr cg_size = 2; - auto constexpr window_size = 4; + auto constexpr bucket_size = 4; SECTION("Static extent must be evaluated at compile time.") { @@ -43,14 +43,14 @@ TEMPLATE_TEST_CASE_SIG( SECTION("Compute static valid extent at compile time.") { auto constexpr size = cuco::extent{}; - auto constexpr res = cuco::make_window_extent(size); + auto constexpr res = cuco::make_bucket_extent(size); STATIC_REQUIRE(gold_reference == res.value()); } SECTION("Compute dynamic valid extent at run time.") { auto const size = cuco::extent{num}; - auto const res = cuco::make_window_extent(size); + auto const res = cuco::make_bucket_extent(size); REQUIRE(gold_reference == res.value()); } } diff --git a/tests/utility/probing_scheme_test.cu b/tests/utility/probing_scheme_test.cu index 994d5e443..4eb01199a 100644 --- a/tests/utility/probing_scheme_test.cu +++ b/tests/utility/probing_scheme_test.cu @@ -79,7 +79,7 @@ __global__ void generate_cg_probing_sequence(Key key, TEMPLATE_TEST_CASE_SIG( "utility probing_scheme tests", "", - ((typename Key, cuco::test::probe_sequence Probe, int32_t WindowSize), Key, Probe, WindowSize), + ((typename Key, cuco::test::probe_sequence Probe, int32_t BucketSize), Key, Probe, BucketSize), (int32_t, cuco::test::probe_sequence::double_hashing, 1), (int32_t, cuco::test::probe_sequence::double_hashing, 2), (int64_t, cuco::test::probe_sequence::double_hashing, 1), @@ -89,7 +89,7 @@ TEMPLATE_TEST_CASE_SIG( (int64_t, cuco::test::probe_sequence::linear_probing, 1), (int64_t, cuco::test::probe_sequence::linear_probing, 2)) { - auto const upper_bound = cuco::make_window_extent<1, WindowSize>(cuco::extent{10}); + auto const upper_bound = cuco::make_bucket_extent<1, BucketSize>(cuco::extent{10}); constexpr size_t seq_length{8}; constexpr Key key{42};