Skip to content

Commit 3897b73

Browse files
MB-61719: Windows requires index variable in an OpenMP for to be signed
See: https://learn.microsoft.com/en-us/cpp/error-messages/compiler-errors-2/compiler-error-c3016?view=msvc-170
1 parent 5ab1ce0 commit 3897b73

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

faiss/utils/distances_fused/simdlib_based.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -257,17 +257,17 @@ void exhaustive_L2sqr_fused_cmax(
257257
}
258258
}
259259

260-
const size_t nx_p = (nx / NX_POINTS_PER_LOOP) * NX_POINTS_PER_LOOP;
260+
const ssize_t nx_p = (ssize_t)((nx / NX_POINTS_PER_LOOP) * NX_POINTS_PER_LOOP);
261261
// the main loop.
262262
#pragma omp parallel for schedule(dynamic) num_threads(num_omp_threads)
263-
for (size_t i = 0; i < nx_p; i += NX_POINTS_PER_LOOP) {
263+
for (ssize_t i = 0; i < nx_p; i += NX_POINTS_PER_LOOP) {
264264
kernel<DIM, NX_POINTS_PER_LOOP, NY_POINTS_PER_LOOP>(
265-
x, y, y_transposed.data(), ny, res, y_norms, i);
265+
x, y, y_transposed.data(), ny, res, y_norms, (size_t)i);
266266
}
267267

268-
for (size_t i = nx_p; i < nx; i++) {
268+
for (ssize_t i = nx_p; i < (ssize_t)nx; i++) {
269269
kernel<DIM, 1, NY_POINTS_PER_LOOP>(
270-
x, y, y_transposed.data(), ny, res, y_norms, i);
270+
x, y, y_transposed.data(), ny, res, y_norms, (size_t)i);
271271
}
272272

273273
// Does nothing for Top1BlockResultHandler, but

0 commit comments

Comments
 (0)