未验证 提交 ed2ee887 编写于 作者: C Cai Yudong 提交者: GitHub

fix SingleIndexTest.IVFSQHybrid unittest (#2215)

Signed-off-by: Nyudong.cai <yudong.cai@zilliz.com>
上级 adccd3db
...@@ -15,6 +15,7 @@ Please mark all change in change log and use the issue from GitHub ...@@ -15,6 +15,7 @@ Please mark all change in change log and use the issue from GitHub
- \#2128 Check has_partition params - \#2128 Check has_partition params
- \#2131 Distance/ID returned is not correct if searching with duplicate ids - \#2131 Distance/ID returned is not correct if searching with duplicate ids
- \#2141 Fix server start failed if wal directory exist - \#2141 Fix server start failed if wal directory exist
- \#2169 Fix SingleIndexTest.IVFSQHybrid unittest
- \#2196 Fix server start failed if wal is disabled - \#2196 Fix server start failed if wal is disabled
## Feature ## Feature
......
...@@ -31,7 +31,9 @@ namespace faiss { ...@@ -31,7 +31,9 @@ namespace faiss {
PageLockMemory::PageLockMemory(size_t size) : nbytes(size) { PageLockMemory::PageLockMemory(size_t size) : nbytes(size) {
auto err = cudaHostAlloc(&(this->data), size, 0); auto err = cudaHostAlloc(&(this->data), size, 0);
if (err) { if (err) {
FAISS_THROW_MSG("Fail to alloc page lock memory " + std::to_string(size)); std::string msg =
"Fail to alloc page lock memory " + std::to_string(size) + ", err code " + std::to_string((int32_t)err);
FAISS_THROW_MSG(msg);
} }
} }
...@@ -42,7 +44,9 @@ PageLockMemory::~PageLockMemory() { ...@@ -42,7 +44,9 @@ PageLockMemory::~PageLockMemory() {
PageLockMemory::PageLockMemory(const PageLockMemory& other) { PageLockMemory::PageLockMemory(const PageLockMemory& other) {
auto err = cudaHostAlloc(&(this->data), other.nbytes, 0); auto err = cudaHostAlloc(&(this->data), other.nbytes, 0);
if (err) { if (err) {
FAISS_THROW_MSG("Fail to alloc page lock memory " + std::to_string(other.nbytes)); std::string msg = "Fail to alloc page lock memory " + std::to_string(other.nbytes) + ", err code " +
std::to_string((int32_t)err);
FAISS_THROW_MSG(msg);
} }
memcpy(this->data, other.data, other.nbytes); memcpy(this->data, other.data, other.nbytes);
this->nbytes = other.nbytes; this->nbytes = other.nbytes;
......
...@@ -24,7 +24,7 @@ class SingleIndexTest : public DataGen, public TestGpuIndexBase { ...@@ -24,7 +24,7 @@ class SingleIndexTest : public DataGen, public TestGpuIndexBase {
void void
SetUp() override { SetUp() override {
TestGpuIndexBase::SetUp(); TestGpuIndexBase::SetUp();
nb = 1000000; nb = 100000;
nq = 1000; nq = 1000;
dim = DIM; dim = DIM;
Generate(dim, nb, nq); Generate(dim, nb, nq);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册