summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeTestCUDACompiler.cmake
Commit message (Collapse)AuthorAgeFilesLines
* enable_language: Assume compiler works if ABI detection compilesBrad King2020-05-251-51/+51
| | | | | | | | | | | | | | | We run a `try_compile` with a tiny test source to check if the compiler works so that we can fail early if it does not. When the compiler does work, we immediately `try_compile` the ABI detection source. In the common case that both steps work, we gain no useful information from the first one and the work was wasted. Re-order the checks to try the ABI detection first. If it works then assume the compiler works and skip the dedicated check. If the ABI check fails then proceed with the normal test for a working compiler so the diagnostic can be shown as before. Fixes: #18703
* CUDA: Refactor implicit library filteringBrad King2020-05-221-15/+3
| | | | | | Filter CMAKE_CUDA_HOST_IMPLICIT_LINK_LIBRARIES just after it is computed. Re-use the same exclusion list for filtering CMAKE_CUDA_IMPLICIT_LINK_LIBRARIES to avoid duplication.
* CUDA: Add support for Clang compilerRaul Tambre2020-05-151-2/+7
| | | | | | | | | | | | | | | | | | | When crosscompiling we pass the sysroot. We need to try various architecture flags. Clang doesn't automatically select one that works. First try the ones that are more likely to work for modern installations: * <=sm_50 is deprecated since CUDA 10.2, try sm_52 first for future compatibility. * <=sm_20 is removed since CUDA 9.0, try sm_30. Otherwise fallback to Clang's current default. Currently that's `sm_20`, the lowest it supports. Separable compilation isn't supported yet. Fixes: #16586
* CUDA: Remove toolkit include dirs from implicit include dirs only with NVIDIABrad King2020-05-151-10/+12
| | | | | | | | | | The special case added by commit 87df637078 (CUDA: Do not treat CUDA toolkit include directories as implicit, 2020-02-02, v3.17.0-rc1~31^2) breaks CMake's protections against changing the compiler's implicit include directory order. Do this only for the NVIDIA compiler where it is needed as a workaround to another problem. That compiler does not put the host compiler's implicit include directories in `-I` paths so we do not detect them as `CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES` anyway.
* CUDA: Do not treat CUDA toolkit include directories as implicitRobert Maynard2020-02-031-0/+12
| | | | | | | | | CMake properly detects the toolkit directories as implicit system includes, but CUDA compilers don't add explicit `-isystem` markups to these directories when compiling CUDA code. Due to this limitation, allow users to explicitly specify these directories as SYSTEM dirs. Fixes: #16464, #19864
* CUDA: Add abstraction for cuda runtime selectionRobert Maynard2020-01-271-0/+11
| | | | | Fixes #17559 Replace our hard-coded default of cudart=static with a first-class abstraction to select the runtime library from an enumeration of logical names.
* CUDA: Add cuda meta-features (e.g. ``cuda_std_11``) supportRobert Maynard2019-12-101-0/+3
|
* Refactor: Use added message types in various modulesAlex Turbov2019-11-021-3/+3
| | | | Co-Authored-By: Craig Scott <craig.scott@crascit.com>
* Maint: misc. typosluz.paz2018-02-161-1/+1
| | | | Found via `codespell`
* Improve formatting of compiler failure error messageBrad King2017-09-191-2/+3
| | | | | | When we report that a compiler was unable to build a simple test program, indent the output of the attempt so that our message formatting will show it as a pre-formatted block.
* CUDA: Detect implicit link information on WindowsBrad King2017-01-121-0/+5
| | | | | The `nvcc -v` output on Windows uses response files, so load the one we need to extract the full link line.
* CUDA: We now properly perform CUDA compiler identification.Robert Maynard2016-11-141-0/+13
|
* CUDA: Add basic CUDA language support for *NIX systems.Robert Maynard2016-11-141-0/+58