diff options
-rw-r--r-- | Help/release/3.27.rst | 3 | ||||
-rw-r--r-- | Modules/FindCUDAToolkit.cmake | 37 |
2 files changed, 31 insertions, 9 deletions
diff --git a/Help/release/3.27.rst b/Help/release/3.27.rst index db087fe..dadd7a6 100644 --- a/Help/release/3.27.rst +++ b/Help/release/3.27.rst @@ -129,7 +129,8 @@ Modules ------- * The :module:`FindCUDAToolkit` module now provides an imported target for - ``cudla``, if found. + ``cudla``, and imported targets for CUPTI's ``nvperf`` and ``pcsampling`` + components. * The :module:`FindDoxygen` module's :command:`doxygen_add_docs` command gained a ``CONFIG_FILE`` option to specify a custom doxygen configuration file. diff --git a/Modules/FindCUDAToolkit.cmake b/Modules/FindCUDAToolkit.cmake index 107ced7..9cf7e29 100644 --- a/Modules/FindCUDAToolkit.cmake +++ b/Modules/FindCUDAToolkit.cmake @@ -257,6 +257,13 @@ Targets Created: - ``CUDA::cupti`` - ``CUDA::cupti_static`` +.. versionadded:: 3.27 + + - ``CUDA::nvperf_host`` starting in CUDA 10.2 + - ``CUDA::nvperf_host_static`` starting in CUDA 10.2 + - ``CUDA::nvperf_target`` starting in CUDA 10.2 + - ``CUDA::pcsamplingutil`` starting in CUDA 11.3 + .. _`cuda_toolkit_NPP`: NPP @@ -1156,18 +1163,32 @@ if(CUDAToolkit_FOUND) mark_as_advanced(CUDAToolkit_CUPTI_INCLUDE_DIR) if(CUDAToolkit_CUPTI_INCLUDE_DIR) + set(_cmake_cupti_extra_paths extras/CUPTI/lib64/ + extras/CUPTI/lib/ + ../extras/CUPTI/lib64/ + ../extras/CUPTI/lib/) _CUDAToolkit_find_and_add_import_lib(cupti - EXTRA_PATH_SUFFIXES extras/CUPTI/lib64/ - extras/CUPTI/lib/ - ../extras/CUPTI/lib64/ - ../extras/CUPTI/lib/ + EXTRA_PATH_SUFFIXES ${_cmake_cupti_extra_paths} EXTRA_INCLUDE_DIRS "${CUDAToolkit_CUPTI_INCLUDE_DIR}") _CUDAToolkit_find_and_add_import_lib(cupti_static - EXTRA_PATH_SUFFIXES extras/CUPTI/lib64/ - extras/CUPTI/lib/ - ../extras/CUPTI/lib64/ - ../extras/CUPTI/lib/ + EXTRA_PATH_SUFFIXES ${_cmake_cupti_extra_paths} EXTRA_INCLUDE_DIRS "${CUDAToolkit_CUPTI_INCLUDE_DIR}") + if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL 10.2.0) + _CUDAToolkit_find_and_add_import_lib(nvperf_host + EXTRA_PATH_SUFFIXES ${_cmake_cupti_extra_paths} + EXTRA_INCLUDE_DIRS "${CUDAToolkit_CUPTI_INCLUDE_DIR}") + _CUDAToolkit_find_and_add_import_lib(nvperf_host_static + EXTRA_PATH_SUFFIXES ${_cmake_cupti_extra_paths} + EXTRA_INCLUDE_DIRS "${CUDAToolkit_CUPTI_INCLUDE_DIR}") + _CUDAToolkit_find_and_add_import_lib(nvperf_target + EXTRA_PATH_SUFFIXES ${_cmake_cupti_extra_paths} + EXTRA_INCLUDE_DIRS "${CUDAToolkit_CUPTI_INCLUDE_DIR}") + endif() + if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL 11.3.0) + _CUDAToolkit_find_and_add_import_lib(pcsamplingutil + EXTRA_PATH_SUFFIXES ${_cmake_cupti_extra_paths} + EXTRA_INCLUDE_DIRS "${CUDAToolkit_CUPTI_INCLUDE_DIR}") + endif() endif() if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL 11.1.0) |