[all-commits] [llvm/llvm-project] bc9c4d: [OpenMP][FIX] Pass the num_threads value directly ...

Joseph Huber via All-commits all-commits at lists.llvm.org
Thu Dec 9 13:30:49 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: bc9c4d7216a5bcdeec8543834fe1451db2c46e5c
      https://github.com/llvm/llvm-project/commit/bc9c4d7216a5bcdeec8543834fe1451db2c46e5c
  Author: Joseph Huber <jhuber6 at vols.utk.edu>
  Date:   2021-12-09 (Thu, 09 Dec 2021)

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

  Log Message:
  -----------
  [OpenMP][FIX] Pass the num_threads value directly to parallel_51

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.

Reviewed By: tianshilei1992

Differential Revision: https://reviews.llvm.org/D113623




More information about the All-commits mailing list