Fix for windows compilation (#4139)

This commit is contained in:
Rory Mitchell 2019-02-17 19:42:32 +13:00 committed by GitHub
parent 1fe874e58a
commit 71a604fae3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1050,8 +1050,9 @@ class SaveCudaContext {
template <typename T, typename FunctionT>
void ExecuteIndexShards(std::vector<T> *shards, FunctionT f) {
SaveCudaContext{[&]() {
#pragma omp parallel for schedule(static, 1) if (shards->size() > 1)
for (size_t shard = 0; shard < shards->size(); ++shard) {
const long shards_size = static_cast<long>(shards->size());
#pragma omp parallel for schedule(static, 1) if (shards_size > 1)
for (long shard = 0; shard < shards_size; ++shard) {
f(shard, shards->at(shard));
}
}};