xj.lin f7287d74ea MS-154
1. Add Submodule knowhere and specify branch
2. Integrate Knowhere, update many cmakelist
3. dev knowhere-wrapper
4. dev knowhere-wrapper unittest


Former-commit-id: 783a85562b2b5db3b89920b0c68de133a577f245
2019-07-04 16:15:30 +08:00

39 lines
1.3 KiB
C++

////////////////////////////////////////////////////////////////////////////////
// Copyright 上海赜睿信息科技有限公司(Zilliz) - All Rights Reserved
// Unauthorized copying of this file, via any medium is strictly prohibited.
// Proprietary and confidential.
////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "knowhere/index/vector_index/vector_index.h"
#include "vec_index.h"
namespace zilliz {
namespace vecwise {
namespace engine {
class VecIndexImpl : public VecIndex {
public:
explicit VecIndexImpl(std::shared_ptr<zilliz::knowhere::VectorIndex> index) : index_(std::move(index)) {};
void BuildAll(const long &nb,
const float *xb,
const long *ids,
const Config &cfg,
const long &nt,
const float *xt) override;
void Add(const long &nb, const float *xb, const long *ids, const Config &cfg) override;
zilliz::knowhere::BinarySet Serialize() override;
void Load(const zilliz::knowhere::BinarySet &index_binary) override;
void Search(const long &nq, const float *xq, float *dist, long *ids, const Config &cfg) override;
private:
std::shared_ptr<zilliz::knowhere::VectorIndex> index_ = nullptr;
};
}
}
}