forked from llvm/llvm-project
-
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.
[CUDA][HIP] Externalize kernels in anonymous name space
kernels in anonymous name space needs to have unique name to avoid duplicate symbols. Fixes: llvm#54560 Reviewed by: Artem Belevich Differential Revision: https://reviews.llvm.org/D123353
- Loading branch information
Showing
6 changed files
with
52 additions
and
25 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
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,24 @@ | ||
// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -fcuda-is-device -cuid=abc \ | ||
// RUN: -aux-triple x86_64-unknown-linux-gnu -std=c++11 -fgpu-rdc \ | ||
// RUN: -emit-llvm -o - -x hip %s > %t.dev | ||
|
||
// RUN: %clang_cc1 -triple x86_64-gnu-linux -cuid=abc \ | ||
// RUN: -aux-triple amdgcn-amd-amdhsa -std=c++11 -fgpu-rdc \ | ||
// RUN: -emit-llvm -o - -x hip %s > %t.host | ||
|
||
// RUN: cat %t.dev %t.host | FileCheck %s | ||
|
||
#include "Inputs/cuda.h" | ||
|
||
// CHECK: define weak_odr {{.*}}void @[[KERN:_ZN12_GLOBAL__N_16kernelEv\.anon\.b04fd23c98500190]]( | ||
// CHECK: @[[STR:.*]] = {{.*}} c"[[KERN]]\00" | ||
// CHECK: call i32 @__hipRegisterFunction({{.*}}@[[STR]] | ||
|
||
namespace { | ||
__global__ void kernel() { | ||
} | ||
} | ||
|
||
void test() { | ||
kernel<<<1, 1>>>(); | ||
} |