From 9a5587469f0120aa97257f88295e0f4483ef6987 Mon Sep 17 00:00:00 2001 From: achirkin Date: Wed, 13 Mar 2024 08:50:49 +0100 Subject: [PATCH] Remove the dynamic dispatch from public search function for it to be moved into detail namespace in #2206 --- cpp/include/raft/neighbors/cagra.cuh | 29 ++-------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/cpp/include/raft/neighbors/cagra.cuh b/cpp/include/raft/neighbors/cagra.cuh index 2446a95ea7..b7e362f704 100644 --- a/cpp/include/raft/neighbors/cagra.cuh +++ b/cpp/include/raft/neighbors/cagra.cuh @@ -346,33 +346,8 @@ void search_with_filtering(raft::resources const& res, auto distances_internal = raft::make_device_matrix_view( distances.data_handle(), distances.extent(0), distances.extent(1)); - // n_rows has the same type as the dataset index (the array extents type) - using ds_idx_type = decltype(idx.dataset().n_rows()); - // Dispatch search parameters based on the dataset kind. - if (auto* strided_dset = dynamic_cast*>(&idx.dataset()); - strided_dset != nullptr) { - // Search using a plain (strided) row-major dataset - return cagra::detail::search_main( - res, params, idx, queries_internal, neighbors_internal, distances_internal, sample_filter); - } else if (auto* vpq_dset = - dynamic_cast*>(&idx.dataset()); - vpq_dset != nullptr) { - // Search using a compressed dataset - RAFT_FAIL("FP32 VPQ dataset support is coming soon"); - } else if (auto* vpq_dset = - dynamic_cast*>(&idx.dataset()); - vpq_dset != nullptr) { - // Search using a compressed dataset - RAFT_FAIL("FP16 VPQ dataset support is coming soon"); - } else if (auto* empty_dset = dynamic_cast*>(&idx.dataset()); - empty_dset != nullptr) { - // Forgot to add a dataset. - RAFT_FAIL( - "Attempted to search without a dataset. Please call index.update_dataset(...) first."); - } else { - // This is a logic error. - RAFT_FAIL("Unrecognized dataset format"); - } + return cagra::detail::search_main( + res, params, idx, queries_internal, neighbors_internal, distances_internal, sample_filter); } /**