This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] Add thread limit environment variable support to plugins
ClosedPublic

Authored by jhuber6 on Jun 8 2021, 12:20 PM.

Details

Summary

The OpenMP 5.1 standard defines the environment variable
OMP_TEAMS_THREAD_LIMIT to limit the number of threads that will be run in a
single block. This patch adds support for this into the AMDGPU and CUDA
plugins.

Diff Detail

Event Timeline

jhuber6 created this revision.Jun 8 2021, 12:20 PM
jhuber6 requested review of this revision.Jun 8 2021, 12:20 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 8 2021, 12:20 PM
grokos added a subscriber: grokos.Jun 8 2021, 12:36 PM
grokos added inline comments.
openmp/libomptarget/plugins/cuda/src/rtl.cpp
625

exceeds the env team thread limit

629–634

This else does not take care of this scenario correctly:

EnvTeamThreadLimit < HardThreadLimit < MaxBlockDimX

MaxBlockDimX will be set to HardThreadLimit whereas it should be set to EnvTeamThreadLimit.

jhuber6 updated this revision to Diff 350695.Jun 8 2021, 12:50 PM

Fixing. Don't know why I kept that mess.

This revision is now accepted and ready to land.Jun 22 2021, 1:22 PM
This revision was landed with ongoing or failed builds.Jun 22 2021, 1:25 PM
This revision was automatically updated to reflect the committed changes.