Commit Graph

5 Commits

Author SHA1 Message Date
Justin Lebar aa370bd0d7 [CUDA] Disallow __shared__ variables in host functions.
Reviewers: tra, rnk

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D25143

llvm-svn: 284144
2016-10-13 18:45:13 +00:00
Justin Lebar e71b2fa4c9 [CUDA] Disallow __constant__ local variables.
Reviewers: tra, rnk

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D25129

llvm-svn: 282986
2016-09-30 23:57:34 +00:00
Justin Lebar 1041101953 [CUDA] Disallow 'extern __shared__' variables.
Also add a test that we disallow

  __constant__ __shared__ int x;

because it's possible to break this without breaking

  __shared__ __constant__ int x;

Reviewers: rnk

Subscribers: cfe-commits, tra

Differential Revision: https://reviews.llvm.org/D25125

llvm-svn: 282985
2016-09-30 23:57:30 +00:00
Justin Lebar c66a10652a [CUDA] Only allow __global__ on free functions and static member functions.
Summary:
Warn for NVCC compatibility if you declare a static member function or
inline function as __global__.

Reviewers: tra

Subscribers: jhen, echristo, cfe-commits

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

llvm-svn: 258263
2016-01-20 00:26:57 +00:00
Justin Lebar 3eaaf86397 [CUDA] Report an error if code tries to mix incompatible CUDA attributes.
Summary: Thanks to jhen for helping me figure this out.

Reviewers: tra, echristo

Subscribers: jhen

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

llvm-svn: 257554
2016-01-13 01:07:35 +00:00