[PATCH] D29879: [OpenMP] Teams reduction on the NVPTX device.

Arpith Jacob via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Feb 12 16:29:46 PST 2017


arpith-jacob created this revision.
Herald added a subscriber: jholewinski.

This patch implements codegen for the reduction clause on
any teams construct for elementary data types.  It builds
on parallel reductions on the GPU.  Subsequently,
the team master writes to a unique location in a global
memory scratchpad.  The last team to do so loads and
reduces this array to calculate the final result.

This patch emits two helper functions that are used by
the OpenMP runtime on the GPU to perform reductions across
teams.

Patch by Tian Jin in collaboration with Arpith Jacob


https://reviews.llvm.org/D29879

Files:
  lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp
  lib/CodeGen/CGStmtOpenMP.cpp
  test/OpenMP/nvptx_teams_reduction_codegen.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D29879.88150.patch
Type: text/x-patch
Size: 84850 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170213/697f5e51/attachment-0001.bin>


More information about the cfe-commits mailing list