Disable query slicing (#3931)

Signed-off-by: Wang Xiangyu <xy.wang@zilliz.com>
pull/3936/head
Wang Xiangyu 2020-10-10 09:43:25 +08:00 committed by GitHub
parent 237ce2aba3
commit e397dd20b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -238,6 +238,7 @@ GpuIndexIVFFlat::searchImpl_(int n,
// Device is already set in GpuIndex::search
FAISS_ASSERT(index_);
FAISS_ASSERT(n > 0);
const bool enableQuerySlicing = false;
auto stream = resources_->getDefaultStream(device_);
@ -250,7 +251,11 @@ GpuIndexIVFFlat::searchImpl_(int n,
if (!bitset) {
auto bitsetDevice = toDevice<uint8_t, 1>(resources_, device_, nullptr, stream, {0});
index_->query(queries, bitsetDevice, nprobe, k, outDistances, outLabels, distances, labels);
if (enableQuerySlicing) {
index_->query(queries, bitsetDevice, nprobe, k, outDistances, outLabels, distances, labels);
} else {
index_->query(queries, bitsetDevice, nprobe, k, outDistances, outLabels);
}
} else {
auto bitsetDevice = toDevice<uint8_t, 1>(resources_, device_,
const_cast<uint8_t*>(bitset->data()), stream,