From 17048638519d83ea96de5549e286d314ba3aee6d Mon Sep 17 00:00:00 2001
From: liliu-z <105927039+liliu-z@users.noreply.github.com>
Date: Thu, 29 Sep 2022 14:12:50 +0800
Subject: [PATCH] Fix large degree error (#489)
Signed-off-by: liliu-z
Signed-off-by: liliu-z
---
thirdparty/DiskANN/src/aux_utils.cpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/thirdparty/DiskANN/src/aux_utils.cpp b/thirdparty/DiskANN/src/aux_utils.cpp
index 5a7778aba..660eda1fd 100644
--- a/thirdparty/DiskANN/src/aux_utils.cpp
+++ b/thirdparty/DiskANN/src/aux_utils.cpp
@@ -803,7 +803,7 @@ namespace diskann {
if (long_node) {
for (_u64 node_id = 0; node_id < npts_64; ++node_id) {
- memset(sector_buf.get(), 0, sector_buf_size);
+ memset(sector_buf.get(), 0, sector_buf_size);
char *nnbrs = sector_buf.get() + ndims_64 * sizeof(T);
char *nhood_buf =
sector_buf.get() + (ndims_64 * sizeof(T)) + sizeof(unsigned);
@@ -816,7 +816,7 @@ namespace diskann {
assert(*nnbrs <= width_u32);
// read node's nhood
- vamana_reader.read(nhood_buf, (*nnbrs) * sizeof(unsigned));
+ vamana_reader.read(nhood_buf, *((unsigned *)nnbrs) * sizeof(unsigned));
// write coords of node first
base_reader.read((char *) sector_buf.get(), sizeof(T) * ndims_64);
@@ -851,7 +851,7 @@ namespace diskann {
assert(*nnbrs <= width_u32);
// read node's nhood
- vamana_reader.read(nhood_buf, (*nnbrs) * sizeof(unsigned));
+ vamana_reader.read(nhood_buf, *((unsigned *)nnbrs) * sizeof(unsigned));
// write coords of node first
base_reader.read(sector_node_buf, sizeof(T) * ndims_64);