-
Notifications
You must be signed in to change notification settings - Fork 179
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
Test combined internal/user-side use of NVTX #1690
Conversation
a5e09f9
to
7adee3e
Compare
cub/test/CMakeLists.txt
Outdated
CPMAddPackage(NAME NVTX GITHUB_REPOSITORY NVIDIA/NVTX GIT_TAG release-v3 DOWNLOAD_ONLY True) | ||
add_subdirectory(${NVTX_SOURCE_DIR}/c ${NVTX_BINARY_DIR}/c) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the best way to obtain a dependency without a top-level CMakeLists.txt
?
cub/test/CMakeLists.txt
Outdated
if (${test_src} MATCHES "test_nvtx_in_usercode.cu") | ||
target_link_libraries(${test_target} nvtx3-cpp) | ||
endif() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How can I best add a library dependency to only a single test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do something like this:
Lines 252 to 257 in ca7109a
if ("${test_target}" MATCHES "nvrtc") | |
target_compile_definitions(${test_target} PRIVATE NVRTC_CUB_PATH="-I${CMAKE_SOURCE_DIR}/cub") | |
target_compile_definitions(${test_target} PRIVATE NVRTC_THRUST_PATH="-I${CMAKE_SOURCE_DIR}/thrust") | |
target_compile_definitions(${test_target} PRIVATE NVRTC_LIBCUDACXX_PATH="-I${CMAKE_SOURCE_DIR}/libcudacxx/include") | |
target_compile_definitions(${test_target} PRIVATE NVRTC_CTK_PATH="-I${CUDAToolkit_INCLUDE_DIRS}") | |
endif() |
@alliepiper might have a better idea
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, I updated my changeset.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is indeed the best way for now. Thrust has a fancier mechanism that lets us add a test-specific ${test_name}.cmake
file that gets loaded and applied to the test targets, but that doesn't currently exist in CUB.
031833d
to
a2a7a6f
Compare
8d44a76
to
8bacb3f
Compare
Co-authored-by: Allison Piper <[email protected]>
8bacb3f
to
c10f9d9
Compare
This PR adds a test where the NVTX API is used internally by CUB via the vendored nvtx3.hpp, and a second time in the test's main file with headers cloned from the NVTX GitHub repository. The test verifies that CUB's use of NVTX does not break users using NVTX beside CUB.