[PATCH] D14000: [CUDA] Allow code generation for functions with target attributes that don't match compilation mode.

Artem Belevich via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 22 15:56:14 PDT 2015


tra created this revision.
tra added reviewers: eliben, jingyue, jpienaar, echristo.
tra added a subscriber: cfe-commits.

Currently -fcuda-disable-target-call-checks option enables parsing of code that calls across host/device boundary.
However, we don't emit any IR for functions that don't have attributes appropriate for the current compilation mode, so such cross-calls always fail at runtime due to unresolved references.

The patch allows CodeGen to emit non-matching functions if they are needed to resolve references in the current module.

This feature is enabled by -fcuda-disable-target-call-checks

The patch makes it possible for device side to use host unmodified includes that provide unattributed functions. 
For instance, it allows use of larger subset of standard C++ library headers.


http://reviews.llvm.org/D14000

Files:
  lib/CodeGen/CodeGenModule.cpp
  lib/CodeGen/CodeGenModule.h
  test/CodeGenCUDA/cross-call.cu
  test/CodeGenCUDA/host-device-calls-host.cu

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14000.38181.patch
Type: text/x-patch
Size: 7530 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20151022/0e556029/attachment.bin>


More information about the cfe-commits mailing list