[CUDA] Added conversion functions to builtin vars.
authorArtem Belevich <tra@google.com>
Thu, 24 Sep 2020 17:47:45 +0000 (10:47 -0700)
committerArtem Belevich <tra@google.com>
Thu, 24 Sep 2020 21:33:04 +0000 (14:33 -0700)
commit30514f0afa3ee1e6da6bf9c41e83c28e884f0740
tree1210b78f41828d5e5bad1bb36d496d76ba6b3766
parent2a96f47c5ffca84cd774ad402cacd137f4bf45e2
[CUDA] Added conversion functions to builtin vars.

This is needed to compile some headers in CUDA-11 that assume that threadIdx is
implicitly convertible to dim3. With NVCC, threadIdx is uint3 and there's
dim3(uint3) constructor. Clang uses a special type for the builtin variables, so
that path does not work. Instead, this patch adds conversion function to the
builtin variable classes. that will allow them to be converted to dim3 and uint3.

Differential Revision: https://reviews.llvm.org/D88250
clang/lib/Headers/__clang_cuda_builtin_vars.h
clang/lib/Headers/__clang_cuda_runtime_wrapper.h