diff options
| author | Artem Belevich <tra@google.com> | 2016-12-07 19:27:16 +0000 |
|---|---|---|
| committer | Artem Belevich <tra@google.com> | 2016-12-07 19:27:16 +0000 |
| commit | 13e9b4d76851d987381d650f63fad1c272fc0239 (patch) | |
| tree | 481481d7409f445b65d7982d1f3776bfbb28cf12 /clang/test/CodeGenCUDA | |
| parent | 34264e17699d56deb8051de2f9ae28abb948bb05 (diff) | |
| download | bcm5719-llvm-13e9b4d76851d987381d650f63fad1c272fc0239.tar.gz bcm5719-llvm-13e9b4d76851d987381d650f63fad1c272fc0239.zip | |
[CUDA] Improve target attribute checking for function templates.
* __host__ __device__ functions are no longer considered to be
redeclarations of __host__ or __device__ functions. This prevents
unintentional merging of target attributes across them.
* Function target attributes are not considered (and must match) during
explicit instantiation and specialization of function templates.
Differential Revision: https://reviews.llvm.org/D25809
llvm-svn: 288962
Diffstat (limited to 'clang/test/CodeGenCUDA')
| -rw-r--r-- | clang/test/CodeGenCUDA/launch-bounds.cu | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/test/CodeGenCUDA/launch-bounds.cu b/clang/test/CodeGenCUDA/launch-bounds.cu index 6c369c6f3f0..dda647ef361 100644 --- a/clang/test/CodeGenCUDA/launch-bounds.cu +++ b/clang/test/CodeGenCUDA/launch-bounds.cu @@ -36,7 +36,7 @@ Kernel3() { } -template void Kernel3<MAX_THREADS_PER_BLOCK>(); +template __global__ void Kernel3<MAX_THREADS_PER_BLOCK>(); // CHECK: !{{[0-9]+}} = !{void ()* @{{.*}}Kernel3{{.*}}, !"maxntidx", i32 256} template <int max_threads_per_block, int min_blocks_per_mp> @@ -45,7 +45,7 @@ __launch_bounds__(max_threads_per_block, min_blocks_per_mp) Kernel4() { } -template void Kernel4<MAX_THREADS_PER_BLOCK, MIN_BLOCKS_PER_MP>(); +template __global__ void Kernel4<MAX_THREADS_PER_BLOCK, MIN_BLOCKS_PER_MP>(); // CHECK: !{{[0-9]+}} = !{void ()* @{{.*}}Kernel4{{.*}}, !"maxntidx", i32 256} // CHECK: !{{[0-9]+}} = !{void ()* @{{.*}}Kernel4{{.*}}, !"minctasm", i32 2} @@ -58,7 +58,7 @@ __launch_bounds__(max_threads_per_block + constint, Kernel5() { } -template void Kernel5<MAX_THREADS_PER_BLOCK, MIN_BLOCKS_PER_MP>(); +template __global__ void Kernel5<MAX_THREADS_PER_BLOCK, MIN_BLOCKS_PER_MP>(); // CHECK: !{{[0-9]+}} = !{void ()* @{{.*}}Kernel5{{.*}}, !"maxntidx", i32 356} // CHECK: !{{[0-9]+}} = !{void ()* @{{.*}}Kernel5{{.*}}, !"minctasm", i32 258} |

