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

Jacques Pienaar jpienaar at google.com
Tue Feb 24 10:34:12 PST 2015


In http://reviews.llvm.org/D7841#129039, @rnk wrote:

> I'm surprised this change doesn't break the cuda codegen pipeline, because there aren't any changes to CodeGen in this patch. This is specifically relaxing the case of a host+device function calling host while in device mode. It's not actually possible to codegen this function, right? Is codegen already set up to compile this case to runtime error?


Yes, what happens is that the host function becomes a declaration in the generated LLVM IR and is treated as an extern function in the generated PTX. If a call on the device from host device function to a host function were possible then it would result in a compilation error when the PTX gets compiled at runtime.


http://reviews.llvm.org/D7841

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






More information about the cfe-commits mailing list