Skip to content

Commit

Permalink
Merge pull request #139 from al42and/fix-nvcpp
Browse files Browse the repository at this point in the history
Simplify OpenMP clause to avoid compiler bugs
  • Loading branch information
beltoforion authored Mar 16, 2024
2 parents f03fdef + c498f01 commit d7b0e59
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/muParserBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1903,7 +1903,8 @@ namespace mu
#endif
omp_set_num_threads(nMaxThreads);

#pragma omp parallel for schedule(static, std::max(nBulkSize/nMaxThreads, 1)) private(nThreadID)
const int chunkSize = std::max(nBulkSize/nMaxThreads, 1);
#pragma omp parallel for schedule(static, chunkSize) private(nThreadID)
for (i = 0; i < nBulkSize; ++i)
{
nThreadID = omp_get_thread_num();
Expand Down

0 comments on commit d7b0e59

Please sign in to comment.