summaryrefslogtreecommitdiff
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-08-15 15:26:15 +0000
committerKitware Robot <kwrobot@kitware.com>2022-08-15 11:26:23 -0400
commit4befac3b328a35e7a1eb34ce229f13710fa651a2 (patch)
tree9c61c182e664071c954bbc62cecfaebbb0900866 /Modules
parenta1dbe7b31735b3def3dcfb6334a5576b7750db63 (diff)
parentcd200c6c2d21806d7ba064f4edf45a5c94094286 (diff)
downloadcmake-4befac3b328a35e7a1eb34ce229f13710fa651a2.tar.gz
Merge topic 'nvtx3'
cd200c6c2d FindCUDAToolkit: nvtx3 target Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7568
Diffstat (limited to 'Modules')
-rw-r--r--Modules/FindCUDAToolkit.cmake32
1 files changed, 32 insertions, 0 deletions
diff --git a/Modules/FindCUDAToolkit.cmake b/Modules/FindCUDAToolkit.cmake
index 538e13241e..c1368da7f4 100644
--- a/Modules/FindCUDAToolkit.cmake
+++ b/Modules/FindCUDAToolkit.cmake
@@ -121,6 +121,7 @@ of the following libraries that are part of the CUDAToolkit:
- :ref:`nvidia-ML<cuda_toolkit_nvML>`
- :ref:`nvRTC<cuda_toolkit_nvRTC>`
- :ref:`nvToolsExt<cuda_toolkit_nvToolsExt>`
+- :ref:`nvtx3<cuda_toolkit_nvtx3>`
- :ref:`OpenCL<cuda_toolkit_opencl>`
- :ref:`cuLIBOS<cuda_toolkit_cuLIBOS>`
@@ -362,6 +363,8 @@ Targets Created:
nvToolsExt
""""""""""
+.. deprecated:: 3.25 With CUDA 10.0+, use :ref:`nvtx3 <cuda_toolkit_nvtx3>`.
+
The `NVIDIA Tools Extension <https://docs.nvidia.com/gameworks/content/gameworkslibrary/nvtx/nvidia_tools_extension_library_nvtx.htm>`_.
This is a shared library only.
@@ -369,6 +372,20 @@ Targets Created:
- ``CUDA::nvToolsExt``
+.. _`cuda_toolkit_nvtx3`:
+
+nvtx3
+"""""
+
+.. versionadded:: 3.25
+
+The header-only `NVIDIA Tools Extension Library <https://nvidia.github.io/NVTX/doxygen/index.html>`_.
+Introduced in CUDA 10.0.
+
+Targets created:
+
+- ``CUDA::nvtx3``
+
.. _`cuda_toolkit_opencl`:
OpenCL
@@ -1011,6 +1028,21 @@ if(CUDAToolkit_FOUND)
endif()
_CUDAToolkit_find_and_add_import_lib(nvToolsExt ALT nvToolsExt64)
+ if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL 10.0)
+ # nvToolsExt is deprecated since nvtx3 introduction.
+ # Warn only if the project requires a sufficiently new CMake to make migration possible.
+ if(CMAKE_MINIMUM_REQUIRED_VERSION VERSION_GREATER_EQUAL 3.25)
+ set_property(TARGET CUDA::nvToolsExt PROPERTY DEPRECATION "nvToolsExt has been superseded by nvtx3 since CUDA 10.0 and CMake 3.25. Use CUDA::nvtx3 and include <nvtx3/nvToolsExt.h> instead.")
+ endif()
+
+ # Header-only variant. Uses dlopen().
+ if(NOT TARGET CUDA::nvtx3)
+ add_library(CUDA::nvtx3 INTERFACE IMPORTED)
+ target_include_directories(CUDA::nvtx3 SYSTEM INTERFACE "${CUDAToolkit_INCLUDE_DIRS}")
+ target_link_libraries(CUDA::nvtx3 INTERFACE ${CMAKE_DL_LIBS})
+ endif()
+ endif()
+
_CUDAToolkit_find_and_add_import_lib(OpenCL)
endif()