From 0b91fc5904008dea4fb571feca8143b1dfd95a77 Mon Sep 17 00:00:00 2001 From: fuhongben Date: Thu, 12 Dec 2024 12:20:46 +0000 Subject: [PATCH 1/2] update mxIndex/TestAscendIndexIVFSP.cpp. Signed-off-by: fuhongben --- mxIndex/TestAscendIndexIVFSP.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/mxIndex/TestAscendIndexIVFSP.cpp b/mxIndex/TestAscendIndexIVFSP.cpp index f86ced1ea..3f195de0c 100644 --- a/mxIndex/TestAscendIndexIVFSP.cpp +++ b/mxIndex/TestAscendIndexIVFSP.cpp @@ -464,10 +464,16 @@ void MultiSearchAndMultiSearchFilter() std::vector indexes; for (int i = 0; i < INDEX_NUM; ++i) { - auto index = new faiss::ascend::AscendIndexIVFSP(dim, nonzeroNum, nlist, - codeBookPath.c_str(), - faiss::ScalarQuantizer::QuantizerType::QT_8bit, - faiss::MetricType::METRIC_L2, conf); + faiss::ascend::AscendIndexIVFSP* index; + if (i == 0) { + index = new faiss::ascend::AscendIndexIVFSP(dim, nonzeroNum, nlist, + codeBookPath.c_str(), faiss::ScalarQuantizer::QuantizerType::QT_8bit, + faiss::MetricType::METRIC_L2, conf); + } else { + index = new faiss::ascend::AscendIndexIVFSP(dim, nonzeroNum, nlist, + *(faiss::ascend::AscendIndexIVFSP*)indexes[0], faiss::ScalarQuantizer::QuantizerType::QT_8bit, + faiss::MetricType::METRIC_L2, conf); + } index->setVerbose(true); indexes.emplace_back(index); printf("create index:%d\n", i); -- Gitee From 76f32e2ca92280521381a3de2447c0bf632bd035 Mon Sep 17 00:00:00 2001 From: fuhongben Date: Fri, 13 Dec 2024 01:27:02 +0000 Subject: [PATCH 2/2] update mxIndex/TestAscendIndexIVFSP.cpp. Signed-off-by: fuhongben --- mxIndex/TestAscendIndexIVFSP.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/mxIndex/TestAscendIndexIVFSP.cpp b/mxIndex/TestAscendIndexIVFSP.cpp index 3f195de0c..2d9602645 100644 --- a/mxIndex/TestAscendIndexIVFSP.cpp +++ b/mxIndex/TestAscendIndexIVFSP.cpp @@ -474,6 +474,7 @@ void MultiSearchAndMultiSearchFilter() *(faiss::ascend::AscendIndexIVFSP*)indexes[0], faiss::ScalarQuantizer::QuantizerType::QT_8bit, faiss::MetricType::METRIC_L2, conf); } + index->setVerbose(true); indexes.emplace_back(index); printf("create index:%d\n", i); -- Gitee