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

Jacques Pienaar jpienaar at google.com
Mon Feb 23 15:06:21 PST 2015


Hi rnk,

nvcc allows host device functions to call host functions with only a warning being produced (host device functions calling device functions is an error in nvcc). This nvcc feature (calling host functions from host device functions) is used by some existing GPU code. Add an option to clang to allow similar behavior. This does not affect code generation and trying to call a host function from the GPU is still an error. We are investigating a more complete solution that would avoid this but this is a first step to allow tools analyzing GPU code to accept the same code as nvcc does.

http://reviews.llvm.org/D7841

Files:
  include/clang/Basic/DiagnosticSemaKinds.td
  include/clang/Basic/LangOptions.def
  include/clang/Driver/CC1Options.td
  lib/Frontend/CompilerInvocation.cpp
  lib/Sema/SemaCUDA.cpp
  test/SemaCUDA/function-target.cu

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D7841.20545.patch
Type: text/x-patch
Size: 7298 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150223/091a26a0/attachment.bin>


More information about the cfe-commits mailing list