2016-07-19 15:33:06 +08:00
|
|
|
; RUN: opt %loadPolly -polly-codegen-ppcg -polly-acc-dump-kernel-ir \
|
|
|
|
; RUN: -disable-output < %s | \
|
|
|
|
; RUN: FileCheck -check-prefix=KERNEL-IR %s
|
|
|
|
|
2016-07-19 15:47:27 +08:00
|
|
|
; REQUIRES: pollyacc
|
|
|
|
|
2016-07-19 15:33:06 +08:00
|
|
|
; void kernel_params_scop_parameter(float A[], long n) {
|
|
|
|
; for (long i = 0; i < n; i++)
|
|
|
|
; A[i] += 42;
|
|
|
|
; }
|
|
|
|
|
Prefix the name of the calling host function in the name of callee GPU kernel
Summary:
Provide more context to the name of a GPU kernel by prefixing its name with the host function that calls it. E.g. The first kernel called by `gemm` would be `FUNC_gemm_KERNEL_0`.
Kernels currently follow the "kernel_#" (# = 0,1,2,3,...) nomenclature. This patch makes it easier to map host caller and device callee, especially when there are many kernels produced by Polly-ACC.
Reviewers: grosser, Meinersbur, bollu, philip.pfaffe, kbarton!
Reviewed By: grosser
Subscribers: nemanjai, pollydev
Tags: #polly
Differential Revision: https://reviews.llvm.org/D33985
llvm-svn: 307173
2017-07-06 00:48:21 +08:00
|
|
|
; KERNEL-IR: define ptx_kernel void @FUNC_kernel_params_scop_parameter_KERNEL_0(i8 addrspace(1)* %MemRef_A, i64 %n)
|
2016-07-19 15:33:06 +08:00
|
|
|
|
|
|
|
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
|
|
|
|
|
|
|
|
define void @kernel_params_scop_parameter(float* %A, i64 %n) {
|
|
|
|
bb:
|
|
|
|
br label %bb1
|
|
|
|
|
|
|
|
bb1: ; preds = %bb6, %bb
|
|
|
|
%i.0 = phi i64 [ 0, %bb ], [ %tmp7, %bb6 ]
|
|
|
|
%tmp = icmp slt i64 %i.0, %n
|
|
|
|
br i1 %tmp, label %bb2, label %bb8
|
|
|
|
|
|
|
|
bb2: ; preds = %bb1
|
|
|
|
%tmp3 = getelementptr inbounds float, float* %A, i64 %i.0
|
|
|
|
%tmp4 = load float, float* %tmp3, align 4
|
|
|
|
%tmp5 = fadd float %tmp4, 4.200000e+01
|
|
|
|
store float %tmp5, float* %tmp3, align 4
|
|
|
|
br label %bb6
|
|
|
|
|
|
|
|
bb6: ; preds = %bb2
|
|
|
|
%tmp7 = add nuw nsw i64 %i.0, 1
|
|
|
|
br label %bb1
|
|
|
|
|
|
|
|
bb8: ; preds = %bb1
|
|
|
|
ret void
|
|
|
|
}
|