diff --git a/openmp/libomptarget/DeviceRTL/src/Parallelism.cpp b/openmp/libomptarget/DeviceRTL/src/Parallelism.cpp --- a/openmp/libomptarget/DeviceRTL/src/Parallelism.cpp +++ b/openmp/libomptarget/DeviceRTL/src/Parallelism.cpp @@ -54,7 +54,11 @@ 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