]> granicus.if.org Git - clang/commit
[CUDA] Add hack so code which includes "curand.h" doesn't break.
authorJustin Lebar <jlebar@google.com>
Wed, 24 Feb 2016 21:49:31 +0000 (21:49 +0000)
committerJustin Lebar <jlebar@google.com>
Wed, 24 Feb 2016 21:49:31 +0000 (21:49 +0000)
commit5a68fbd86b5d46737cb456194701fb25474ee87d
treecc677853d221f78c46efa9ab213e6705f59e60cf
parente672b73d4c186bd08189ec473f6ad43f21920165
[CUDA] Add hack so code which includes "curand.h" doesn't break.

Summary:
curand.h includes curand_mtgp32_kernel.h.  In host mode, this header
redefines threadIdx and blockDim, giving them their "proper" types of
uint3 and dim3, respectively.

clang has its own plan for these variables -- their types are magic
builtin classes.  So these redefinitions are incompatible.

As a hack, we force-include the offending CUDA header and use #defines
to get the right types for threadIdx and blockDim.

Reviewers: tra

Subscribers: echristo, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261776 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Headers/__clang_cuda_runtime_wrapper.h