summaryrefslogtreecommitdiffstats
path: root/polly/lib/CodeGen/PPCGCodeGeneration.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'polly/lib/CodeGen/PPCGCodeGeneration.cpp')
-rw-r--r--polly/lib/CodeGen/PPCGCodeGeneration.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/polly/lib/CodeGen/PPCGCodeGeneration.cpp b/polly/lib/CodeGen/PPCGCodeGeneration.cpp
index b882455c620..4e49d1c46ff 100644
--- a/polly/lib/CodeGen/PPCGCodeGeneration.cpp
+++ b/polly/lib/CodeGen/PPCGCodeGeneration.cpp
@@ -299,6 +299,9 @@ public:
/// The maximal number of loops surrounding a parallel kernel.
unsigned DeepestParallel = 0;
+ /// Return the name to set for the ptx_kernel.
+ std::string getKernelFuncName(int Kernel_id);
+
private:
/// A vector of array base pointers for which a new ScopArrayInfo was created.
///
@@ -662,6 +665,11 @@ private:
Value *Parameters);
};
+std::string GPUNodeBuilder::getKernelFuncName(int Kernel_id) {
+ return "FUNC_" + S.getFunction().getName().str() + "_KERNEL_" +
+ std::to_string(Kernel_id);
+}
+
void GPUNodeBuilder::initializeAfterRTH() {
BasicBlock *NewBB = SplitBlock(Builder.GetInsertBlock(),
&*Builder.GetInsertPoint(), &DT, &LI);
@@ -1621,7 +1629,7 @@ void GPUNodeBuilder::createKernel(__isl_take isl_ast_node *KernelStmt) {
Builder.SetInsertPoint(&HostInsertPoint);
Value *Parameters = createLaunchParameters(Kernel, F, SubtreeValues);
- std::string Name = "kernel_" + std::to_string(Kernel->id);
+ std::string Name = getKernelFuncName(Kernel->id);
Value *KernelString = Builder.CreateGlobalStringPtr(ASMString, Name);
Value *NameString = Builder.CreateGlobalStringPtr(Name, Name + "_name");
Value *GPUKernel = createCallGetKernel(KernelString, NameString);
@@ -1662,7 +1670,7 @@ Function *
GPUNodeBuilder::createKernelFunctionDecl(ppcg_kernel *Kernel,
SetVector<Value *> &SubtreeValues) {
std::vector<Type *> Args;
- std::string Identifier = "kernel_" + std::to_string(Kernel->id);
+ std::string Identifier = getKernelFuncName(Kernel->id);
for (long i = 0; i < Prog->n_array; i++) {
if (!ppcg_kernel_requires_array_argument(Kernel, i))
@@ -1926,7 +1934,7 @@ void GPUNodeBuilder::createKernelVariables(ppcg_kernel *Kernel, Function *FN) {
void GPUNodeBuilder::createKernelFunction(
ppcg_kernel *Kernel, SetVector<Value *> &SubtreeValues,
SetVector<Function *> &SubtreeFunctions) {
- std::string Identifier = "kernel_" + std::to_string(Kernel->id);
+ std::string Identifier = getKernelFuncName(Kernel->id);
GPUModule.reset(new Module(Identifier, Builder.getContext()));
switch (Arch) {
OpenPOWER on IntegriCloud