Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating cmake files to enable NVTX markers for cuML build #4684

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,11 @@ if(BUILD_CUML_CPP_LIBRARY)
$<$<BOOL:${ENABLE_CUMLPRIMS_MG}>:cumlprims_mg::cumlprims_mg>
)

if(NVTX)
target_link_libraries(${CUML_CPP_TARGET} PRIVATE nvToolsExt)
target_compile_options(${CUML_CPP_TARGET} PRIVATE "-DNVTX_ENABLED")
endif()

# If we export the libdmlc symbols, they can lead to weird crashes with other
# libraries that use libdmlc. This just hides the symbols internally.
target_link_options(${CUML_CPP_TARGET} PRIVATE "-Wl,--exclude-libs,libdmlc.a")
Expand Down
5 changes: 5 additions & 0 deletions cpp/bench/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ if(BUILD_CUML_PRIMS_BENCH)
raft::distance
)

if(NVTX)
target_compile_options(${PRIMS_BENCH_TARGET} PRIVATE "-DNVTX_ENABLED")
target_link_libraries(${PRIMS_BENCH_TARGET} PRIVATE nvToolsExt)
endif()
Comment on lines +107 to +110
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since all bench and test targets depend on the cuml library target, we shouldn't need to repeat the compile options / link libraries. Does it work properly without these lines?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw link time errors related to unresolved nvtx function calls. Thats why added them.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it still error if you change the scope to PUBLIC in the library's CMakeLists?


target_include_directories(${PRIMS_BENCH_TARGET}
PRIVATE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../src_prims>
Expand Down
5 changes: 5 additions & 0 deletions cpp/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ function(ConfigureTest)
$<TARGET_NAME_IF_EXISTS:conda_env>
)

if(NVTX)
target_compile_options(${TEST_NAME} PRIVATE "-DNVTX_ENABLED")
target_link_libraries(${TEST_NAME} PRIVATE nvToolsExt)
endif()

target_compile_options(${TEST_NAME}
PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:${CUML_CXX_FLAGS}>"
"$<$<COMPILE_LANGUAGE:CUDA>:${CUML_CUDA_FLAGS}>"
Expand Down