Skip to content

Commit

Permalink
fix hnsw cpu search ids type
Browse files Browse the repository at this point in the history
Signed-off-by: yusheng.ma <[email protected]>
  • Loading branch information
Presburger committed Oct 21, 2024
1 parent 5836a81 commit a37d71d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cpp/src/neighbors/detail/hnsw.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ template <typename T>
void get_search_knn_results(hnswlib::HierarchicalNSW<typename hnsw_dist_t<T>::type> const* idx,
const T* query,
int k,
uint64_t* indices,
int64_t* indices,
float* distances)
{
auto result = idx->searchKnn(query, k);
Expand All @@ -132,7 +132,7 @@ void search(raft::resources const& res,
const search_params& params,
const index<T>& idx,
raft::host_matrix_view<const T, int64_t, raft::row_major> queries,
raft::host_matrix_view<uint64_t, int64_t, raft::row_major> neighbors,
raft::host_matrix_view<int64_t, int64_t, raft::row_major> neighbors,
raft::host_matrix_view<float, int64_t, raft::row_major> distances)
{
RAFT_EXPECTS(
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/neighbors/hnsw_c.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ void _search(cuvsResources_t res,
search_params.num_threads = params.numThreads;

using queries_mdspan_type = raft::host_matrix_view<T const, int64_t, raft::row_major>;
using neighbors_mdspan_type = raft::host_matrix_view<uint64_t, int64_t, raft::row_major>;
using neighbors_mdspan_type = raft::host_matrix_view<int64_t, int64_t, raft::row_major>;
using distances_mdspan_type = raft::host_matrix_view<float, int64_t, raft::row_major>;
auto queries_mds = cuvs::core::from_dlpack<queries_mdspan_type>(queries_tensor);
auto neighbors_mds = cuvs::core::from_dlpack<neighbors_mdspan_type>(neighbors_tensor);
Expand Down

0 comments on commit a37d71d

Please sign in to comment.