[OpenMP] Remove restriction on the thread count for parallel regions

Differential Revision: https://reviews.llvm.org/D112194
This commit is contained in:
Johannes Doerfert 2023-03-21 17:43:26 -07:00
parent de9edf4afe
commit 0153ab6dbc

View File

@ -54,7 +54,11 @@ uint32_t determineNumberOfThreads(int32_t NumThreadsClause) {
if (NThreadsICV != 0 && NThreadsICV < NumThreads)
NumThreads = NThreadsICV;
// Round down to a multiple of WARPSIZE since it is legal to do so in OpenMP.
// SPMD mode allows any number of threads, for generic mode we round down to a
// multiple of WARPSIZE since it is legal to do so in OpenMP.
if (mapping::isSPMDMode())
return NumThreads;
if (NumThreads < mapping::getWarpSize())
NumThreads = 1;
else