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

Alexey Bataev via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 3 23:09:44 PST 2016


ABataev 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:
----------------
sfantao wrote:
> 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?
> 
Oh, I missed that you did not add header file. I think you need to add a new one for new runtime support library.


http://reviews.llvm.org/D16784





More information about the cfe-commits mailing list