8000 torch_global_deps: link torch::nvtx3 first, fall back to CUDA::nvtx3,… · pytorch/pytorch@c019802 · GitHub
[go: up one dir, main page]

Skip to content

Commit c019802

Browse files
committed
torch_global_deps: link torch::nvtx3 first, fall back to CUDA::nvtx3, for older Cuda nvtoolsext
8000
1 parent 4fd746e commit c019802

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

caffe2/CMakeLists.txt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1619,10 +1619,12 @@ if(USE_CUDA)
16191619
endif()
16201620
target_link_libraries(torch_cuda INTERFACE torch::cudart)
16211621
target_link_libraries(torch_cuda PUBLIC c10_cuda)
1622-
if(TARGET torch::nvtx3)
1623-
target_link_libraries(torch_cuda PRIVATE torch::nvtx3)
1624-
else()
1625-
target_link_libraries(torch_cuda PUBLIC torch::nvtoolsext)
1622+
if(TARGET torch::nvtx3) # modern path
1623+
target_link_libraries(torch_global_deps torch::nvtx3)
1624+
elseif(TARGET CUDA::nvtx3) # fallback for newer CUDA toolkits
1625+
target_link_libraries(torch_global_deps CUDA::nvtx3)
1626+
elseif(TARGET torch::nvtoolsext) # legacy nvtoolsext
1627+
target_link_libraries(torch_global_deps torch::nvtoolsext)
16261628
endif()
16271629

16281630
target_include_directories(

0 commit comments

Comments
 (0)
0