From cad88b38a1de065fed933e8a910002d543b8cfa2 Mon Sep 17 00:00:00 2001 From: viclafargue Date: Wed, 12 Jul 2023 16:22:25 +0200 Subject: [PATCH] addressing review 2/2 --- cpp/include/raft/neighbors/ivf_flat-ext.cuh | 12 ---------- cpp/include/raft/neighbors/ivf_flat-inl.cuh | 22 ------------------- .../raft_runtime/neighbors/ivf_flat.hpp | 5 ----- .../ivf_flat_reconstruct_float_int64_t.cu | 6 ----- .../ivf_flat_reconstruct_int8_t_int64_t.cu | 6 ----- .../ivf_flat_reconstruct_uint8_t_int64_t.cu | 6 ----- .../raft_runtime/neighbors/ivf_flat_build.cu | 8 ------- cpp/test/neighbors/ann_ivf_flat.cuh | 3 ++- 8 files changed, 2 insertions(+), 66 deletions(-) diff --git a/cpp/include/raft/neighbors/ivf_flat-ext.cuh b/cpp/include/raft/neighbors/ivf_flat-ext.cuh index 384446d1db..2273e1e354 100644 --- a/cpp/include/raft/neighbors/ivf_flat-ext.cuh +++ b/cpp/include/raft/neighbors/ivf_flat-ext.cuh @@ -93,12 +93,6 @@ void search(raft::resources const& handle, raft::device_matrix_view neighbors, raft::device_matrix_view distances) RAFT_EXPLICIT; -template -void reconstruct_batch(raft::resources const& handle, - const index& index, - raft::device_vector_view vector_ids, - raft::device_matrix_view vector_out) RAFT_EXPLICIT; - template void reconstruct_list_data(raft::resources const& handle, const index& index, @@ -198,12 +192,6 @@ instantiate_raft_neighbors_ivf_flat_search(uint8_t, int64_t); #undef instantiate_raft_neighbors_ivf_flat_search #define instantiate_raft_neighbors_ivf_flat_reconstruct(T, IdxT) \ - extern template void raft::neighbors::ivf_flat::reconstruct_batch( \ - raft::resources const& handle, \ - const raft::neighbors::ivf_flat::index& index, \ - raft::device_vector_view vector_ids, \ - raft::device_matrix_view vector_out); \ - \ extern template void raft::neighbors::ivf_flat::reconstruct_list_data( \ raft::resources const& handle, \ const raft::neighbors::ivf_flat::index& index, \ diff --git a/cpp/include/raft/neighbors/ivf_flat-inl.cuh b/cpp/include/raft/neighbors/ivf_flat-inl.cuh index 65ce62e9cd..40c9a7a8a2 100644 --- a/cpp/include/raft/neighbors/ivf_flat-inl.cuh +++ b/cpp/include/raft/neighbors/ivf_flat-inl.cuh @@ -464,28 +464,6 @@ void search(raft::resources const& handle, nullptr); } -/** - * @brief Reconstruct vector database - * - * - * @tparam T data element type - * @tparam IdxT type of the indices - * - * @param[in] handle - * @param[in] index ivf-flat constructed index - * @param[in] vector_ids vector with the ids of vectors to look for - * @param[out] vector_out matrix with the database of vectors - */ -template -void reconstruct_batch(raft::resources const& handle, - const index& index, - raft::device_vector_view vector_ids, - raft::device_matrix_view vector_out) -{ - return raft::neighbors::ivf_flat::detail::reconstruct_batch( - handle, index, vector_ids, vector_out); -} - /** * @brief Reconstruct vectors of a given cluster * diff --git a/cpp/include/raft_runtime/neighbors/ivf_flat.hpp b/cpp/include/raft_runtime/neighbors/ivf_flat.hpp index efe40f3a54..a076e870b9 100644 --- a/cpp/include/raft_runtime/neighbors/ivf_flat.hpp +++ b/cpp/include/raft_runtime/neighbors/ivf_flat.hpp @@ -46,11 +46,6 @@ namespace raft::runtime::neighbors::ivf_flat { std::optional> new_indices, \ raft::neighbors::ivf_flat::index* idx); \ \ - void reconstruct_batch(raft::resources const& handle, \ - raft::neighbors::ivf_flat::index& idx, \ - raft::device_vector_view vector_ids, \ - raft::device_matrix_view vector_out); \ - \ void reconstruct_list_data(raft::resources const& handle, \ const raft::neighbors::ivf_flat::index& idx, \ device_matrix_view out_vectors, \ diff --git a/cpp/src/neighbors/ivf_flat_reconstruct_float_int64_t.cu b/cpp/src/neighbors/ivf_flat_reconstruct_float_int64_t.cu index fffe9dc66b..1ae8cfdcf9 100644 --- a/cpp/src/neighbors/ivf_flat_reconstruct_float_int64_t.cu +++ b/cpp/src/neighbors/ivf_flat_reconstruct_float_int64_t.cu @@ -26,12 +26,6 @@ #include #define instantiate_raft_neighbors_ivf_flat_reconstruct(T, IdxT) \ - template void raft::neighbors::ivf_flat::reconstruct_batch( \ - raft::resources const& handle, \ - const raft::neighbors::ivf_flat::index& idx, \ - raft::device_vector_view vector_ids, \ - raft::device_matrix_view vector_out); \ - \ template void raft::neighbors::ivf_flat::reconstruct_list_data( \ raft::resources const& handle, \ const raft::neighbors::ivf_flat::index& idx, \ diff --git a/cpp/src/neighbors/ivf_flat_reconstruct_int8_t_int64_t.cu b/cpp/src/neighbors/ivf_flat_reconstruct_int8_t_int64_t.cu index 933a9a6b3a..1d5250487d 100644 --- a/cpp/src/neighbors/ivf_flat_reconstruct_int8_t_int64_t.cu +++ b/cpp/src/neighbors/ivf_flat_reconstruct_int8_t_int64_t.cu @@ -26,12 +26,6 @@ #include #define instantiate_raft_neighbors_ivf_flat_reconstruct(T, IdxT) \ - template void raft::neighbors::ivf_flat::reconstruct_batch( \ - raft::resources const& handle, \ - const raft::neighbors::ivf_flat::index& idx, \ - raft::device_vector_view vector_ids, \ - raft::device_matrix_view vector_out); \ - \ template void raft::neighbors::ivf_flat::reconstruct_list_data( \ raft::resources const& handle, \ const raft::neighbors::ivf_flat::index& idx, \ diff --git a/cpp/src/neighbors/ivf_flat_reconstruct_uint8_t_int64_t.cu b/cpp/src/neighbors/ivf_flat_reconstruct_uint8_t_int64_t.cu index 492e1caee7..2d521d9703 100644 --- a/cpp/src/neighbors/ivf_flat_reconstruct_uint8_t_int64_t.cu +++ b/cpp/src/neighbors/ivf_flat_reconstruct_uint8_t_int64_t.cu @@ -26,12 +26,6 @@ #include #define instantiate_raft_neighbors_ivf_flat_reconstruct(T, IdxT) \ - template void raft::neighbors::ivf_flat::reconstruct_batch( \ - raft::resources const& handle, \ - const raft::neighbors::ivf_flat::index& idx, \ - raft::device_vector_view vector_ids, \ - raft::device_matrix_view vector_out); \ - \ template void raft::neighbors::ivf_flat::reconstruct_list_data( \ raft::resources const& handle, \ const raft::neighbors::ivf_flat::index& idx, \ diff --git a/cpp/src/raft_runtime/neighbors/ivf_flat_build.cu b/cpp/src/raft_runtime/neighbors/ivf_flat_build.cu index b62b09e32c..c5a608555b 100644 --- a/cpp/src/raft_runtime/neighbors/ivf_flat_build.cu +++ b/cpp/src/raft_runtime/neighbors/ivf_flat_build.cu @@ -53,14 +53,6 @@ namespace raft::runtime::neighbors::ivf_flat { raft::neighbors::ivf_flat::extend(handle, new_vectors, new_indices, idx); \ } \ \ - void reconstruct_batch(raft::resources const& handle, \ - const raft::neighbors::ivf_flat::index& idx, \ - raft::device_vector_view vector_ids, \ - raft::device_matrix_view vector_out) \ - { \ - raft::neighbors::ivf_flat::reconstruct_batch(handle, idx, vector_ids, vector_out); \ - } \ - \ void reconstruct_list_data(raft::resources const& handle, \ const raft::neighbors::ivf_flat::index& idx, \ device_matrix_view out_vectors, \ diff --git a/cpp/test/neighbors/ann_ivf_flat.cuh b/cpp/test/neighbors/ann_ivf_flat.cuh index 1bae97b096..a557fd0ea6 100644 --- a/cpp/test/neighbors/ann_ivf_flat.cuh +++ b/cpp/test/neighbors/ann_ivf_flat.cuh @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -286,7 +287,7 @@ class AnnIVFFlatTest : public ::testing::TestWithParam> { raft::make_device_vector_view(vecs_ids.data(), ps.num_db_vecs); auto vectors_out = raft::make_device_matrix(handle_, ps.num_db_vecs, ps.dim); - ivf_flat::reconstruct_batch(handle_, index, vectors_ids, vectors_out.view()); + ivf_flat::detail::reconstruct_batch(handle_, index, vectors_ids, vectors_out.view()); resource::sync_stream(handle_);