Skip to content

Commit

Permalink
Add support NVTX3 for CMake versions >3.25
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew-Beggs-ECMWF committed Sep 26, 2024
1 parent 6117c1e commit 9b82f8e
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions cmake/FindNVTX.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,25 @@ if(CMAKE_C_COMPILER_ID STREQUAL "PGI" OR CMAKE_C_COMPILER_ID STREQUAL "NVHPC" )
)
else()
find_package(CUDAToolkit REQUIRED COMPONENTS CUDA::nvtx3)
set (NVTX_LIBRARY "CUDA::nvtx3")
#TODO: Implementation for NVTX3

find_path(NVTX_ROOT
NAMES include/nvtx3/nvToolsExt.h
HINTS ${CUDAToolkit_LIBRARY_DIR}/..
)

find_path(NVTX_INCLUDE_DIRS
NAMES nvToolsExt.h
HINTS ${NVTX_ROOT}/include/nvtx3
)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(NVTX DEFAULT_MSG
NVTX_INCLUDE_DIRS
)

mark_as_advanced(
NVTX_INCLUDE_DIRS
)
endif()


Expand Down

0 comments on commit 9b82f8e

Please sign in to comment.