hanchenye-llvm-project/clang/test/SemaCUDA
Justin Lebar ba122ab42f [CUDA] Make unattributed constexpr functions implicitly host+device.
With this patch, by a constexpr function is implicitly host+device
unless:

 a) it's a variadic function (variadic functions are not allowed on the
    device side), or
 b) it's preceeded by a __device__ overload in a system header.

The restriction on overloading __host__ __device__ functions on the
basis of their CUDA attributes remains in place, but we use (b) to allow
us to define __device__ overloads for constexpr functions in cmath,
which would otherwise be __host__ __device__ and thus not overloadable.

You can disable this behavior with -fno-cuda-host-device-constexpr.

Reviewers: tra, rnk, rsmith

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D18380

llvm-svn: 264964
2016-03-30 23:30:21 +00:00
..
Inputs [CUDA] Make unattributed constexpr functions implicitly host+device. 2016-03-30 23:30:21 +00:00
alias.cu [CUDA] Reject the alias attribute in CUDA device code. 2016-01-23 21:28:10 +00:00
amdgpu-num-gpr-attr.cu
asm-constraints-device.cu
asm-constraints-mixed.cu Produce a better diagnostic for global register variables. 2015-11-18 00:15:28 +00:00
attributes-on-non-cuda.cu [CUDA] Report an error if code tries to mix incompatible CUDA attributes. 2016-01-13 01:07:35 +00:00
bad-attributes.cu [CUDA] Only allow __global__ on free functions and static member functions. 2016-01-20 00:26:57 +00:00
builtins.cu [CUDA] Remove three obsolete CUDA cc1 flags. 2016-03-29 16:24:16 +00:00
config-type.cu
cuda-builtin-vars.cu [CUDA] Don't specify exact line numbers in cuda-builtin-vars.cu. 2016-02-24 21:49:30 +00:00
cxx11-kernel-call.cu [CUDA] Warn undeclared identifiers in CUDA kernel calls 2016-01-14 23:31:30 +00:00
function-overload.cu [CUDA] Remove three obsolete CUDA cc1 flags. 2016-03-29 16:24:16 +00:00
function-target.cu
host-device-constexpr.cu [CUDA] Make unattributed constexpr functions implicitly host+device. 2016-03-30 23:30:21 +00:00
implicit-copy.cu
implicit-intrinsic.cu [CUDA] Remove three obsolete CUDA cc1 flags. 2016-03-29 16:24:16 +00:00
implicit-member-target-collision-cxx11.cu [CUDA] Remove three obsolete CUDA cc1 flags. 2016-03-29 16:24:16 +00:00
implicit-member-target-collision.cu
implicit-member-target.cu
kernel-call.cu [CUDA] Warn undeclared identifiers in CUDA kernel calls 2016-01-14 23:31:30 +00:00
launch_bounds.cu [cuda] Allow using integral non-type template parameters as launch_bounds attribute arguments. 2015-04-21 22:55:54 +00:00
lit.local.cfg
method-target.cu [CUDA] Remove three obsolete CUDA cc1 flags. 2016-03-29 16:24:16 +00:00
no-host-device-constexpr.cu [CUDA] Make unattributed constexpr functions implicitly host+device. 2016-03-30 23:30:21 +00:00
qualifiers.cu [cuda] Preserve TLS storage class of host variable even if it's a 2015-04-28 20:31:49 +00:00
vararg.cu [CUDA] Don't allow templated variadic functions. 2016-03-22 22:06:19 +00:00