[CUDA] Make __GCC_ATOMIC_XXX_LOCK_FREE macros the same on host/device.
authorJustin Lebar <jlebar@google.com>
Fri, 9 Sep 2016 20:35:43 +0000 (20:35 +0000)
committerJustin Lebar <jlebar@google.com>
Fri, 9 Sep 2016 20:35:43 +0000 (20:35 +0000)
commit5057f17716f0622e3237af141627fb0eeba76fa1
tree5f22934af09bb382fc4d40371ededc3af6afa051
parent92e33a3ebcb6e1912f7d4c5be17b5eb7b3c19b1a
[CUDA] Make __GCC_ATOMIC_XXX_LOCK_FREE macros the same on host/device.

Summary:
This fixes a bug where we were unable to compile the following CUDA
file with libstdc++ (didn't try libc++):

  #include <future>
  void foo() { std::shared_future<int> x; }

The problem is that <future> only defines std::shared_future if
__GCC_ATOMIC_INT_LOCK_FREE > 1.  When we compiled this file for device,
the macro was set to 1, and then the class didn't exist at all.

Reviewers: tra

Subscribers: cfe-commits, jhen

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

llvm-svn: 281089
clang/lib/Basic/Targets.cpp
clang/test/Preprocessor/cuda-types.cu