Skip to content

Commit

Permalink
fix clang format
Browse files Browse the repository at this point in the history
  • Loading branch information
NeelamMahapatro committed Oct 9, 2023
1 parent 9f51040 commit 4a4edfb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions include/pq_flash_index.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ template <typename T, typename LabelT = uint32_t> 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<std::pair<uint32_t, uint32_t>> _node_visit_counter;
Expand Down
4 changes: 2 additions & 2 deletions src/index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ void Index<T, TagT, LabelT>::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);
Expand Down Expand Up @@ -2212,7 +2212,7 @@ std::pair<uint32_t, uint32_t> Index<T, TagT, LabelT>::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);

Expand Down
7 changes: 4 additions & 3 deletions src/pq_flash_index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,8 @@ template <typename T, typename LabelT> void PQFlashIndex<T, LabelT>::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;
Expand Down Expand Up @@ -1037,7 +1038,7 @@ int PQFlashIndex<T, LabelT>::load_from_separate_paths(uint32_t num_threads, cons
#else
diskann::load_aligned_bin<float>(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;
Expand Down Expand Up @@ -1183,7 +1184,7 @@ void PQFlashIndex<T, LabelT>::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;
Expand Down

0 comments on commit 4a4edfb

Please sign in to comment.