Skip to content

Commit

Permalink
move to correct file
Browse files Browse the repository at this point in the history
  • Loading branch information
metonymic-smokey committed Jan 11, 2024
1 parent ac3ca14 commit 50990d8
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 15 deletions.
11 changes: 0 additions & 11 deletions c_api/IndexIVF_c.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<faiss::IDSelector*>(sel);
*p_sp = reinterpret_cast<FaissSearchParametersIVF*>(sp);
}
CATCH_AND_HANDLE
}

DEFINE_GETTER_PERMISSIVE(SearchParametersIVF, const FaissIDSelector*, sel)

DEFINE_GETTER(SearchParametersIVF, size_t, nprobe)
Expand Down
4 changes: 0 additions & 4 deletions c_api/IndexIVF_c.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
12 changes: 12 additions & 0 deletions c_api/IndexIVF_c_ex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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<faiss::IDSelector*>(sel);
*p_sp = reinterpret_cast<FaissSearchParametersIVF*>(sp);
}
CATCH_AND_HANDLE
}
4 changes: 4 additions & 0 deletions c_api/IndexIVF_c_ex.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 50990d8

Please sign in to comment.