[OpenMP] Improve default block count selection fow low block counts
authorJohannes Doerfert <johannes@jdoerfert.de>
Thu, 18 May 2023 21:49:40 +0000 (14:49 -0700)
committerJohannes Doerfert <johannes@jdoerfert.de>
Mon, 5 Jun 2023 23:35:44 +0000 (16:35 -0700)
commit6629a96a8ce5f07c72bd4931180a3ca9fc535cbb
tree916555eaff207e94965660f72b873c862bd976cd
parent8f4fadd1b4cb516c61a48f1686275a75c23591f1
[OpenMP] Improve default block count selection fow low block counts

If a combined loop has insufficient parallelism (= low trip count), we
might end up with too few teams/blocks. To counter that we can reduce
the number of threads per team we use. This patch implements a heuristic
and exposes a new environment variable to control the minimum of threads
to be employed in this case.

Issue reported by:
Felipe Cabarcas Jaramillo <cabarcas@udel.edu> (@fel-cab).

Reviewed By: tianshilei1992

Differential Revision: https://reviews.llvm.org/D152014
openmp/docs/design/Runtimes.rst
openmp/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.cpp
openmp/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.h
openmp/libomptarget/test/offloading/small_trip_count.c [new file with mode: 0644]