Skip to content

Commit

Permalink
Regard #505, fixes #490: Switch to depending on CUDA::nvtx3 for CUD…
Browse files Browse the repository at this point in the history
…A 10.0 or later (and assume the CMake version is >= 3.25); this helps with locating NVTX includes on Windows
  • Loading branch information
eyalroz committed Apr 23, 2023
1 parent 453e0b7 commit 98edf68
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# your platform. They are not finicky with library dependencies, so
# compatability is very likely. Also, the package's CMake binary will
# not mistake any other local CMake-related files for its own.
cmake_minimum_required(VERSION 3.18 FATAL_ERROR)
cmake_minimum_required(VERSION 3.25 FATAL_ERROR)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules")

# -----------------------------------
Expand Down Expand Up @@ -80,7 +80,14 @@ if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL 11.1)
target_link_libraries(CUDA::nvptxcompiler_static INTERFACE Threads::Threads) # Because the NVIDIA PTX compiler itself uses threads
endif()

target_link_libraries(caw_nvtx INTERFACE cuda-api-wrappers::runtime-and-driver CUDA::nvToolsExt ${CMAKE_DL_LIBS}) # libnvToolsExt uses dlclose
target_link_libraries(caw_nvtx INTERFACE cuda-api-wrappers::runtime-and-driver ${CMAKE_DL_LIBS}) # libnvToolsExt uses dlclose

if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL 10.0)
target_link_libraries(caw_nvtx INTERFACE CUDA::nvtx3)
else()
target_link_libraries(caw_nvtx INTERFACE CUDA::nvToolsExt)
endif()


# Note: This is a bit like a poor man's configure.h file;
# but for two settings I won't bother creating one of those
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Detailed Doxygen-genereated documentation is [available](https://codedocs.xyz/ey

- Other software:
- A C++11-capable compiler compatible with your version of CUDA.
- CMake v3.18 or later; it's very easy to [download and install](https://cmake.org/download/) a recent version - no need to build it yourself.
- CMake v3.25 or later; it's very easy to [download and install](https://cmake.org/download/) a recent version - no need to build it yourself.

- An NVIDIA GPU supporting Unified Virtual Addressing (UVA), i.e. Fermi microarchitecture or later. With earlier GPUs, memory copying, and other functionality relying on automtically determining where a memory address is located, will fail.

Expand Down

0 comments on commit 98edf68

Please sign in to comment.