提交 0741b76b 编写于 作者: J jinhai

Merge branch 'branch-0.5.0-yk' into '0.5.0'

add wrapper unittest

See merge request megasearch/milvus!760

Former-commit-id: 4843f757bb00a32cd717e4272865b67c8f1eaa4b
...@@ -34,9 +34,9 @@ namespace scheduler { ...@@ -34,9 +34,9 @@ namespace scheduler {
class Pass { class Pass {
public: public:
virtual void // virtual void
Init() { // Init() {
} // }
virtual bool virtual bool
Run(const TaskPtr& task) = 0; Run(const TaskPtr& task) = 0;
......
...@@ -164,3 +164,14 @@ TEST_P(KnowhereWrapperTest, SERIALIZE_TEST) { ...@@ -164,3 +164,14 @@ TEST_P(KnowhereWrapperTest, SERIALIZE_TEST) {
AssertResult(res_ids, res_dis); AssertResult(res_ids, res_dis);
} }
} }
#include "wrapper/ConfAdapter.h"
TEST(whatever, test_config) {
milvus::engine::TempMetaConf conf;
auto nsg_conf = std::make_shared<milvus::engine::NSGConfAdapter>();
nsg_conf->Match(conf);
nsg_conf->MatchSearch(conf, milvus::engine::IndexType::FAISS_IVFPQ_GPU);
auto pq_conf = std::make_shared<milvus::engine::IVFPQConfAdapter>();
pq_conf->Match(conf);
}
...@@ -104,28 +104,28 @@ class ParamGenerator { ...@@ -104,28 +104,28 @@ class ParamGenerator {
tempconf->metric_type = knowhere::METRICTYPE::L2; tempconf->metric_type = knowhere::METRICTYPE::L2;
return tempconf; return tempconf;
} }
case milvus::engine::IndexType::FAISS_IVFPQ_CPU: // case milvus::engine::IndexType::FAISS_IVFPQ_CPU:
case milvus::engine::IndexType::FAISS_IVFPQ_GPU: { // case milvus::engine::IndexType::FAISS_IVFPQ_GPU: {
auto tempconf = std::make_shared<knowhere::IVFPQCfg>(); // auto tempconf = std::make_shared<knowhere::IVFPQCfg>();
tempconf->nlist = 100; // tempconf->nlist = 100;
tempconf->nprobe = 16; // tempconf->nprobe = 16;
tempconf->nbits = 8; // tempconf->nbits = 8;
tempconf->m = 8; // tempconf->m = 8;
tempconf->metric_type = knowhere::METRICTYPE::L2; // tempconf->metric_type = knowhere::METRICTYPE::L2;
return tempconf; // return tempconf;
} // }
case milvus::engine::IndexType::NSG_MIX: { // case milvus::engine::IndexType::NSG_MIX: {
auto tempconf = std::make_shared<knowhere::NSGCfg>(); // auto tempconf = std::make_shared<knowhere::NSGCfg>();
tempconf->nlist = 100; // tempconf->nlist = 100;
tempconf->nprobe = 16; // tempconf->nprobe = 16;
tempconf->search_length = 8; // tempconf->search_length = 8;
tempconf->knng = 200; // tempconf->knng = 200;
tempconf->search_length = 40; // TODO(linxj): be 20 when search // tempconf->search_length = 40; // TODO(linxj): be 20 when search
tempconf->out_degree = 60; // tempconf->out_degree = 60;
tempconf->candidate_pool_size = 200; // tempconf->candidate_pool_size = 200;
tempconf->metric_type = knowhere::METRICTYPE::L2; // tempconf->metric_type = knowhere::METRICTYPE::L2;
return tempconf; // return tempconf;
} // }
} }
} }
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册