From 5d8bf47f9add948ce0b2e2f9e2a770f0b2e6fee7 Mon Sep 17 00:00:00 2001 From: I <1091761+wx257osn2@users.noreply.github.com> Date: Wed, 31 May 2023 19:56:09 +0900 Subject: [PATCH] fix windows CI MSVC doesn't accept unsigned index with pragma omp parallel for --- faiss/utils/utils.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/faiss/utils/utils.cpp b/faiss/utils/utils.cpp index 9cc8d3fe45..f9b1856ea7 100644 --- a/faiss/utils/utils.cpp +++ b/faiss/utils/utils.cpp @@ -28,6 +28,7 @@ #include #include +#include #include #include @@ -447,7 +448,8 @@ uint64_t bvec_checksum(size_t n, const uint8_t* a) { void bvecs_checksum(size_t n, size_t d, const uint8_t* a, uint64_t* cs) { #pragma omp parallel for if (n > 1000) - for (size_t i = 0; i < n; i++) { + for (std::make_signed::type i_ = 0; static_cast(i_) < n; i_++) { + const auto i = static_cast(i_); cs[i] = bvec_checksum(d, a + i * d); } }