[CUDA] Unbreak CUDA compilation with -std=c++20
authorArtem Belevich <tra@google.com>
Thu, 19 Nov 2020 18:06:57 +0000 (10:06 -0800)
committerArtem Belevich <tra@google.com>
Thu, 19 Nov 2020 18:35:47 +0000 (10:35 -0800)
commit9a465057a64dba8a8614424d26136f5c0452bcc3
treef56863761f8bbfa1af0129b4cab8d9f14c9459d8
parent332710e70428d7a587d32de9fda833748d408944
[CUDA] Unbreak CUDA compilation with -std=c++20

Standard libc++ headers in stdc++ mode include <new> which picks up
cuda_wrappers/new before any of the CUDA macros have been defined.

We can not include CUDA headers that early, so the work-around is to define
__device__ in the wrapper header itself.

Differential Revision: https://reviews.llvm.org/D91807
clang/lib/Headers/cuda_wrappers/new