Skip to content

Commit 0153ab6

Browse files
committed
[OpenMP] Remove restriction on the thread count for parallel regions
Differential Revision: https://reviews.llvm.org/D112194
1 parent de9edf4 commit 0153ab6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

openmp/libomptarget/DeviceRTL/src/Parallelism.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,11 @@ uint32_t determineNumberOfThreads(int32_t NumThreadsClause) {
5454
if (NThreadsICV != 0 && NThreadsICV < NumThreads)
5555
NumThreads = NThreadsICV;
5656

57-
// Round down to a multiple of WARPSIZE since it is legal to do so in OpenMP.
57+
// SPMD mode allows any number of threads, for generic mode we round down to a
58+
// multiple of WARPSIZE since it is legal to do so in OpenMP.
59+
if (mapping::isSPMDMode())
60+
return NumThreads;
61+
5862
if (NumThreads < mapping::getWarpSize())
5963
NumThreads = 1;
6064
else

0 commit comments

Comments
 (0)