提交 92983fcf 编写于 作者: X Xu Peng

fix(wrapper): fix write index


Former-commit-id: 98af046872115568f3b4e7859bf6b6970b0655f6
上级 8d163abd
......@@ -62,6 +62,10 @@ bool Index::search(idx_t n, const float *data, idx_t k, float *distances, long *
return true;
}
void write_index(const Index_ptr &index, const std::string &file_name) {
write_index(index->index_.get(), file_name.c_str());
}
}
}
}
......@@ -23,6 +23,9 @@ namespace zilliz {
namespace vecwise {
namespace engine {
class Index;
using Index_ptr = std::shared_ptr<Index>;
class Index {
typedef long idx_t;
......@@ -61,6 +64,7 @@ public:
// virtual bool index_display();
private:
friend void write_index(const Index_ptr &index, const std::string &file_name);
std::shared_ptr<faiss::Index> index_ = nullptr;
// std::vector<faiss::gpu::GpuResources *> res_;
// std::vector<int> devs_;
......@@ -69,9 +73,8 @@ private:
// faiss::gpu::GpuMultipleClonerOptions *options = new faiss::gpu::GpuMultipleClonerOptions();
};
using Index_ptr = std::shared_ptr<Index>;
extern void write_index(const Index_ptr &index, const std::string &file_name);
void write_index(const Index_ptr &index, const std::string &file_name);
extern Index_ptr read_index(const std::string &file_name);
......@@ -79,4 +82,3 @@ extern Index_ptr read_index(const std::string &file_name);
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册