mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-07 11:21:52 +08:00
clang tidy and clang format
Former-commit-id: 2bee4aa19cf50687308cf94dc4a7c9a735386789
This commit is contained in:
parent
f9f336efc3
commit
762fc164cc
2
cpp/src/cache/DataObj.h
vendored
2
cpp/src/cache/DataObj.h
vendored
@ -17,7 +17,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace milvus {
|
||||
@ -27,7 +26,6 @@ class DataObj {
|
||||
public:
|
||||
virtual int64_t
|
||||
Size() = 0;
|
||||
|
||||
};
|
||||
|
||||
using DataObjPtr = std::shared_ptr<DataObj>;
|
||||
|
||||
@ -93,56 +93,56 @@ ExecutionEngineImpl::CreatetVecIndex(EngineType type) {
|
||||
|
||||
void
|
||||
ExecutionEngineImpl::HybridLoad() {
|
||||
// if (index_type_ != EngineType::FAISS_IVFSQ8Hybrid) {
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// const std::string key = location_ + ".quantizer";
|
||||
// std::vector<uint64_t> gpus;
|
||||
//
|
||||
// // cache hit
|
||||
// {
|
||||
// int64_t selected = -1;
|
||||
// void* quantizer = nullptr;
|
||||
// for (auto& gpu : gpus) {
|
||||
// auto cache = cache::GpuCacheMgr::GetInstance(gpu);
|
||||
// if (auto quan = cache->GetIndex(key)) {
|
||||
// selected = gpu;
|
||||
// quantizer = quan;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// if (selected != -1) {
|
||||
// // set quantizer into index;
|
||||
// return;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// // cache miss
|
||||
// {
|
||||
// std::vector<int64_t> all_free_mem;
|
||||
// for (auto& gpu : gpus) {
|
||||
// auto cache = cache::GpuCacheMgr::GetInstance(gpu);
|
||||
// auto free_mem = cache->CacheCapacity() - cache->CacheUsage();
|
||||
// all_free_mem.push_back(free_mem);
|
||||
// }
|
||||
//
|
||||
// auto max_e = std::max_element(all_free_mem.begin(), all_free_mem.end());
|
||||
// auto best = std::distance(all_free_mem.begin(), max_e);
|
||||
//
|
||||
// // load to best device;
|
||||
// // cache quantizer
|
||||
// }
|
||||
//
|
||||
// // if index_type == Hybrid
|
||||
//
|
||||
// // 1. quantizer in which gpu
|
||||
//
|
||||
// // 2.1 which gpu cache best
|
||||
//
|
||||
// // 2.2 load to that gpu cache
|
||||
//
|
||||
// // set quantizer into index
|
||||
// if (index_type_ != EngineType::FAISS_IVFSQ8Hybrid) {
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// const std::string key = location_ + ".quantizer";
|
||||
// std::vector<uint64_t> gpus;
|
||||
//
|
||||
// // cache hit
|
||||
// {
|
||||
// int64_t selected = -1;
|
||||
// void* quantizer = nullptr;
|
||||
// for (auto& gpu : gpus) {
|
||||
// auto cache = cache::GpuCacheMgr::GetInstance(gpu);
|
||||
// if (auto quan = cache->GetIndex(key)) {
|
||||
// selected = gpu;
|
||||
// quantizer = quan;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// if (selected != -1) {
|
||||
// // set quantizer into index;
|
||||
// return;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// // cache miss
|
||||
// {
|
||||
// std::vector<int64_t> all_free_mem;
|
||||
// for (auto& gpu : gpus) {
|
||||
// auto cache = cache::GpuCacheMgr::GetInstance(gpu);
|
||||
// auto free_mem = cache->CacheCapacity() - cache->CacheUsage();
|
||||
// all_free_mem.push_back(free_mem);
|
||||
// }
|
||||
//
|
||||
// auto max_e = std::max_element(all_free_mem.begin(), all_free_mem.end());
|
||||
// auto best = std::distance(all_free_mem.begin(), max_e);
|
||||
//
|
||||
// // load to best device;
|
||||
// // cache quantizer
|
||||
// }
|
||||
//
|
||||
// // if index_type == Hybrid
|
||||
//
|
||||
// // 1. quantizer in which gpu
|
||||
//
|
||||
// // 2.1 which gpu cache best
|
||||
//
|
||||
// // 2.2 load to that gpu cache
|
||||
//
|
||||
// // set quantizer into index
|
||||
}
|
||||
|
||||
Status
|
||||
|
||||
@ -113,10 +113,13 @@ class BFIndex : public VecIndexImpl {
|
||||
|
||||
class ToIndexData : public cache::DataObj {
|
||||
public:
|
||||
ToIndexData(int64_t size) : size_(size) {}
|
||||
explicit ToIndexData(int64_t size) : size_(size) {
|
||||
}
|
||||
|
||||
int64_t
|
||||
Size() override {return size_;}
|
||||
Size() override {
|
||||
return size_;
|
||||
}
|
||||
|
||||
private:
|
||||
int64_t size_;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user