|
1 | 1 | /* |
2 | | - * Copyright (c) 2023-2024, NVIDIA CORPORATION. |
| 2 | + * Copyright (c) 2023-2025, NVIDIA CORPORATION. |
3 | 3 | * |
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | 5 | * you may not use this file except in compliance with the License. |
@@ -120,24 +120,21 @@ template <int32_t CGSize, int32_t BucketSize, typename SizeType> |
120 | 120 | template <typename ProbingScheme, typename Storage, typename SizeType, std::size_t N> |
121 | 121 | [[nodiscard]] auto constexpr make_bucket_extent(extent<SizeType, N> ext) |
122 | 122 | { |
123 | | - return make_bucket_extent<ProbingScheme::cg_size, Storage::bucket_size, SizeType, N>(ext); |
124 | | - /* |
125 | | -// TODO fix linear probing with exact capacity |
126 | | -if constexpr (cuco::is_double_hashing<ProbingScheme>::value) { |
127 | | - return make_bucket_extent<ProbingScheme::cg_size, Storage::bucket_size, SizeType, N>(ext); |
128 | | -} else { |
129 | | - auto const size = cuco::detail::int_div_ceil( |
130 | | - cuda::std::max(static_cast<SizeType>(ext), static_cast<SizeType>(1)), |
131 | | - ProbingScheme::cg_size * Storage::bucket_size) + |
132 | | - cuda::std::min(static_cast<SizeType>(ext), static_cast<SizeType>(1)); |
133 | | - if constexpr (N == dynamic_extent) { |
134 | | - return bucket_extent<SizeType>{size * ProbingScheme::cg_size}; |
| 123 | + if constexpr (cuco::is_double_hashing<ProbingScheme>::value) { |
| 124 | + return make_bucket_extent<ProbingScheme::cg_size, Storage::bucket_size, SizeType, N>(ext); |
135 | 125 | } else { |
136 | | - return bucket_extent<SizeType, size * ProbingScheme::cg_size>{}; |
| 126 | + auto const size = |
| 127 | + cuco::detail::int_div_ceil(std::max(static_cast<SizeType>(ext), static_cast<SizeType>(1)), |
| 128 | + ProbingScheme::cg_size * Storage::bucket_size) + |
| 129 | + static_cast<SizeType>(ext == 0); |
| 130 | + |
| 131 | + if constexpr (N == dynamic_extent) { |
| 132 | + return bucket_extent<SizeType>{size * ProbingScheme::cg_size}; |
| 133 | + } else { |
| 134 | + return bucket_extent<SizeType, size * ProbingScheme::cg_size>{}; |
| 135 | + } |
137 | 136 | } |
138 | 137 | } |
139 | | -*/ |
140 | | -} |
141 | 138 |
|
142 | 139 | template <typename ProbingScheme, typename Storage, typename SizeType> |
143 | 140 | [[nodiscard]] auto constexpr make_bucket_extent(SizeType size) |
|
0 commit comments