diff options
author | Yaxun (Sam) Liu <yaxun.liu@amd.com> | 2020-04-11 12:45:00 -0400 |
---|---|---|
committer | Yaxun (Sam) Liu <yaxun.liu@amd.com> | 2020-04-24 14:55:18 -0400 |
commit | c77a4078e01033aa2206c31a579d217c8a07569b (patch) | |
tree | 5473deb88955e67bfe498276f4a34c99a7806f51 /llvm/lib/Support/Threading.cpp | |
parent | 304ba5d4c6bc48853832e4fc4666f8e37308d7a4 (diff) | |
download | llvm-c77a4078e01033aa2206c31a579d217c8a07569b.zip llvm-c77a4078e01033aa2206c31a579d217c8a07569b.tar.gz llvm-c77a4078e01033aa2206c31a579d217c8a07569b.tar.bz2 |
[CUDA][HIP] Fix host/device based overload resolution
Currently clang fails to compile the following CUDA program in device compilation:
__host__ int foo(int x) {
return 1;
}
template<class T>
__device__ __host__ int foo(T x) {
return 2;
}
__device__ __host__ int bar() {
return foo(1);
}
__global__ void test(int *a) {
*a = bar();
}
This is due to foo is resolved to the __host__ foo instead of __device__ __host__ foo.
This seems to be a bug since __device__ __host__ foo is a viable callee for foo whereas
clang is unable to choose it.
This patch fixes that.
Differential Revision: https://reviews.llvm.org/D77954
Diffstat (limited to 'llvm/lib/Support/Threading.cpp')
0 files changed, 0 insertions, 0 deletions