From d1b55bdb5fa4faefb173169cdff503f24dae8543 Mon Sep 17 00:00:00 2001 From: Alexandr Guzhva Date: Tue, 28 Nov 2023 10:54:33 -0500 Subject: [PATCH] Fix way too many warnings 'comparison of integer expressions of different signedness' during the compilation Signed-off-by: Alexandr Guzhva --- faiss/impl/pq4_fast_scan_search_1.cpp | 2 +- faiss/impl/pq4_fast_scan_search_qbs.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/faiss/impl/pq4_fast_scan_search_1.cpp b/faiss/impl/pq4_fast_scan_search_1.cpp index 672c7d6db9..6197c2be78 100644 --- a/faiss/impl/pq4_fast_scan_search_1.cpp +++ b/faiss/impl/pq4_fast_scan_search_1.cpp @@ -125,7 +125,7 @@ void accumulate_fixed_blocks( ResultHandler& res, const Scaler& scaler) { constexpr int bbs = 32 * BB; - for (int64_t j0 = 0; j0 < nb; j0 += bbs) { + for (size_t j0 = 0; j0 < nb; j0 += bbs) { FixedStorageHandler res2; kernel_accumulate_block(nsq, codes, LUT, res2, scaler); res.set_block_origin(0, j0); diff --git a/faiss/impl/pq4_fast_scan_search_qbs.cpp b/faiss/impl/pq4_fast_scan_search_qbs.cpp index 2db5f628da..50c0f6217b 100644 --- a/faiss/impl/pq4_fast_scan_search_qbs.cpp +++ b/faiss/impl/pq4_fast_scan_search_qbs.cpp @@ -123,7 +123,7 @@ void accumulate_q_4step( constexpr int Q4 = (QBS >> 12) & 15; constexpr int SQ = Q1 + Q2 + Q3 + Q4; - for (int64_t j0 = 0; j0 < ntotal2; j0 += 32) { + for (size_t j0 = 0; j0 < ntotal2; j0 += 32) { FixedStorageHandler res2; const uint8_t* LUT = LUT0; kernel_accumulate_block(nsq, codes, LUT, res2, scaler); @@ -156,7 +156,7 @@ void kernel_accumulate_block_loop( const uint8_t* LUT, ResultHandler& res, const Scaler& scaler) { - for (int64_t j0 = 0; j0 < ntotal2; j0 += 32) { + for (size_t j0 = 0; j0 < ntotal2; j0 += 32) { res.set_block_origin(0, j0); kernel_accumulate_block( nsq, codes + j0 * nsq / 2, LUT, res, scaler); @@ -243,7 +243,7 @@ void pq4_accumulate_loop_qbs( // default implementation where qbs is not known at compile time - for (int64_t j0 = 0; j0 < ntotal2; j0 += 32) { + for (size_t j0 = 0; j0 < ntotal2; j0 += 32) { const uint8_t* LUT = LUT0; int qi = qbs; int i0 = 0;