summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeCUDAInformation.cmake
Commit message (Collapse)AuthorAgeFilesLines
* CUDA: Support CMP0105 on ClangRaul Tambre2021-11-081-1/+1
| | | | | | | Add link flags during the "device compile" step. Enabled the relevant tests. The disable reasons regarding separable compilation were outdated and the actual failure case was device link flags support.
* CUDA: Allow both CUDA_SEPARABLE_COMPILATION and CUDA_PTX_COMPILATIONRobert Maynard2021-10-201-16/+3
| | | | | | The target properties `CUDA_SEPARABLE_COMPILATION` and `CUDA_PTX_COMPILATION` now aren't mutually exclusive and can now be used together on the same target.
* LINK_WHAT_YOU_USE feature: externalize configurationMarc Chevrier2021-07-091-0/+9
| | | | | | | | Currently, this feature is only supported on ELF platforms. So, the property LINK_WHAT_YOU_USE will be ignored for other plateforms. Moreover, flags and commands are now controled by CMake variables. Fixes: #20174
* CUDA: Implement CMAKE_USER_MAKE_RULES_OVERRIDE[_CUDA]Seth R Johnson2021-06-221-0/+19
| | | | | This is implemented by other languages, and is documented for all languages. This was accidentally left out of CUDA.
* CUDA: Add CMAKE_CUDA_HOST_COMPILER support on Windows non-VS generatorsunknown2021-04-221-7/+0
|
* Merge topic 'cuda-depfile-ccbin'Brad King2021-04-081-0/+3
|\ | | | | | | | | | | | | | | | | 8e38985db7 Makefiles: Fix dependency extraction with CUDA < 10.2 and host compiler Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Raul Tambre <raul@tambre.ee> Acked-by: Robert Maynard <robertjmaynard@gmail.com> Merge-request: !5992
| * Makefiles: Fix dependency extraction with CUDA < 10.2 and host compilerBrad King2021-04-071-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit 2c71d051fa (Makefiles Generators: use compiler for dependencies generation, 2020-10-18, v3.20.0-rc1~392^2) we invoke `nvcc` for CUDA < 10.2 a second time in order to generate a depfile. When `CMAKE_CUDA_HOST_COMPILER` is set, the second invocation is missing its `-ccbin=` option, even after refactoring in commit 8981e3e7cc (NVIDIA-CUDA: rely on new capabilities for deps generation, 2020-12-02, v3.20.0-rc1~362^2). Ideally we should move the `-ccbin=` flag into `Compiler/NVIDIA-CUDA`, but that will add `CMAKE_CUDA_HOST_COMPILER` support on Windows in command-line generators but not the Visual Studio generators. For now, add the flag to the depfile command specifically. Fixes: #22037
* | CUDA: Fix spelling __IMPLICT_ -> __IMPLICIT_Raul Tambre2021-02-141-16/+16
|/
* NVIDIA-CUDA: rely on new capabilities for deps generationMarc Chevrier2020-12-021-15/+0
|
* CUDA: Clang separable compilationRaul Tambre2020-09-241-1/+6
| | | | | | | | | | | | For NVCC the compiler takes care of device linking when passed the "-dlink" flag. Clang doesn't support such magic and requires the buildsystem to do the work that NVCC does behind the scenes. The implementation is based on Bazel's device linking documentation: https://github.com/tensorflow/tensorflow/blob/7cabcdf073abad8c46e9dda62bb8fa4682d2061e/third_party/nccl/build_defs.bzl.tpl#L259 Closes: #20726
* CUDA: Add support for Clang compilerRaul Tambre2020-05-151-13/+14
| | | | | | | | | | | | | | | | | | | 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: Device linking use now link optionsMarc Chevrier2020-04-191-3/+2
| | | | | | | | | | properties LINK_OPTIONS and INTERFACE_LINK_OPTIONS are propagated to the device link step. To control which options are selected for normal link and device link steps, the $<DEVICE_LINK> and $<HOST_LINK> generator expressions can be used. Fixes: #18265
* CUDA: Refactor PTX compilation flag into compiler modulesRaul Tambre2020-04-071-1/+1
|
* Modules: Collapse consecutive whitespace in stringsDaan De Meyer2020-03-231-1/+1
|
* CUDA: Abstract language flag to compiler modulesRaul Tambre2020-03-111-5/+5
| | | | | Separate this detail out into compiler-specific modules. Required for Clang support, as it uses slightly different language flags.
* Merge topic 'cuda_updates_for_10.2'Brad King2019-12-091-18/+10
|\ | | | | | | | | | | | | | | 5341f5e4a1 CUDA: get header deps from compiler invocation when possible 7f15c99851 CUDA: forward unknown flags to host compiler when possible. Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4099
| * CUDA: get header deps from compiler invocation when possibleRobert Maynard2019-11-291-2/+2
| | | | | | | | | | Before CUDA 10.2 `nvcc` didn't support providing header dependency information while compiling.
| * CUDA: forward unknown flags to host compiler when possible.Robert Maynard2019-11-291-16/+8
| | | | | | | | | | | | | | | | | | | | Starting with CUDA 10.2 the nvcc compiler has gained support to automatically forward unknown flags to the host compiler. This behavior is highly desired as projcts that mix CUDA, C, C++ run into situation where flags such as `-pthread` which aren't supported by nvcc, are being applied to all source files and therefore break CUDA compilation.
* | launcher: support setting a compiler launcher through the environmentBen Boeckel2019-12-051-0/+5
|/ | | | | | This makes it much easier to use a launcher for all CMake projects in an environment rather than having to remember to pass the setting to every CMake build.
* CUDA: Compilers can now state they don't require a device linking stepRobert Maynard2019-08-061-1/+2
|
* CUDA: Avoid using deprecated cublas_device to identify device lib dirsRobert Maynard2018-08-231-1/+1
| | | | | | | Use `curand_static` to identify directories containing device libraries because `cublas_device` is deprecated and will be removed in the future. Issue: #18290
* CUDA: Drop unused/broken platform link flags placeholderBrad King2018-05-251-3/+3
| | | | | | | | | | | | | | | | The `<CMAKE_CUDA_LINK_FLAGS>` placeholder in CUDA rule variables comes from the `<CMAKE_CXX_LINK_FLAGS>` placeholder from which the CUDA rule variables were originally derived. It is not a public interface for adding link flags so no projects should be using it. It is needed for platform information modules to specify platform-specific link flags for the language. None of our platform modules set it, so it is unused. Furthermore, it is broken as currently implemented. Some of the contexts in which it is used need `-Xlinker` and some do not. Therefore it is not possible to use the placeholder at all. Simply remove it for now. If some need for platform-specific CUDA link flags arises a new solution will be needed.
* Modules: Introduce CMAKE_EFFECTIVE_SYSTEM_NAME to lookup compiler infoGregor Jasny2018-04-181-2/+2
| | | | | | | | | Create a `CMAKE_EFFECTIVE_SYSTEM_NAME` variable to use for looking up compiler information modules instead of using `CMAKE_SYSTEM_NAME` directly. This will allow multiple platforms to share the same set of compiler information modules without spelling out all of them. Issue: #17870
* CUDA: Pass host linker directories to device linkerBrad King2018-03-281-2/+16
| | | | | | | | | In some environments, libraries containing device code are installed in directories searched by the host linker but not passed by nvcc to nvlink. Make these libraries available by explicitly passing the host linker search directories during device linking. Issue: #16317
* Unhardcode the CMAKE_CONFIGURATION_TYPES valuesBeren Minor2018-01-081-25/+1
| | | | | | | | | | | | This removes duplicated code for per-config variable initialization by providing a `cmake_initialize_per_config_variable(<PREFIX> <DOCSTRING>)` function. This function initializes a `<PREFIX>` cache variable from `<PREFIX>_INIT` and unless the `CMAKE_NOT_USING_CONFIG_FLAGS` variable is defined, does the same with `<PREFIX>_<CONFIG>` from `<PREFIX>_<CONFIG>_INIT` for every `<CONFIG>` in `CMAKE_CONFIGURATION_TYPES` for multi-config generators or `CMAKE_BUILD_TYPE` for single-config generators.
* CUDA: Pass host compiler to nvcc while device linkingMaikel van den Hurk2017-08-151-2/+2
|
* CUDA: CMAKE_EXPORT_COMPILE_COMMANDS now works with CUDA and NinjaRobert Maynard2017-07-131-1/+3
| | | | Fixes: #17061
* CUDA: When linking device code suppress CUDA 8.0+ deprecation warningsRobert Maynard2017-06-131-2/+11
| | | | | | The CUDA compiler automatic deprecation warnings are pure noise when doing device linking, and should be suppressed to reduce the amount of confusion from users.
* CUDA: Link to standard system libraries when linking as CUDABrad King2017-02-141-0/+6
| | | | | | | On Windows with MSVC-like host compilers we must honor the standard libraries chosen by the `Platform/Windows-MSVC` module. Otherwise C code linked into the CUDA binary that expects to have these libraries available may not link.
* CUDA: Now pass correct FLAGS when device link cuda executables.Robert Maynard2017-01-121-1/+1
| | | | | | | | Previously we had a two issues when building cuda executables that required separable compilation. The first was that we didn't propagate FLAGS causing any -arch / -gencode flags to be dropped, and secondly generators such as ninja would use the CXX language flags instead of CUDA when the executable was mixed language.
* CUDA: Use `.obj` object file extension on WindowsBrad King2017-01-121-1/+5
|
* CUDA: Allow platform files to set device linking rulesBrad King2017-01-121-5/+8
| | | | | Condition the default settings on the rule variables not already being set.
* CUDA: Refactor CMakeCUDAInformation to prepare for separable compilation.Robert Maynard2016-11-141-9/+66
|
* CUDA: Use the host compiler for linking CUDA executables and shared libs.Robert Maynard2016-11-141-3/+15
|
* CUDA: add support for specifying an explicit host compiler.Robert Maynard2016-11-141-4/+10
|
* CUDA: Enable header dependency scanning.Robert Maynard2016-11-141-1/+14
|
* CUDA: We now properly perform CUDA compiler identification.Robert Maynard2016-11-141-4/+0
|
* CUDA: Explicitly state all source files are cuda sources.Robert Maynard2016-11-141-1/+1
| | | | | This way you can mark a .C/.CPP files as a cuda source file and have nvcc build it as a cuda file.
* CUDA: Add basic CUDA language support for *NIX systems.Robert Maynard2016-11-141-0/+109