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

Arpith Jacob via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 3 12:00:32 PST 2017


arpith-jacob added inline comments.


================
Comment at: lib/CodeGen/CGOpenMPRuntime.h:524
+
+  static bool classof(const CGOpenMPRuntime *RT) {
+    return RT->getKind() == RK_HOST;
----------------
This is required to cast to the NVPTX runtime in a static function as follows;

CGOpenMPRuntimeNVPTX &RT = cast<CGOpenMPRuntimeNVPTX>(CGM.getOpenMPRuntime());


================
Comment at: lib/CodeGen/CGOpenMPRuntime.h:975
+                             bool WithNowait, bool SimpleReduction,
+                             OpenMPDirectiveKind ReductionKind);
 
----------------
NVPTX requires this parameter because the reduction implementation for 'parallel', 'simd', and 'teams' are different.  This is required for correctness and performance.


https://reviews.llvm.org/D29506





More information about the cfe-commits mailing list