From 118c8c90d20118a59e98bbd73d4c78b8a0bf78ba Mon Sep 17 00:00:00 2001 From: "xiaojun.lin" Date: Fri, 11 Oct 2019 19:49:48 +0800 Subject: [PATCH] MS-635 coding style check Former-commit-id: 6803034828abc15f882b05cad19425a4b86db10c --- .../knowhere/index/vector_index/IndexIVFSQHybrid.cpp | 9 +-------- cpp/src/core/unittest/test_ivf.cpp | 3 +-- cpp/src/wrapper/VecIndex.cpp | 7 ++++--- cpp/src/wrapper/VecIndex.h | 2 +- 4 files changed, 7 insertions(+), 14 deletions(-) diff --git a/cpp/src/core/knowhere/knowhere/index/vector_index/IndexIVFSQHybrid.cpp b/cpp/src/core/knowhere/knowhere/index/vector_index/IndexIVFSQHybrid.cpp index 5449aec8..5f916f33 100644 --- a/cpp/src/core/knowhere/knowhere/index/vector_index/IndexIVFSQHybrid.cpp +++ b/cpp/src/core/knowhere/knowhere/index/vector_index/IndexIVFSQHybrid.cpp @@ -231,17 +231,14 @@ IVFSQHybrid::LoadQuantizer(const Config& conf) { void IVFSQHybrid::SetQuantizer(const QuantizerPtr& q) { - } void IVFSQHybrid::UnsetQuantizer() { - } void IVFSQHybrid::LoadData(const knowhere::QuantizerPtr& q, const Config& conf) { - } IndexModelPtr @@ -260,11 +257,7 @@ IVFSQHybrid::CopyCpuToGpu(const int64_t& device_id, const Config& config) { } void -IVFSQHybrid::search_impl(int64_t n, - const float* data, - int64_t k, - float* distances, - int64_t* labels, +IVFSQHybrid::search_impl(int64_t n, const float* data, int64_t k, float* distances, int64_t* labels, const Config& cfg) { GPUIVF::search_impl(n, data, k, distances, labels, cfg); } diff --git a/cpp/src/core/unittest/test_ivf.cpp b/cpp/src/core/unittest/test_ivf.cpp index cc4712c2..c6faea91 100644 --- a/cpp/src/core/unittest/test_ivf.cpp +++ b/cpp/src/core/unittest/test_ivf.cpp @@ -160,8 +160,7 @@ INSTANTIATE_TEST_CASE_P(IVFParameters, IVFTest, #ifdef CUSTOMIZATION std::make_tuple("IVFSQHybrid", ParameterType::ivfsq), #endif - std::make_tuple("GPUIVFSQ", ParameterType::ivfsq)) - ); + std::make_tuple("GPUIVFSQ", ParameterType::ivfsq))); void AssertAnns(const knowhere::DatasetPtr& result, const int& nq, const int& k) { diff --git a/cpp/src/wrapper/VecIndex.cpp b/cpp/src/wrapper/VecIndex.cpp index bd0e8724..6bc054bd 100644 --- a/cpp/src/wrapper/VecIndex.cpp +++ b/cpp/src/wrapper/VecIndex.cpp @@ -15,6 +15,8 @@ // specific language governing permissions and limitations // under the License. +#include "wrapper/VecIndex.h" +#include "VecImpl.h" #include "knowhere/common/Exception.h" #include "knowhere/index/vector_index/IndexGPUIVF.h" #include "knowhere/index/vector_index/IndexGPUIVFPQ.h" @@ -26,8 +28,6 @@ #include "knowhere/index/vector_index/IndexIVFSQHybrid.h" #include "knowhere/index/vector_index/IndexKDT.h" #include "knowhere/index/vector_index/IndexNSG.h" -#include "wrapper/VecIndex.h" -#include "VecImpl.h" #include "utils/Log.h" #include @@ -161,7 +161,8 @@ GetVecIndexFactory(const IndexType& type, const Config& cfg) { VecIndexPtr LoadVecIndex(const IndexType& index_type, const knowhere::BinarySet& index_binary) { auto index = GetVecIndexFactory(index_type); - if (index == nullptr) return nullptr; + if (index == nullptr) + return nullptr; // else index->Load(index_binary); return index; diff --git a/cpp/src/wrapper/VecIndex.h b/cpp/src/wrapper/VecIndex.h index 2284c442..34d3d2f7 100644 --- a/cpp/src/wrapper/VecIndex.h +++ b/cpp/src/wrapper/VecIndex.h @@ -20,10 +20,10 @@ #include #include +#include "cache/DataObj.h" #include "knowhere/common/BinarySet.h" #include "knowhere/common/Config.h" #include "knowhere/index/vector_index/Quantizer.h" -#include "cache/DataObj.h" #include "utils/Status.h" namespace milvus { -- GitLab