[PATCH] CUDA: Add option to allow host device functions to call host functions

Reid Kleckner rnk at google.com
Tue Feb 24 10:33:14 PST 2015


================
Comment at: test/CodeGenCUDA/host-device-calls-host.cu:21
@@ +20,3 @@
+extern "C"
+__host__ __device__ void hd_function() {
+  host_function();
----------------
I think this is a more interesting test case:
  extern "C" {
  void host_function() {}
  __host__ __device__ void hd_function(bool b) { if (b) host_function(); }
  __device__ void device_function() { hd_function(false); }
  }

It actually tests emission of the bogus call, even though it can never occur in practice. What should clang do for that?

http://reviews.llvm.org/D7841

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the cfe-commits mailing list