Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions faiss/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,22 +71,22 @@ set(FAISS_SRC
# impl/LocalSearchQuantizer.cpp
# impl/ProductAdditiveQuantizer.cpp
# impl/ScalarQuantizer.cpp
# impl/index_read.cpp
# impl/index_write.cpp
# impl/io.cpp
impl/index_read.cpp
impl/index_write.cpp
impl/io.cpp
# impl/kmeans1d.cpp
# impl/lattice_Zn.cpp
# impl/mapped_io.cpp
impl/mapped_io.cpp
# impl/pq4_fast_scan.cpp
# impl/pq4_fast_scan_search_1.cpp
# impl/pq4_fast_scan_search_qbs.cpp
# impl/residual_quantizer_encode_steps.cpp
# impl/zerocopy_io.cpp
impl/zerocopy_io.cpp
# impl/NNDescent.cpp
# invlists/BlockInvertedLists.cpp
# invlists/DirectMap.cpp
# invlists/InvertedLists.cpp
# invlists/InvertedListsIOHook.cpp
invlists/InvertedLists.cpp
invlists/InvertedListsIOHook.cpp
# utils/Heap.cpp
# utils/NeuralNet.cpp
# utils/WorkerThread.cpp
Expand Down
15 changes: 11 additions & 4 deletions faiss/impl/index_read.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ bool read_vector_base(
return false;
}

/*
// a replacement for READANDCHECK for reading data into std::vector
template <typename VectorT>
void read_vector_with_known_size(VectorT& target, IOReader* f, size_t size) {
Expand All @@ -167,6 +168,7 @@ void read_vector_with_known_size(VectorT& target, IOReader* f, size_t size) {
// the default case
READANDCHECK(target.data(), size);
}
*/

// a replacement for READVECTOR
template <typename VectorT>
Expand All @@ -180,6 +182,7 @@ void read_vector(VectorT& target, IOReader* f) {
READVECTOR(target);
}

/*
// a replacement for READXBVECTOR
template <typename VectorT>
void read_xb_vector(VectorT& target, IOReader* f) {
Expand All @@ -191,11 +194,12 @@ void read_xb_vector(VectorT& target, IOReader* f) {
// the default case
READXBVECTOR(target);
}
*/

/*************************************************************
* Read
**************************************************************/

/*
void read_index_header(Index* idx, IOReader* f) {
READ1(idx->d);
READ1(idx->ntotal);
Expand Down Expand Up @@ -497,8 +501,9 @@ void read_ScalarQuantizer(ScalarQuantizer* ivsc, IOReader* f) {
READVECTOR(ivsc->trained);
ivsc->set_derived_sizes();
}
*/

static void read_HNSW(HNSW* hnsw, IOReader* f) {
void read_HNSW(HNSW* hnsw, IOReader* f) {
READVECTOR(hnsw->assign_probas);
READVECTOR(hnsw->cum_nneighbor_per_level);
READVECTOR(hnsw->levels);
Expand All @@ -515,6 +520,7 @@ static void read_HNSW(HNSW* hnsw, IOReader* f) {
READ1_DUMMY(int)
}

/*
static void read_NSG(NSG* nsg, IOReader* f) {
READ1(nsg->ntotal);
READ1(nsg->R);
Expand Down Expand Up @@ -1329,11 +1335,12 @@ VectorTransform* read_VectorTransform(const char* fname) {
VectorTransform* vt = read_VectorTransform(&reader);
return vt;
}
*/

/*************************************************************
* Read binary indexes
**************************************************************/

/*
static void read_InvertedLists(IndexBinaryIVF* ivf, IOReader* f, int io_flags) {
InvertedLists* ils = read_InvertedLists(f, io_flags);
FAISS_THROW_IF_NOT(
Expand Down Expand Up @@ -1525,5 +1532,5 @@ IndexBinary* read_index_binary(const char* fname, int io_flags) {
return idx;
}
}

*/
} // namespace faiss
8 changes: 7 additions & 1 deletion faiss/impl/index_write.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ namespace faiss {
/*************************************************************
* Write
**************************************************************/
/*
static void write_index_header(const Index* idx, IOWriter* f) {
WRITE1(idx->d);
WRITE1(idx->ntotal);
Expand Down Expand Up @@ -300,8 +301,9 @@ void write_ProductQuantizer(const ProductQuantizer* pq, const char* fname) {
FileIOWriter writer(fname);
write_ProductQuantizer(pq, &writer);
}
*/

static void write_HNSW(const HNSW* hnsw, IOWriter* f) {
void write_HNSW(const HNSW* hnsw, IOWriter* f) {
WRITEVECTOR(hnsw->assign_probas);
WRITEVECTOR(hnsw->cum_nneighbor_per_level);
WRITEVECTOR(hnsw->levels);
Expand All @@ -319,6 +321,7 @@ static void write_HNSW(const HNSW* hnsw, IOWriter* f) {
WRITE1(tmp_upper_beam);
}

/*
static void write_NSG(const NSG* nsg, IOWriter* f) {
WRITE1(nsg->ntotal);
WRITE1(nsg->R);
Expand Down Expand Up @@ -934,11 +937,13 @@ void write_VectorTransform(const VectorTransform* vt, const char* fname) {
FileIOWriter writer(fname);
write_VectorTransform(vt, &writer);
}
*/

/*************************************************************
* Write binary indexes
**************************************************************/

/*
static void write_index_binary_header(const IndexBinary* idx, IOWriter* f) {
WRITE1(idx->d);
WRITE1(idx->code_size);
Expand Down Expand Up @@ -1104,5 +1109,6 @@ void write_index_binary(const IndexBinary* idx, const char* fname) {
FileIOWriter writer(fname);
write_index_binary(idx, &writer);
}
*/

} // namespace faiss