Skip to content

Commit

Permalink
fix compiler warnings (zilliztech#538)
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandr Guzhva <[email protected]>
  • Loading branch information
alexanderguzhva authored May 9, 2024
1 parent 7db6314 commit c0dcda0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
1 change: 1 addition & 0 deletions tests/ut/test_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ TEST_CASE("Test Time Recorder") {
}
auto span = tr.ElapseFromBegin("done");
REQUIRE(span > 0);
REQUIRE(sum > 0);
}

TEST_CASE("Test Version") {
Expand Down
12 changes: 6 additions & 6 deletions thirdparty/DiskANN/include/diskann/linux_aligned_file_reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,25 @@ class LinuxAlignedFileReader : public AlignedFileReader {
LinuxAlignedFileReader();
~LinuxAlignedFileReader();

io_context_t get_ctx() {
io_context_t get_ctx() override {
return ctx_pool_->pop();
}

void put_ctx(io_context_t ctx) {
void put_ctx(io_context_t ctx) override {
ctx_pool_->push(ctx);
}

// Open & close ops
// Blocking calls
void open(const std::string &fname);
void close();
void open(const std::string &fname) override;
void close() override;

// process batch of aligned requests in parallel
// NOTE :: blocking call
void read(std::vector<AlignedRead> &read_reqs, IOContext &ctx,
bool async = false);
bool async = false) override;

// async reads
void get_submitted_req (io_context_t &ctx, size_t n_ops) override;
void submit_req(io_context_t &ctx, std::vector<AlignedRead> &read_reqs);
void submit_req(io_context_t &ctx, std::vector<AlignedRead> &read_reqs) override;
};
9 changes: 8 additions & 1 deletion thirdparty/faiss/faiss/utils/binary_distances.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,14 @@ void binary_knn_hc(
size_t all_heap_size = thread_heap_size * thread_max_num;
T* value = new T[all_heap_size];
int64_t* labels = new int64_t[all_heap_size];
T init_value = (typeid(T) == typeid(float)) ? (1.0 / 0.0) : 0x7fffffff;

T init_value;
if constexpr (std::is_same_v<T, float>) {
init_value = std::numeric_limits<float>::infinity();
} else {
init_value = 0x7fffffff;
}

for (int i = 0; i < all_heap_size; i++) {
value[i] = init_value;
labels[i] = -1;
Expand Down

0 comments on commit c0dcda0

Please sign in to comment.