Smarter handling of CUDA unsupported compilers / always using allow-unsupported-compiler
Is your feature request related to a problem? Please describe.
For anyone doing development, it is more than annoying to have to add -allow-unsupported-compiler to handle recent GCC or LLVM or to test with old CUDA versions. As far as I know, we have never hit an incompatibility for our flavors of CUDA usage, and this has only cost us our time. This may also be required to use OpenMP target offload in production since it needs recent compilers to have any chance of sufficient performance and/or correctness.
SET(CUDA_NVCC_FLAGS "-allow-unsupported-compiler;${CUDA_NVCC_FLAGS}")
Describe the solution you'd like
Either:
- Do a test compile with nvcc, and if the unsupported warning is hit, print a "Make sure you know what you are doing" warning and add the allow-unsupported-compiler flag.
- (Quick route) Permanently add the allow-unsupported-compiler flag.
Describe alternatives you've considered
Keep editing CMakeLists.txt or modifying build scripts.
It needs to be an option not on by default. nvcc checks host compiler for good reason. Host compiler may not have compatible header files. More likely in C++. I have been bitten by this in the past. I always use GCC as host compiler for nvcc, so this flag is not must.
changed my view and implemented in #3957