mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-07 19:31:51 +08:00
Signed-off-by: groot <yihua.mo@zilliz.com>
This commit is contained in:
parent
d380c8d69b
commit
220ecf5fac
@ -27,6 +27,7 @@ Please mark all change in change log and use the issue from GitHub
|
||||
- \#1240 - Update license declaration
|
||||
- \#1298 - Unittest failed when on CPU2GPU case
|
||||
- \#1359 - Negative distance value returned when searching with HNSW index type
|
||||
- \#1429 - Server crashed when searching vectors using GPU
|
||||
|
||||
## Feature
|
||||
- \#216 - Add CLI to get server info
|
||||
|
||||
@ -32,27 +32,36 @@ CopyGpuToCpu(const VectorIndexPtr& index, const Config& config) {
|
||||
|
||||
VectorIndexPtr
|
||||
CopyCpuToGpu(const VectorIndexPtr& index, const int64_t& device_id, const Config& config) {
|
||||
VectorIndexPtr result;
|
||||
auto uids = index->GetUids();
|
||||
#ifdef CUSTOMIZATION
|
||||
if (auto device_index = std::dynamic_pointer_cast<IVFSQHybrid>(index)) {
|
||||
return device_index->CopyCpuToGpu(device_id, config);
|
||||
result = device_index->CopyCpuToGpu(device_id, config);
|
||||
result->SetUids(uids);
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (auto device_index = std::dynamic_pointer_cast<GPUIndex>(index)) {
|
||||
return device_index->CopyGpuToGpu(device_id, config);
|
||||
result = device_index->CopyGpuToGpu(device_id, config);
|
||||
result->SetUids(uids);
|
||||
return result;
|
||||
}
|
||||
|
||||
if (auto cpu_index = std::dynamic_pointer_cast<IVFSQ>(index)) {
|
||||
return cpu_index->CopyCpuToGpu(device_id, config);
|
||||
result = cpu_index->CopyCpuToGpu(device_id, config);
|
||||
} else if (auto cpu_index = std::dynamic_pointer_cast<IVFPQ>(index)) {
|
||||
return cpu_index->CopyCpuToGpu(device_id, config);
|
||||
result = cpu_index->CopyCpuToGpu(device_id, config);
|
||||
} else if (auto cpu_index = std::dynamic_pointer_cast<IVF>(index)) {
|
||||
return cpu_index->CopyCpuToGpu(device_id, config);
|
||||
result = cpu_index->CopyCpuToGpu(device_id, config);
|
||||
} else if (auto cpu_index = std::dynamic_pointer_cast<IDMAP>(index)) {
|
||||
return cpu_index->CopyCpuToGpu(device_id, config);
|
||||
result = cpu_index->CopyCpuToGpu(device_id, config);
|
||||
} else {
|
||||
KNOWHERE_THROW_MSG("this index type not support tranfer to gpu");
|
||||
}
|
||||
|
||||
result->SetUids(uids);
|
||||
return result;
|
||||
}
|
||||
|
||||
} // namespace cloner
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user