forked from llvm-mirror/clang
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add .stub to kernel stub function name so that it is different from kernel name in device code. This is necessary to let debugger find correct symbol for kernel. Differential Revision: https://reviews.llvm.org/D58518 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354948 91177308-0d34-0410-b5e6-96231b3b80d8
- Loading branch information
Showing
3 changed files
with
32 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// RUN: echo "GPU binary would be here" > %t | ||
|
||
// RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm %s \ | ||
// RUN: -fcuda-include-gpubinary %t -o - -x hip\ | ||
// RUN: | FileCheck -allow-deprecated-dag-overlap %s --check-prefixes=CHECK | ||
|
||
#include "Inputs/cuda.h" | ||
|
||
template<class T> | ||
__global__ void kernelfunc() {} | ||
|
||
// CHECK-LABEL: define{{.*}}@_Z8hostfuncv() | ||
// CHECK: call void @[[STUB:_Z10kernelfuncIiEvv.stub]]() | ||
void hostfunc(void) { kernelfunc<int><<<1, 1>>>(); } | ||
|
||
// CHECK: define{{.*}}@[[STUB]] | ||
// CHECK: call{{.*}}@hipLaunchByPtr{{.*}}@[[STUB]] | ||
|
||
// CHECK-LABEL: define{{.*}}@__hip_register_globals | ||
// CHECK: call{{.*}}@__hipRegisterFunction{{.*}}@[[STUB]] |