[CUDA] Update docs to reflect that we no longer define __NVCC__.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264208 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Justin Lebar 2016-03-23 22:43:10 +00:00
parent 552f3d8472
commit fe3378bb83

View File

@ -125,10 +125,9 @@ Detecting clang vs NVCC
Although clang's CUDA implementation is largely compatible with NVCC's, you may
still want to detect when you're compiling CUDA code specifically with clang.
This is tricky, because clang defines the ``__NVCC__`` macro, and because NVCC
may invoke clang as part of its own compilation process! For example, NVCC
uses the host compiler's preprocessor when compiling for device code, and that
host compiler may in fact be clang.
This is tricky, because NVCC may invoke clang as part of its own compilation
process! For example, NVCC uses the host compiler's preprocessor when
compiling for device code, and that host compiler may in fact be clang.
When clang is actually compiling CUDA code -- rather than being used as a
subtool of NVCC's -- it defines the ``__CUDA__`` macro. ``__CUDA_ARCH__`` is
@ -146,6 +145,8 @@ compilation, in host and device modes:
// clang compiling CUDA code, device mode.
#endif
Both clang and nvcc define ``__CUDACC__`` during CUDA compilation. You can
detect NVCC specifically by looking for ``__NVCC__``.
Optimizations
=============