From 05dda4ab7384317637324bfd60f46ec4a62af52b Mon Sep 17 00:00:00 2001 From: youny626 Date: Tue, 5 Nov 2019 13:42:12 +0800 Subject: [PATCH] clang format --- core/src/config.h | 19 ++++++++++++++++++- .../index/vector_index/IndexGPUIDMAP.cpp | 2 +- .../index/vector_index/IndexGPUIDMAP.h | 2 +- .../index/vector_index/IndexIVFSQ.cpp | 1 - core/src/scheduler/ResourceMgr.cpp | 4 +--- core/src/scheduler/Scheduler.cpp | 4 +--- core/src/scheduler/resource/Resource.cpp | 4 +--- core/src/wrapper/VecIndex.cpp | 12 +++--------- core/src/wrapper/gpu/GPUVecImpl.cpp | 2 +- 9 files changed, 27 insertions(+), 23 deletions(-) diff --git a/core/src/config.h b/core/src/config.h index 5f604f53..c0e5235d 100644 --- a/core/src/config.h +++ b/core/src/config.h @@ -1,3 +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 +// +// 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. + #define MILVUS_VERSION "0.5.0" #define BUILD_TYPE "Debug" -#define BUILD_TIME "2019-11-05 13:20.31" +#define BUILD_TIME "2019-11-05 13:39.33" diff --git a/core/src/index/knowhere/knowhere/index/vector_index/IndexGPUIDMAP.cpp b/core/src/index/knowhere/knowhere/index/vector_index/IndexGPUIDMAP.cpp index a13d1ad5..1aded3dd 100644 --- a/core/src/index/knowhere/knowhere/index/vector_index/IndexGPUIDMAP.cpp +++ b/core/src/index/knowhere/knowhere/index/vector_index/IndexGPUIDMAP.cpp @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. -#include "IndexGPUIDMAP.h" +#include "knowhere/index/vector_index/IndexGPUIDMAP.h" #include #include diff --git a/core/src/index/knowhere/knowhere/index/vector_index/IndexGPUIDMAP.h b/core/src/index/knowhere/knowhere/index/vector_index/IndexGPUIDMAP.h index 002e5d5e..f1dfe2f2 100644 --- a/core/src/index/knowhere/knowhere/index/vector_index/IndexGPUIDMAP.h +++ b/core/src/index/knowhere/knowhere/index/vector_index/IndexGPUIDMAP.h @@ -60,4 +60,4 @@ class GPUIDMAP : public IDMAP, public GPUIndex { using GPUIDMAPPtr = std::shared_ptr; -} // namespace knowhere \ No newline at end of file +} // namespace knowhere 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 dcdac010..7c86cd4d 100644 --- a/core/src/index/knowhere/knowhere/index/vector_index/IndexIVFSQ.cpp +++ b/core/src/index/knowhere/knowhere/index/vector_index/IndexIVFSQ.cpp @@ -31,7 +31,6 @@ #include "knowhere/index/vector_index/IndexGPUIVFSQ.h" #include "knowhere/index/vector_index/helpers/FaissGpuResourceMgr.h" #endif -#include "knowhere/index/vector_index/IndexIVFSQ.h" namespace knowhere { diff --git a/core/src/scheduler/ResourceMgr.cpp b/core/src/scheduler/ResourceMgr.cpp index 06a5628f..187cd97b 100644 --- a/core/src/scheduler/ResourceMgr.cpp +++ b/core/src/scheduler/ResourceMgr.cpp @@ -79,9 +79,7 @@ ResourceMgr::Add(ResourcePtr&& resource) { gpu_resources_.emplace_back(ResourceWPtr(resource)); break; } - default: { - break; - } + default: { break; } } resources_.emplace_back(resource); diff --git a/core/src/scheduler/Scheduler.cpp b/core/src/scheduler/Scheduler.cpp index 24acdd59..8d2d4406 100644 --- a/core/src/scheduler/Scheduler.cpp +++ b/core/src/scheduler/Scheduler.cpp @@ -123,9 +123,7 @@ Scheduler::OnLoadCompleted(const EventPtr& event) { Action::PushTaskToAllNeighbour(load_completed_event->task_table_item_, resource); break; } - default: { - break; - } + default: { break; } } resource->WakeupLoader(); } diff --git a/core/src/scheduler/resource/Resource.cpp b/core/src/scheduler/resource/Resource.cpp index c5a93d41..8cf03275 100644 --- a/core/src/scheduler/resource/Resource.cpp +++ b/core/src/scheduler/resource/Resource.cpp @@ -44,9 +44,7 @@ ToString(ResourceType type) { case ResourceType::GPU: { return "GPU"; } - default: { - return "UNKNOWN"; - } + default: { return "UNKNOWN"; } } } diff --git a/core/src/wrapper/VecIndex.cpp b/core/src/wrapper/VecIndex.cpp index 41a7d559..2323783c 100644 --- a/core/src/wrapper/VecIndex.cpp +++ b/core/src/wrapper/VecIndex.cpp @@ -168,9 +168,7 @@ GetVecIndexFactory(const IndexType& type, const Config& cfg) { index = std::make_shared(gpu_device); break; } - default: { - return nullptr; - } + default: { return nullptr; } } return std::make_shared(index, type); } @@ -278,9 +276,7 @@ ConvertToCpuIndexType(const IndexType& type) { case IndexType::FAISS_IVFSQ8_MIX: { return IndexType::FAISS_IVFSQ8_CPU; } - default: { - return type; - } + default: { return type; } } } @@ -295,9 +291,7 @@ ConvertToGpuIndexType(const IndexType& type) { case IndexType::FAISS_IVFSQ8_CPU: { return IndexType::FAISS_IVFSQ8_GPU; } - default: { - return type; - } + default: { return type; } } } diff --git a/core/src/wrapper/gpu/GPUVecImpl.cpp b/core/src/wrapper/gpu/GPUVecImpl.cpp index fc87b15e..e40f5038 100644 --- a/core/src/wrapper/gpu/GPUVecImpl.cpp +++ b/core/src/wrapper/gpu/GPUVecImpl.cpp @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. -#include "GPUVecImpl.h" +#include "wrapper/gpu/GPUVecImpl.h" #include "knowhere/common/Exception.h" #include "knowhere/index/vector_index/IndexGPUIDMAP.h" #include "knowhere/index/vector_index/IndexGPUIVF.h" -- GitLab