MS-648 add ut v3

Former-commit-id: f9127c08e1bf0d2244fbed8113a003e52d781df4
This commit is contained in:
xiaojun.lin 2019-10-17 16:31:02 +08:00
parent 157d221120
commit c19a6ee483
5 changed files with 19 additions and 12 deletions

View File

@ -16,6 +16,7 @@
// under the License.
#include <memory>
#include <string>
#include "knowhere/index/vector_index/IndexGPUIVF.h"
#include "knowhere/index/vector_index/IndexGPUIVFPQ.h"
@ -116,4 +117,4 @@ class TestGpuIndexBase : public ::testing::Test {
TearDown() override {
knowhere::FaissGpuResourceMgr::GetInstance().Free();
}
};
};

View File

@ -1,6 +1,20 @@
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// Created by link on 2019/10/17.
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
#include <gtest/gtest.h>
#include "unittest/Helper.h"

View File

@ -28,7 +28,7 @@ using ::testing::Values;
using ::testing::Combine;
class KnowhereHybrid
: public DataGenBase, public ::testing::Test {
: public DataGenBase, public ::testing::Test {
protected:
void SetUp() override {
knowhere::FaissGpuResourceMgr::GetInstance().InitDevice(DEVICEID, PINMEM, TEMPMEM, RESNUM);
@ -38,7 +38,6 @@ class KnowhereHybrid
nq = 100;
k = 100;
GenData(dim, nb, nq, xb, xq, ids, k, gt_ids, gt_dis);
}
void TearDown() override {
@ -130,4 +129,5 @@ TEST_F(KnowhereHybrid, test_interface) {
}
}
}
#endif

View File

@ -86,5 +86,4 @@ DataGenBase::AssertResult(const std::vector<int64_t>& ids, const std::vector<flo
<< ", match: " << match
<< ", total: " << nq * k
<< std::endl;
}

View File

@ -70,13 +70,6 @@ class DataGenBase {
std::vector<float> gt_dis;
};
namespace {
namespace ms = milvus::engine;
namespace kw = knowhere;
} // namespace
class ParamGenerator {
public:
static ParamGenerator& GetInstance() {