[PATCH] D16261: [CUDA] Only allow __global__ on free functions and static member functions.

Justin Lebar via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 19 13:12:51 PST 2016


jlebar added a comment.

Thank you for the review.


================
Comment at: include/clang/Basic/DiagnosticSemaKinds.td:6418
@@ +6417,3 @@
+def warn_nvcc_compat_kern_is_method : Warning<
+  "kernel function %0 is a member function; this may not be accepted by nvcc">,
+  InGroup<CudaCompat>;
----------------
tra wrote:
> There's an Extension<> tablegen class used to report various C and C++ extensions.
> This looks like a good use case for it.
I'll also check that the rest of the CudaCompat warnings here shouldn't be Extension<>s.

================
Comment at: include/clang/Basic/DiagnosticSemaKinds.td:6421
@@ +6420,3 @@
+def warn_nvcc_compat_kern_is_inlined : Warning<
+  "kernel function %0 is inlined; this may not be accepted by nvcc">,
+  InGroup<CudaCompat>;
----------------
tra wrote:
> Perhaps we should use the same message as nvcc here:
> 'inline qualifier ignored for "global" function'
Ah, yes, given that it's not an nvcc error, we should just warn.  (Or even not say anything at all; it seems like a silly warning.)


http://reviews.llvm.org/D16261





More information about the cfe-commits mailing list