Skip to content

Commit 1321082

Browse files
authored
Merge pull request kokkos#290 from uliegecsm/nvtx3
update(`nvtx-connector`): use `nvtx3`
2 parents d9f04c0 + 43894cb commit 1321082

File tree

6 files changed

+20
-6
lines changed

6 files changed

+20
-6
lines changed

.github/workflows/build-with-kokkos.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- image: nvidia/cuda:12.1.0-devel-ubuntu22.04
1717
preset: Cuda
1818
compiler: default
19-
- image: nvidia/cuda:12.2.0-devel-ubuntu22.04
19+
- image: nvidia/cuda:12.9.0-devel-ubuntu22.04
2020
preset: Cuda
2121
compiler: {cpp: g++-12, c: gcc-12}
2222
- image: rocm/dev-ubuntu-22.04:5.4
Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
find_package(CUDAToolkit REQUIRED)
22
kp_add_library(kp_nvtx_connector kp_nvtx_connector.cpp)
33

4-
target_link_libraries(kp_nvtx_connector CUDA::nvToolsExt)
4+
# Fallback since the imported target CUDA::nvtx3 is defined only as of CMake 3.25.
5+
if(NOT TARGET CUDA::nvtx3)
6+
add_library(CUDA::nvtx3 INTERFACE IMPORTED)
7+
target_include_directories(CUDA::nvtx3 INTERFACE "${CUDAToolkit_INCLUDE_DIRS}")
8+
target_link_libraries(CUDA::nvtx3 INTERFACE ${CMAKE_DL_LIBS})
9+
endif()
10+
11+
target_link_libraries(kp_nvtx_connector CUDA::nvtx3)

profiling/nvtx-connector/kp_nvtx_connector.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
#include <pthread.h>
2424

25-
#include "nvToolsExt.h"
25+
#include "nvtx3/nvToolsExt.h"
2626

2727
#include "kp_core.hpp"
2828

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
find_package(CUDAToolkit REQUIRED)
22
kp_add_library(kp_nvtx_focused_connector kp_nvtx_focused_connector.cpp)
33

4-
target_link_libraries(kp_nvtx_focused_connector CUDA::nvToolsExt)
4+
# Fallback since the imported target CUDA::nvtx3 is defined only as of CMake 3.25.
5+
if(NOT TARGET CUDA::nvtx3)
6+
add_library(CUDA::nvtx3 INTERFACE IMPORTED)
7+
target_include_directories(CUDA::nvtx3 INTERFACE "${CUDAToolkit_INCLUDE_DIRS}")
8+
target_link_libraries(CUDA::nvtx3 INTERFACE ${CMAKE_DL_LIBS})
9+
endif()
10+
11+
target_link_libraries(kp_nvtx_focused_connector CUDA::nvtx3)

profiling/nvtx-focused-connector/kp_nvtx_focused_connector.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
#include "kp_nvtx_focused_connector_domain.h"
2929

30-
#include "nvToolsExt.h"
30+
#include "nvtx3/nvToolsExt.h"
3131

3232
#include "kp_core.hpp"
3333

profiling/nvtx-focused-connector/kp_nvtx_focused_connector_domain.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include <sys/time.h>
2222
#include <cstring>
2323

24-
#include "nvToolsExt.h"
24+
#include "nvtx3/nvToolsExt.h"
2525

2626
namespace KokkosTools {
2727
namespace NVTXFocusedConnector {

0 commit comments

Comments
 (0)