Skip to content

Commit

Permalink
MB-61719: Windows requires index variable in an OpenMP for to be signed
Browse files Browse the repository at this point in the history
  • Loading branch information
abhinavdangeti committed Sep 5, 2024
1 parent 5ab1ce0 commit 12719c3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions faiss/utils/distances_fused/simdlib_based.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,17 +257,17 @@ void exhaustive_L2sqr_fused_cmax(
}
}

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

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

// Does nothing for Top1BlockResultHandler, but
Expand Down

0 comments on commit 12719c3

Please sign in to comment.