summaryrefslogtreecommitdiffstats
path: root/Modules/FindCUDAToolkit.cmake
Commit message (Collapse)AuthorAgeFilesLines
* CudaToolkit: Update for new/removed libraries in CUDA 11Robert Maynard2020-06-181-1/+5
|
* CUDA: Determine CUDA toolkit location for NVCCRaul Tambre2020-06-121-1/+1
| | | | | Similar to how we already do for Clang. Avoids a lot of redundant work in FindCUDAToolkit.
* CUDA: Pass toolkit path to ClangRaul Tambre2020-06-121-115/+126
| | | | | | | | | | | | | | | | | | | | | | | | | Clang isn't very good at finding the installed CUDA toolkit. The upstream recommendation is that we should pass the toolkit explicitly. Additionally: * Avoids Clang having to search for the toolkit on every invocation. * Allows the user to use a toolkit from a non-standard location by simply setting CUDAToolkit_ROOT. The same way as with FindCUDAToolkit. Clang wants the directory containing the device library and version.txt as the toolkit path. We thus pass the newly introduced CUDAToolkit_LIBRARY_ROOT as the toolkit path. We save CUDAToolkit_ROOT_DIR and CUDAToolkit_LIBRARY_ROOT on Clang to have them available in try_compile() and avoid unnecessary re-searching or a possibly different installation being found in FindCUDAToolkit. This however means that the selected toolkit can't be changed after the initial language enablement. We now determine CUDA compiler ID before doing actual detection, as we don't want to spend time finding the CUDA toolkit for NVIDIA. Implements #20754.
* FindCUDAToolkit: Avoid unnecessary temporary variable computing binary dirRaul Tambre2020-06-121-6/+4
|
* FindCUDAToolkit: Remove unnecessary checks around searchesRaul Tambre2020-06-121-15/+11
| | | | | find_*() don't search if the result variable is already set. Remove the if()s around such cases.
* FindCUDAToolkit: Use list(SORT) to sort in natural orderRaul Tambre2020-06-121-36/+4
| | | | | We had a custom loop to sort in the natural order. Since CMake 3.18 this is supported natively by CMake and simplifies the code significantly.
* FindCUDAToolkit: Compute CUDAToolkit_INCLUDE_DIR instead of searchingRaul Tambre2020-06-121-4/+7
| | | | | | | We can avoid searching for this since CUDAToolkit_TARGET_DIR always contains the include/ directory. But add a warning just in case. Also apply this in CMakeDetermineCUDACompiler for Clang code.
* FindCUDAToolkit: Add CUDAToolkit_LIBRARY_ROOTRaul Tambre2020-06-121-0/+15
| | | | | | | | | On scattered installations version.txt and nvvm are located at this location. This may be useful to users and will allow us in the future to parse version.txt instead of invoking nvcc to figure out the CUDA toolkit version. We also add it to CMakeDetermineCUDACompiler in preparation for future use by Clang code.
* FindCUDAToolkit: Re-unify with Internal/CUDAToolkitRaul Tambre2020-06-121-3/+211
| | | | | | | | | | | | | | | | A portion of FindCUDAToolkit was previously split in commit dc2eae1f (FindCUDAToolkit: Factor out discovery code into a separate file, 2020-04-22) out into Internal/CUDAToolkit to allow re-use of the code in CMakeDetermineCUDACompiler for Clang support. This has turned out to be a bad solution due to Clang requiring quite a bit of special handling and special handling for NVCC leaking out from Internal/CUDAToolkit into the Clang code using it. Thus it seems better to re-unify this code and duplicate the parts of the code necessary for Clang where it's required. This will help us get logic correct for both NVCC and CUDA handling. We can still unify the common parts in the future once the code has matured.
* FindCUDAToolkit: Fix cudart not found status messageRaul Tambre2020-06-081-4/+4
| | | | | | This ended up after the searching after commit dc2eae1 (FindCUDAToolkit: Factor out discovery code into a separate file, 2020-04-22). Move it back to where it was and should be.
* FindCUDAToolkit: Factor out discovery code into a separate fileRaul Tambre2020-05-151-218/+8
| | | | | | This allows for re-use in other parts of the code, that require the CUDA toolkit location, but can't or may not want to use the full `FindCUDAToolkit`.
* Merge topic 'FindCUDAToolkit-search-stubs'Brad King2020-04-151-2/+20
|\ | | | | | | | | | | | | 4f1e24efa0 FindCUDAToolkit searches stub location last Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4589
| * FindCUDAToolkit searches stub location lastRobert Maynard2020-04-141-2/+20
| | | | | | | | Fixes #20252
* | CUDAToolkit: Deduce toolkit binary directory from compiler path only for NVCCRaul Tambre2020-04-071-2/+2
|/ | | | | This assumption doesn't hold for Clang. When crosscompiling this causes X86 libraries to be used and thus linker errors.
* CUDAToolkit: Mark find queries as advanced variablesRobert Maynard2020-03-101-1/+8
| | | | Fixes #20435
* CUDAToolkit: Add support for cupti libraryRobert Maynard2020-02-061-1/+23
| | | | Fixes: #20318
* CUDAToolkit: Correct location of OpenCL doc linkRobert Maynard2020-02-061-2/+2
|
* CUDAToolkit: Add required static runtime library dependenciesRobert Maynard2020-01-301-0/+25
| | | | | CUDAToolkit now adds the correct libraries that are required by the static runtime.
* FindCUDAToolkit: Fix behavior on multiple callsRodolfo Lima2020-01-281-41/+22
| | | | | | | | | Update `_CUDAToolkit_find_and_add_import_lib` to create and add dependencies to a target in one step that shared a single guard against repeated definitions. Otherwise we were adding dependencies again on every call. Fixes: #20282
* FindCUDAToolkit: Fix CUDA::* target guard logicRodolfo Lima2020-01-281-4/+6
| | | | Issue: #20282
* CUDAToolkit: Use CMAKE_FIND_ROOT_PATH for all sdk lib searchesRobert Maynard2020-01-271-6/+18
|
* CUDAToolkit: Use HINTS as it has higher precedence for searchesRobert Maynard2020-01-241-1/+1
|
* CUDAToolkit: functions names now use CMake's reserved namespaceRobert Maynard2020-01-241-24/+24
|
* CUDAToolkit: Make sure to also search 'stubs' directoryRobert Maynard2020-01-231-2/+2
| | | | Fixes #20252
* CUDAToolkit: Add support for cross-compilingRobert Maynard2020-01-231-3/+43
| | | | | | | CUDAToolkit now searches the correct targets folder based on what platform we are cross-compiling for. Fixes: #20232
* CUDAToolkit: No targets now depend on the CUDA runtimeRobert Maynard2020-01-141-5/+0
| | | | | | It is not a requirement to have shared|static consistent across your CUDA libraries (e.g curand, nppc ) and your CUDA runtime library. It is entirely allowable to use a static nppc and a shared runtime.
* CUDAToolkit: Gracefully handle missing SDK componentsRobert Maynard2020-01-061-7/+8
|
* CUDAToolkit: add_cuda_link_dependency correctly sets dependenciesRobert Maynard2020-01-031-1/+1
|
* FindCUDAToolkit: correct searches for Toolkit componentsRobert Maynard2019-12-161-38/+61
|
* FindCUDAToolkit: Improve usage, library set, and testsRobert Maynard2019-12-161-66/+153
| | | | | | Refined the initial design of FindCUDAToolkit and improve it by adding more library support, more toolkit information and tests.
* FindCUDAToolkit: Import targets for toolkit librariesStephen McDowell2019-12-161-44/+345
|
* FindCUDAToolkit: Add module to find the CUDA ToolkitStephen McDowell2019-12-161-0/+374