Skip to content

Commit

Permalink
use pairwise_distance specialization to speed up compile times
Browse files Browse the repository at this point in the history
  • Loading branch information
benfred committed Feb 7, 2023
1 parent cb2b750 commit e870eb3
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions cpp/include/raft/neighbors/detail/knn_brute_force.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -200,16 +200,19 @@ void tiled_brute_force_knn(const raft::device_resources& handle,

// calculate the top-k elements for the current tile, by calculating the
// full pairwise distance for the tile - and then selecting the top-k from that
distance::pairwise_distance<ElementType, IndexType>(handle,
search + i * d,
index + j * d,
temp_distances.data(),
current_query_size,
current_centroid_size,
d,
metric,
true,
metric_arg);
// note: we're using a int32 IndexType here on purpose in order to
// use the pairwise_distance specializations. Since the tile size will ensure
// that the total memory is < 1GB per tile, this will not cause any issues
distance::pairwise_distance<ElementType, int>(handle,
search + i * d,
index + j * d,
temp_distances.data(),
current_query_size,
current_centroid_size,
d,
metric,
true,
metric_arg);

detail::select_k<IndexType, ElementType>(temp_distances.data(),
nullptr,
Expand Down

0 comments on commit e870eb3

Please sign in to comment.