提交 4b5044da 编写于 作者: X Xu Peng 提交者: xj.lin

fix(wrapper): fix write index


Former-commit-id: 3e96e1039dc77d768695e1a1f5bcdb72bc4866d3
上级 c224e5bc
......@@ -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.
先完成此消息的编辑!
想要评论请 注册