File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -447,10 +447,12 @@ uint64_t bvec_checksum(size_t n, const uint8_t* a) {
447447}
448448
449449void bvecs_checksum (size_t n, size_t d, const uint8_t * a, uint64_t * cs) {
450- #pragma omp parallel for if (n > 1000)
451- for (std::make_signed<std::size_t >::type i_ = 0 ;
452- static_cast <std::size_t >(i_) < n;
453- i_++) {
450+ // MSVC can't accept unsigned index for #pragma omp parallel for
451+ // so below codes only accept n <= std::numeric_limits<ssize_t>::max()
452+ using ssize_t = std::make_signed<std::size_t >::type;
453+ const ssize_t size = n;
454+ #pragma omp parallel for if (size > 1000)
455+ for (ssize_t i_ = 0 ; i_ < size; i_++) {
454456 const auto i = static_cast <std::size_t >(i_);
455457 cs[i] = bvec_checksum (d, a + i * d);
456458 }
You can’t perform that action at this time.
0 commit comments