diff --git a/core/src/db/engine/ExecutionEngineImpl.cpp b/core/src/db/engine/ExecutionEngineImpl.cpp index 9c411deba15045561af4592e19db7fad1b4b7a3c..aeb17203ef1543f940351809557a73d85cfbbc57 100644 --- a/core/src/db/engine/ExecutionEngineImpl.cpp +++ b/core/src/db/engine/ExecutionEngineImpl.cpp @@ -18,13 +18,13 @@ #include "db/engine/ExecutionEngineImpl.h" #include "cache/CpuCacheMgr.h" #include "cache/GpuCacheMgr.h" +#include "knowhere/common/Config.h" #include "metrics/Metrics.h" +#include "scheduler/Utils.h" +#include "server/Config.h" #include "utils/CommonUtil.h" #include "utils/Exception.h" #include "utils/Log.h" -#include "knowhere/common/Config.h" -#include "scheduler/Utils.h" -#include "server/Config.h" #include "wrapper/ConfAdapter.h" #include "wrapper/ConfAdapterMgr.h" #include "wrapper/VecImpl.h" diff --git a/core/src/index/knowhere/knowhere/index/vector_index/IndexGPUIVF.cpp b/core/src/index/knowhere/knowhere/index/vector_index/IndexGPUIVF.cpp index 65938e1630c3984bd8172d2c81e0a7410511eb02..a26f94718161cd1b2041625272708a59d4c58b15 100644 --- a/core/src/index/knowhere/knowhere/index/vector_index/IndexGPUIVF.cpp +++ b/core/src/index/knowhere/knowhere/index/vector_index/IndexGPUIVF.cpp @@ -17,10 +17,10 @@ #include +#include #include #include #include -#include #include "knowhere/adapter/VectorAdapter.h" #include "knowhere/common/Exception.h" @@ -133,7 +133,7 @@ GPUIVF::search_impl(int64_t n, const float* data, int64_t k, float* distances, i if (auto device_index = std::dynamic_pointer_cast(index_)) { auto search_cfg = std::dynamic_pointer_cast(cfg); device_index->nprobe = search_cfg->nprobe; -// assert(device_index->getNumProbes() == search_cfg->nprobe); + // assert(device_index->getNumProbes() == search_cfg->nprobe); { ResScope rs(res_, gpu_id_); diff --git a/core/src/index/knowhere/knowhere/index/vector_index/IndexGPUIVFPQ.cpp b/core/src/index/knowhere/knowhere/index/vector_index/IndexGPUIVFPQ.cpp index 9ba8dd04564b848476a5d012a46f3c6cd46ab9ab..b027539c37dd485a1af9f7841ba5092618b828ea 100644 --- a/core/src/index/knowhere/knowhere/index/vector_index/IndexGPUIVFPQ.cpp +++ b/core/src/index/knowhere/knowhere/index/vector_index/IndexGPUIVFPQ.cpp @@ -16,9 +16,9 @@ // under the License. #include +#include #include #include -#include #include diff --git a/core/src/index/knowhere/knowhere/index/vector_index/IndexGPUIVFSQ.cpp b/core/src/index/knowhere/knowhere/index/vector_index/IndexGPUIVFSQ.cpp index fff27cd7db226d145ba9a22e9a38e8f41d0fdc39..941f9adc48cd55c2b4cc778c27eb7d314a869b3a 100644 --- a/core/src/index/knowhere/knowhere/index/vector_index/IndexGPUIVFSQ.cpp +++ b/core/src/index/knowhere/knowhere/index/vector_index/IndexGPUIVFSQ.cpp @@ -15,8 +15,8 @@ // specific language governing permissions and limitations // under the License. -#include #include +#include #include diff --git a/core/src/index/knowhere/knowhere/index/vector_index/IndexIDMAP.cpp b/core/src/index/knowhere/knowhere/index/vector_index/IndexIDMAP.cpp index 643bb16076fef2cb501e70b8e07d8754f48625ec..f926951736c24467d203a32aad18dfcfb631d254 100644 --- a/core/src/index/knowhere/knowhere/index/vector_index/IndexIDMAP.cpp +++ b/core/src/index/knowhere/knowhere/index/vector_index/IndexIDMAP.cpp @@ -17,9 +17,9 @@ #include #include -#include -#include #include +#include +#include #include diff --git a/core/src/index/knowhere/knowhere/index/vector_index/IndexIVF.cpp b/core/src/index/knowhere/knowhere/index/vector_index/IndexIVF.cpp index 02708ff5d7b338fb8997b1acec35edc4c64e9d59..73f5c4164b3ffd569a218e38975a1b36d210dcc0 100644 --- a/core/src/index/knowhere/knowhere/index/vector_index/IndexIVF.cpp +++ b/core/src/index/knowhere/knowhere/index/vector_index/IndexIVF.cpp @@ -15,11 +15,11 @@ // specific language governing permissions and limitations // under the License. -#include #include #include #include #include +#include #include #include #include diff --git a/core/src/index/knowhere/knowhere/index/vector_index/IndexIVFSQ.cpp b/core/src/index/knowhere/knowhere/index/vector_index/IndexIVFSQ.cpp index 80b4c788832e280555df7dda2b9de93d8fa9ceca..6e9a1d94dafbd025c542fe69383803cd8bf7ddee 100644 --- a/core/src/index/knowhere/knowhere/index/vector_index/IndexIVFSQ.cpp +++ b/core/src/index/knowhere/knowhere/index/vector_index/IndexIVFSQ.cpp @@ -15,8 +15,8 @@ // specific language governing permissions and limitations // under the License. -#include #include +#include #include #include "knowhere/adapter/VectorAdapter.h" diff --git a/core/src/index/knowhere/knowhere/index/vector_index/IndexIVFSQHybrid.cpp b/core/src/index/knowhere/knowhere/index/vector_index/IndexIVFSQHybrid.cpp index af67722266b6649ec3b8551bd51ca8233b856b1c..7b229db21eca23088229612d8a35a1197218afde 100644 --- a/core/src/index/knowhere/knowhere/index/vector_index/IndexIVFSQHybrid.cpp +++ b/core/src/index/knowhere/knowhere/index/vector_index/IndexIVFSQHybrid.cpp @@ -22,19 +22,19 @@ #include +#include #include #include -#include namespace knowhere { #ifdef CUSTOMIZATION -//std::mutex g_mutex; +// std::mutex g_mutex; IndexModelPtr IVFSQHybrid::Train(const DatasetPtr& dataset, const Config& config) { -// std::lock_guard lk(g_mutex); + // std::lock_guard lk(g_mutex); auto build_cfg = std::dynamic_pointer_cast(config); if (build_cfg != nullptr) { @@ -74,12 +74,12 @@ IVFSQHybrid::CopyGpuToCpu(const Config& config) { } std::lock_guard lk(mutex_); - faiss::Index* device_index = index_.get(); - faiss::Index* host_index = faiss::gpu::index_gpu_to_cpu(device_index); + faiss::Index* device_index = index_.get(); + faiss::Index* host_index = faiss::gpu::index_gpu_to_cpu(device_index); - std::shared_ptr new_index; - new_index.reset(host_index); - return std::make_shared(new_index); + std::shared_ptr new_index; + new_index.reset(host_index); + return std::make_shared(new_index); } VectorIndexPtr @@ -119,14 +119,14 @@ IVFSQHybrid::LoadImpl(const BinarySet& index_binary) { void IVFSQHybrid::search_impl(int64_t n, const float* data, int64_t k, float* distances, int64_t* labels, const Config& cfg) { -// std::lock_guard lk(g_mutex); -// static int64_t search_count; -// ++search_count; + // std::lock_guard lk(g_mutex); + // static int64_t search_count; + // ++search_count; if (gpu_mode == 2) { GPUIVF::search_impl(n, data, k, distances, labels, cfg); -// index_->search(n, (float*)data, k, distances, labels); - } else if (gpu_mode == 1) { // hybrid + // index_->search(n, (float*)data, k, distances, labels); + } else if (gpu_mode == 1) { // hybrid if (auto res = FaissGpuResourceMgr::GetInstance().GetRes(quantizer_gpu_id_)) { ResScope rs(res, quantizer_gpu_id_, true); IVF::search_impl(n, data, k, distances, labels, cfg); @@ -140,7 +140,7 @@ IVFSQHybrid::search_impl(int64_t n, const float* data, int64_t k, float* distanc QuantizerPtr IVFSQHybrid::LoadQuantizer(const Config& conf) { -// std::lock_guard lk(g_mutex); + // std::lock_guard lk(g_mutex); auto quantizer_conf = std::dynamic_pointer_cast(conf); if (quantizer_conf != nullptr) { @@ -179,7 +179,7 @@ IVFSQHybrid::LoadQuantizer(const Config& conf) { void IVFSQHybrid::SetQuantizer(const QuantizerPtr& q) { -// std::lock_guard lk(g_mutex); + // std::lock_guard lk(g_mutex); auto ivf_quantizer = std::dynamic_pointer_cast(q); if (ivf_quantizer == nullptr) { @@ -199,7 +199,7 @@ IVFSQHybrid::SetQuantizer(const QuantizerPtr& q) { void IVFSQHybrid::UnsetQuantizer() { -// std::lock_guard lk(g_mutex); + // std::lock_guard lk(g_mutex); auto* ivf_index = dynamic_cast(index_.get()); if (ivf_index == nullptr) { @@ -212,7 +212,7 @@ IVFSQHybrid::UnsetQuantizer() { VectorIndexPtr IVFSQHybrid::LoadData(const knowhere::QuantizerPtr& q, const Config& conf) { -// std::lock_guard lk(g_mutex); + // std::lock_guard lk(g_mutex); auto quantizer_conf = std::dynamic_pointer_cast(conf); if (quantizer_conf != nullptr) { @@ -251,7 +251,7 @@ IVFSQHybrid::LoadData(const knowhere::QuantizerPtr& q, const Config& conf) { std::pair IVFSQHybrid::CopyCpuToGpuWithQuantizer(const int64_t& device_id, const Config& config) { -// std::lock_guard lk(g_mutex); + // std::lock_guard lk(g_mutex); if (auto res = FaissGpuResourceMgr::GetInstance().GetRes(device_id)) { ResScope rs(res, device_id, false); diff --git a/core/src/index/knowhere/knowhere/index/vector_index/IndexIVFSQHybrid.h b/core/src/index/knowhere/knowhere/index/vector_index/IndexIVFSQHybrid.h index 87cc22931f0c4b5c5d46694a202648f8c494097d..d2a3be6c3996770d79bce2e470345305fe5e6768 100644 --- a/core/src/index/knowhere/knowhere/index/vector_index/IndexIVFSQHybrid.h +++ b/core/src/index/knowhere/knowhere/index/vector_index/IndexIVFSQHybrid.h @@ -17,8 +17,8 @@ #pragma once -#include #include +#include #include #include diff --git a/core/src/index/unittest/test_customized_index.cpp b/core/src/index/unittest/test_customized_index.cpp index f9b48b8b671a591b372d51fc550c79a659482622..346e8e3d933ae95da9ce27a47004e618d0bca79b 100644 --- a/core/src/index/unittest/test_customized_index.cpp +++ b/core/src/index/unittest/test_customized_index.cpp @@ -125,7 +125,7 @@ TEST_F(SingleIndexTest, IVFSQHybrid) { } } -//TEST_F(SingleIndexTest, thread_safe) { +// TEST_F(SingleIndexTest, thread_safe) { // assert(!xb.empty()); // // index_type = "IVFSQHybrid"; @@ -234,5 +234,4 @@ TEST_F(SingleIndexTest, IVFSQHybrid) { // //} - #endif diff --git a/core/src/index/unittest/test_ivf.cpp b/core/src/index/unittest/test_ivf.cpp index 3fd3e16d0eefe5ee08a585b12ca67bd3ec0f831c..20addc82bbd391b320a343b5ad3db2b9c5596096 100644 --- a/core/src/index/unittest/test_ivf.cpp +++ b/core/src/index/unittest/test_ivf.cpp @@ -44,9 +44,9 @@ class IVFTest : public DataGen, public TestWithParam<::std::tupleType() != TaskType::SearchTask) { return false; } @@ -67,7 +67,7 @@ namespace scheduler { task->label() = label; return true; - } +} } // namespace scheduler } // namespace milvus