[PATCH] D16784: [OpenMP] Reorganize code to allow specialized code generation for different devices.

Samuel Antao via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 3 22:52:32 PST 2016


sfantao added inline comments.

================
Comment at: lib/CodeGen/CGOpenMPRuntime.h:552-555
@@ -551,2 +551,6 @@
 
+  /// \brief Create specialized OpenMP runtime code generation class for NVPTX
+  /// targets.
+  static CGOpenMPRuntime *createCGOpenMPRuntimeNVPTX(CodeGenModule &CGM);
+
 public:
----------------
ABataev wrote:
> sfantao wrote:
> > ABataev wrote:
> > > Do you really need this function? Currently, I don't see a point in adding this platform-specific thing to (mostly) common interface
> > I am using that function to avoid exposing the constructor of `CGOpenMPRuntimeNVPTX ` in CGOpenMPRuntime.h. Do you prefer me to do that instead?
> Why do you need to expose constructor of CGOpenMPRuntimeNVPTX in CGOpenMPRuntime.h? It must be exposed only in CGOpenMPRuntime.cpp. Also, it would be a good idea to remove CGOpenMPRuntime::create() and move the whole logic to CodeGenModule::createOpenMPRuntime()
Ok I can move things to CodeGenModule.

I am afraid I am not understanding what you want me to do with `CGOpenMPRuntimeNVPTX` constructor.   We have `CGOpenMPRuntimeNVPTX` in CGOpenMPRuntimeNVPTX.cpp, so unless I declare it in CGOpenMPRuntime.h (or some other header file) or have a function declared somewhere and defined in CGOpenMPRuntimeNVPTX.cpp, I can't call the Ctor. 

So do you want me do create two functions in the CodeGen namespace (say createDefaultOpenMPRuntime() and createNVPTXOpenMPRuntime) and use them in CodeGenModule after checking which target is being used?



http://reviews.llvm.org/D16784





More information about the cfe-commits mailing list