]> granicus.if.org Git - clang/commit
[OPENMP] Codegen for teams directive for NVPTX
authorCarlo Bertolli <cbertol@us.ibm.com>
Mon, 4 Apr 2016 15:55:02 +0000 (15:55 +0000)
committerCarlo Bertolli <cbertol@us.ibm.com>
Mon, 4 Apr 2016 15:55:02 +0000 (15:55 +0000)
commit885217218dd21498430d50c5a2f6dd8e329add4b
treeabfc561f3e0b20e7bd7944a5a05e954f8cc94e11
parent2c6cec24fd854608b7d028265c3cda8184b09639
[OPENMP] Codegen for teams directive for NVPTX

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.

http://reviews.llvm.org/D17963

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@265304 91177308-0d34-0410-b5e6-96231b3b80d8
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 [new file with mode: 0644]