[PATCH] D17963: [OPENMP] Codegen for teams directive for NVPTX

Carlo Bertolli via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 8 10:15:31 PST 2016


carlo.bertolli created this revision.
carlo.bertolli added reviewers: ABataev, fraggamuffin, kkwli0.
carlo.bertolli added subscribers: sfantao, arpith-jacob, caomhin, cfe-commits.
carlo.bertolli set the repository for this revision to rL LLVM.
Herald added a subscriber: jholewinski.

This patch implements the teams directive for the NVPTX backend. It is different from the host code generation path as it:

- Does not call kmpc_fork_teams. All necessary teams and threads are started upon touching the target region, when launching a CUDA kernel, and their execution is coordinated through sequential and parallel regions within the target region.

- Does not call kmpc_push_num_teams even if a num_teams of thread_limit clause is present. Setting the number of teams and the thread limit is implemented by the nvptx-related runtime.

Please note that I am now passing a Clang Expr * to emitPushNumTeams instead of the originally chosen llvm::Value * type. The reason for that is that I want to avoid emitting expressions for num_teams and thread_limit if they are not needed in the target region.

Repository:
  rL LLVM

http://reviews.llvm.org/D17963

Files:
  lib/CodeGen/CGOpenMPRuntime.cpp
  lib/CodeGen/CGOpenMPRuntime.h
  lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp
  lib/CodeGen/CGOpenMPRuntimeNVPTX.h
  lib/CodeGen/CGStmtOpenMP.cpp
  test/OpenMP/nvptx_teams_codegen.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D17963.50052.patch
Type: text/x-patch
Size: 13339 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160308/5ddaac2a/attachment-0001.bin>


More information about the cfe-commits mailing list