From 4a4edfb785a9dbe42544e46a600823d6c9483c6a Mon Sep 17 00:00:00 2001 From: Neelam Mahapatro Date: Mon, 9 Oct 2023 14:25:53 +0530 Subject: [PATCH] fix clang format --- include/pq_flash_index.h | 1 + src/index.cpp | 4 ++-- src/pq_flash_index.cpp | 7 ++++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/include/pq_flash_index.h b/include/pq_flash_index.h index e399c66bd..eef498718 100644 --- a/include/pq_flash_index.h +++ b/include/pq_flash_index.h @@ -176,6 +176,7 @@ template class PQFlashIndex uint64_t _data_dim = 0; uint64_t _aligned_dim = 0; uint64_t _disk_bytes_per_point = 0; // Number of bytes + uint64_t memory_in_bytes = 0; std::string _disk_index_file; std::vector> _node_visit_counter; diff --git a/src/index.cpp b/src/index.cpp index 2f61e94c1..935e6f6d6 100644 --- a/src/index.cpp +++ b/src/index.cpp @@ -620,7 +620,7 @@ void Index::load(const char *filename, uint32_t num_threads, ui line_cnt++; } - _memory_in_bytes += (sizeof(LabelT) + sizeof(uint32_t)) * _label_to_medoid_id.size(); + _memory_in_bytes += (sizeof(LabelT) + sizeof(uint32_t)) * _label_to_start_id.size(); } std::string universal_label_file(filename); @@ -2212,7 +2212,7 @@ std::pair Index::search_with_filters(const { return std::make_pair(0, 0); } - + _data_store->get_dist_fn()->preprocess_query(query, _data_store->get_dims(), scratch->aligned_query()); auto retval = iterate_to_fixed_point(scratch->aligned_query(), L, init_ids, scratch, true, filter_vec, true); diff --git a/src/pq_flash_index.cpp b/src/pq_flash_index.cpp index a48380b5f..56493c7a0 100644 --- a/src/pq_flash_index.cpp +++ b/src/pq_flash_index.cpp @@ -212,7 +212,8 @@ template void PQFlashIndex::load_cache_ memory_in_bytes += sizeof(uint32_t) * _nhood_cache_buf; // Allocate space for coordinate cache size_t coord_cache_buf_len = num_cached_nodes * _aligned_dim; - memory_in_bytes += diskann::alloc_aligned((void **)&_coord_cache_buf, coord_cache_buf_len * sizeof(T), 8 * sizeof(T)); + memory_in_bytes += + diskann::alloc_aligned((void **)&_coord_cache_buf, coord_cache_buf_len * sizeof(T), 8 * sizeof(T)); memset(_coord_cache_buf, 0, coord_cache_buf_len * sizeof(T)); size_t BLOCK_SIZE = 8; @@ -1037,7 +1038,7 @@ int PQFlashIndex::load_from_separate_paths(uint32_t num_threads, cons #else diskann::load_aligned_bin(centroids_file, _centroid_data, num_centroids, tmp_dim, aligned_tmp_dim); #endif - memory_in_bytes += sizeof(float) * num_centroids * aligned_tmp_dim; + memory_in_bytes += sizeof(float) * num_centroids * aligned_tmp_dim; if (aligned_tmp_dim != _aligned_dim || num_centroids != _num_medoids) { std::stringstream stream; @@ -1183,7 +1184,7 @@ void PQFlashIndex::cached_beam_search(const T *query1, const uint64_t { context.SetState(State::FailureException); throw ANNException("Beamwidth can not be higher than defaults::MAX_N_SECTOR_READS", -1, __FUNCSIG__, __FILE__, - __LINE__); + __LINE__); } Timer query_timer, io_timer, cpu_timer;