[PATCH] D24975: [CUDA] Add #pragma clang force_cuda_host_device_{begin, end} pragmas.

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 27 15:39:28 PDT 2016


rsmith added a comment.

Please add serialisation code for the push count for PCH. Should it be an error if the count is nonzero at the end of the TU?

What happens if there are trailing tokens after the pragma?


================
Comment at: clang/include/clang/Basic/DiagnosticParseKinds.td:1027
@@ +1026,3 @@
+def warn_pragma_force_cuda_host_device_bad_arg : Warning<
+  "Incorrect use of #pragma clang force_cuda_host_device begin|end">;
+
----------------
Diagnostics should start with a lowercase letter.

================
Comment at: clang/test/Parser/cuda-force-host-device-templates.cu:8
@@ +7,3 @@
+template <typename T>
+T foo() {  // expected-note {{declared here}}
+  return T();
----------------
You need this to return `auto` to trigger the eager instantiation codepath I was concerned about.


https://reviews.llvm.org/D24975





More information about the cfe-commits mailing list