Skip to content

Commit 6fbed48

Browse files
committed
Use pow-of-4
1 parent eedb3cf commit 6fbed48

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

cpp/src/neighbors/ivf_flat/ivf_flat_interleaved_scan.cuh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1196,8 +1196,6 @@ void launch_with_fixed_consts(cuvs::distance::DistanceType metric, Args&&... arg
11961196
}
11971197
}
11981198

1199-
#define BASE_CAPACITY 8u
1200-
12011199
/**
12021200
* Lift the `capacity` and `veclen` parameters to the template level,
12031201
* forward the rest of the arguments unmodified to `launch_interleaved_scan_kernel`.
@@ -1224,7 +1222,7 @@ struct select_interleaved_scan_kernel {
12241222
k_max, veclen, select_min, std::forward<Args>(args)...);
12251223
}
12261224
}
1227-
if constexpr (Capacity > BASE_CAPACITY) {
1225+
if constexpr (Capacity > 1) {
12281226
if (k_max * 2 <= Capacity) {
12291227
return select_interleaved_scan_kernel<T,
12301228
AccT,
@@ -1334,7 +1332,7 @@ void ivfflat_interleaved_scan(const index<T, IdxT>& index,
13341332
uint32_t& grid_dim_x,
13351333
rmm::cuda_stream_view stream)
13361334
{
1337-
const int capacity = std::max(BASE_CAPACITY, bound_by_power_of_two(k));
1335+
const int capacity = bound_by_power_of_four(k);
13381336

13391337
auto filter_adapter = cuvs::neighbors::filtering::ivf_to_sample_filter(
13401338
index.inds_ptrs().data_handle(), sample_filter);

0 commit comments

Comments
 (0)