diff options
| author | Tobias Grosser <tobias@grosser.es> | 2016-07-19 07:33:06 +0000 |
|---|---|---|
| committer | Tobias Grosser <tobias@grosser.es> | 2016-07-19 07:33:06 +0000 |
| commit | c84a1995feeedd57ef595ba588345e952062e2bf (patch) | |
| tree | 9b148440dd6f6152726353695e87a5c9e33de381 /polly/lib/CodeGen/PPCGCodeGeneration.cpp | |
| parent | f6044bd0ef9d718d9207b6709539c2fa3fff1ae3 (diff) | |
GPGPU: add scop parameters to kernel arguments
llvm-svn: 275955
Diffstat (limited to 'polly/lib/CodeGen/PPCGCodeGeneration.cpp')
| -rw-r--r-- | polly/lib/CodeGen/PPCGCodeGeneration.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/polly/lib/CodeGen/PPCGCodeGeneration.cpp b/polly/lib/CodeGen/PPCGCodeGeneration.cpp index e38fed44b1df..fcfc9ff6c8fd 100644 --- a/polly/lib/CodeGen/PPCGCodeGeneration.cpp +++ b/polly/lib/CodeGen/PPCGCodeGeneration.cpp @@ -141,7 +141,7 @@ private: /// /// - One i8 pointer for each external array reference used in the kernel. /// - Host iterators - /// - Parameters (TODO) + /// - Parameters /// - Other LLVM Value references (TODO) /// /// @param Kernel The kernel to generate the function declaration for. @@ -228,6 +228,11 @@ Function *GPUNodeBuilder::createKernelFunctionDecl(ppcg_kernel *Kernel) { for (long i = 0; i < NumHostIters; i++) Args.push_back(Builder.getInt64Ty()); + int NumVars = isl_space_dim(Kernel->space, isl_dim_param); + + for (long i = 0; i < NumVars; i++) + Args.push_back(Builder.getInt64Ty()); + auto *FT = FunctionType::get(Builder.getVoidTy(), Args, false); auto *FN = Function::Create(FT, Function::ExternalLinkage, Identifier, GPUModule.get()); @@ -250,6 +255,14 @@ Function *GPUNodeBuilder::createKernelFunctionDecl(ppcg_kernel *Kernel) { Arg++; } + for (long i = 0; i < NumVars; i++) { + isl_id *Id = isl_space_get_dim_id(Kernel->space, isl_dim_param, i); + Arg->setName(isl_id_get_name(Id)); + IDToValue[Id] = &*Arg; + KernelIDs.insert(std::unique_ptr<isl_id, IslIdDeleter>(Id)); + Arg++; + } + return FN; } |
