[PATCH] D113623: [OpenMP][FIX] Pass the num_threads value directly to parallel_51

Johannes Doerfert via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 10 15:40:12 PST 2021


jdoerfert created this revision.
jdoerfert added reviewers: jhuber6, ggeorgakoudis, tianshilei1992, grokos, jdenny.
Herald added subscribers: asavonic, guansong, bollu, yaxunl.
jdoerfert requested review of this revision.
Herald added subscribers: cfe-commits, sstefan1.
Herald added projects: clang, OpenMP.

The problem with the old scheme is that we would need to keep track of
the "next region" and reset the num_threads value after it. The new RT
doesn't do it and an assertion is triggered. The old RT doesn't do it
either, I haven't tested it but I assume a num_threads clause might
impact multiple parallel regions "accidentally". Further, in SPMD mode
num_threads was simply ignored, for some reason beyond me.

In any case, parallel_51 is designed to take the clause value directly,
so let's do that instead.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D113623

Files:
  clang/lib/CodeGen/CGOpenMPRuntime.cpp
  clang/lib/CodeGen/CGOpenMPRuntime.h
  clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp
  clang/lib/CodeGen/CGOpenMPRuntimeGPU.h
  clang/lib/CodeGen/CGStmtOpenMP.cpp
  clang/test/OpenMP/nvptx_nested_parallel_codegen.cpp
  clang/test/OpenMP/nvptx_target_codegen.cpp
  clang/test/OpenMP/nvptx_target_parallel_num_threads_codegen.cpp
  openmp/libomptarget/DeviceRTL/include/Interface.h
  openmp/libomptarget/DeviceRTL/src/Parallelism.cpp
  openmp/libomptarget/deviceRTLs/common/omptarget.h
  openmp/libomptarget/deviceRTLs/common/omptargeti.h
  openmp/libomptarget/deviceRTLs/common/src/parallel.cu
  openmp/libomptarget/deviceRTLs/interface.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D113623.386338.patch
Type: text/x-patch
Size: 44459 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20211110/a2d14575/attachment-0001.bin>


More information about the cfe-commits mailing list