From 50990d84a1e977c0062cdc6e4be972f9cc237a65 Mon Sep 17 00:00:00 2001 From: Aditi Ahuja Date: Thu, 11 Jan 2024 13:07:08 +0530 Subject: [PATCH] move to correct file --- c_api/IndexIVF_c.cpp | 11 ----------- c_api/IndexIVF_c.h | 4 ---- c_api/IndexIVF_c_ex.cpp | 12 ++++++++++++ c_api/IndexIVF_c_ex.h | 4 ++++ 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/c_api/IndexIVF_c.cpp b/c_api/IndexIVF_c.cpp index 8409ef4089..5c54fb6e29 100644 --- a/c_api/IndexIVF_c.cpp +++ b/c_api/IndexIVF_c.cpp @@ -47,17 +47,6 @@ int faiss_SearchParametersIVF_new_with( CATCH_AND_HANDLE } -int faiss_SearchParametersIVF_new_with_sel( - FaissSearchParametersIVF** p_sp, - FaissIDSelector* sel) { - try { - SearchParametersIVF* sp = new SearchParametersIVF; - sp->sel = reinterpret_cast(sel); - *p_sp = reinterpret_cast(sp); - } - CATCH_AND_HANDLE -} - DEFINE_GETTER_PERMISSIVE(SearchParametersIVF, const FaissIDSelector*, sel) DEFINE_GETTER(SearchParametersIVF, size_t, nprobe) diff --git a/c_api/IndexIVF_c.h b/c_api/IndexIVF_c.h index 3d128586da..3ef8a9ad7f 100644 --- a/c_api/IndexIVF_c.h +++ b/c_api/IndexIVF_c.h @@ -31,10 +31,6 @@ int faiss_SearchParametersIVF_new_with( size_t nprobe, size_t max_codes); -int faiss_SearchParametersIVF_new_with_sel( - FaissSearchParametersIVF** p_sp, - FaissIDSelector* sel); - FAISS_DECLARE_GETTER(SearchParametersIVF, const FaissIDSelector*, sel) FAISS_DECLARE_GETTER_SETTER(SearchParametersIVF, size_t, nprobe) FAISS_DECLARE_GETTER_SETTER(SearchParametersIVF, size_t, max_codes) diff --git a/c_api/IndexIVF_c_ex.cpp b/c_api/IndexIVF_c_ex.cpp index 1fbec3aec0..5b72e15c94 100644 --- a/c_api/IndexIVF_c_ex.cpp +++ b/c_api/IndexIVF_c_ex.cpp @@ -12,6 +12,7 @@ #include "macros_impl.h" using faiss::IndexIVF; +using faiss::SearchParametersIVF; int faiss_IndexIVF_set_direct_map(FaissIndexIVF* index, int direct_map_type) { try { @@ -20,3 +21,14 @@ int faiss_IndexIVF_set_direct_map(FaissIndexIVF* index, int direct_map_type) { } CATCH_AND_HANDLE } + +int faiss_SearchParametersIVF_new_with_sel( + FaissSearchParametersIVF** p_sp, + FaissIDSelector* sel) { + try { + SearchParametersIVF* sp = new SearchParametersIVF; + sp->sel = reinterpret_cast(sel); + *p_sp = reinterpret_cast(sp); + } + CATCH_AND_HANDLE +} \ No newline at end of file diff --git a/c_api/IndexIVF_c_ex.h b/c_api/IndexIVF_c_ex.h index 49e7bbfd0c..e82c5c106f 100644 --- a/c_api/IndexIVF_c_ex.h +++ b/c_api/IndexIVF_c_ex.h @@ -23,6 +23,10 @@ int faiss_IndexIVF_set_direct_map( FaissIndexIVF* index, int direct_map_type); +int faiss_SearchParametersIVF_new_with_sel( + FaissSearchParametersIVF** p_sp, + FaissIDSelector* sel); + #ifdef __cplusplus } #endif