Skip to content

Commit

Permalink
Nit: fix variable types (#3147)
Browse files Browse the repository at this point in the history
Summary:
The inconsistency in variable types would generate waaaaaaay too many warnings `comparison of integer expressions of different signedness` during the compilation if all the warnings are made reported

Pull Request resolved: #3147

Reviewed By: mlomeli1

Differential Revision: D51988074

Pulled By: algoriddle

fbshipit-source-id: 31a57bbe3a14105a968d3f06c0807c2fe60f1a62
  • Loading branch information
alexanderguzhva authored and facebook-github-bot committed Dec 11, 2023
1 parent aebc1d5 commit d40b39a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion faiss/impl/pq4_fast_scan_search_1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<NQ, 2 * BB> res2;
kernel_accumulate_block<NQ, BB>(nsq, codes, LUT, res2, scaler);
res.set_block_origin(0, j0);
Expand Down
6 changes: 3 additions & 3 deletions faiss/impl/pq4_fast_scan_search_qbs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<SQ, 2> res2;
const uint8_t* LUT = LUT0;
kernel_accumulate_block<Q1>(nsq, codes, LUT, res2, scaler);
Expand Down Expand Up @@ -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<NQ, ResultHandler>(
nsq, codes + j0 * nsq / 2, LUT, res, scaler);
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit d40b39a

Please sign in to comment.