[PATCH] D17877: [OpenMP] Base support for target directive codegen on NVPTX device.

Arpith Jacob via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 9 19:44:44 PST 2016


arpith-jacob marked an inline comment as done.

================
Comment at: lib/CodeGen/CGOpenMPRuntime.h:69
@@ +68,3 @@
+  /// evaluates to false.
+  virtual void emitTargetOutlinedFunctionHelper(const OMPExecutableDirective &D,
+                                                StringRef ParentName,
----------------
ABataev wrote:
> arpith-jacob wrote:
> > Do we need 'virtual'?  This function needs to be called by the NVPTX implementation (in emitTargetOutlinedFunction) but doesn't need to be overridden.
> I we don't need it in 'CGOpenMPRuntime', then why it is here?
Alexey, both CGOpenMPRuntime and CGOpenMPRuntimeNVPTX call emitTargetOutlinedFunctionHelper().

CGOpenMPRuntime::emitTargetOutlinedFunction() sets up the 'codegen' lambda and then calls CGOpenMPRuntime::emitTargetOutlinedFunctionHelper() to do the work.

In the same way, CGOpenMPRuntimeNVPTX::emitTargetOutlinedFunction() sets up the 'codegen' lambda for the GPU and then calls CGOpenMPRuntime::emitTargetOutlinedFunctionHelper().

Does that make sense?


http://reviews.llvm.org/D17877





More information about the cfe-commits mailing list