[PATCH] D32431: [Polly] Added OpenCL Runtime to GPURuntime Library for GPGPU CodeGen

Hongbin Zheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 26 00:12:18 PDT 2017


etherzhhb added inline comments.


================
Comment at: include/polly/LinkAllPasses.h:51
 #ifdef GPU_CODEGEN
-llvm::Pass *createPPCGCodeGenerationPass();
+llvm::Pass *createPPCGCodeGenerationPass(int Runtime);
 #endif
----------------
PhilippSchaad wrote:
> etherzhhb wrote:
> > is this Runtime supposed to be with type GPURuntimeT ? it is a little bit tricky here.
> > Maybe we need to introduce a PPCG header and define the runtime enum there, than include that runtime enum.
> > 
> > or we can declare the function as
> > 
> > 
> > ```
> > llvm::Pass *createPPCGCodeGenerationPass(int Runtime = 0);
> > ```
> > 
> > to at least avoid the magic number 0 in line 86.
> > 
> > 
> Yes, it would be. The reason it's not is exactly the one you mentioned. I was considering adding a PPCG header, but refrained from it because I was hesitant about creating a header 'just for one enum'. If you agree that this is a good solution, I will indeed introduce a new header for PPCG and define the enum there, to get rid of magic numbers. The second option seems reasonable too though.
we could start from the second option if you think it is reasonable


https://reviews.llvm.org/D32431





More information about the llvm-commits mailing list