mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-07 19:31:51 +08:00
Add ToIndexData for CopyToIndexFileToGpu
Former-commit-id: 901d2113cb3530b7425f267b34f42e99439b6e0c
This commit is contained in:
parent
16cdd21795
commit
f9f336efc3
@ -243,12 +243,9 @@ ExecutionEngineImpl::CopyToGpu(uint64_t device_id) {
|
||||
|
||||
Status
|
||||
ExecutionEngineImpl::CopyToIndexFileToGpu(uint64_t device_id) {
|
||||
auto index = cache::GpuCacheMgr::GetInstance(device_id)->GetIndex(location_);
|
||||
bool already_in_cache = (index != nullptr);
|
||||
if (!already_in_cache) {
|
||||
cache::DataObjPtr obj = std::make_shared<cache::DataObj>(nullptr, PhysicalSize());
|
||||
milvus::cache::GpuCacheMgr::GetInstance(device_id)->InsertItem(location_, obj);
|
||||
}
|
||||
auto to_index_data = std::make_shared<ToIndexData>(PhysicalSize());
|
||||
cache::DataObjPtr obj = std::static_pointer_cast<cache::DataObj>(to_index_data);
|
||||
milvus::cache::GpuCacheMgr::GetInstance(device_id)->InsertItem(location_, obj);
|
||||
return Status::OK();
|
||||
}
|
||||
|
||||
|
||||
@ -111,5 +111,16 @@ class BFIndex : public VecIndexImpl {
|
||||
GetRawIds();
|
||||
};
|
||||
|
||||
class ToIndexData : public cache::DataObj {
|
||||
public:
|
||||
ToIndexData(int64_t size) : size_(size) {}
|
||||
|
||||
int64_t
|
||||
Size() override {return size_;}
|
||||
|
||||
private:
|
||||
int64_t size_;
|
||||
};
|
||||
|
||||
} // namespace engine
|
||||
} // namespace milvus
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user