<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 23, 2016 at 3:42 PM, Justin Lebar via cfe-commits <span dir="ltr"><<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: jlebar<br>
Date: Wed Mar 23 17:42:27 2016<br>
New Revision: 264205<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=264205&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=264205&view=rev</a><br>
Log:<br>
[CUDA] Don't define __NVCC__.<br>
<br>
Summary:<br>
We decided this makes life too difficult for code authors.  For example,<br>
people may want to detect NVCC and disable variadic templates, which<br>
NVCC does not support, but which we do.<br></blockquote><div><br></div><div>This seems like a different tradeoff from the one Clang made for GCC compatibility (we define all the GCC macros, but then also define others so people can detect Clang). If people were just disabling features that NVCC didn't support, that seems fairly harmless - what sort of problems/difficulties did this create?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Since people are going to have to change compiler flags *anyway* in<br>
order to compile with clang, if they really want the old behavior, they<br>
can pass -D__NVCC__.<br>
<br>
Tested with tensorflow and thrust, no apparent problems.<br>
<br>
Reviewers: tra<br>
<br>
Subscribers: cfe-commits<br>
<br>
Differential Revision: <a href="http://reviews.llvm.org/D18417" rel="noreferrer" target="_blank">http://reviews.llvm.org/D18417</a><br>
<br>
Modified:<br>
    cfe/trunk/lib/Headers/__clang_cuda_runtime_wrapper.h<br>
<br>
Modified: cfe/trunk/lib/Headers/__clang_cuda_runtime_wrapper.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/__clang_cuda_runtime_wrapper.h?rev=264205&r1=264204&r2=264205&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/__clang_cuda_runtime_wrapper.h?rev=264205&r1=264204&r2=264205&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Headers/__clang_cuda_runtime_wrapper.h (original)<br>
+++ cfe/trunk/lib/Headers/__clang_cuda_runtime_wrapper.h Wed Mar 23 17:42:27 2016<br>
@@ -199,7 +199,6 @@ static inline __device__ void __brkpt(in<br>
 // Set up compiler macros expected to be seen during compilation.<br>
 #undef __CUDABE__<br>
 #define __CUDACC__<br>
-#define __NVCC__<br>
<br>
 #if defined(__CUDA_ARCH__)<br>
 // We need to emit IR declaration for non-existing __nvvm_reflect() to<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div></div>