2
0
mirror of https://github.com/boostorg/predef.git synced 2026-01-19 04:22:14 +00:00
Benjamin Worpitz 07df9dd360 Always define BOOST_COMP_NVCC instead of BOOST_COMP_NVCC_EMULATED (#84)
Currently BOOST_COMP_NVCC is never set but always BOOST_COMP_NVCC_EMULATED
because the NVCC preprocessor emulates the host compiler being used
(gcc/clang/msvc/...) which are detected earlier.

The nvcc compilation process is somewhat special as can be read here:
https://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html#cuda-compilation-trajectory
The nvcc compiler precompiles the input two times. Once for the device code
being compiled by the cicc device compiler and once for the host code
compiled by the real host compiler. NVCC uses gcc/clang/msvc/...
depending on the host compiler being set on the command line.

Predef (as a preprocessor only lib) detects the one doing the preprocessing
as compiler and expects it to be the one doing the real compilation.
This is not true for NVCC which is only doing the preprocessing and which
is using another compiler for parts of its work. So for NVCC it should be
allowed to set BOOST_COMP_NVCC additionally to the already detected host
compiler because both is true: It is gcc/clang/... compiling the code, but it
is also NVCC doing th preprocessing and adding some other quirks you may
want to detect.

This behavior is similar to what boost config is doing in `select_compiler_config.hpp`.
There the NVCC detection is not handled as a real compiler (part of the
#if-#elif) but as additional option before the real compiler.
2018-08-30 14:41:44 -05:00
2018-08-25 23:36:20 -05:00
2014-08-18 15:09:00 +01:00
2014-01-02 21:18:34 -06:00
2018-08-25 23:36:20 -05:00
2018-08-25 23:36:20 -05:00
Description
Mirrored via gitea-mirror
1.5 MiB
Languages
C 87.2%
C++ 10.5%
CMake 0.9%
Shell 0.8%
Objective-C++ 0.2%
Other 0.4%