[1/N] Don't use CUDA.cmake module (#157188)

Small changes before removing CUDA.cmake.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/157188
Approved by: https://github.com/ezyang
This commit is contained in:
cyy
2025-07-08 03:05:35 +00:00
committed by PyTorch MergeBot
parent f56bfb3030
commit 3ee8828c87
2 changed files with 6 additions and 1 deletions

View File

@ -3,7 +3,7 @@
# CUB_INCLUDE_DIRS - the CUB include directory
find_path(CUB_INCLUDE_DIR
HINTS "${CUDA_TOOLKIT_INCLUDE}"
HINTS "${CUDAToolkit_INCLUDE_DIRS}"
NAMES cub/cub.cuh
DOC "The directory where CUB includes reside"
)

View File

@ -478,6 +478,11 @@ else()
set(TORCH_VERSION_DEBUG 0)
endif()
set(CUDA_VERSION "")
if(CUDAToolkit_VERSION_MAJOR)
set(CUDA_VERSION "${CUDAToolkit_VERSION_MAJOR}.${CUDAToolkit_VERSION_MINOR}")
endif()
add_custom_target(
gen_torch_version ALL
"${Python_EXECUTABLE}" "${TOOLS_PATH}/generate_torch_version.py"