2021-03-17 11:35:28 +08:00
|
|
|
// Copyright (C) 2019-2020 Zilliz. All rights reserved.
|
|
|
|
//
|
|
|
|
// Licensed 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
|
|
|
|
//
|
|
|
|
// 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>
|
2023-08-13 20:53:30 +08:00
|
|
|
#include <exception>
|
2021-10-13 10:58:33 +08:00
|
|
|
|
2023-08-13 20:53:30 +08:00
|
|
|
#include "config/ConfigKnowhere.h"
|
|
|
|
#include "gtest/gtest-death-test.h"
|
2021-04-16 14:02:49 +08:00
|
|
|
#include "segcore/segcore_init_c.h"
|
2021-10-13 10:58:33 +08:00
|
|
|
#include "test_utils/DataGen.h"
|
2021-03-17 11:35:28 +08:00
|
|
|
|
|
|
|
TEST(Init, Naive) {
|
|
|
|
using namespace milvus;
|
|
|
|
using namespace milvus::segcore;
|
2022-05-03 08:39:49 +08:00
|
|
|
SegcoreInit(nullptr);
|
2021-09-15 15:15:52 +08:00
|
|
|
SegcoreSetChunkRows(32768);
|
2022-12-29 15:29:31 +08:00
|
|
|
auto simd_type = SegcoreSetSimdType("auto");
|
|
|
|
free(simd_type);
|
2021-09-15 12:57:48 +08:00
|
|
|
}
|
2023-08-13 20:53:30 +08:00
|
|
|
|
|
|
|
TEST(Init, KnowhereThreadPoolInit) {
|
|
|
|
#ifdef BUILD_DISK_ANN
|
|
|
|
try {
|
2023-08-18 14:00:19 +08:00
|
|
|
milvus::config::KnowhereInitSearchThreadPool(0);
|
2023-08-13 20:53:30 +08:00
|
|
|
} catch (std::exception& e) {
|
|
|
|
ASSERT_TRUE(std::string(e.what()).find(
|
|
|
|
"Failed to set aio context pool") != std::string::npos);
|
|
|
|
}
|
|
|
|
#endif
|
2023-08-18 14:00:19 +08:00
|
|
|
milvus::config::KnowhereInitSearchThreadPool(8);
|
2023-08-13 20:53:30 +08:00
|
|
|
}
|