1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
Description: let it fallback to use the old NVTX3 headers. Grep the code with
TORCH_CUDA_USE_NVTX3 can you will find the simple fallback logic. The new
header needs new nvtx packages. The old one is already in nvidia-cuda-dev.
Forward: no need.
@@ -176,15 +176,8 @@
find_path(nvtx3_dir NAMES nvtx3 PATHS "${PROJECT_SOURCE_DIR}/third_party/NVTX/c/include" NO_DEFAULT_PATH)
endif()
find_package_handle_standard_args(nvtx3 DEFAULT_MSG nvtx3_dir)
-if(nvtx3_FOUND)
- add_library(torch::nvtx3 INTERFACE IMPORTED)
- target_include_directories(torch::nvtx3 INTERFACE "${nvtx3_dir}")
- target_compile_definitions(torch::nvtx3 INTERFACE TORCH_CUDA_USE_NVTX3)
-else()
- message(WARNING "Cannot find NVTX3, find old NVTX instead")
- add_library(torch::nvtoolsext INTERFACE IMPORTED)
- set_property(TARGET torch::nvtoolsext PROPERTY INTERFACE_LINK_LIBRARIES CUDA::nvToolsExt)
-endif()
+add_library(torch::nvtoolsext INTERFACE IMPORTED)
+set_property(TARGET torch::nvtoolsext PROPERTY INTERFACE_LINK_LIBRARIES CUDA::nvToolsExt)
# cublas
@@ -1580,11 +1580,7 @@
endif()
target_link_libraries(torch_cuda INTERFACE torch::cudart)
target_link_libraries(torch_cuda PUBLIC c10_cuda)
- if(TARGET torch::nvtx3)
- target_link_libraries(torch_cuda PRIVATE torch::nvtx3)
- else()
- target_link_libraries(torch_cuda PUBLIC torch::nvtoolsext)
- endif()
+ target_link_libraries(torch_cuda PUBLIC torch::nvtoolsext)
target_include_directories(
torch_cuda INTERFACE $<INSTALL_INTERFACE:include>)
|