]> granicus.if.org Git - clang/commit
[CUDA] Make touching a kernel from a __host__ __device__ function a deferred error.
authorJustin Lebar <jlebar@google.com>
Wed, 12 Oct 2016 01:30:08 +0000 (01:30 +0000)
committerJustin Lebar <jlebar@google.com>
Wed, 12 Oct 2016 01:30:08 +0000 (01:30 +0000)
commitf3d02c144a250d213f6e2882eea6d1e3ca5a995c
treed963bab1b39962f2ecc34be93f7523f699038146
parent683bf4db05fb5149c1f2bc3e8c508938ad6dccfa
[CUDA] Make touching a kernel from a __host__ __device__ function a deferred error.

Previously, this was an immediate, don't pass go, don't collect $200
error.  But this precludes us from writing code like

  __host__ __device__ void launch_kernel() {
    kernel<<<...>>>();
  }

Such code isn't wrong, following our notions of right and wrong in CUDA,
unless it's codegen'ed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@283963 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/SemaCUDA.cpp
test/SemaCUDA/function-overload-hd.cu [new file with mode: 0644]
test/SemaCUDA/function-overload.cu
test/SemaCUDA/reference-to-kernel-fn.cu